Class NLinearInterpolatorARGB

All Implemented Interfaces:
EuclideanSpace, Positionable, RealLocalizable, RealPositionable, RealRandomAccess<ARGBType>, Sampler<ARGBType>, Typed<ARGBType>

public class NLinearInterpolatorARGB extends NLinearInterpolator<ARGBType>
N-linear interpolator for ARGB values with overflow check.
  • Field Details

    • accA

      protected double accA
    • accR

      protected double accR
    • accG

      protected double accG
    • accB

      protected double accB
  • Constructor Details

  • Method Details

    • get

      public ARGBType 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.

      See http://en.wikipedia.org/wiki/Gray_code

      Specified by:
      get in interface Sampler<ARGBType>
      Overrides:
      get in class NLinearInterpolator<ARGBType>
    • copy

      public NLinearInterpolatorARGB copy()
      Specified by:
      copy in interface RealRandomAccess<ARGBType>
      Specified by:
      copy in interface Sampler<ARGBType>
      Overrides:
      copy in class NLinearInterpolator<ARGBType>
      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.
    • printWeights

      private final void printWeights()
    • printCode

      private final void printCode()