net.grelf.image
Class ImageBase

java.lang.Object
  extended by net.grelf.image.ImageBase
Direct Known Subclasses:
Image32, Image64, Image8or16Base

public abstract class ImageBase
extends java.lang.Object

Common methods for implementors of Image.


Field Summary
protected  Metadata metadata
           
 
Constructor Summary
ImageBase()
           
 
Method Summary
static Image createImage(int width, int height, int nBands, int nBits)
          Utility for constructing an uninitialised image of suitable type for the number of bits.
static Image createImage(int width, int height, int nBands, int nBits, boolean fillWithZeroes, boolean compatibleWithDisplay)
          Utility for constructing an image of suitable type for the number of bits, optionally filled with zeroes.
 Calibration getCalibration()
          Get a reference to the Calibration object for this image.
 java.lang.String getFilePath()
          Get the path of the file from which this image was loaded or to which it was last saved.
static java.awt.GraphicsConfiguration getGraphicsConfiguration()
          Get a reference to the GraphicsConfiguration object, which is the default one for the display system.
 Metadata getMetadata()
          Get metadata associated with the image.
static Image recombine(Image... images)
          Make a multi-band image from an array of monochrome ones.
static boolean sameBitsAndBands(Image... images)
          Check whether all the images have the same bit depth and number of channels.
static boolean sameSizeBitsAndBands(Image... images)
          Check whether all the images have the same width, height, bit depth and number of channels.
 void setCalibration(Calibration aCalib)
          Associate a Calibration object with this image.
 void setFilePath(java.lang.String filePath)
          Record the path to the file in which the image was last saved.
 void setMetadata(Metadata theData)
          Associate metadata with the image.
protected  void showInfo(Image image)
          Display information about the given image in a dialogue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

metadata

protected Metadata metadata
Constructor Detail

ImageBase

public ImageBase()
Method Detail

getCalibration

public Calibration getCalibration()
Get a reference to the Calibration object for this image.


setCalibration

public void setCalibration(Calibration aCalib)
Associate a Calibration object with this image.


getFilePath

public java.lang.String getFilePath()
Get the path of the file from which this image was loaded or to which it was last saved.


setFilePath

public void setFilePath(java.lang.String filePath)
Record the path to the file in which the image was last saved.


getGraphicsConfiguration

public static java.awt.GraphicsConfiguration getGraphicsConfiguration()
Get a reference to the GraphicsConfiguration object, which is the default one for the display system.


getMetadata

public Metadata getMetadata()
Get metadata associated with the image. Null if none.


setMetadata

public void setMetadata(Metadata theData)
Associate metadata with the image.


createImage

public static Image createImage(int width,
                                int height,
                                int nBands,
                                int nBits)
Utility for constructing an uninitialised image of suitable type for the number of bits. Returns null if nBits is not 8, 16, 32 or 64.


createImage

public static Image createImage(int width,
                                int height,
                                int nBands,
                                int nBits,
                                boolean fillWithZeroes,
                                boolean compatibleWithDisplay)
Utility for constructing an image of suitable type for the number of bits, optionally filled with zeroes. Returns null if nBits is not 8, 16, 32 or 64.


recombine

public static Image recombine(Image... images)
Make a multi-band image from an array of monochrome ones. Tests that the images are all the same size, number of bands and bit depth, informing user and returning null if they are not.


sameBitsAndBands

public static boolean sameBitsAndBands(Image... images)
Check whether all the images have the same bit depth and number of channels.


sameSizeBitsAndBands

public static boolean sameSizeBitsAndBands(Image... images)
Check whether all the images have the same width, height, bit depth and number of channels.


showInfo

protected void showInfo(Image image)
Display information about the given image in a dialogue.