|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.media.jai.LookupTableJAI
A lookup table object associated with the "Lookup" operation. The
"Lookup" operation is described in
javax.media.jai.operator.LookupDescriptor
.
This object represents a single- or multi-banded table of any JAI supported data type. A single- or multi-banded source image of integral data types is passed through the table and transformed into a single- or multi-banded destination image of either integral and floating point data types.
The table data may cover only a subrange of the legal range of the input data type. The subrange is selected by means of an offset parameter which is to be subtracted from the input value before indexing into the table array. When only a subranged table is used with a source image, it is up to the user to make certain that the source image does not have pixel values outside of the table range. Otherwise, an ArrayIndexOutOfBoundsException can occur.
The table data is saved by reference only.
LookupDescriptor
, Serialized FormConstructor Summary | |
LookupTableJAI(byte[] data)
Constructs a single-banded byte lookup table. |
|
LookupTableJAI(byte[][] data)
Constructs a multi-banded byte lookup table. |
|
LookupTableJAI(byte[][] data,
int offset)
Constructs a multi-banded byte lookup table where all bands have the same index offset. |
|
LookupTableJAI(byte[][] data,
int[] offsets)
Constructs a multi-banded byte lookup table where each band has a different index offset. |
|
LookupTableJAI(byte[] data,
int offset)
Constructs a single-banded byte lookup table with an index offset. |
|
LookupTableJAI(double[] data)
Constructs a single-banded double lookup table. |
|
LookupTableJAI(double[][] data)
Constructs a multi-banded double lookup table. |
|
LookupTableJAI(double[][] data,
int offset)
Constructs a multi-banded double lookup table where all bands have the same index offset. |
|
LookupTableJAI(double[][] data,
int[] offsets)
Constructs a multi-banded double lookup table where each band has a different index offset. |
|
LookupTableJAI(double[] data,
int offset)
Constructs a single-banded double lookup table with an index offset. |
|
LookupTableJAI(float[] data)
Constructs a single-banded float lookup table. |
|
LookupTableJAI(float[][] data)
Constructs a multi-banded float lookup table. |
|
LookupTableJAI(float[][] data,
int offset)
Constructs a multi-banded float lookup table where all bands have the same index offset. |
|
LookupTableJAI(float[][] data,
int[] offsets)
Constructs a multi-banded float lookup table where each band has a different index offset. |
|
LookupTableJAI(float[] data,
int offset)
Constructs a single-banded float lookup table with an index offset. |
|
LookupTableJAI(int[] data)
Constructs a single-banded int lookup table. |
|
LookupTableJAI(int[][] data)
Constructs a multi-banded int lookup table. |
|
LookupTableJAI(int[][] data,
int offset)
Constructs a multi-banded int lookup table where all bands have the same index offset. |
|
LookupTableJAI(int[][] data,
int[] offsets)
Constructs a multi-banded int lookup table where each band has a different index offset. |
|
LookupTableJAI(int[] data,
int offset)
Constructs a single-banded int lookup table with an index offset. |
|
LookupTableJAI(short[][] data,
boolean isUShort)
Constructs a multi-banded short or unsigned short lookup table. |
|
LookupTableJAI(short[][] data,
int[] offsets,
boolean isUShort)
Constructs a multi-banded short or unsigned short lookup table where each band has a different index offset. |
|
LookupTableJAI(short[][] data,
int offset,
boolean isUShort)
Constructs a multi-banded short or unsigned short lookup table where all bands have the same index offset. |
|
LookupTableJAI(short[] data,
boolean isUShort)
Constructs a single-banded short or unsigned short lookup table. |
|
LookupTableJAI(short[] data,
int offset,
boolean isUShort)
Constructs a single-banded short or unsigned short lookup table with an index offset. |
Method Summary | |
int |
findNearestEntry(float[] pixel)
Determine which entry in the LookupTableJAI is closest
in Euclidean distance to the argument pixel. |
byte[][] |
getByteData()
Returns the byte table data in array format, or null if the table's data type is not byte. |
byte[] |
getByteData(int band)
Returns the byte table data of a specific band in array format, or null if the table's data type is not byte. |
DataBuffer |
getData()
Returns the table data as a DataBuffer. |
int |
getDataType()
Returns the data type of the table data. |
int |
getDestNumBands(int srcNumBands)
Returns the number of bands of the destination image, based on the number of bands of the source image and lookup table. |
SampleModel |
getDestSampleModel(SampleModel srcSampleModel)
Returns a SampleModel suitable for holding the output
of a lookup operation on the source data described by a given
SampleModel with this table. |
SampleModel |
getDestSampleModel(SampleModel srcSampleModel,
int width,
int height)
Returns a SampleModel suitable for holding the output
of a lookup operation on the source data described by a given
SampleModel with this table. |
double[][] |
getDoubleData()
Returns the double table data in array format, or null if the table's data type is not double. |
double[] |
getDoubleData(int band)
Returns the double table data of a specific band in array format, or null if table's data type is not double. |
float[][] |
getFloatData()
Returns the float table data in array format, or null if the table's data type is not float. |
float[] |
getFloatData(int band)
Returns the float table data of a specific band in array format, or null if table's data type is not float. |
int[][] |
getIntData()
Returns the integer table data in array format, or null if the table's data type is not int. |
int[] |
getIntData(int band)
Returns the integer table data of a specific band in array format, or null if table's data type is not int. |
int |
getNumBands()
Returns the number of bands of the table. |
int |
getNumEntries()
Returns the number of entries per band of the table. |
int |
getOffset()
Returns the index offset of entry 0 for the default band. |
int |
getOffset(int band)
Returns the index offset of entry 0 for a specific band. |
int[] |
getOffsets()
Returns the index offsets of entry 0 for all bands. |
short[][] |
getShortData()
Returns the short table data in array format, or null if the table's data type is not short. |
short[] |
getShortData(int band)
Returns the short table data of a specific band in array format, or null if the table's data type is not short. |
boolean |
isIntegralDataType(int dataType)
Returns true if the specified data type is
an integral data type, such as byte, ushort, short, or int. |
boolean |
isIntegralDataType(SampleModel sampleModel)
Validates data type. |
int |
lookup(int band,
int value)
Performs lookup on a given value belonging to a given source band, and returns the result as an int. |
WritableRaster |
lookup(Raster src,
WritableRaster dst,
Rectangle rect)
Performs table lookup on a source Raster, writing the result into a supplied WritableRaster. |
WritableRaster |
lookup(WritableRaster src)
Performs table lookup in place on a given WritableRaster. |
double |
lookupDouble(int band,
int value)
Performs lookup on a given value belonging to a given source band, and returns the result as a double. |
float |
lookupFloat(int band,
int value)
Performs lookup on a given value belonging to a given source band, and returns the result as a float. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LookupTableJAI(byte[] data)
data
- The single-banded byte data.IllegalArgumentException
- if data is null.public LookupTableJAI(byte[] data, int offset)
data
- The single-banded byte data.offset
- The offset.IllegalArgumentException
- if data is null.public LookupTableJAI(byte[][] data)
data
- The multi-banded byte data in [band][index] format.IllegalArgumentException
- if data is null.public LookupTableJAI(byte[][] data, int offset)
data
- The multi-banded byte data in [band][index] format.offset
- The common offset for all bands.IllegalArgumentException
- if data is null.public LookupTableJAI(byte[][] data, int[] offsets)
data
- The multi-banded byte data in [band][index] format.offsets
- The offsets for the bands.IllegalArgumentException
- if data is null.public LookupTableJAI(short[] data, boolean isUShort)
data
- The single-banded short data.isUShort
- True if data type is DataBuffer.TYPE_USHORT;
false if data type is DataBuffer.TYPE_SHORT.IllegalArgumentException
- if data is null.public LookupTableJAI(short[] data, int offset, boolean isUShort)
data
- The single-banded short data.offset
- The offset.isUShort
- True if data type is DataBuffer.TYPE_USHORT;
false if data type is DataBuffer.TYPE_SHORT.IllegalArgumentException
- if data is null.public LookupTableJAI(short[][] data, boolean isUShort)
data
- The multi-banded short data in [band][index] format.isUShort
- True if data type is DataBuffer.TYPE_USHORT;
false if data type is DataBuffer.TYPE_SHORT.IllegalArgumentException
- if data is null.public LookupTableJAI(short[][] data, int offset, boolean isUShort)
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.IllegalArgumentException
- if data is null.public LookupTableJAI(short[][] data, int[] offsets, boolean isUShort)
data
- The multi-banded short data in [band][index] format.offsets
- The offsets for the bands.isUShort
- True if data type is DataBuffer.TYPE_USHORT;
false if data type is DataBuffer.TYPE_SHORT.IllegalArgumentException
- if data is null.public LookupTableJAI(int[] data)
data
- The single-banded int data.IllegalArgumentException
- if data is null.public LookupTableJAI(int[] data, int offset)
data
- The single-banded int data.offset
- The offset.IllegalArgumentException
- if data is null.public LookupTableJAI(int[][] data)
data
- The multi-banded int data in [band][index] format.IllegalArgumentException
- if data is null.public LookupTableJAI(int[][] data, int offset)
data
- The multi-banded int data in [band][index] format.offset
- The common offset for all bands.IllegalArgumentException
- if data is null.public LookupTableJAI(int[][] data, int[] offsets)
data
- The multi-banded int data in [band][index] format.offsets
- The offsets for the bands.IllegalArgumentException
- if data is null.public LookupTableJAI(float[] data)
data
- The single-banded float data.IllegalArgumentException
- if data is null.public LookupTableJAI(float[] data, int offset)
data
- The single-banded float data.offset
- The offset.IllegalArgumentException
- if data is null.public LookupTableJAI(float[][] data)
data
- The multi-banded float data in [band][index] format.IllegalArgumentException
- if data is null.public LookupTableJAI(float[][] data, int offset)
data
- The multi-banded float data in [band][index] format.offset
- The common offset for all bands.IllegalArgumentException
- if data is null.public LookupTableJAI(float[][] data, int[] offsets)
data
- The multi-banded float data in [band][index] format.offsets
- The offsets for the bands.IllegalArgumentException
- if data is null.public LookupTableJAI(double[] data)
data
- The single-banded double data.IllegalArgumentException
- if data is null.public LookupTableJAI(double[] data, int offset)
data
- The single-banded double data.offset
- The offset.IllegalArgumentException
- if data is null.public LookupTableJAI(double[][] data)
data
- The multi-banded double data in [band][index] format.IllegalArgumentException
- if data is null.public LookupTableJAI(double[][] data, int offset)
data
- The multi-banded double data in [band][index] format.offset
- The common offset for all bands.IllegalArgumentException
- if data is null.public LookupTableJAI(double[][] data, int[] offsets)
data
- The multi-banded double data in [band][index] format.offsets
- The offsets for the bands.IllegalArgumentException
- if data is null.Method Detail |
public DataBuffer getData()
public byte[][] getByteData()
public byte[] getByteData(int band)
public short[][] getShortData()
public short[] getShortData(int band)
public int[][] getIntData()
public int[] getIntData(int band)
public float[][] getFloatData()
public float[] getFloatData(int band)
public double[][] getDoubleData()
public double[] getDoubleData(int band)
public int[] getOffsets()
public int getOffset()
public int getOffset(int band)
public int getNumBands()
public int getNumEntries()
public int getDataType()
public int getDestNumBands(int srcNumBands)
srcNumBands
- The number of bands of the source image.public SampleModel getDestSampleModel(SampleModel srcSampleModel)
SampleModel
suitable for holding the output
of a lookup operation on the source data described by a given
SampleModel with this table. The width and height of the destination
SampleModel are the same as that of the source. This method will
return null if the source SampleModel has a non-integral data type.srcSampleModel
- The SampleModel of the source image.IllegalArgumentException
- if srcSampleModel is null.public SampleModel getDestSampleModel(SampleModel srcSampleModel, int width, int height)
SampleModel
suitable for holding the output
of a lookup operation on the source data described by a given
SampleModel with this table. This method will return null if the
source SampleModel has a non-integral data type.srcSampleModel
- The SampleModel of the source image.width
- The width of the destination SampleModel.height
- The height of the destination SampleModel.IllegalArgumentException
- if srcSampleModel is null.public boolean isIntegralDataType(SampleModel sampleModel)
IllegalArgumentException
- if sampleModel is null.public boolean isIntegralDataType(int dataType)
true
if the specified data type is
an integral data type, such as byte, ushort, short, or int.public int lookup(int band, int value)
band
- The source band the value is from.value
- The source value to be placed through the lookup table.public float lookupFloat(int band, int value)
band
- The source band the value is from.value
- The source value to be placed through the lookup table.public double lookupDouble(int band, int value)
band
- The source band the value is from.value
- The source value to be placed through the lookup table.public WritableRaster lookup(WritableRaster src)
IllegalArgumentException
- if the src is null.IllegalArgumentException
- if the source's SampleModel
is not of integral type.IllegalArgumentException
- if the lookup operation would
result in a change in the data type or number of bands
of the Raster.public WritableRaster lookup(Raster src, WritableRaster dst, Rectangle rect)
The dst
argument may be null, in which case a new
WritableRaster is created using the appropriate SampleModel.
The rectangle of interest may be null, in which case the operation will be performed on the intersection of the source and destination bounding rectangles.
src
- A Raster containing the source pixel data.dst
- The WritableRaster to be computed, or null.
If supplied, its data type and number of bands must
be suitable for the source and lookup table.rect
- The rectangle within the tile to be computed.
If rect is null, the intersection of the source and
destination bounds will be used. Otherwise, it
will be clipped to the intersection of the source
and destination bounds.IllegalArgumentException
- if the source is null.IllegalArgumentException
- if the source's SampleModel
is not of integral type.IllegalArgumentException
- if the destination's data type
or number of bands differ from those returned by
getDataType() and getDestNumBands().public int findNearestEntry(float[] pixel)
LookupTableJAI
is closest
in Euclidean distance to the argument pixel.pixel
- The pixel the closest entry to which is to be found.v = data[b][index - lookup.getOffset()]where index is the returned value of this method.
IllegalArgumentException
- if pixel is null.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |