Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

Class java.awt.image.PackedColorModel

java.lang.Object
    |
    +----java.awt.image.ColorModel
            |
            +----java.awt.image.PackedColorModel
Subclasses:
DirectColorModel

public abstract class PackedColorModel
extends ColorModel
An abstract ColorModel class that represents pixel values that have the color components embedded directly in the bits of an integer pixel. A subclass is the DirectColorModel, which is similar to an X11 TrueColor visual.

See Also:
DirectColorModel

Fields inherited from class java.awt.image.ColorModel
 pixel_bits, transferType
 

Constructor Summary
 PackedColorModel(ColorSpace space, int bits, int[] colorMaskArray, int alphaMask, boolean isAlphaPremultiplied, int trans)
Constructs a PackedColorModel from a mask array, which specifies which bits in the integer pixel contain each of the color components in the ColorSpace.
 PackedColorModel(ColorSpace space, int bits, int rmask, int gmask, int bmask, int amask, boolean isAlphaPremultiplied, int trans)
Constructs a PackedColorModel from the given masks specifying which bits in the pixel contain the alpha, red, green and blue color components.
 

Method Summary
boolean  equals(Object obj)
 
int  getMask(int index)
Returns the mask indicating which bits in a pixel contain the color component.
int[]  getMask()
Returns the mask array indicating which bits in a pixel contain the color and alpha components.
 
Methods inherited from class java.awt.image.ColorModel
 coerceData, createCompatibleWritableRaster, equals, finalize, getAlpha, getAlpha, getBlue, getBlue, getColorSpace, getComponents, getComponents, getComponents, getComponentSize, getComponentSize, getGreen, getGreen, getMaxComponentSize, getNormalizedComponents, getNumColorComponents, getNumComponents, getPixelData, getPixelSize, getRed, getRed, getRGB, getRGB, getRGBdefault, getTransparency, hasAlpha, isAlphaPremultiplied, isCompatibleRaster, setComponents, setComponents, toString
 
Methods inherited from class java.lang.Object
 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PackedColorModel

public PackedColorModel(ColorSpace space,
                        int bits,
                        int[] colorMaskArray,
                        int alphaMask,
                        boolean isAlphaPremultiplied,
                        int trans)
Constructs a PackedColorModel from a mask array, which specifies which bits in the integer pixel contain each of the color components in the ColorSpace. All of the bits in each mask must be contiguous and fit in the specified number of least significant bits of the integer. If the alphaMask is 0, there is no alpha. If there is alpha, the boolean, isAlphaPremultiplied, specifies how to interpret color data that are passed to this ColorModel. If it is true, the color data will have been multiplied with alpha.

PackedColorModel

public PackedColorModel(ColorSpace space,
                        int bits,
                        int rmask,
                        int gmask,
                        int bmask,
                        int amask,
                        boolean isAlphaPremultiplied,
                        int trans)
Constructs a PackedColorModel from the given masks specifying which bits in the pixel contain the alpha, 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. The boolean, isAlphaPremultiplied, specifies how to interpret color data that are passed to this ColorModel. If it is true, the color data will have been multiplied with alpha. The ColorSpace should be of type ColorSpace.TYPE_RGB.
See Also:
ColorSpace
Method Detail

getMask

public final int getMask(int index)
Returns the mask indicating which bits in a pixel contain the color component. The index corresponds to the placement of color component names in the color space. Thus, index 0 for a CMYK ColorSpace would correspond to Cyan and index 1 would correspond to Magenta. If there is alpha, the alpha index would be:
      alphaIndex = numComponents() - 1;
 

getMask

public final int[] getMask()
Returns the mask array indicating which bits in a pixel contain the color and alpha components.

equals

public boolean equals(Object obj)
Overrides:
equals in class ColorModel

Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

Submit a bug or feature
Submit comments/suggestions about new javadoc look.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.