All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.awt.image.DirectColorModel

java.lang.Object
   |
   +----java.awt.image.ColorModel
           |
           +----java.awt.image.DirectColorModel

public class DirectColorModel
extends ColorModel
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

Constructor Index

 o DirectColorModel(int, int, int, int)
Constructs a DirectColorModel from the given masks specifying which bits in the pixel contain the red, green and blue color components.
 o DirectColorModel(int, int, int, int, int)
Constructs a DirectColorModel from the given masks specifying which bits in the pixel contain the alhpa, red, green and blue color components.

Method Index

 o getAlpha(int)
Return the alpha transparency value for the specified pixel in the range 0-255.
 o getAlphaMask()
Returns the mask indicating which bits in a pixel contain the alpha transparency component.
 o getBlue(int)
Returns the blue color compoment for the specified pixel in the range 0-255.
 o getBlueMask()
Returns the mask indicating which bits in a pixel contain the blue color component.
 o getGreen(int)
Returns the green color compoment for the specified pixel in the range 0-255.
 o getGreenMask()
Returns the mask indicating which bits in a pixel contain the green color component.
 o getRed(int)
Returns the red color compoment for the specified pixel in the range 0-255.
 o getRedMask()
Returns the mask indicating which bits in a pixel contain the red color component.
 o getRGB(int)
Returns the color of the pixel in the default RGB color model.

Constructors

 o DirectColorModel
 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. 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.

 o DirectColorModel
 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. All of the bits in each mask must be contiguous and fit in the specified number of least significant bits of the integer.

Methods

 o getRedMask
 public final int getRedMask()
Returns the mask indicating which bits in a pixel contain the red color component.

 o getGreenMask
 public final int getGreenMask()
Returns the mask indicating which bits in a pixel contain the green color component.

 o getBlueMask
 public final int getBlueMask()
Returns the mask indicating which bits in a pixel contain the blue color component.

 o getAlphaMask
 public final int getAlphaMask()
Returns the mask indicating which bits in a pixel contain the alpha transparency component.

 o getRed
 public final int getRed(int pixel)
Returns the red color compoment for the specified pixel in the range 0-255.

Overrides:
getRed in class ColorModel
 o getGreen
 public final int getGreen(int pixel)
Returns the green color compoment for the specified pixel in the range 0-255.

Overrides:
getGreen in class ColorModel
 o getBlue
 public final int getBlue(int pixel)
Returns the blue color compoment for the specified pixel in the range 0-255.

Overrides:
getBlue in class ColorModel
 o getAlpha
 public final int getAlpha(int pixel)
Return the alpha transparency value for the specified pixel in the range 0-255.

Overrides:
getAlpha in class ColorModel
 o getRGB
 public final int getRGB(int pixel)
Returns the color of the pixel in the default RGB color model.

Overrides:
getRGB in class ColorModel
See Also:
getRGBdefault

All Packages  Class Hierarchy  This Package  Previous  Next  Index