|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.image.ColorModel
java.awt.image.IndexColorModel
com.twelvemonkeys.image.InverseColorMapIndexColorModel
public class InverseColorMapIndexColorModel
A faster implementation of IndexColorModel, that is backed by an
inverse color-map, for fast look-ups.
| Field Summary | |
|---|---|
protected com.twelvemonkeys.image.InverseColorMap |
inverseMap
|
protected int |
mapSize
|
protected int[] |
rgbs
|
| Fields inherited from class java.awt.image.ColorModel |
|---|
pixel_bits, transferType |
| Fields inherited from interface java.awt.Transparency |
|---|
BITMASK, OPAQUE, TRANSLUCENT |
| Constructor Summary | |
|---|---|
InverseColorMapIndexColorModel(IndexColorModel pColorModel)
Creates an InverseColorMapIndexColorModel from an existing
IndexColorModel. |
|
InverseColorMapIndexColorModel(int pNumBits,
int pSize,
byte[] pReds,
byte[] pGreens,
byte[] pBlues)
Creates an InverseColorMapIndexColorModel from the given arrays
of red, green, and blue components. |
|
InverseColorMapIndexColorModel(int pNumBits,
int pSize,
byte[] pReds,
byte[] pGreens,
byte[] pBlues,
int pTransparentIndex)
Creates an InverseColorMapIndexColorModel from the given arrays
of red, green, and blue components, plus one transparent index. |
|
InverseColorMapIndexColorModel(int pNumBits,
int pSize,
int[] pRGBs,
int pStart,
boolean pAlpha,
int pTransparentIndex,
int pTransferType)
Creates an InverseColorMapIndexColorModel from the given array
of RGB components, plus one transparent index. |
|
| Method Summary | |
|---|---|
static IndexColorModel |
create(Image pImage,
int pNumCols,
int pFlags)
Creates an IndexColorModel optimized for the given Image. |
Object |
getDataElements(int rgb,
Object pixel)
Returns a data element array representation of a pixel in this ColorModel, given an integer pixel representation in the default RGB color model. |
String |
toString()
|
| Methods inherited from class java.awt.image.IndexColorModel |
|---|
convertToIntDiscrete, createCompatibleSampleModel, createCompatibleWritableRaster, finalize, getAlpha, getAlphas, getBlue, getBlues, getComponents, getComponents, getComponentSize, getDataElement, getDataElements, getGreen, getGreens, getMapSize, getRed, getReds, getRGB, getRGBs, getTransparency, getTransparentPixel, getValidPixels, isCompatibleRaster, isCompatibleSampleModel, isValid, isValid |
| Methods inherited from class java.awt.image.ColorModel |
|---|
coerceData, equals, getAlpha, getAlphaRaster, getBlue, getColorSpace, getComponentSize, getDataElement, getDataElements, getGreen, getNormalizedComponents, getNormalizedComponents, getNumColorComponents, getNumComponents, getPixelSize, getRed, getRGB, getRGBdefault, getTransferType, getUnnormalizedComponents, hasAlpha, hashCode, isAlphaPremultiplied |
| Methods inherited from class java.lang.Object |
|---|
clone, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int[] rgbs
protected int mapSize
protected com.twelvemonkeys.image.InverseColorMap inverseMap
| Constructor Detail |
|---|
public InverseColorMapIndexColorModel(IndexColorModel pColorModel)
InverseColorMapIndexColorModel from an existing
IndexColorModel.
pColorModel - the color model to create from.
IllegalArgumentException - if pColorModel is null
public InverseColorMapIndexColorModel(int pNumBits,
int pSize,
int[] pRGBs,
int pStart,
boolean pAlpha,
int pTransparentIndex,
int pTransferType)
InverseColorMapIndexColorModel from the given array
of RGB components, plus one transparent index.
pNumBits - the number of bits each pixel occupiespSize - the size of the color component arrayspRGBs - the array of packed RGB color componentspStart - the starting offset of the first color componentpAlpha - indicates whether alpha values are contained in pRGBspTransparentIndex - the index of the transparent pixelpTransferType - the data type of the array used to represent pixels
IllegalArgumentException - if bits is less than 1 or greater than 16,
or if size is less than 1IndexColorModel.IndexColorModel(int, int, int[], int, boolean, int, int)
public InverseColorMapIndexColorModel(int pNumBits,
int pSize,
byte[] pReds,
byte[] pGreens,
byte[] pBlues,
int pTransparentIndex)
InverseColorMapIndexColorModel from the given arrays
of red, green, and blue components, plus one transparent index.
pNumBits - the number of bits each pixel occupiespSize - the size of the color component arrayspReds - the array of red color componentspGreens - the array of green color componentspBlues - the array of blue color componentspTransparentIndex - the index of the transparent pixel
IllegalArgumentException - if bits is less than 1 or greater than 16,
or if size is less than 1IndexColorModel.IndexColorModel(int, int, byte[], byte[], byte[], int)
public InverseColorMapIndexColorModel(int pNumBits,
int pSize,
byte[] pReds,
byte[] pGreens,
byte[] pBlues)
InverseColorMapIndexColorModel from the given arrays
of red, green, and blue components.
pNumBits - the number of bits each pixel occupiespSize - the size of the color component arrayspReds - the array of red color componentspGreens - the array of green color componentspBlues - the array of blue color components
IllegalArgumentException - if bits is less than 1 or greater than 16,
or if size is less than 1IndexColorModel.IndexColorModel(int, int, byte[], byte[], byte[])| Method Detail |
|---|
public static IndexColorModel create(Image pImage,
int pNumCols,
int pFlags)
IndexColorModel optimized for the given Image.
pImage - the Image containing the RGB samplespNumCols - the maximum number of colors in the IndexColorModelpFlags - flags
IndexColorModel
public Object getDataElements(int rgb,
Object pixel)
setDataElements
method of a WritableRaster object. If the pixel variable is
null, a new array is allocated. If pixel
is not null, it must be
a primitive array of type transferType; otherwise, a
ClassCastException is thrown. An
ArrayIndexOutOfBoundsException is
thrown if pixel is not large enough to hold a pixel
value for this ColorModel. The pixel array is returned.
Since OpaqueIndexColorModel can be subclassed, subclasses
inherit the implementation of this method and if they don't
override it then they throw an exception if they use an
unsupported transferType.
#param rgb the integer pixel representation in the default RGB
color model
#param pixel the specified pixel
#return an array representation of the specified pixel in this
OpaqueIndexColorModel.
#throws ClassCastException if pixel
is not a primitive array of type transferType
#throws ArrayIndexOutOfBoundsException if
pixel is not large enough to hold a pixel value
for this ColorModel
#throws UnsupportedOperationException if transferType
is invalid
getDataElements in class IndexColorModelWritableRaster.setDataElements(int, int, java.lang.Object),
SampleModel.setDataElements(int, int, java.lang.Object, java.awt.image.DataBuffer)public String toString()
toString in class IndexColorModel
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||