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
FieldsModifier and TypeFieldDescriptionprivate final intprivate final IndexColorModelprivate final intFields inherited from class ColorModel
pixel_bits, transferTypeFields inherited from interface 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) private int[]createOffsets(int samples) booleanintgetAlpha(int pixel) intintgetBlue(int pixel) intintgetGreen(int pixel) intintintgetRed(int pixel) intprivate intbooleanisCompatibleRaster(Raster raster) booleantoString()Methods inherited from class ColorModel
coerceData, getAlphaRaster, getColorSpace, getComponents, getComponents, getComponentSize, getComponentSize, getDataElement, getDataElement, getDataElements, getDataElements, getDataElements, getNormalizedComponents, getNormalizedComponents, getNumColorComponents, getPixelSize, getRGB, getRGB, getRGBdefault, getTransferType, getTransparency, getUnnormalizedComponents, hasAlpha, hashCode, isAlphaPremultiplied
-
Field Details
-
icm
-
extraSamples
private final int extraSamples -
samples
private final int samples
-
-
Constructor Details
-
DiscreteAlphaIndexColorModel
Creates aDiscreteAlphaIndexColorModel, delegating color map look-ups to the givenIndexColorModel.- Parameters:
icm- TheIndexColorModeldelegate. 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- TheIndexColorModeldelegate. 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-trueif the extra samples contains alpha, otherwisefalse.
-
-
Method Details
-
getNumComponents
public int getNumComponents()- Overrides:
getNumComponentsin classColorModel
-
getRed
public int getRed(int pixel) - Specified by:
getRedin classColorModel
-
getGreen
public int getGreen(int pixel) - Specified by:
getGreenin classColorModel
-
getBlue
public int getBlue(int pixel) - Specified by:
getBluein classColorModel
-
getAlpha
public int getAlpha(int pixel) - Specified by:
getAlphain classColorModel
-
getSample
-
getRed
- Overrides:
getRedin classColorModel
-
getGreen
- Overrides:
getGreenin classColorModel
-
getBlue
- Overrides:
getBluein classColorModel
-
getAlpha
- Overrides:
getAlphain classColorModel
-
createCompatibleSampleModel
- Overrides:
createCompatibleSampleModelin classColorModel
-
createOffsets
private int[] createOffsets(int samples) -
isCompatibleSampleModel
- Overrides:
isCompatibleSampleModelin classColorModel
-
createCompatibleWritableRaster
- Overrides:
createCompatibleWritableRasterin classColorModel
-
isCompatibleRaster
- Overrides:
isCompatibleRasterin classColorModel
-
equals
- Overrides:
equalsin classColorModel
-
toString
- Overrides:
toStringin classColorModel
-