comparison clojure/com/aurellem/run/image.clj @ 519:fd1ae0047a1a

added pinkie pie cutie mark.
author Robert McIntyre <rlm@mit.edu>
date Sat, 23 Jun 2012 15:10:14 -0500
parents bb4434c5a8f3
children 5596cd4a3fc6
comparison
equal deleted inserted replaced
518:bb4434c5a8f3 519:fd1ae0047a1a
306 306
307 (def test-image-color 307 (def test-image-color
308 (ImageIO/read 308 (ImageIO/read
309 (File. user-home "/proj/vba-clojure/images/colors-test.png"))) 309 (File. user-home "/proj/vba-clojure/images/colors-test.png")))
310 310
311 (def pinkie-pie-mark
312 (ImageIO/read
313 (File. user-home "/proj/vba-clojure/images/pinkie-pie-cutie-mark.png")))
314
315
311 (defn rgb->triplet [rgb] 316 (defn rgb->triplet [rgb]
312 (let [r (bit-shift-right (bit-and rgb 0xFF0000) 16) 317 (let [r (bit-shift-right (bit-and rgb 0xFF0000) 16)
313 g (bit-shift-right (bit-and rgb 0xFF00) 8) 318 g (bit-shift-right (bit-and rgb 0xFF00) 8)
314 b (bit-and rgb 0xFF)] 319 b (bit-and rgb 0xFF)]
315 [r g b])) 320 [r g b]))