|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectit.geosolutions.jaiext.lookup.LookupTable
public abstract class LookupTable
This abstract class defines the general methods of a LookupTable. This class contains all the table informations used by its direct subclasses for doing the lookup operation. The Constructor methods are called by all the 4 subclasses(one for every integral data type). The set/unsetROI() and set/unsetNoData() methods are used for setting or unsetting the ROI or No Data Range used by this table. ALl the get() methods are support methods used for retrieve table information in a faster way. Lookup(), lookupFloat() and lookupDouble() are 3 methods that return the table data associated with the selected input image. The lase method called lookup(Raster,WritableRaster,Rectangle) is abstract because its implementation depends on the subClass data type.
Field Summary | |
---|---|
protected DataBuffer |
data
The table data. |
protected byte |
destinationNoDataByte
Destination no data for Byte images |
protected double |
destinationNoDataDouble
Destination no data for Double images |
protected float |
destinationNoDataFloat
Destination no data for Float images |
protected int |
destinationNoDataInt
Destination no data for Integer images |
protected short |
destinationNoDataShort
Destination no data for Short/Ushort images |
protected boolean |
hasNoData
Boolean indicating if the image contains No Data values |
protected boolean |
hasROI
Boolean indicating if the image contains a ROI |
protected Range |
noData
Range object containing no data values |
protected Rectangle |
roiBounds
Rectangle containing roi bounds |
protected javax.media.jai.iterator.RandomIter |
roiIter
Iterator used for iterating on the roi data |
protected javax.media.jai.PlanarImage |
srcROIImage
ROI image |
protected int[] |
tableOffsets
The band offset values |
protected boolean |
useROIAccessor
Boolean indicating if Roi RasterAccessor must be used |
Constructor Summary | |
---|---|
protected |
LookupTable(byte[] data)
Constructs a single-banded byte lookup table. |
|
LookupTable(byte[][] data)
Constructs a multi-banded byte lookup table. |
|
LookupTable(byte[][] data,
int offset)
Constructs a multi-banded byte lookup table where all bands have the same index offset. |
protected |
LookupTable(byte[][] data,
int[] offsets)
Constructs a multi-banded byte lookup table where each band has a different index offset. |
protected |
LookupTable(byte[] data,
int offset)
Constructs a single-banded byte lookup table with an index offset. |
protected |
LookupTable(double[] data)
Constructs a single-banded double lookup table. |
protected |
LookupTable(double[][] data)
Constructs a multi-banded double lookup table. |
protected |
LookupTable(double[][] data,
int offset)
Constructs a multi-banded double lookup table where all bands have the same index offset. |
protected |
LookupTable(double[][] data,
int[] offsets)
Constructs a multi-banded double lookup table where each band has a different index offset. |
protected |
LookupTable(double[] data,
int offset)
Constructs a single-banded double lookup table with an index offset. |
protected |
LookupTable(float[] data)
Constructs a single-banded float lookup table. |
protected |
LookupTable(float[][] data)
Constructs a multi-banded float lookup table. |
protected |
LookupTable(float[][] data,
int offset)
Constructs a multi-banded float lookup table where all bands have the same index offset. |
protected |
LookupTable(float[][] data,
int[] offsets)
Constructs a multi-banded float lookup table where each band has a different index offset. |
protected |
LookupTable(float[] data,
int offset)
Constructs a single-banded float lookup table with an index offset. |
protected |
LookupTable(int[] data)
Constructs a single-banded int lookup table. |
protected |
LookupTable(int[][] data)
Constructs a multi-banded int lookup table. |
protected |
LookupTable(int[][] data,
int offset)
Constructs a multi-banded int lookup table where all bands have the same index offset. |
protected |
LookupTable(int[][] data,
int[] offsets)
Constructs a multi-banded int lookup table where each band has a different index offset. |
protected |
LookupTable(int[] data,
int offset)
Constructs a single-banded int lookup table with an index offset. |
protected |
LookupTable(short[][] data,
boolean isUShort)
Constructs a multi-banded short or unsigned short lookup table. |
protected |
LookupTable(short[][] data,
int[] offsets,
boolean isUShort)
Constructs a multi-banded short or unsigned short lookup table where each band has a different index offset. |
protected |
LookupTable(short[][] data,
int offset,
boolean isUShort)
Constructs a multi-banded short or unsigned short lookup table where all bands have the same index offset. |
protected |
LookupTable(short[] data,
boolean isUShort)
Constructs a single-banded short or unsigned short lookup table. |
protected |
LookupTable(short[] data,
int offset,
boolean isUShort)
Constructs a single-banded short or unsigned short lookup table with an index offset. |
Method Summary | |
---|---|
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. |
protected void |
initOffsets(int nbands,
int offset)
This method sets the same table offset for all the bands |
protected void |
initOffsets(int nbands,
int[] offset)
This method sets the table offset related to every band |
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. |
protected abstract void |
lookup(Raster source,
WritableRaster dst,
Rectangle rect,
Raster roi)
Abstract method for calculating the destination tile from the source tile and an eventual ROI raster |
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. |
void |
setDestinationNoData(double destinationNoData)
This method sets destination no data used for No Data or ROI calculation |
void |
setNoDataRange(Range noData)
No Data flag is set to true and no data range is taken |
void |
setROIparams(Rectangle roiBounds,
javax.media.jai.iterator.RandomIter roiIter,
javax.media.jai.PlanarImage srcROIImage,
boolean useROIAccessor)
ROI flag is set to true and the ROI fields are all filled |
void |
unsetNoData()
No Data flag is set to false and no data range is set to null |
void |
unsetROI()
ROI flag is set to flag and the ROI fields are all left empty |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected transient DataBuffer data
protected int[] tableOffsets
protected byte destinationNoDataByte
protected short destinationNoDataShort
protected int destinationNoDataInt
protected float destinationNoDataFloat
protected double destinationNoDataDouble
protected Range noData
protected Rectangle roiBounds
protected javax.media.jai.iterator.RandomIter roiIter
protected boolean useROIAccessor
protected javax.media.jai.PlanarImage srcROIImage
protected boolean hasNoData
protected boolean hasROI
Constructor Detail |
---|
protected LookupTable(byte[] data)
data
- The single-banded byte data.
IllegalArgumentException
- if data is null.protected LookupTable(byte[] data, int offset)
data
- The single-banded byte data.offset
- The offset.
IllegalArgumentException
- if data is null.public LookupTable(byte[][] data)
data
- The multi-banded byte data in [band][index] format.
IllegalArgumentException
- if data is null.public LookupTable(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.protected LookupTable(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.protected LookupTable(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.protected LookupTable(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.protected LookupTable(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.protected LookupTable(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.protected LookupTable(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.protected LookupTable(int[] data)
data
- The single-banded int data.
IllegalArgumentException
- if data is null.protected LookupTable(int[] data, int offset)
data
- The single-banded int data.offset
- The offset.
IllegalArgumentException
- if data is null.protected LookupTable(int[][] data)
data
- The multi-banded int data in [band][index] format.
IllegalArgumentException
- if data is null.protected LookupTable(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.protected LookupTable(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.protected LookupTable(float[] data)
data
- The single-banded float data.
IllegalArgumentException
- if data is null.protected LookupTable(float[] data, int offset)
data
- The single-banded float data.offset
- The offset.
IllegalArgumentException
- if data is null.protected LookupTable(float[][] data)
data
- The multi-banded float data in [band][index] format.
IllegalArgumentException
- if data is null.protected LookupTable(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.protected LookupTable(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.protected LookupTable(double[] data)
data
- The single-banded double data.
IllegalArgumentException
- if data is null.protected LookupTable(double[] data, int offset)
data
- The single-banded double data.offset
- The offset.
IllegalArgumentException
- if data is null.protected LookupTable(double[][] data)
data
- The multi-banded double data in [band][index] format.
IllegalArgumentException
- if data is null.protected LookupTable(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.protected LookupTable(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.protected void initOffsets(int nbands, int offset)
protected void initOffsets(int nbands, int[] offset)
public void setDestinationNoData(double destinationNoData)
public void setNoDataRange(Range noData)
public void unsetNoData()
public void setROIparams(Rectangle roiBounds, javax.media.jai.iterator.RandomIter roiIter, javax.media.jai.PlanarImage srcROIImage, boolean useROIAccessor)
public void unsetROI()
protected abstract void lookup(Raster source, WritableRaster dst, Rectangle rect, Raster roi)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |