| java.lang.Object java.awt.image.ColorModel java.awt.image.DirectColorModel
DirectColorModel | public class DirectColorModel extends ColorModel (Code) | | A ColorModel class that specifies a translation from pixel values
to alpha, red, green, and blue color components for pixels which
have the color components embedded directly in the bits of the
pixel itself. This color model is similar to an X11 TrueColor
visual.
Many of the methods in this class are final. This is because the
underlying native graphics code makes assumptions about the layout
and operation of this class and those assumptions are reflected in
the implementations of the methods here that are marked final. You
can subclass this class for other reaons, but you cannot override
or modify the behaviour of those methods.
See Also: ColorModel version: 1.24 08/21/02 author: Jim Graham |
Constructor Summary | |
public | DirectColorModel(int bits, int rmask, int gmask, int bmask) Constructs a DirectColorModel from the given masks specifying
which bits in the pixel contain the red, green and blue color
components. | public | DirectColorModel(int bits, int rmask, int gmask, int bmask, int amask) Constructs a DirectColorModel from the given masks specifying
which bits in the pixel contain the alhpa, red, green and blue
color components. | public | DirectColorModel(ColorSpace space, int bits, int rmask, int gmask, int bmask, int amask, boolean isAlphaPremultiplied, int transferType) Constructs a DirectColorModel from the specified
parameters. |
Method Summary | |
final public int | getAlpha(int pixel) Return the alpha transparency value for the specified pixel in the
range 0-255. | final public int | getAlphaMask() Returns the mask indicating which bits in a pixel contain the alpha
transparency component. | final public int | getBlue(int pixel) Returns the blue color compoment for the specified pixel in the
range 0-255. | final public int | getBlueMask() Returns the mask indicating which bits in a pixel contain the blue
color component. | final public int | getGreen(int pixel) Returns the green color compoment for the specified pixel in the
range 0-255. | final public int | getGreenMask() Returns the mask indicating which bits in a pixel contain the green
color component. | final public int | getRGB(int pixel) Returns the color of the pixel in the default RGB color model. | final public int | getRed(int pixel) Returns the red color compoment for the specified pixel in the
range 0-255. | final public int | getRedMask() Returns the mask indicating which bits in a pixel contain the red
color component. |
DirectColorModel | public DirectColorModel(int bits, int rmask, int gmask, int bmask)(Code) | | Constructs a DirectColorModel from the given masks specifying
which bits in the pixel contain the red, green and blue color
components. Pixels described by this color model will all
have alpha components of 255 (fully opaque). All of the bits
in each mask must be contiguous and fit in the specified number
of least significant bits of the integer.
|
DirectColorModel | public DirectColorModel(int bits, int rmask, int gmask, int bmask, int amask)(Code) | | Constructs a DirectColorModel from the given masks specifying
which bits in the pixel contain the alhpa, red, green and blue
color components. All of the bits in each mask must be contiguous
and fit in the specified number of least significant bits of the
integer.
|
DirectColorModel | public DirectColorModel(ColorSpace space, int bits, int rmask, int gmask, int bmask, int amask, boolean isAlphaPremultiplied, int transferType)(Code) | | Constructs a DirectColorModel from the specified
parameters. Color components are in the specified
ColorSpace , which must be of type ColorSpace.TYPE_RGB.
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 Parameters: bits - the number of bits in the pixel values; for example,the sum of the number of bits in the masks. Parameters: rmask - specifies a mask indicating which bits in aninteger pixel contain the red component Parameters: gmask - specifies a mask indicating which bits in aninteger pixel contain the green component Parameters: bmask - specifies a mask indicating which bits in aninteger pixel contain the blue component Parameters: amask - specifies a mask indicating which bits in aninteger pixel contain the alpha component Parameters: isAlphaPremultiplied - true if color samples arepremultiplied by the alpha sample; false otherwise Parameters: transferType - the type of array used to represent pixel values |
getAlpha | final public int getAlpha(int pixel)(Code) | | Return the alpha transparency value for the specified pixel in the
range 0-255.
|
getAlphaMask | final public int getAlphaMask()(Code) | | Returns the mask indicating which bits in a pixel contain the alpha
transparency component.
|
getBlue | final public int getBlue(int pixel)(Code) | | Returns the blue color compoment for the specified pixel in the
range 0-255.
|
getBlueMask | final public int getBlueMask()(Code) | | Returns the mask indicating which bits in a pixel contain the blue
color component.
|
getGreen | final public int getGreen(int pixel)(Code) | | Returns the green color compoment for the specified pixel in the
range 0-255.
|
getGreenMask | final public int getGreenMask()(Code) | | Returns the mask indicating which bits in a pixel contain the green
color component.
|
getRed | final public int getRed(int pixel)(Code) | | Returns the red color compoment for the specified pixel in the
range 0-255.
|
getRedMask | final public int getRedMask()(Code) | | Returns the mask indicating which bits in a pixel contain the red
color component.
|
|
|