public final class TLcdIndexLookupOp extends ALcdImageOperator
TLcdLookupTable
specified must satisfy the following constraints:
MIN_VALUE
, MAX_VALUE
] if they are specified.ALcdBandSemantics.getMinValue()
, ALcdBandSemantics.getMaxValue()
] if they are specified.
// Define the table colors
// With interpolation enabled, a smooth gradient is automatically created
byte[] lookupColors = new byte[]{ 0, 0, (byte) 255, (byte) 255, // blue
0, (byte) 255, (byte) 255, (byte) 255,
0, (byte) 255, 0, (byte) 255, // green
(byte) 255, (byte) 255, 0, (byte) 255,
(byte) 255, 0, 0, (byte) 255}; // red
TLcdLookupTable indexLookupTable = TLcdLookupTable.newBuilder()
.dimensions(5)
.componentCount(4)
.data(ByteBuffer.wrap(lookupColors))
.build();
//use a chain. First bandSelect then indexLookUp
ALcdImageOperatorChain chain = ALcdImageOperatorChain.newBuilder()
.bandSelect(new int[]{0})
.indexLookup(indexLookupTable, new double[]{0.0, 0.0, 0.0, 0.0})
.build();
ALcdImage outputImage = chain.apply(inputImage);
ALcdImageOperator.ImageOperatorTypeBuilder
Modifier and Type | Field and Description |
---|---|
static TLcdDataType |
INDEX_LOOKUP_FILTER_TYPE
Input data type of the operator.
|
static TLcdDataProperty |
INPUT_IMAGE
The input image.
|
static TLcdDataProperty |
LOOKUP_TABLE
The lookup table to use.
|
static String |
NAME
Name of the operator.
|
static TLcdDataProperty |
NAN_COLOR
The color to set invalid pixels to.
|
INPUT_IMAGE_NAME
Constructor and Description |
---|
TLcdIndexLookupOp()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
ALcdImage |
apply(ILcdDataObject aParameters)
Applies this operator to the given input parameters.
|
static ALcdImage |
indexLookup(ALcdImage aImage,
TLcdLookupTable aLUT)
Perform a color lookup operation.
|
static ALcdImage |
indexLookup(ALcdImage aSource,
TLcdLookupTable aLUT,
double[] aNaNColor)
Perform a color lookup operation.
|
createTypeBuilder, createTypeBuilder, equals, getParameterDataType, hashCode, toString
public static final String NAME
public static final TLcdDataProperty INPUT_IMAGE
public static final TLcdDataProperty LOOKUP_TABLE
public static final TLcdDataProperty NAN_COLOR
public static final TLcdDataType INDEX_LOOKUP_FILTER_TYPE
public ALcdImage apply(ILcdDataObject aParameters)
ALcdImageOperator
apply
in class ALcdImageOperator
aParameters
- the parameters for the operatorpublic static ALcdImage indexLookup(ALcdImage aImage, TLcdLookupTable aLUT)
aImage
- the input image.aLUT
- the lookup table to use.public static ALcdImage indexLookup(ALcdImage aSource, TLcdLookupTable aLUT, double[] aNaNColor)
aSource
- the input image.aLUT
- the lookup table to use.aNaNColor
- color to use for pixels that have an invalid or no value.