comparison clojure/com/aurellem/run/image.clj @ 496:a6d060a64246

pixel introspection. but entire image is upside down.
author Robert McIntyre <rlm@mit.edu>
date Mon, 11 Jun 2012 06:04:25 -0500
parents 1d81ddd4fa41
children 554883a95de0
comparison
equal deleted inserted replaced
495:1d81ddd4fa41 496:a6d060a64246
141 (-> (set-memory-range (second (music-base)) 141 (-> (set-memory-range (second (music-base))
142 kernel-address (flatten kernel)) 142 kernel-address (flatten kernel))
143 (PC! kernel-address)))) 143 (PC! kernel-address))))
144 144
145 145
146 (require 'cortex.sense)
147 (import java.awt.image.BufferedImage)
146 148
149 (defn show-screenshot []
150 (let [im (BufferedImage. 160 144 BufferedImage/TYPE_INT_RGB)
151 pix (vec (pixels))
152 view (cortex.sense/view-image)]
153 (dorun (for [x (range 160) y (range 144)]
154 (.setRGB im x y
155 ;0
156 (pix (+ x (* 160 y)))
157 )))
158 (view im)))
159
160
147 161
148 (defn write-palette-color [palette-num r g b] 162 (defn write-palette-color [palette-num r g b]
149 (let [[byte-1 byte-2] (gb-rgb->bits r g b)] 163 (let [[byte-1 byte-2] (gb-rgb->bits r g b)]
150 164
151 165