public interface ILcdMatrixRasterValueMapper
double
matrix values to
short
raster values.
This interface is used to create a line-of-sight raster from a created line-of-sight matrix.
Depending on the propagation function that was used to create the coverage matrix, different
special values can be set to the matrix. In general, these special values should be handled
in a different manner than normal values. For example, when creating a raster with fill mode
TLcdCoverageFillMode.MINIMUM
, the comparison between a special and normal value does
not necessarily mean that the actual minimum should be used as value in the raster. This interface
adds a way to define which value that should be used when comparing a matrix value with the
current raster value.
There are two mapping possibilities. The first is called forward mapping and is done by using
the method mapMatrixValue
. Each matrix entry is mapped onto a raster
pixel. When a raster pixel already contains a value, the method will determine the new value
for that pixel using the given fill mode. Only, the modes TLcdCoverageFillMode.MINIMUM
and TLcdCoverageFillMode.MAXIMUM
are supported for this method. The following image
clarifies this mapping technique:
combineMatrixValues
is used in
combination with the fill mode TLcdCoverageFillMode.NEAREST_NEIGHBOR
. The following image
clarifies this:
Modifier and Type | Method and Description |
---|---|
short |
combineMatrixValues(double[] aMatrixValues,
double[] aWeightsForMatrixValues,
TLcdCoverageFillMode aFillMode)
Combines matrix values depending on the given weights.
|
short |
getDefaultValue()
Returns the default raster value of this instance.
|
short |
mapMatrixValue(short aOldRasterValue,
double aMatrixValue,
TLcdCoverageFillMode aFillMode)
Returns a raster value that is the result of a comparison between the given matrix value and
the current raster value for a raster pixel.
|
short combineMatrixValues(double[] aMatrixValues, double[] aWeightsForMatrixValues, TLcdCoverageFillMode aFillMode)
TLcdCoverageFillMode.NEAREST_NEIGHBOR
. In this mode, the matrix value array contains
only one value, the value corresponding to the matrix entry closest to the raster pixel. The
weight array should not be used, because there is only one matrix value.aMatrixValues
- The matrix values to combine.aWeightsForMatrixValues
- The weights of the matrix values.aFillMode
- The fill mode to use.IllegalArgumentException
- if one of the matrix values is an unexpected value or if
the given fill mode is not supported.short mapMatrixValue(short aOldRasterValue, double aMatrixValue, TLcdCoverageFillMode aFillMode)
aOldRasterValue
- The old raster value to compare to.aMatrixValue
- The matrix value to check.aFillMode
- The fill mode to use.IllegalArgumentException
- if one of the matrix values is an unexpected value or if
the given fill mode is not supported.short getDefaultValue()