public interface IRasterInterpolator
Row and Column Scale Factors
In order to produce meaningful computations for derivatives and surface normal vectors, it is necessary that the three coordinate axes (x, y, and z) used in the interpolation have a uniform scale. In other words, one unit of change in the coordinate system associated with the input (the row-column coordinates) should cover the same distance as one unit of change in the output coordinates. Thus, when computing derivatives or the surface normal, the interpolation method implemented by this class requires the specification “spacing” values for the rows and columns. These values allow the application to assign appropriate scales to the input grid and to treat the interpolation coordinate system as “isotropic” (eg. As having a uniform scale). The rowSpace and columnSpace specifications are required in order to produce meaningful results for surface normal and derivatives. If your application is only using the interpolated value, and you do not wish to compute derivatives, you may supply zeroes for these input. For testing purposes, you may also try specifying values of 1.0 for these inputs.
Using and reusing an IntepolationResult object
In raster-based applications, it is common for applications to process gridded data sets containing a very large number of samples. Therefore implementations of this class are designed to operate efficiently. In particular, they may opt to re-use InterpolationResult objects across multiple interpolations. Implementations of this interface are expected to accept a reference to an InterpolationResult object. If the reference is not null (valid), the interpolate method populates it with the resulting computations and returns the same reference that was input. If the reference is null, the interpolate method constructs a new instance which is returned to the calling method.
Modifier and Type | Method and Description |
---|---|
InterpolationResult |
interpolate(double row,
double column,
int nRowsInGrid,
int nColumnsInGrid,
float[] grid,
double rowSpacing,
double columnSpacing,
InterpolationTarget target,
InterpolationResult outputResult)
Compute the interpolated value, the derivatives, and the normal vector to
the surface at the specified grid coordinates.
|
double |
interpolateValue(double row,
double column,
int nRowsInGrid,
int nColumnsInGrid,
float[] grid)
Compute the interpolated value at the specified grid coordinates.
|
boolean |
isInterpolationTargetSupported(InterpolationTarget target)
Indicates whether the interpolation implementation supports the
specified target.
|
InterpolationResult interpolate(double row, double column, int nRowsInGrid, int nColumnsInGrid, float[] grid, double rowSpacing, double columnSpacing, InterpolationTarget target, InterpolationResult outputResult)
The row and column specifications represent real-valued coordinates and may use non-integral values to indicate positions between sample points. The interpolation coordinates may be given for any point within the grid.
The row and column spacing parameters are necessary for this routine to compute derivatives and surface normal vectors. If derivatives are not required, the spacing parameters will be ignored and applications are free to supply zeroes.
row
- a real-valued, potentially non-integral row coordinatecolumn
- a real-valued, potentially non-integral column coordinatenRowsInGrid
- the number of rows in the input grid.nColumnsInGrid
- the number of columns in the input gridgrid
- the input grid, given in row-major orderrowSpacing
- a scale factor required for computing derivatives, or
zero if derivative and surface normal vector computations are not requiredcolumnSpacing
- a scale factor required for computing derivatives, or
zero if derivative and surface normal vector computations are not requiredtarget
- indicates which product is required for the interpolation,
including value, value and first derivative, or value and first and
second derivatives.outputResult
- an instance to store the results, or null if the method
should construct a new instance.double interpolateValue(double row, double column, int nRowsInGrid, int nColumnsInGrid, float[] grid)
The row and column specifications represent real-valued coordinates and may use non-integral values to indicate positions between sample points. The interpolation coordinates may be given for any point within the grid.
row
- a real-valued, potentially non-integral row coordinatecolumn
- a real-valued, potentially non-integral column coordinatenRowsInGrid
- the number of rows in the input grid.nColumnsInGrid
- the number of columns in the input gridgrid
- the input grid, given in row-major orderboolean isInterpolationTargetSupported(InterpolationTarget target)
target
- a valid enumeration value.Copyright © 2022. All rights reserved.