org.geotoolkit.image
Class ImageInspector

Object
  extended by ImageInspector
Direct Known Subclasses:
ImageWorker

Deprecated. This class is a legacy from old days and has never been seriously used in the Geotoolkit.org library. Its work is quite arbitrary, so we are probably better to let users do their work in their own way.

@Deprecated
public class ImageInspector
extends Object

Provides convenience methods for describing an image. This base class is "read only" in that it doesn't provide any operation that may change the pixel values. However subclasses like ImageWorker may applied JAI operations on the image.

Since:
2.3
Version:
3.00
Author:
Martin Desruisseaux (Geomatys), Simone Giannecchini (Geosolutions), Bryce Nordgren
Module:
coverage/geotk-coverage (download)    View source code for this class

Field Summary
static Hints.Key IGNORE_FULLY_TRANSPARENT_PIXELS
          Deprecated. If TRUE, the RGB values of fully transparent pixels will not be taken in account when deciding if an Index Color Model is gray scale.
static PaletteInterpretation IHS
          Deprecated. An additional PaletteInterpretation code representing the IHS (Intensity, Hue, Saturation) color space.
protected  RenderedImage image
          Deprecated. The image on which operation are appiled.
 
Constructor Summary
ImageInspector(RenderedImage image)
          Deprecated. Creates a new ImageInspector for the specified image.
 
Method Summary
 BufferedImage getBufferedImage()
          Deprecated. Returns the current image as a buffered image.
 PaletteInterpretation getColorSpaceType()
          Deprecated. Returns the type of the Color Space used by the image.
 ROI getImageAsROI()
          Deprecated. Returns a Region Of Interest built from a binarized version of the current rendered image.
 double[] getMaximums()
          Deprecated. Returns the maximal values found in every image bands.
 double[] getMinimums()
          Deprecated. Returns the minimal values found in every image bands.
 int getNumBands()
          Deprecated. Returns the number of bands in the image.
 PlanarImage getPlanarImage()
          Deprecated. Returns the rendered image as a planar image.
 RenderedImage getRenderedImage()
          Deprecated. Returns the current image.
 RenderedOp getRenderedOperation()
          Deprecated. Returns the rendered image as a rendered operation.
 Object getRenderingHint(RenderingHints.Key key)
          Deprecated. Returns the rendering hint for the specified key, or null if none.
 RenderingHints getRenderingHints()
          Deprecated. Returns the rendering hints for an image to be computed by subclasses.
 ROI getROI()
          Deprecated. Returns the Region Of Interest currently set, or null if none.
 int getTransparentPixel()
          Deprecated. Returns the transparent pixel value, or -1 if none.
 boolean isBinary()
          Deprecated. Returns true if the image is binary.
 boolean isBytes()
          Deprecated. Returns true if the image stores its pixel values in bytes.
 boolean isGrayScale()
          Deprecated. Returns true if the image uses gray scale.
 boolean isIndexed()
          Deprecated. Returns true if the image uses an Index Color Model.
 boolean isTiled()
          Deprecated. Returns true if the image is tiled.
 boolean isTranslucent()
          Deprecated. Returns true if the image is translucent.
 void removeRenderingHint(RenderingHints.Key key)
          Deprecated. Removes a rendering hint.
 void setImage(RenderedImage image)
          Deprecated. Sets the image on which future operations will be applied.
 void setRenderingHint(RenderingHints.Key key, Object value)
          Deprecated. Sets a rendering hint to use for all images to be computed by subclasses.
 void setROI(ROI roi)
          Deprecated. Sets the Region Of Interest (ROI).
 void show()
          Deprecated. Shows the current image in a window together with the operation chain as a tree.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IHS

public static final PaletteInterpretation IHS
Deprecated. 
An additional PaletteInterpretation code representing the IHS (Intensity, Hue, Saturation) color space. This color space is also known as HSI or HIS and is implemented in Java Advanced Imaging by the IHSColorSpace class.

Since:
3.00

IGNORE_FULLY_TRANSPARENT_PIXELS

