java.awt.image
Class PackedColorModel

java.lang.Object
  extended by java.awt.image.ColorModel
      extended by java.awt.image.PackedColorModel
All Implemented Interfaces:
Transparency
Direct Known Subclasses:
DirectColorModel

public abstract class PackedColorModel
extends ColorModel


Field Summary
 
Fields inherited from class java.awt.image.ColorModel
pixel_bits, transferType
 
Fields inherited from interface java.awt.Transparency
BITMASK, OPAQUE, TRANSLUCENT
 
Constructor Summary
PackedColorModel(ColorSpace cspace, int pixelBits, int[] colorMaskArray, int alphaMask, boolean isAlphaPremultiplied, int transparency, int transferType)
           
PackedColorModel(ColorSpace cspace, int pixelBits, int rmask, int gmask, int bmask, int amask, boolean isAlphaPremultiplied, int transparency, int transferType)
           
 
Method Summary
 SampleModel createCompatibleSampleModel(int w, int h)
           
 boolean equals(Object obj)
          Determine whether this Object is semantically equal to another Object.
 WritableRaster getAlphaRaster(WritableRaster raster)
          Subclasses must override this method if it is possible for the color model to have an alpha channel.
 int getMask(int index)
           
 int[] getMasks()
           
 boolean isCompatibleSampleModel(SampleModel sm)
           
 
Methods inherited from class java.awt.image.ColorModel
coerceData, coerceDataWorker, createCompatibleWritableRaster, finalize, getAlpha, getAlpha, getBlue, getBlue, getColorSpace, getComponents, getComponents, getComponentSize, getComponentSize, getDataElement, getDataElement, getDataElements, getDataElements, getDataElements, getGreen, getGreen, getNormalizedComponents, getNormalizedComponents, getNumColorComponents, getNumComponents, getPixelSize, getRed, getRed, getRGB, getRGB, getRGBdefault, getTransferType, getTransparency, getUnnormalizedComponents, hasAlpha, isAlphaPremultiplied, isCompatibleRaster, toString
 
Methods inherited from class java.lang.Object
clone, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PackedColorModel

public PackedColorModel(ColorSpace cspace,
                        int pixelBits,
                        int[] colorMaskArray,
                        int alphaMask,
                        boolean isAlphaPremultiplied,
                        int transparency,
                        int transferType)

PackedColorModel

public PackedColorModel(ColorSpace cspace,
                        int pixelBits,
                        int rmask,
                        int gmask,
                        int bmask,
                        int amask,
                        boolean isAlphaPremultiplied,
                        int transparency,
                        int transferType)
Method Detail

getMask

public final int getMask(int index)

getMasks

public final int[] getMasks()

createCompatibleSampleModel

public SampleModel createCompatibleSampleModel(int w,
                                               int h)
Overrides:
createCompatibleSampleModel in class ColorModel

isCompatibleSampleModel

public boolean isCompatibleSampleModel(SampleModel sm)
Overrides:
isCompatibleSampleModel in class ColorModel

getAlphaRaster

public WritableRaster getAlphaRaster(WritableRaster raster)
Description copied from class: ColorModel
Subclasses must override this method if it is possible for the color model to have an alpha channel.

Overrides:
getAlphaRaster in class ColorModel
Returns:
null, as per JDK 1.3 doc. Subclasses will only return null if no alpha raster exists.

equals

public boolean equals(Object obj)
Description copied from class: Object
Determine whether this Object is semantically equal to another Object.

There are some fairly strict requirements on this method which subclasses must follow:

This is typically overridden to throw a ClassCastException if the argument is not comparable to the class performing the comparison, but that is not a requirement. It is legal for a.equals(b) to be true even though a.getClass() != b.getClass(). Also, it is typical to never cause a NullPointerException.

In general, the Collections API (java.util) use the equals method rather than the == operator to compare objects. However, IdentityHashMap is an exception to this rule, for its own good reasons.

The default implementation returns this == o.

Overrides:
equals in class ColorModel
Parameters:
obj - the Object to compare to
Returns:
whether this Object is semantically equal to another
See Also:
Object.hashCode()