Constructs a
DirectColorModel
from the specified
parameters. Color components are in the specified
ColorSpace
, which must be of type ColorSpace.TYPE_RGB
and have minimum normalized component values which are all 0.0
and maximum values which are all 1.0.
The masks specify which bits in an
int
pixel
representation contain the red, green and blue color samples and
the alpha sample, if present. If
amask
is 0, pixel
values do not contain alpha information and all pixels are treated
as opaque, which means that alpha = 1.0. All of the
bits in each mask must be contiguous and fit in the specified number
of least significant bits of an
int
pixel
representation. If there is alpha, the
boolean
isAlphaPremultiplied
specifies how to interpret
color and alpha samples in pixel values. If the
boolean
is
true
, color samples are assumed to have been
multiplied by the alpha sample. The transparency value is
Transparency.OPAQUE, if no alpha is present, or
Transparency.TRANSLUCENT otherwise. The transfer type
is the type of primitive array used to represent pixel values and
must be one of DataBuffer.TYPE_BYTE, DataBuffer.TYPE_USHORT, or
DataBuffer.TYPE_INT.
Parameters:
-
space - the specified
ColorSpace
-
bits - the number of bits in the pixel values; for example,
the sum of the number of bits in the masks.
-
rmask - specifies a mask indicating which bits in an
integer pixel contain the red component
-
gmask - specifies a mask indicating which bits in an
integer pixel contain the green component
-
bmask - specifies a mask indicating which bits in an
integer pixel contain the blue component
-
amask - specifies a mask indicating which bits in an
integer pixel contain the alpha component
-
isAlphaPremultiplied -
true
if color samples are
premultiplied by the alpha sample;
false
otherwise
-
transferType - the type of array used to represent pixel values
Throws:
-
IllegalArgumentException - if
space
is not a
TYPE_RGB space or if the min/max normalized component
values are not 0.0/1.0.