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 Type
    Method
    Description
    Returns a PixelInterpolator instance for the specified InterpolationMethod.
    float
    getInterpolatedValue(ScalarAccessor ia, double x, double y)
    Returns the interpolated pixel value for the specified position.
    double
    getWeight(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 double
    getWeight(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 a PixelInterpolator instance for the specified InterpolationMethod.
      Parameters:
      method - the interpolation method
      Returns:
      an instance of PixelInterpolator
    • getInterpolatedValue

      float getInterpolatedValue(ScalarAccessor ia, double x, double y)
      Returns the interpolated pixel value for the specified position.
      Parameters:
      ia - a ScalarAccessor to the interpolated image
      x - continuous interpolation position (horiz.)
      y - continuous interpolation position (vert.)
      Returns:
      the interpolated pixel value at position (x,y).
    • getWeight

      double getWeight(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. This method is primarily used for testing.
      Parameters:
      x - the position relative to the interpolation point
      Returns:
      the weight for this position
    • getWeight

      default double getWeight(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. This method is primarily used for testing.
      Parameters:
      x - the x-position relative to the interpolation point
      y - the y-position relative to the interpolation point
      Returns:
      the weight for this position