Package org.geotools.image.util
Class ComponentColorModelJAI
- Object
- 
- ColorModel
- 
- ComponentColorModel
- 
- ComponentColorModelJAI
 
 
 
- 
- All Implemented Interfaces:
- Transparency
 
 public class ComponentColorModelJAI extends ComponentColorModel AComponentColorModelmodified 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:- ComponentColorModelsupports- floatand- doubledatatypes since J2SE 1.4 only. The workaround for J2SE 1.3 is to use the- FloatDoubleColorModelprovided with JAI 1.1.
- FloatDoubleColorModelignores the new API in- ColorSpace, especially the- getMinValueand- getMaxValuemethods. Consequently, rendering of any image using our custom- ScaledColorSpaceis wrong.
- ComponentColorModeluses- DataBufferFloatand- DataBufferDouble, which are unknown to JAI 1.1. Consequently, trying to use- RectIterwith one of those will throw- ClassCastException.
 ComponentColorModel(which work with our customColorSpace) and override itscreateCompatibleSampleModelin order to returnsComponentSampleModelJAIinstead ofComponentSampleModelwhenfloatordoubledatatype is requested.- Since:
- 2.0
- Author:
- Martin Desruisseaux (IRD)
 
- 
- 
Field SummaryFields Modifier and Type Field Description static booleanENABLEDWhatever usage of this class should be enabled or not.- 
Fields inherited from class ColorModelpixel_bits, transferType
 - 
Fields inherited from interface TransparencyBITMASK, OPAQUE, TRANSLUCENT
 
- 
 - 
Constructor SummaryConstructors Constructor Description ComponentColorModelJAI(ColorSpace colorSpace, boolean hasAlpha, boolean isAlphaPremultiplied, int transparency, int transferType)Construct a new color model.ComponentColorModelJAI(ColorSpace colorSpace, int[] bits, boolean hasAlpha, boolean isAlphaPremultiplied, int transparency, int transferType)Construct a new color model.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description SampleModelcreateCompatibleSampleModel(int w, int h)Returns a compatible sample model.StringtoString()Returns theStringrepresentation of the contents of thisColorModelobject.- 
Methods inherited from class ComponentColorModelcoerceData, createCompatibleWritableRaster, equals, getAlpha, getAlpha, getAlphaRaster, getBlue, getBlue, getComponents, getComponents, getDataElement, getDataElement, getDataElements, getDataElements, getDataElements, getGreen, getGreen, getNormalizedComponents, getNormalizedComponents, getRed, getRed, getRGB, getRGB, getUnnormalizedComponents, hashCode, isCompatibleRaster, isCompatibleSampleModel
 - 
Methods inherited from class ColorModelfinalize, getColorSpace, getComponentSize, getComponentSize, getNumColorComponents, getNumComponents, getPixelSize, getRGBdefault, getTransferType, getTransparency, hasAlpha, isAlphaPremultiplied
 
- 
 
- 
- 
- 
Field Detail- 
ENABLEDpublic static final boolean ENABLED Whatever usage of this class should be enabled or not.- See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
ComponentColorModelJAIpublic ComponentColorModelJAI(ColorSpace colorSpace, int[] bits, boolean hasAlpha, boolean isAlphaPremultiplied, int transparency, int transferType) Construct a new color model.
 - 
ComponentColorModelJAIpublic ComponentColorModelJAI(ColorSpace colorSpace, boolean hasAlpha, boolean isAlphaPremultiplied, int transparency, int transferType) Construct a new color model.
 
- 
 - 
Method Detail- 
createCompatibleSampleModelpublic 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:
- createCompatibleSampleModelin class- ComponentColorModel
 
 - 
toStringpublic String toString() Returns theStringrepresentation of the contents of thisColorModelobject.- Overrides:
- toStringin class- ColorModel
- Returns:
- a Stringrepresenting the contents of thisColorModelobject.
 
 
- 
 
-