1 #ifndef TIL_CATMULL_ROM_INTERPOLATION_TPP_
2 #define TIL_CATMULL_ROM_INTERPOLATION_TPP_
8 template < typename T >
9 static inline T CRPo(T x)
10 { return x*x*(x-1)/T(2.0); }
12 template < typename T >
13 static inline T lapl_(T x1, T x2, T x3)
14 { return x1 + x3 - 2*x2; }
18 template < typename T >
19 T CatmullRomInterpolation<T>::compute(T f1, T f2, T f3, T f4, T x)
22 CRPo(x) * lapl_(f2, f3, f4) + x * f3 +
23 CRPo(1-x) * lapl_(f1, f2, f3) + (1-x) * f2;
28 #endif /*CATMULL_ROM_INTERPOLATION_TPP_*/