23#ifndef INTERPOLATION_H
24#define INTERPOLATION_H
42 case InterpolateMode::Linear:
44 case InterpolateMode::Cosine:
46 case InterpolateMode::Third:
48 case InterpolateMode::Cubic:
50 case InterpolateMode::Hermite:
64 return y1 * ( 1 - mu ) + y2 * mu;
76 mu2 = ( 1 - cos ( mu * 3.14159 ) ) / 2;
77 return( y1 * (1 - mu2 ) + y2 * mu2 );
91 float c1 = 0.5f * ( y2 - y0 );
92 float c3 = 1.5f * ( y1 - y2 ) + 0.5f * ( y3 - y0 );
93 float c2 = y0 - y1 + c1 - c3;
94 return ( ( c3 * mu + c2 ) * mu + c1 ) * mu + c0;
107 double a0, a1, a2, a3, mu2;
110 a0 = y3 - y2 - y0 + y1;
115 return( a0 * mu * mu2 + a1 * mu2 + a2 * mu + a3 );
128 double a0, a1, a2, a3, mu2;
131 a0 = -0.5 * y0 + 1.5 * y1 - 1.5 * y2 + 0.5 * y3;
132 a1 = y0 - 2.5 * y1 + 2 * y2 - 0.5 * y3;
133 a2 = -0.5 * y0 + 0.5 * y2;
136 return( a0 * mu * mu2 + a1 * mu2 + a2 * mu + a3 );
static const QString ModeToQString(InterpolateMode mode)
static float cosine_Interpolate(float y1, float y2, double mu)
static float cubic_Interpolate(float y0, float y1, float y2, float y3, double mu)
static float linear_Interpolate(float y1, float y2, float mu)
static float hermite_Interpolate(float y0, float y1, float y2, float y3, double mu)
static float third_Interpolate(float y0, float y1, float y2, float y3, double mu)