java.awt.image
public class DirectColorModel extends PackedColorModel
| Constructor Summary | |
|---|---|
| DirectColorModel(int pixelBits, int rmask, int gmask, int bmask)
For the color model created with this constructor the pixels
will have fully opaque alpha components with a value of 255.
| |
| DirectColorModel(int pixelBits, int rmask, int gmask, int bmask, int amask)
For the color model created with this constructor the pixels
will have fully opaque alpha components with a value of 255.
| |
| DirectColorModel(ColorSpace cspace, int pixelBits, int rmask, int gmask, int bmask, int amask, boolean isAlphaPremultiplied, int transferType) | |
| Method Summary | |
|---|---|
| ColorModel | coerceData(WritableRaster raster, boolean isAlphaPremultiplied) |
| WritableRaster | createCompatibleWritableRaster(int w, int h)
Creates a WriteableRaster that has a SampleModel
that is compatible with this ColorModel.
|
| int | getAlpha(int pixel)
Get the alpha component of the given pixel.
|
| int | getAlpha(Object inData) |
| int | getAlphaMask() |
| int | getBlue(int pixel)
Get the blue component of the given pixel.
|
| int | getBlue(Object inData) |
| int | getBlueMask() |
| int[] | getComponents(int pixel, int[] components, int offset)
Fills an array with the unnormalized component samples from a
pixel value. |
| int[] | getComponents(Object pixel, int[] components, int offset) |
| int | getDataElement(int[] components, int offset) |
| Object | getDataElements(int rgb, Object pixel)
Converts a normalized pixel int value in the sRGB color
space to an array containing a single pixel of the color space
of the color model.
|
| Object | getDataElements(int[] components, int offset, Object obj) |
| int | getGreen(int pixel)
Get the green component of the given pixel.
|
| int | getGreen(Object inData) |
| int | getGreenMask() |
| int | getRed(int pixel)
Get the red component of the given pixel.
|
| int | getRed(Object inData) |
| int | getRedMask() |
| int | getRGB(int pixel)
Get the RGB color value of the given pixel using the default
RGB color model.
|
| int | getRGB(Object inData) |
| boolean | isCompatibleRaster(Raster raster) |
| String | toString() |
Parameters: pixelBits the number of bits wide used for bit size of pixel values rmask the bits describing the red component of a pixel gmask the bits describing the green component of a pixel bmask the bits describing the blue component of a pixel
Parameters: pixelBits the number of bits wide used for bit size of pixel values rmask the bits describing the red component of a pixel gmask the bits describing the green component of a pixel bmask the bits describing the blue component of a pixel amask the bits describing the alpha component of a pixel
WriteableRaster that has a SampleModel
that is compatible with this ColorModel.
Parameters: w the width of the writeable raster to create h the height of the writeable raster to create
Throws: IllegalArgumentException if w or h
is less than or equal to zero
This method performs the inverse function of
getRGB(Object inData).
Parameters: rgb pixel as a normalized sRGB, 0xAARRGGBB value. pixel to avoid needless creation of arrays, an array to use to return the pixel can be given. If null, a suitable array will be created.
Returns: array of transferType containing a single pixel. The pixel should be encoded in the natural way of the color model.
See Also: getRGB
Parameters: pixel a pixel value