| java.lang.Object javax.media.jai.LookupTableJAI javax.media.jai.ColorCube
ColorCube | public class ColorCube extends LookupTableJAI (Code) | | 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.
See Also: javax.media.jai.LookupTableJAI |
Field Summary | |
final public static ColorCube | BYTE_496 A ColorCube for dithering RGB byte data into 216 colors. | final public 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(short data, int offset, boolean isUShort) Returns a multi-banded short or unsigned short 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(float data, int offset) Returns a multi-banded float 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. |
Method Summary | |
public static ColorCube | createColorCube(int dataType, int offset, int dimension) Returns a multi-banded ColorCube of a specified data type. | public static ColorCube | createColorCube(int dataType, int dimension) Returns a multi-banded ColorCube of a specified
data type with zero offset for all bands.
Parameters: dataType - The data type of the ColorCube . Parameters: dimension - The signed dimension of each band. throws: IllegalArgumentException - if dimension is null. | public int | findNearestEntry(float[] pixel) Finds the index of the nearest color in the color map to the
pixel value argument.
Parameters: pixel - a float array of all samples of a pixel. | public int | getAdjustedOffset() Returns the adjusted offset into the lookup table, accounting for
negative dimensions. | public int[] | getDimension() Returns the array of signed dimensions used to construct the
ColorCube . | public int[] | getDimsLessOne() Returns an array containing the signed dimensions, less one. | public int[] | getMultipliers() Returns the multipliers as an array. |
BYTE_496 | final public static ColorCube BYTE_496(Code) | | A ColorCube for dithering RGB byte data into 216 colors.
The offset of this ColorCube is 38.
|
BYTE_855 | final public static ColorCube BYTE_855(Code) | | A ColorCube for dithering YCC byte data into 200 colors.
The offset of this ColorCube is 54.
|
ColorCube | protected ColorCube(byte data, int offset)(Code) | | Returns a multi-banded byte ColorCube with an index
offset common to all bands.
Parameters: data - The multi-banded byte data in [band][index] format. Parameters: offset - The common offset for all bands. throws: IllegalArgumentException - if data is null. |
ColorCube | protected ColorCube(short data, int offset, boolean isUShort)(Code) | | Returns a multi-banded short or unsigned short ColorCube
with an index offset common to all bands.
Parameters: data - The multi-banded short data in [band][index] format. Parameters: offset - The common offset for all bands. Parameters: isUShort - True if data type is DataBuffer.TYPE_USHORT;false if data type is DataBuffer.TYPE_SHORT. throws: IllegalArgumentException - if data is null. |
ColorCube | protected ColorCube(int data, int offset)(Code) | | Returns a multi-banded int ColorCube with an index
offset common to all bands.
Parameters: data - The multi-banded int data in [band][index] format. Parameters: offset - The common offset for all bands. throws: IllegalArgumentException - if data is null. |
ColorCube | protected ColorCube(float data, int offset)(Code) | | Returns a multi-banded float ColorCube with an index
offset common to all bands.
Parameters: data - The multi-banded float data in [band][index] format. Parameters: offset - The common offset for all bands. throws: IllegalArgumentException - if data is null. |
ColorCube | protected ColorCube(double data, int offset)(Code) | | Returns a multi-banded double ColorCube with an index
offset common to all bands.
Parameters: data - The multi-banded double data in [band][index] format. Parameters: offset - The common offset for all bands. throws: IllegalArgumentException - if data is null. |
createColorCube | public static ColorCube createColorCube(int dataType, int offset, int dimension)(Code) | | Returns a multi-banded ColorCube of a specified data type.
Parameters: dataType - The data type of the ColorCube ,one of DataBuffer.TYPE_BYTE ,TYPE_SHORT ,TYPE_USHORT ,TYPE_INT ,TYPE_FLOAT ,or TYPE_DOUBLE . Parameters: offset - The common offset for all bands. Parameters: dimension - The signed dimension of each band. throws: RuntimeExceptions - for unsupported data types An appropriate ColorCube . |
createColorCube | public static ColorCube createColorCube(int dataType, int dimension)(Code) | | Returns a multi-banded ColorCube of a specified
data type with zero offset for all bands.
Parameters: dataType - The data type of the ColorCube . Parameters: dimension - The signed dimension of each band. throws: IllegalArgumentException - if dimension is null. An appropriate ColorCube . |
findNearestEntry | public int findNearestEntry(float[] pixel)(Code) | | Finds the index of the nearest color in the color map to the
pixel value argument.
Parameters: pixel - a float array of all samples of a pixel. the index of the nearest color. throws: RuntimeException - for dataTypes other thanDataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORTDataBuffer.TYPE_SHORT DataBuffer.TYPE_INTDataBuffer.TYPE_FLOAT DataBuffer.TYPE_DOUBLE |
getAdjustedOffset | public int getAdjustedOffset()(Code) | | Returns the adjusted offset into the lookup table, accounting for
negative dimensions.
|
getDimension | public int[] getDimension()(Code) | | Returns the array of signed dimensions used to construct the
ColorCube .
|
getDimsLessOne | public int[] getDimsLessOne()(Code) | | Returns an array containing the signed dimensions, less one.
|
getMultipliers | public int[] getMultipliers()(Code) | | Returns the multipliers as an array.
|
Fields inherited from javax.media.jai.LookupTableJAI | transient DataBuffer data(Code)(Java Doc)
|
|
|