public class TLcdLinearRasterValueConverter extends Object implements ILcdRasterValueConverter
A raster value converter that uses a linear transformation to convert between raster and data values.
When converting from raster values to data values, the following formula is used:
D = (clamp(R, minR, maxR) - O) / S
When converting from data values to raster values, the following formula is used:
R = clamp(D * S + O, minR, maxR)
With:
D
: the data valueR
: the raster valueminR
: the minimum raster valuemaxR
: the maximum raster valueO
: the offset to applyS
: the scale to applyConstructor and Description |
---|
TLcdLinearRasterValueConverter(int aMinRasterValue,
int aMaxRasterValue,
double aDataToRasterOffset,
double aDataToRasterScale,
int aDefaultRasterValue,
ILcdISO19103UnitOfMeasure aUnit)
Creates a new raster value converter that uses a linear transformation to convert between
raster values and data values.
|
Modifier and Type | Method and Description |
---|---|
int |
dataToRaster(double aDataValue)
Converts data values to raster values.
|
ILcdISO19103UnitOfMeasure |
getUnit()
Returns the unit of the data values.
|
double |
rasterToData(int aRasterValue)
Converts raster values to data values.
|
public TLcdLinearRasterValueConverter(int aMinRasterValue, int aMaxRasterValue, double aDataToRasterOffset, double aDataToRasterScale, int aDefaultRasterValue, ILcdISO19103UnitOfMeasure aUnit)
aMinRasterValue
- the minimal raster valueaMaxRasterValue
- the maximal raster valueaDataToRasterScale
- the scale to apply.aDataToRasterOffset
- the offset to apply.aDefaultRasterValue
- the default raster value.aUnit
- the unit of the data values.public int dataToRaster(double aDataValue)
ILcdRasterValueConverter
dataToRaster
in interface ILcdRasterValueConverter
aDataValue
- the data value.public double rasterToData(int aRasterValue)
ILcdRasterValueConverter
rasterToData
in interface ILcdRasterValueConverter
aRasterValue
- the raster value.public ILcdISO19103UnitOfMeasure getUnit()
ILcdRasterValueConverter
getUnit
in interface ILcdRasterValueConverter
null
.