Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defn digit-image [data sizex sizey]
- (prn data)
- (prn sizex)
- (prn sizey)
- (prn (type (first data)))
- (let [img (java.awt.image.BufferedImage. (int sizex) (int sizey) java.awt.image.BufferedImage/TYPE_BYTE_GRAY)]
- (-> (.getRaster img)
- (.setPixels 0 0 (int sizex) (int sizey) (int-array (first data))))
- ;; doesn't work, because of type mismatch or something..
- ;; (doto (BufferedImage. (int sizex) sizey BufferedImage/TYPE_BYTE_GRAY)
- ;; (.setRGB 0 0 sizex sizey data 0 sizex))
- img
- )
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement