java.awt.image
Class PackedColorModel
java.lang.Object
java.awt.image.ColorModel
java.awt.image.PackedColorModel
- All Implemented Interfaces:
- Transparency
- Direct Known Subclasses:
- DirectColorModel
public abstract class PackedColorModel
- extends ColorModel
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)
|
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 |
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)
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:
- It must be transitive. If
a.equals(b)
and
b.equals(c)
, then a.equals(c)
must be true as well.
- It must be symmetric.
a.equals(b)
and
b.equals(a)
must have the same value.
- It must be reflexive.
a.equals(a)
must
always be true.
- It must be consistent. Whichever value a.equals(b)
returns on the first invocation must be the value
returned on all later invocations.
a.equals(null)
must be false.
- It must be consistent with hashCode(). That is,
a.equals(b)
must imply
a.hashCode() == b.hashCode()
.
The reverse is not true; two objects that are not
equal may have the same hashcode, but that has
the potential to harm hashing performance.
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()