Advertisement
Guest User

Untitled

a guest
Oct 6th, 2013
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (defn digit-image [data sizex sizey]
  2.   (prn data)
  3.   (prn sizex)
  4.   (prn sizey)
  5.   (prn (type (first data)))
  6.  
  7.  
  8.   (let [img (java.awt.image.BufferedImage. (int sizex) (int sizey) java.awt.image.BufferedImage/TYPE_BYTE_GRAY)]
  9.     (->  (.getRaster img)
  10.          (.setPixels 0 0 (int sizex) (int sizey) (int-array (first data))))
  11.  
  12.      ;; doesn't work, because of type mismatch or something..
  13.      
  14.       ;; (doto (BufferedImage. (int sizex) sizey BufferedImage/TYPE_BYTE_GRAY)
  15.       ;;   (.setRGB 0 0 sizex sizey data 0 sizex))
  16.     img
  17.       )
  18. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement