diff org/util.org @ 335:5dcd44576cbc

add BufferedImage to Viewable Protocol
author Robert McIntyre <rlm@mit.edu>
date Fri, 20 Jul 2012 13:02:58 -0500
parents 52de8a36edde
children 70469ff8eb56
line wrap: on
line diff
     1.1 --- a/org/util.org	Fri Jul 20 11:22:21 2012 -0500
     1.2 +++ b/org/util.org	Fri Jul 20 13:02:58 2012 -0500
     1.3 @@ -100,6 +100,7 @@
     1.4    (:import java.awt.image.BufferedImage)
     1.5    (:import javax.swing.JPanel)
     1.6    (:import javax.swing.JFrame)
     1.7 +  (:import ij.ImagePlus)
     1.8    (:import javax.swing.SwingUtilities)
     1.9    (:import com.jme3.scene.plugins.blender.BlenderModelLoader)
    1.10    (:import (java.util.logging Level Logger)))
    1.11 @@ -532,6 +533,12 @@
    1.12      (view (doto (Node.)
    1.13              (.attachChild (box 1 1 1 :color color))))))
    1.14  
    1.15 +(extend-type java.awt.image.BufferedImage
    1.16 +  Viewable
    1.17 +  (view
    1.18 +    [image]
    1.19 +    (.show (ImagePlus. "view-buffered-image" image))))
    1.20 +                       
    1.21  (defprotocol Textual
    1.22    (text [something]
    1.23      "Display a detailed textual analysis of the given object."))