Package org.esa.snap.core.dataop.resamp
Class BilinearInterpolationResampling
- java.lang.Object
-
- org.esa.snap.core.dataop.resamp.BilinearInterpolationResampling
-
- All Implemented Interfaces:
Resampling
public final class BilinearInterpolationResampling extends Object implements Resampling
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.esa.snap.core.dataop.resamp.Resampling
Resampling.Index, Resampling.Raster
-
-
Field Summary
-
Fields inherited from interface org.esa.snap.core.dataop.resamp.Resampling
BICUBIC_INTERPOLATION, BILINEAR_INTERPOLATION, BISINC_11_POINT_INTERPOLATION, BISINC_21_POINT_INTERPOLATION, BISINC_5_POINT_INTERPOLATION, CUBIC_CONVOLUTION, NEAREST_NEIGHBOUR
-
-
Constructor Summary
Constructors Constructor Description BilinearInterpolationResampling()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
computeIndex(double x, double y, int width, int height, Resampling.Index index)
Computes the index's properties for the given pixel coordinate.Resampling.Index
createIndex()
Factory method which creates an appropriate index for raster access.String
getName()
Gets a unique identifier for this resampling method, e.g.double
resample(Resampling.Raster raster, Resampling.Index index)
Performs the actual resampling operation.String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.esa.snap.core.dataop.resamp.Resampling
computeCornerBasedIndex, getKernelSize
-
-
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:Resampling
Gets a unique identifier for this resampling method, e.g. "BILINEAR_INTERPOLATION".- Specified by:
getName
in interfaceResampling
- Returns:
- a unique name
-
createIndex
public final Resampling.Index createIndex()
Description copied from interface:Resampling
Factory method which creates an appropriate index for raster access.- Specified by:
createIndex
in interfaceResampling
- Returns:
- an appropriate index, never null
-
computeIndex
public final void computeIndex(double x, double y, int width, int height, Resampling.Index index)
Description copied from interface:Resampling
Computes the index's properties for the given pixel coordinate.- Specified by:
computeIndex
in interfaceResampling
- Parameters:
x
- the raster's x coordinatey
- the raster's y coordinatewidth
- the raster's widthheight
- the raster's heightindex
- the index object to which the results are to be assigned
-
resample
public final double resample(Resampling.Raster raster, Resampling.Index index) throws Exception
Description copied from interface:Resampling
Performs the actual resampling operation. If a sample value could not be computed at the given index, e.g. in case of missing data, the method returns the special valueFloat.NaN
.- Specified by:
resample
in interfaceResampling
- Parameters:
raster
- the rasterindex
- the index, must be computed using theResampling.computeIndex(double, double, int, int, org.esa.snap.core.dataop.resamp.Resampling.Index)
method- Returns:
- either the re-sampled sample value or
Float.NaN
. - Throws:
Exception
- if a non-runtime error occurs, e.g I/O error
-
-