Class ClampingNLinearInterpolatorRealType<T extends RealType<T>>

Type Parameters:
T -
All Implemented Interfaces:
EuclideanSpace, Positionable, RealLocalizable, RealPositionable, RealRandomAccess<T>, Sampler<T>, Typed<T>

public class ClampingNLinearInterpolatorRealType<T extends RealType<T>> extends NLinearInterpolator<T>
N-linear interpolator for RealType values with overflow check. Interpoalted values are clamped to the range RealType.getMinValue(),RealType.getMaxValue().
  • Field Details

    • acc

      protected double acc
    • clampMin

      protected final double clampMin
    • clampMax

      protected final double clampMax
  • Constructor Details

    • ClampingNLinearInterpolatorRealType

      protected ClampingNLinearInterpolatorRealType(ClampingNLinearInterpolatorRealType<T> interpolator)
    • ClampingNLinearInterpolatorRealType

      protected ClampingNLinearInterpolatorRealType(RandomAccessible<T> randomAccessible, T type)
    • ClampingNLinearInterpolatorRealType

      protected ClampingNLinearInterpolatorRealType(RandomAccessible<T> randomAccessible)
  • Method Details

    • get

      public T get()
      Get the interpolated value at the current position.

      To visit the pixels that contribute to an interpolated value, we move in a (binary-reflected) Gray code pattern, such that only one dimension of the target position is modified per move.

      Specified by:
      get in interface Sampler<T extends RealType<T>>
      Overrides:
      get in class NLinearInterpolator<T extends RealType<T>>
      See Also:
    • copy

      Specified by:
      copy in interface RealRandomAccess<T extends RealType<T>>
      Specified by:
      copy in interface Sampler<T extends RealType<T>>
      Overrides:
      copy in class NLinearInterpolator<T extends RealType<T>>
      Returns:
      - A new Sampler in the same state accessing the same values. It does NOT copy T, just the state of the Sampler. Otherwise use T.copy() if available. Sampler.copy().get() == Sampler.get(), i.e. both hold the same value, not necessarily the same instance (this is the case for an ArrayCursor for example)
    • graycodeFwdRecursive

      private final void graycodeFwdRecursive(int dimension)
    • graycodeBckRecursive

      private final void graycodeBckRecursive(int dimension)
    • accumulate

      private final void accumulate()
      multiply current target value with current weight and add to accumulator.