Package com.twelvemonkeys.imageio.color
Class DiscreteAlphaIndexColorModel
java.lang.Object
java.awt.image.ColorModel
com.twelvemonkeys.imageio.color.DiscreteAlphaIndexColorModel
- All Implemented Interfaces:
Transparency
This class represents a hybrid between an
IndexColorModel
and a ComponentColorModel
,
having both a color map and a full, discrete alpha channel and/or one or more "extra" channels.
The color map entries are assumed to be fully opaque and should have no transparent index.
ColorSpace will always be the default sRGB color space (as with IndexColorModel
).
Component order is always I, A, X1, X2... Xn, where I is a palette index, A is the alpha value and Xn are extra samples (ignored for display).
- See Also:
-
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
ConstructorsConstructorDescriptionCreates aDiscreteAlphaIndexColorModel
, delegating color map look-ups to the givenIndexColorModel
.DiscreteAlphaIndexColorModel
(IndexColorModel icm, int extraSamples, boolean hasAlpha) Creates aDiscreteAlphaIndexColorModel
, delegating color map look-ups to the givenIndexColorModel
. -
Method Summary
Modifier and TypeMethodDescriptioncreateCompatibleSampleModel
(int w, int h) createCompatibleWritableRaster
(int w, int h) boolean
int
getAlpha
(int pixel) int
int
getBlue
(int pixel) int
int
getGreen
(int pixel) int
int
int
getRed
(int pixel) int
boolean
isCompatibleRaster
(Raster raster) boolean
toString()
Methods inherited from class java.awt.image.ColorModel
coerceData, finalize, getAlphaRaster, getColorSpace, getComponents, getComponents, getComponentSize, getComponentSize, getDataElement, getDataElement, getDataElements, getDataElements, getDataElements, getNormalizedComponents, getNormalizedComponents, getNumColorComponents, getPixelSize, getRGB, getRGB, getRGBdefault, getTransferType, getTransparency, getUnnormalizedComponents, hasAlpha, hashCode, isAlphaPremultiplied
-
Constructor Details
-
DiscreteAlphaIndexColorModel
Creates aDiscreteAlphaIndexColorModel
, delegating color map look-ups to the givenIndexColorModel
.- Parameters:
icm
- TheIndexColorModel
delegate. Color map entries are assumed to be fully opaque, any transparency or transparent index will be ignored.
-
DiscreteAlphaIndexColorModel
Creates aDiscreteAlphaIndexColorModel
, delegating color map look-ups to the givenIndexColorModel
.- Parameters:
icm
- TheIndexColorModel
delegate. Color map entries are assumed to be fully opaque, any transparency or transparent index will be ignored.extraSamples
- the number of extra samples in the color model.hasAlpha
-true
if the extra samples contains alpha, otherwisefalse
.
-
-
Method Details
-
getNumComponents
public int getNumComponents()- Overrides:
getNumComponents
in classColorModel
-
getRed
public int getRed(int pixel) - Specified by:
getRed
in classColorModel
-
getGreen
public int getGreen(int pixel) - Specified by:
getGreen
in classColorModel
-
getBlue
public int getBlue(int pixel) - Specified by:
getBlue
in classColorModel
-
getAlpha
public int getAlpha(int pixel) - Specified by:
getAlpha
in classColorModel
-
getRed
- Overrides:
getRed
in classColorModel
-
getGreen
- Overrides:
getGreen
in classColorModel
-
getBlue
- Overrides:
getBlue
in classColorModel
-
getAlpha
- Overrides:
getAlpha
in classColorModel
-
createCompatibleSampleModel
- Overrides:
createCompatibleSampleModel
in classColorModel
-
isCompatibleSampleModel
- Overrides:
isCompatibleSampleModel
in classColorModel
-
createCompatibleWritableRaster
- Overrides:
createCompatibleWritableRaster
in classColorModel
-
isCompatibleRaster
- Overrides:
isCompatibleRaster
in classColorModel
-
equals
- Overrides:
equals
in classColorModel
-
toString
- Overrides:
toString
in classColorModel
-