org.esa.beam.framework.datamodel
Class ImageInfo

java.lang.Object
  extended by org.esa.beam.framework.datamodel.ImageInfo
All Implemented Interfaces:
Cloneable

public class ImageInfo
extends Object
implements Cloneable

This class contains information about how a product's raster data node is displayed as an image.

Version:
$Revision$ $Date$
Author:
Norman Fomferra

Nested Class Summary
static class ImageInfo.HistogramMatching
          Enumerates the possible histogram matching modes.
 
Field Summary
static String HISTOGRAM_MATCHING_EQUALIZE
          Deprecated. 
static String HISTOGRAM_MATCHING_NORMALIZE
          Deprecated. 
static String HISTOGRAM_MATCHING_OFF
          Deprecated. since BEAM 4.2, use enum ImageInfo.HistogramMatching
static Color NO_COLOR
           
 
Constructor Summary
ImageInfo(ColorPaletteDef colorPaletteDef)
          Constructs a new image information instance.
ImageInfo(RGBChannelDef rgbChannelDef)
          Constructs a new RGB image information instance.
 
Method Summary
 Object clone()
          Creates and returns a copy of this object.
 ComponentColorModel createComponentColorModel()
           
 ImageInfo createDeepCopy()
          Creates and returns a "deep" copy of this object.
 IndexColorModel createIndexColorModel(Scaling scaling)
           
 void dispose()
          Releases all of the resources used by this object instance and all of its owned children.
 int getColorComponentCount()
          Gets the number of color components the image shall have using an instance of this ImageInfo.
 ColorPaletteDef getColorPaletteDef()
          Gets the color palette definition as used for images created from single bands.
 Color[] getColors()
           
 ImageInfo.HistogramMatching getHistogramMatching()
           
static ImageInfo.HistogramMatching getHistogramMatching(String mode)
          Converts a string to a histogram matching.
 Color getNoDataColor()
           
 RGBChannelDef getRgbChannelDef()
          Gets the RGB(A) channel definition as used for images created from 3 tp 4 bands.
 boolean isLogScaled()
           
 void setColorPaletteDef(ColorPaletteDef colorPaletteDef, double minSample, double maxSample, boolean autoDistribute)
          Transfers the colour palette into this image info.
 void setColors(Color[] colors)
          Sets the colours of the colour palette of this image info.
 void setHistogramMatching(ImageInfo.HistogramMatching histogramMatching)
           
 void setLogScaled(boolean logScaled)
           
 void setNoDataColor(Color noDataColor)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_COLOR

public static final Color NO_COLOR

HISTOGRAM_MATCHING_OFF

@Deprecated
public static final String HISTOGRAM_MATCHING_OFF
Deprecated. since BEAM 4.2, use enum ImageInfo.HistogramMatching
See Also:
Constant Field Values

HISTOGRAM_MATCHING_EQUALIZE

@Deprecated
public static final String HISTOGRAM_MATCHING_EQUALIZE
Deprecated. 
See Also:
Constant Field Values

HISTOGRAM_MATCHING_NORMALIZE

@Deprecated
public static final String HISTOGRAM_MATCHING_NORMALIZE
Deprecated. 
See Also:
Constant Field Values
Constructor Detail

ImageInfo

public ImageInfo(ColorPaletteDef colorPaletteDef)
Constructs a new image information instance.

Parameters:
colorPaletteDef - the color palette definition

ImageInfo

public ImageInfo(RGBChannelDef rgbChannelDef)
Constructs a new RGB image information instance.

Parameters:
rgbChannelDef - the RGB channel definition
Method Detail

getColorPaletteDef

public ColorPaletteDef getColorPaletteDef()
Gets the color palette definition as used for images created from single bands.

Returns:
The color palette definition. Can be null. In this case getRgbChannelDef() is non-null.

getRgbChannelDef

public RGBChannelDef getRgbChannelDef()
Gets the RGB(A) channel definition as used for images created from 3 tp 4 bands.

Returns:
The RGB(A) channel definition. Can be null. In this case getColorPaletteDef() is non-null.

getNoDataColor

public Color getNoDataColor()

setNoDataColor

public void setNoDataColor(Color noDataColor)

getHistogramMatching

public ImageInfo.HistogramMatching getHistogramMatching()

setHistogramMatching

public void setHistogramMatching(ImageInfo.HistogramMatching histogramMatching)

isLogScaled

public boolean isLogScaled()

setLogScaled

public void setLogScaled(boolean logScaled)

getColors

public Color[] getColors()

getColorComponentCount

public int getColorComponentCount()
Gets the number of color components the image shall have using an instance of this ImageInfo.

Returns:
3 for RGB images, 4 for RGB images with an alpha channel (transparency)

createIndexColorModel

public IndexColorModel createIndexColorModel(Scaling scaling)

createComponentColorModel

public ComponentColorModel createComponentColorModel()

clone

public final Object clone()
Creates and returns a copy of this object.

Overrides:
clone in class Object
Returns:
a copy of this object

createDeepCopy

public ImageInfo createDeepCopy()
Creates and returns a "deep" copy of this object. The method simply returns the value of clone().

Returns:
a copy of this object

dispose

public void dispose()
Releases all of the resources used by this object instance and all of its owned children. Its primary use is to allow the garbage collector to perform a vanilla job.

This method should be called only if it is for sure that this object instance will never be used again. The results of referencing an instance of this class after a call to dispose() are undefined.

Overrides of this method should always call super.dispose(); after disposing this instance.


setColors

public void setColors(Color[] colors)
Sets the colours of the colour palette of this image info.

Parameters:
colors - the new colours

setColorPaletteDef

public void setColorPaletteDef(ColorPaletteDef colorPaletteDef,
                               double minSample,
                               double maxSample,
                               boolean autoDistribute)
Transfers the colour palette into this image info.

Parameters:
colorPaletteDef - another colour palette
minSample - the minium allowed sample value in the new colour palette
maxSample - the maximum allowed sample value in the new colour palette
autoDistribute - if true, points are distributed between minSample/maxSample.

getHistogramMatching

public static ImageInfo.HistogramMatching getHistogramMatching(String mode)
Converts a string to a histogram matching.

Parameters:
mode - the histogram matching string
Returns:
the histogram matching. ImageInfo.HistogramMatching.None if maode is not "Equalize" or "Normalize".


Copyright © 2002-2012 Brockmann Consult GmbH. All Rights Reserved.