java.awt.image

Class ComponentColorModel

public class ComponentColorModel extends ColorModel

Constructor Summary
ComponentColorModel(ColorSpace colorSpace, int[] bits, boolean hasAlpha, boolean isAlphaPremultiplied, int transparency, int transferType)
ComponentColorModel(ColorSpace colorSpace, boolean hasAlpha, boolean isAlphaPremultiplied, int transparency, int transferType)
Construct a new ComponentColorModel.
Method Summary
ColorModelcoerceData(WritableRaster raster, boolean isAlphaPremultiplied)
SampleModelcreateCompatibleSampleModel(int w, int h)
Creates a SampleModel whose arrangement of pixel data is compatible to this ColorModel.
WritableRastercreateCompatibleWritableRaster(int w, int h)
booleanequals(Object obj)
intgetAlpha(int pixel)
intgetAlpha(Object inData)
WritableRastergetAlphaRaster(WritableRaster raster)
intgetBlue(int pixel)
intgetBlue(Object inData)
int[]getComponents(int pixel, int[] components, int offset)
int[]getComponents(Object pixel, int[] components, int offset)
intgetDataElement(int[] components, int offset)
ObjectgetDataElements(int rgb, Object pixel)
ObjectgetDataElements(int[] components, int offset, Object obj)
intgetGreen(int pixel)
intgetGreen(Object inData)
intgetRed(int pixel)
intgetRed(Object inData)
intgetRGB(int pixel)
intgetRGB(Object inData)
booleanisCompatibleRaster(Raster raster)
booleanisCompatibleSampleModel(SampleModel sm)

Constructor Detail

ComponentColorModel

public ComponentColorModel(ColorSpace colorSpace, int[] bits, boolean hasAlpha, boolean isAlphaPremultiplied, int transparency, int transferType)

ComponentColorModel

public ComponentColorModel(ColorSpace colorSpace, boolean hasAlpha, boolean isAlphaPremultiplied, int transparency, int transferType)
Construct a new ComponentColorModel. This constructor makes all bits of each sample significant, so for a transferType of DataBuffer.BYTE, the bits per sample is 8, etc. If both hasAlpha and isAlphaPremultiplied are true, color samples are assumed to be premultiplied by the alpha component. Transparency may be one of OPAQUE, BITMASK, or TRANSLUCENT.

Parameters: colorSpace The colorspace for this color model. hasAlpha True if there is an alpha component. isAlphaPremultiplied True if colors are already multiplied by alpha. transparency The type of alpha values. transferType Data type of pixel sample values.

Since: 1.4

Method Detail

coerceData

public ColorModel coerceData(WritableRaster raster, boolean isAlphaPremultiplied)

createCompatibleSampleModel

public SampleModel createCompatibleSampleModel(int w, int h)
Creates a SampleModel whose arrangement of pixel data is compatible to this ColorModel.

Parameters: w the number of pixels in the horizontal direction. h the number of pixels in the vertical direction.

createCompatibleWritableRaster

public WritableRaster createCompatibleWritableRaster(int w, int h)

equals

public boolean equals(Object obj)

getAlpha

public int getAlpha(int pixel)

getAlpha

public int getAlpha(Object inData)

getAlphaRaster

public WritableRaster getAlphaRaster(WritableRaster raster)

getBlue

public int getBlue(int pixel)

getBlue

public int getBlue(Object inData)

getComponents

public int[] getComponents(int pixel, int[] components, int offset)

getComponents

public int[] getComponents(Object pixel, int[] components, int offset)

getDataElement

public int getDataElement(int[] components, int offset)

getDataElements

public Object getDataElements(int rgb, Object pixel)

getDataElements

public Object getDataElements(int[] components, int offset, Object obj)

getGreen

public int getGreen(int pixel)

getGreen

public int getGreen(Object inData)

getRed

public int getRed(int pixel)

getRed

public int getRed(Object inData)

getRGB

public int getRGB(int pixel)

getRGB

public int getRGB(Object inData)

Parameters: inData pixel data of transferType, as returned by the getDataElements method in SampleModel.

isCompatibleRaster

public boolean isCompatibleRaster(Raster raster)

isCompatibleSampleModel

public boolean isCompatibleSampleModel(SampleModel sm)