Class Interpolator

java.lang.Object
org.vanted.animation.interpolators.Interpolator
Direct Known Subclasses:
BezierInterpolator, CosineInterpolator, CubicInterpolator, LinearInterpolator, SigmoidInterpolator, SineInterpolator, SmoothCubicInterpolator

public abstract class Interpolator
extends Object
Author:
- Patrick Shaw
  • Constructor Details

    • Interpolator

      public Interpolator()
      Interpolator classes specify how data is interpolated between datapoints.
  • Method Details

    • interpolateColor

      public Color interpolateColor​(double time, double loopDuration, int previousIndex, List<ColorTimePoint> dataPoints, Looper looper, ColorMode transitionMode)
      Colors can interpolate in special ways.
      It is recommended that you call this method instead of interpolate() to interpolate between values.
      Type Parameters:
      V - The type of data value that the data point holds.
      T - The type of data point that the interpolator is interpolating for.
      Parameters:
      time - The time that has elapsed since the start of the animation.
      loopDuration - How long each loop takes in milliseconds.
      dataPoints - All the dataPoints that the interpolator needs to interpolate between.
      looper - Used to figure out which points are needed at a particular time for interpolation.
      transitionMode - Specifies what kind of the color interpolation the interpolator is using.
      Returns:
      The interpolated color.
    • interpolate

      public <V,​ T extends InterpolatableTimePoint<V>> V interpolate​(double time, double duration, int previousIndex, List<T> dataPoints, Looper looper)