Class LanczosInterpolator<T extends RealType<T>>

    • Field Detail

      • alpha

        protected final int alpha
      • interpolatedValue

        protected final T extends RealType<T> interpolatedValue
      • size

        protected final long[] size
      • max

        protected final long[] max
      • minValue

        protected final double minValue
      • maxValue

        protected final double maxValue
      • clip

        protected final boolean clip
      • lut

        protected final double[] lut
      • products

        protected final double[] products
    • Constructor Detail

      • LanczosInterpolator

        public LanczosInterpolator​(RandomAccessible<T> randomAccessible,
                                   int alpha,
                                   boolean clip,
                                   double min,
                                   double max)
        Creates a new Lanczos-interpolation
        Parameters:
        randomAccessible - - the RandomAccessible to work on
        alpha - - the radius of values to incorporate (typically 2 or 3)
        clip - - clips the value to range of the RealType, i.e. tests if the interpolated value is out of range
        min - - range for clipping (ignored if min==max)
        max - - range for clipping (ignored if min==max)
    • Method Detail

      • createOffset

        private static final long[] createOffset​(int a,
                                                 int n)
      • createLanczosLUT

        private static final double[] createLanczosLUT​(int max,
                                                       int scale)
      • resetKernel

        protected final void resetKernel()
      • accumulate

        protected final void accumulate​(int d)
      • get

        public T get()
        Description copied from interface: Sampler
        Access the actual T instance providing access to a pixel, sub-pixel or integral region value the Sampler points at.
        Specified by:
        get in interface Sampler<T extends RealType<T>>
      • getType

        public T getType()
        Description copied from interface: Typed
        Get an instance of T.

        It should not be assumed that the returned T instance is an independent copy. In particular, repeated calls to getType() may return the same instance.

        Specified by:
        getType in interface Sampler<T extends RealType<T>>
        Specified by:
        getType in interface Typed<T extends RealType<T>>
        Returns:
        an instance of T
      • lanczos

        private static final double lanczos​(double x,
                                            double a)
      • lookUpLanczos

        private final double lookUpLanczos​(double x)
      • copy

        public RealRandomAccess<T> copy()
        Specified by:
        copy in interface RealRandomAccess<T extends RealType<T>>
        Specified by:
        copy in interface Sampler<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)