ColorModel
class that works with pixel values that represent color and alpha information as separate samples, using float or double elements. This class can be used with an arbitrary ColorSpace
. The number of color samples in the pixel values must be same as the number of color components in the ColorSpace
. There may be a single alpha sample. Sample values are taken as ranging from 0.0 to 1.0; that is, when converting to 8-bit RGB, a multiplication by 255 is performed and values outside of the range 0-255 are clamped at the closest endpoint.
For maximum efficiency, pixel data being interpreted by this class should be in the sRGB color space. This will result in only the trivial conversion (scaling by 255 and dividing by any premultiplied alpha) to be performed. Other color spaces require more general conversions.
For those methods that use a primitive array pixel representation of type transferType
, the array length is the same as the number of color and alpha samples. Color samples are stored first in the array followed by the alpha sample, if present. The order of the color samples is specified by the ColorSpace
. Typically, this order reflects the name of the color space type. For example, for TYPE_RGB
, index 0 corresponds to red, index 1 to green, and index 2 to blue. The transfer types supported are DataBuffer.TYPE_FLOAT
, DataBuffer.TYPE_DOUBLE
.
The translation from pixel values to color/alpha components for display or processing purposes is a one-to-one correspondence of samples to components.
Methods that use a single int pixel representation throw an IllegalArgumentException
.
A FloatDoubleColorModel
can be used in conjunction with a ComponentSampleModelJAI
.
@see java.awt.image.ColorModel
@see java.awt.color.ColorSpace
@see java.awt.image.ComponentSampleModel
@see ComponentSampleModelJAI
|
|
|
|
|
|