public class ComponentColorModelJAI extends ComponentColorModel
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:
ComponentColorModel supports float and double datatypes since J2SE
1.4 only. The workaround for J2SE 1.3 is to use the FloatDoubleColorModel provided
with JAI 1.1.
FloatDoubleColorModel ignores the new API in ColorSpace, especially the
getMinValue and getMaxValue methods. Consequently, rendering of any image
using our custom ScaledColorSpace is wrong.
ComponentColorModel uses DataBufferFloat and DataBufferDouble, which are unknown to JAI 1.1. Consequently, trying to use
RectIter with one of those will throw ClassCastException.
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.| Modifier and Type | Field and Description |
|---|---|
static boolean |
ENABLED
Whatever usage of this class should be enabled or not.
|
pixel_bits, transferTypeBITMASK, OPAQUE, TRANSLUCENT| Constructor and 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.
|
| Modifier and Type | Method and Description |
|---|---|
SampleModel |
createCompatibleSampleModel(int w,
int h)
Returns a compatible sample model.
|
String |
toString()
Returns the
String representation of the contents of this ColorModelobject. |
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, isCompatibleSampleModelfinalize, getColorSpace, getComponentSize, getComponentSize, getNumColorComponents, getNumComponents, getPixelSize, getRGBdefault, getTransferType, getTransparency, hasAlpha, hashCode, isAlphaPremultipliedpublic static final boolean ENABLED
public ComponentColorModelJAI(ColorSpace colorSpace, int[] bits, boolean hasAlpha, boolean isAlphaPremultiplied, int transparency, int transferType)
public ComponentColorModelJAI(ColorSpace colorSpace, boolean hasAlpha, boolean isAlphaPremultiplied, int transparency, int transferType)
public SampleModel createCompatibleSampleModel(int w, int h)
createCompatibleSampleModel in class ComponentColorModelpublic String toString()
String representation of the contents of this ColorModelobject.toString in class ColorModelString representing the contents of this ColorModel object.Copyright © 1996–2021 Geotools. All rights reserved.