Module imagingbook.common
Interface PixelInterpolator
- All Known Implementing Classes:
BicubicInterpolator,BilinearInterpolator,CatmullRomInterpolator,CubicBSplineInterpolator,LanczosInterpolator,MitchellNetravaliInterpolator,NearestNeighborInterpolator,SplineInterpolator
public interface PixelInterpolator
This interface defines the behavior of 2D pixel interpolators for scalar-valued images. See Ch. 22 of [1] for additional details.
[1] W. Burger, M.J. Burge, Digital Image Processing – An Algorithmic Introduction, 3rd ed, Springer (2022).
-
Method Summary
Modifier and TypeMethodDescriptionstatic PixelInterpolatorcreate(InterpolationMethod method) Returns aPixelInterpolatorinstance for the specifiedInterpolationMethod.floatgetInterpolatedValue(ScalarAccessor ia, double x, double y) Returns the interpolated pixel value for the specified position.doublegetWeight(double x) Returns the value of the one-dimensional weight function w(x), that is the weight given to some pixel at distance x from the current interpolation point.default doublegetWeight(double x, double y) Returns the value of the two-dimensional weight function W(x,y), that is the weight given to some pixel at distance (x,y) relative to the current interpolation point.
-
Method Details
-
create
Returns aPixelInterpolatorinstance for the specifiedInterpolationMethod.- Parameters:
method- the interpolation method- Returns:
- an instance of
PixelInterpolator
-
getInterpolatedValue
Returns the interpolated pixel value for the specified position.- Parameters:
ia- aScalarAccessorto the interpolated imagex- continuous interpolation position (horiz.)y- continuous interpolation position (vert.)- Returns:
- the interpolated pixel value at position (x,y).
-
getWeight
Returns the value of the one-dimensional weight function w(x), that is the weight given to some pixel at distance x from the current interpolation point. This method is primarily used for testing.- Parameters:
x- the position relative to the interpolation point- Returns:
- the weight for this position
-
getWeight
Returns the value of the two-dimensional weight function W(x,y), that is the weight given to some pixel at distance (x,y) relative to the current interpolation point. This method is primarily used for testing.- Parameters:
x- the x-position relative to the interpolation pointy- the y-position relative to the interpolation point- Returns:
- the weight for this position
-