Mercurial > cortex
diff org/eyes.org @ 114:9d0fe7f54e14
merged image viewing code to cortex.util
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Thu, 19 Jan 2012 22:19:24 -0700 |
parents | a980462ebe76 |
children | aaacf087504c |
line wrap: on
line diff
1.1 --- a/org/eyes.org Thu Jan 19 22:08:46 2012 -0700 1.2 +++ b/org/eyes.org Thu Jan 19 22:19:24 2012 -0700 1.3 @@ -119,34 +119,6 @@ 1.4 (:import com.jme3.scene.Node) 1.5 (:import com.jme3.math.Vector3f)) 1.6 1.7 -(defn view-image 1.8 - "Initailizes a JPanel on which you may draw a BufferedImage. 1.9 - Returns a function that accepts a BufferedImage and draws it to the 1.10 - JPanel." 1.11 - [] 1.12 - (let [image 1.13 - (atom 1.14 - (BufferedImage. 1 1 BufferedImage/TYPE_4BYTE_ABGR)) 1.15 - panel 1.16 - (proxy [JPanel] [] 1.17 - (paint 1.18 - [graphics] 1.19 - (proxy-super paintComponent graphics) 1.20 - (.drawImage graphics @image 0 0 nil))) 1.21 - frame (JFrame. "Display Image")] 1.22 - (SwingUtilities/invokeLater 1.23 - (fn [] 1.24 - (doto frame 1.25 - (-> (.getContentPane) (.add panel)) 1.26 - (.pack) 1.27 - (.setLocationRelativeTo nil) 1.28 - (.setResizable true) 1.29 - (.setVisible true)))) 1.30 - (fn [#^BufferedImage i] 1.31 - (reset! image i) 1.32 - (.setSize frame (+ 8 (.getWidth i)) (+ 28 (.getHeight i))) 1.33 - (.repaint panel 0 0 (.getWidth i) (.getHeight i))))) 1.34 - 1.35 (defn test-two-eyes 1.36 "Testing vision: 1.37 Tests the vision system by creating two views of the same rotating