public static final Hints.Key IGNORE_FULLY_TRANSPARENT_PIXELS
Deprecated. 
If TRUE, the RGB values of fully transparent pixels will not be taken in account when deciding if an Index Color Model is gray scale. Fully transparent pixels are the ones having an alpha value of 0.

The default value is Boolean.TRUE.

Since:
3.00
See Also:
isGrayScale(), setRenderingHint(java.awt.RenderingHints.Key, java.lang.Object)

image

protected RenderedImage image
Deprecated. 
The image on which operation are appiled. Subclasses may replace the value of this field by the operation results every time a new operation is applied.

Constructor Detail

ImageInspector

public ImageInspector(RenderedImage image)
Deprecated. 
Creates a new ImageInspector for the specified image.

Parameters:
image - The source image.
Method Detail

setImage

public void setImage(RenderedImage image)
Deprecated. 
Sets the image on which future operations will be applied.

Parameters:
image - The new source image.

getRenderedImage

public RenderedImage getRenderedImage()
Deprecated. 
Returns the current image.

Returns:
The rendered image.
See Also:
getBufferedImage(), getPlanarImage(), getRenderedOperation(), getImageAsROI()

getBufferedImage

public BufferedImage getBufferedImage()
Deprecated. 
Returns the current image as a buffered image.

Returns:
The buffered image.
Since:
2.5
See Also:
getRenderedImage(), getPlanarImage(), getRenderedOperation(), getImageAsROI()

getPlanarImage

public PlanarImage getPlanarImage()
Deprecated. 
Returns the rendered image as a planar image.

Returns:
The planar image.
See Also:
getRenderedImage(), getRenderedOperation(), getImageAsROI()

getRenderedOperation

public RenderedOp getRenderedOperation()
Deprecated. 
Returns the rendered image as a rendered operation.

Returns:
The rendered operation.
See Also:
getRenderedImage(), getPlanarImage(), getImageAsROI()

getImageAsROI

public ROI getImageAsROI()
Deprecated. 
Returns a Region Of Interest built from a binarized version of the current rendered image.

Returns:
The image as a Region Of Interest.
See Also:
getRenderedImage(), getPlanarImage(), getRenderedOperation()

getROI

public ROI getROI()
Deprecated. 
Returns the Region Of Interest currently set, or null if none. The ROI applies to statistical methods like getMinimums() and getMaximums(). The default value is null, which means that statistics are computed on the whole image.

Returns:
The current Region Of Interest.
See Also:
getMinimums(), getMaximums()

setROI

public void setROI(ROI roi)
Deprecated. 
Sets the Region Of Interest (ROI). A null value sets the ROI to the whole image. The ROI applies to statistical methods like getMinimums() and getMaximums().

Parameters:
roi - The new Region Of Interest.
See Also:
getMinimums(), getMaximums()

getRenderingHints

public RenderingHints getRenderingHints()
Deprecated. 
Returns the rendering hints for an image to be computed by subclasses. The default implementation returns the following hints:

Returns:
The rendering hints to use for image computation (never null).

getRenderingHint

public Object getRenderingHint(RenderingHints.Key key)
Deprecated. 
Returns the rendering hint for the specified key, or null if none. Newly created image worker have no rendering hints.

Parameters:
key - The key for which to get the rendering hint.
Returns:
The rendering hint for the given key.

setRenderingHint

public void setRenderingHint(RenderingHints.Key key,
                             Object value)
Deprecated. 
Sets a rendering hint to use for all images to be computed by subclasses. This method applies only to the next images to be computed. Images already computed before this method call (if any) will not be affected.

Some common examples:

Parameters:
key - The key for which to set a rendering hint.
value - The value to assign to the given key.

removeRenderingHint

public void removeRenderingHint(RenderingHints.Key key)
Deprecated. 
Removes a rendering hint. Note that invoking this method is not the same than invoking setRenderingHint(key, null). This is especially true for the tile cache hint:

Parameters:
key - The key for which to remove the rendering hint.

getNumBands

public int getNumBands()
Deprecated. 
Returns the number of bands in the image.

