|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.media.jai.LookupTableJAI | +--javax.media.jai.ColorCube
A subclass of LookupTableJAI
which represents a lookup
table which is a color cube. A color cube provides a fixed,
invertible mapping between table indices and sample values.
This allows the findNearestEntry
method to be implemented
more efficiently than in the general case.
All constructors are protected. The correct way to create a
ColorCube
is to use one of the static
create
methods defined in this class.
LookupTableJAI
, Serialized FormField Summary | |
static ColorCube |
BYTE_496
A ColorCube for dithering RGB byte data into 216 colors. |
static ColorCube |
BYTE_855
A ColorCube for dithering YCC byte data into 200 colors. |
Constructor Summary | |
protected |
ColorCube(byte[][] data,
int offset)
Returns a multi-banded byte ColorCube with an index
offset common to all bands. |
protected |
ColorCube(double[][] data,
int offset)
Returns a multi-banded double ColorCube with an index
offset common to all bands. |
protected |
ColorCube(float[][] data,
int offset)
Returns a multi-banded float ColorCube with an index
offset common to all bands. |
protected |
ColorCube(int[][] data,
int offset)
Returns a multi-banded int ColorCube with an index
offset common to all bands. |
protected |
ColorCube(short[][] data,
int offset,
boolean isUShort)
Returns a multi-banded short or unsigned short ColorCube
with an index offset common to all bands. |
Method Summary | |
static ColorCube |
createColorCube(int dataType,
int[] dimension)
Returns a multi-banded ColorCube of a specified
data type with zero offset for all bands. |
static ColorCube |
createColorCube(int dataType,
int offset,
int[] dimension)
Returns a multi-banded ColorCube of a specified data type. |
int |
findNearestEntry(float[] pixel)
Finds the index of the nearest color in the color map to the pixel value argument. |
int |
getAdjustedOffset()
Returns the adjusted offset into the lookup table, accounting for negative dimensions. |
int[] |
getDimension()
Returns the array of signed dimensions used to construct the ColorCube . |
int[] |
getDimsLessOne()
Returns an array containing the signed dimensions, less one. |
int[] |
getMultipliers()
Returns the multipliers as an array. |
Methods inherited from class javax.media.jai.LookupTableJAI |
getByteData,
getByteData,
getData,
getDataType,
getDestNumBands,
getDestSampleModel,
getDestSampleModel,
getDoubleData,
getDoubleData,
getFloatData,
getFloatData,
getIntData,
getIntData,
getNumBands,
getNumEntries,
getOffset,
getOffset,
getOffsets,
getShortData,
getShortData,
isIntegralDataType,
isIntegralDataType,
lookup,
lookup,
lookup,
lookupDouble,
lookupFloat |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final ColorCube BYTE_496
ColorCube
for dithering RGB byte data into 216 colors.
The offset of this ColorCube
is 38.public static final ColorCube BYTE_855
ColorCube
for dithering YCC byte data into 200 colors.
The offset of this ColorCube
is 54.Constructor Detail |
protected ColorCube(byte[][] data, int offset)
ColorCube
with an index
offset common to all bands.data
- The multi-banded byte data in [band][index] format.offset
- The common offset for all bands.protected ColorCube(short[][] data, int offset, boolean isUShort)
ColorCube
with an index offset common to all bands.data
- The multi-banded short data in [band][index] format.offset
- The common offset for all bands.isUShort
- True if data type is DataBuffer.TYPE_USHORT;
false if data type is DataBuffer.TYPE_SHORT.protected ColorCube(int[][] data, int offset)
ColorCube
with an index
offset common to all bands.data
- The multi-banded int data in [band][index] format.offset
- The common offset for all bands.protected ColorCube(float[][] data, int offset)
ColorCube
with an index
offset common to all bands.data
- The multi-banded float data in [band][index] format.offset
- The common offset for all bands.protected ColorCube(double[][] data, int offset)
ColorCube
with an index
offset common to all bands.data
- The multi-banded double data in [band][index] format.offset
- The common offset for all bands.Method Detail |
public static ColorCube createColorCube(int dataType, int offset, int[] dimension)
ColorCube
of a specified data type.dataType
- The data type of the ColorCube
,
one of DataBuffer.TYPE_BYTE
,
TYPE_SHORT
,
TYPE_USHORT
,
TYPE_INT
,
TYPE_FLOAT
,
or TYPE_DOUBLE
.offset
- The common offset for all bands.dimension
- The signed dimension of each band.ColorCube
.public static ColorCube createColorCube(int dataType, int[] dimension)
ColorCube
of a specified
data type with zero offset for all bands.dataType
- The data type of the ColorCube
.dimension
- The signed dimension of each band.ColorCube
.public int[] getDimension()
ColorCube
.public int[] getDimsLessOne()
public int[] getMultipliers()
public int getAdjustedOffset()
public int findNearestEntry(float[] pixel)
pixel
- a float array of all samples of a pixel.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |