jsky.image.gui
Interface BasicImageDisplay

All Superinterfaces:
BasicImageReadableProcessor
All Known Subinterfaces:
GraphicsImageDisplay, MainImageDisplay
All Known Implementing Classes:
DivaGraphicsImageDisplay, DivaMainImageDisplay, ImageDisplay, NavigatorImageDisplay

public interface BasicImageDisplay
extends BasicImageReadableProcessor

This defines the common interface for classes that display an image (a JAI PlanarImage).

This interface also assumes that the ImageProcessor class is used to process the source image to produce the actual image to be displayed.

Any JAI PlanarImage can be displayed. Grayscale images may be displayed with false colors, depending on the ImageProcessor options specified.

Version:
$Revision: 1.1 $
Author:
Allan Brighton

Method Summary
 void addImageGraphicsHandler(ImageGraphicsHandler igh)
          Register as an image graphics handler.
 javax.swing.JComponent getCanvas()
          Return the image canvas component.
 CoordinateConverter getCoordinateConverter()
          Return the object used to convert coordinates.
 javax.media.jai.PlanarImage getDisplayImage()
          Return the image being displayed (after image processing).
 javax.media.jai.PlanarImage getImage()
          Return the source image (before processing).
 int getImageHeight()
          Return the height of the source image in pixels
 ImageProcessor getImageProcessor()
          Return the image processor object.
 int getImageWidth()
          Return the width of the source image in pixels
 javax.media.jai.Interpolation getInterpolation()
          Return the interpolation object used to scale the image
 java.awt.geom.Point2D.Double getOrigin()
          Return the origin of the displayed image in canvas coordinates.
 float getPixelValue(java.awt.geom.Point2D.Double p, int band)
          Return the value of the pixel in the given band at the given user coordinates
 float getScale()
          Return the current scale (zoom factor) for the image.
 java.awt.RenderingHints getScaleHints()
          Return the optional rendering hints used for the image scale operation
 java.awt.geom.Rectangle2D.Double getVisibleArea()
          Return a rectangle describing the visible area of the image (in user coordinates).
 WorldCoordinateConverter getWCS()
          Return the object used to convert between image and world coordinates, or null if none is available.
 boolean isAutoCenterImage()
          Return true if the image is automatically centered when it is smaller than the window.
 boolean isImmediateMode()
          Return true if immediate mode is turned on.
 boolean isInitialized()
          Return true if this widget has been initialized and is displaying an image.
 boolean isPrescaled()
          Return true if the image has been prescaled
 boolean isWCS()
          Return true if the current image supports world coordinates (has the necessary keywords in the header).
 void removeImageGraphicsHandler(ImageGraphicsHandler igh)
          Unregister as an image graphics handler.
 void scaleToFit()
          Set the scaling factor so that the image will fit in the current window.
 void setAutoCenterImage(boolean b)
          Set to true (default) to automatically center the image, if it is smaller than the window.
 void setImage(javax.media.jai.PlanarImage im)
          Set the source image to display.
 void setImageProcessor(ImageProcessor imageProcessor)
          Set the image processor to use to get the image to display.
 void setImmediateMode(boolean b)
          Set to true if scrolling and other operations should update the image immediately, otherwise only on button release.
 void setInterpolation(javax.media.jai.Interpolation i)
          Set the interpolation object used to scale the image (a subclass of Interpolation, such as InterpolationNearest (default), or InterpolationBilinear (better, but slower)).
 void setOrigin(java.awt.geom.Point2D.Double origin)
          Set the origin of the image to display in canvas coordinates.
 void setPrescaled(boolean b)
          Set to true if the image being displayed has been prescaled (such as for a pan window or thumbnail image).
 void setScale(float scale)
          Set the scale (zoom factor) for the image.
 void setScaleHints(java.awt.RenderingHints hints)
          Set the optional rendering hints for the image scale operation
 void setWCS(WorldCoordinateConverter wcs)
          Set the object used to convert between image and world coordinates.
 void updateImage()
          Update the image display after a change has been made.
 

Method Detail

setImage

void setImage(javax.media.jai.PlanarImage im)
Set the source image to display.


