org.geotools.resources.image
Class ComponentColorModelJAI

java.lang.Object
  extended by java.awt.image.ColorModel
      extended by java.awt.image.ComponentColorModel
          extended by org.geotools.resources.image.ComponentColorModelJAI
All Implemented Interfaces:
java.awt.Transparency

public class ComponentColorModelJAI
extends java.awt.image.ComponentColorModel

A ComponentColorModel modified for interoperability with Java Advanced Imaging. JAI 1.1 was designed for use with J2SE 1.3 and is not aware of new features in J2SE 1.4. This leads to the following problems:

The work around is to use J2SE's ComponentColorModel (which work with our custom ColorSpace) and override its createCompatibleSampleModel in order to returns ComponentSampleModelJAI instead of ComponentSampleModel when float or double datatype is requested.

Since:
2.0
Version:
$Id: ComponentColorModelJAI.java 30836 2008-07-01 18:02:49Z desruisseaux $
Author:
Martin Desruisseaux (IRD)

Field Summary
static boolean ENABLED
          Whatever usage of this class should be enabled or not.
 
Fields inherited from class java.awt.image.ColorModel
pixel_bits, transferType
 
Fields inherited from interface java.awt.Transparency
BITMASK, OPAQUE, TRANSLUCENT
 
Constructor Summary
ComponentColorModelJAI(java.awt.color.ColorSpace colorSpace, boolean hasAlpha, boolean isAlphaPremultiplied, int transparency, int transferType)
          Construct a new color model.
ComponentColorModelJAI(java.awt.color.ColorSpace colorSpace, int[] bits, boolean hasAlpha, boolean isAlphaPremultiplied, int transparency, int transferType)
          Construct a new color model.
 
Method Summary
 java.awt.image.SampleModel createCompatibleSampleModel(int w, int h)
          Returns a compatible sample model.
 java.lang.String toString()
          Returns the String representation of the contents of this ColorModelobject.
 
Methods inherited from class java.awt.image.ComponentColorModel
coerceData, createCompatibleWritableRaster, equals, getAlpha, getAlpha, getAlphaRaster, getBlue, getBlue, getComponents, getComponents, getDataElement, getDataElement, getDataElements, getDataElements, getDataElements, getGreen, getGreen, getNormalizedComponents, getNormalizedComponents, getRed, getRed, getRGB, getRGB, getUnnormalizedComponents, isCompatibleRaster, isCompatibleSampleModel
 
Methods inherited from class java.awt.image.ColorModel
finalize, getColorSpace, getComponentSize, getComponentSize, getNumColorComponents, getNumComponents, getPixelSize, getRGBdefault, getTransferType, getTransparency, hasAlpha, hashCode, isAlphaPremultiplied
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ENABLED

public static final boolean ENABLED
Whatever usage of this class should be enabled or not.

See Also:
Constant Field Values
Constructor Detail

ComponentColorModelJAI

public ComponentColorModelJAI(java.awt.color.ColorSpace colorSpace,
                              int[] bits,
                              boolean hasAlpha,
                              boolean isAlphaPremultiplied,
                              int transparency,
                              int transferType)
Construct a new color model.


ComponentColorModelJAI

public ComponentColorModelJAI(java.awt.color.ColorSpace colorSpace,
                              boolean hasAlpha,
                              boolean isAlphaPremultiplied,
                              int transparency,
                              int transferType)
Construct a new color model.

Method Detail

createCompatibleSampleModel

public java.awt.image.SampleModel createCompatibleSampleModel(int w,
                                                              int h)
Returns a compatible sample model. This implementation is nearly identical to default J2SE's implementation, except that it construct a JAI color model instead of a J2SE one.

Overrides:
createCompatibleSampleModel in class java.awt.image.ComponentColorModel

toString

public java.lang.String toString()
Returns the String representation of the contents of this ColorModelobject.

Overrides:
toString in class java.awt.image.ColorModel
Returns:
a String representing the contents of this ColorModel object.


Copyright © 1996-2010 Geotools. All Rights Reserved.