Returns:
The number of bands in the image.
See Also:
ImageWorker.retainBands(int, int), SampleModel.getNumBands()

getMinimums

public double[] getMinimums()
Deprecated. 
Returns the minimal values found in every image bands. If a Region Of Interest is defined, then the statistics will be computed only over that region.

Returns:
The minimal values found in all bands. This is a direct reference to the array stored in image properties, not a clone.
See Also:
getMaximums(), setROI(javax.media.jai.ROI)

getMaximums

public double[] getMaximums()
Deprecated. 
Returns the maximal values found in every image bands. If a Region Of Interest is defined, then the statistics will be computed only over that region.

Returns:
The maximal values found in all bands. This is a direct reference to the array stored in image properties, not a clone.
See Also:
getMinimums(), setROI(javax.media.jai.ROI)

getTransparentPixel

public int getTransparentPixel()
Deprecated. 
Returns the transparent pixel value, or -1 if none.

Returns:
The transparent pixel value, or -1 if none.

isTranslucent

public boolean isTranslucent()
Deprecated. 
Returns true if the image is translucent.

Returns:
true if the image is translucent.
See Also:
ImageWorker.forceBitmaskIndexColorModel(int)

isTiled

public boolean isTiled()
Deprecated. 
Returns true if the image is tiled.

Returns:
true if the image is tiled.
Since:
3.00
See Also:
ImageWorker.tile()

isBytes

public boolean isBytes()
Deprecated. 
Returns true if the image stores its pixel values in bytes. If true, then each sample values use at most 8 bits. However they may use less than 8 bits. For example a binary image stores 8 pixels by byte.

Returns:
true if the image stores pixel values as bytes.
See Also:
ImageWorker.format(int, boolean)

isBinary

public boolean isBinary()
Deprecated. 
Returns true if the image is binary. An image is binary if it has only one band and uses only one bit per pixel. Such image can contains only two values: 0 and 1.

Returns:
true if the image is binary.
See Also:
ImageWorker.binarize(boolean)

isIndexed

public boolean isIndexed()
Deprecated. 
Returns true if the image uses an Index Color Model.

Returns:
true if the image is indexed.
See Also:
ImageWorker.setColorModelType(java.lang.Class)

isGrayScale

public boolean isGrayScale()
Deprecated. 
Returns true if the image uses gray scale. This method returns true if one of the following conditions is true:

Relationship with Color Space type
If this method returns false, then it is guaranteed that getColorSpaceType() will not return PaletteInterpretation.GRAY. However the converse is not necessarily true. See the Index Color Model section in getColorSpaceType().

Returns:
true if the image uses gray scale.
Since:
3.00
See Also:
IGNORE_FULLY_TRANSPARENT_PIXELS

getColorSpaceType

public PaletteInterpretation getColorSpaceType()
Deprecated. 
Returns the type of the Color Space used by the image. If the Color Space is known to this method, then it returns one of the constants defined in the PaletteInterpretation code list, or the IHS constant. Otherwise this method returns null.

Index Color Model
RGB Color Space doesn't mean that pixel values are directly stored as RGB components. The main canvat is IndexColorModel, which has RGB color space despite the fact that images using such Color Model have only one band. In addition the color map in an IndexColorModel may contains only gray colors - this method will not returns the PaletteInterpretation.GRAY in this case since the Color Space still of type RGB in the Java2D sense. For detecting such IndexColorModel having only gray colors, use isGrayScale() instead.

Returns:
The palette interpretation inferred from the Color Space of the current image, or null if unknown.
Since:
3.00
See Also:
ImageWorker.setColorSpaceType(org.opengis.coverage.PaletteInterpretation)

show

@Debug
public void show()
          throws HeadlessException
Deprecated. 
Shows the current image in a window together with the operation chain as a tree. This method is provided mostly for debugging purpose. This method requires the geotk-widgets.jar file in the classpath.

Throws:
HeadlessException - if geotk-widgets.jar is not on the classpath, or if AWT can't create the window components.
See Also:
OperationTreeBrowser.show(RenderedImage)


Copyright © 2009-2012 Geotoolkit.org. All Rights Reserved.