getImage

javax.media.jai.PlanarImage getImage()
Return the source image (before processing).


getDisplayImage

javax.media.jai.PlanarImage getDisplayImage()
Return the image being displayed (after image processing).


isInitialized

boolean isInitialized()
Return true if this widget has been initialized and is displaying an image.


updateImage

void updateImage()
Update the image display after a change has been made.


setImageProcessor

void setImageProcessor(ImageProcessor imageProcessor)
Set the image processor to use to get the image to display.


getImageProcessor

ImageProcessor getImageProcessor()
Return the image processor object.

Specified by:
getImageProcessor in interface BasicImageReadableProcessor
Returns:
The Object responsible for most image transformations that processes PlanarImages.
See Also:
PlanarImage

getImageWidth

int getImageWidth()
Return the width of the source image in pixels


getImageHeight

int getImageHeight()
Return the height of the source image in pixels


getOrigin

java.awt.geom.Point2D.Double getOrigin()
Return the origin of the displayed image in canvas coordinates.


setScale

void setScale(float scale)
Set the scale (zoom factor) for the image.


getScale

float getScale()
Return the current scale (zoom factor) for the image.


scaleToFit

void scaleToFit()
Set the scaling factor so that the image will fit in the current window.

Note that only integer scaling factors are used, for example 2, 1, 1/2, 1/3, etc., for performance reasons.


setPrescaled

void setPrescaled(boolean b)
Set to true if the image being displayed has been prescaled (such as for a pan window or thumbnail image). If true, the scale value will only be used to calculate coordinate transformations, but the image will not actually be scaled.


isPrescaled

boolean isPrescaled()
Return true if the image has been prescaled


setScaleHints

void setScaleHints(java.awt.RenderingHints hints)
Set the optional rendering hints for the image scale operation


getScaleHints

java.awt.RenderingHints getScaleHints()
Return the optional rendering hints used for the image scale operation


setAutoCenterImage

void setAutoCenterImage(boolean b)
Set to true (default) to automatically center the image, if it is smaller than the window.


isAutoCenterImage

boolean isAutoCenterImage()
Return true if the image is automatically centered when it is smaller than the window.


setInterpolation

void setInterpolation(javax.media.jai.Interpolation i)
Set the interpolation object used to scale the image (a subclass of Interpolation, such as InterpolationNearest (default), or InterpolationBilinear (better, but slower)).


getInterpolation

javax.media.jai.Interpolation getInterpolation()
Return the interpolation object used to scale the image


getPixelValue

float getPixelValue(java.awt.geom.Point2D.Double p,
                    int band)
Return the value of the pixel in the given band at the given user coordinates


getVisibleArea

java.awt.geom.Rectangle2D.Double getVisibleArea()
Return a rectangle describing the visible area of the image (in user coordinates).

Specified by:
getVisibleArea in interface BasicImageReadableProcessor
Returns:
User Coordinates of retangle. Note, this may be a a SuperRectangle if the PlanarImage is non-rectangular.

setOrigin

void setOrigin(java.awt.geom.Point2D.Double origin)
Set the origin of the image to display in canvas coordinates.


getCanvas

javax.swing.JComponent getCanvas()
Return the image canvas component.


setImmediateMode

void setImmediateMode(boolean b)
Set to true if scrolling and other operations should update the image immediately, otherwise only on button release.


isImmediateMode

boolean isImmediateMode()
Return true if immediate mode is turned on.


isWCS

boolean isWCS()
Return true if the current image supports world coordinates (has the necessary keywords in the header).


getWCS

WorldCoordinateConverter getWCS()
Return the object used to convert between image and world coordinates, or null if none is available.


setWCS

void setWCS(WorldCoordinateConverter wcs)
Set the object used to convert between image and world coordinates.


getCoordinateConverter

CoordinateConverter getCoordinateConverter()
Return the object used to convert coordinates.


addImageGraphicsHandler

void addImageGraphicsHandler(ImageGraphicsHandler igh)
Register as an image graphics handler.


removeImageGraphicsHandler

void removeImageGraphicsHandler(ImageGraphicsHandler igh)
Unregister as an image graphics handler.