aimstil  5.0.5
CatmullRomInterpolation.h
Go to the documentation of this file.
1 #ifndef TIL_CATMULL_ROM_INTERPOLATION_H
2 #define TIL_CATMULL_ROM_INTERPOLATION_H
3 
4 // includes from TIL library
5 #include "til/til_common.h"
6 #include "til/labels.h"
7 
8 namespace til
9 {
10 
11  //----------------------------------------------------------------------------------
12 
13  //---------------------------//
14  // CatmullRomInterpolation //
15  //---------------------------//
16 
28  // NOTE: The templating has been done on the function members rather than on
29  // the class itself, to make use of the automatic template deduction of functions.
30  // It may be changed.
31 
32  template < typename T >
34  : public Interpolator_label
35  {
36  public: // typedefs
38 
39  public: // static method
40 
43  // NB: There is a priori no reason for f to be the same type as x.
44  // However, forcing x and f to have the same type forces the
45  // (necessary anyway) casting to be done once, before function
46  // call.
47  inline static T compute(
48  T f1,
49  T f2,
50  T f3,
51  T f4,
52  T x
53  );
54  };
55 
56  //----------------------------------------------------------------------------------
57 
58 } // namespace til
59 
61 
62 #endif
63 
Interpolation using the Catmull-Rom polynomial.
static T compute(T f1, T f2, T f3, T f4, T x)
Returns the interpolated value of four numbers using the Catmull-Rom method.
Belongs to package Box Do not include directly, include til/Box.h instead.
Definition: Accumulator.h:10
General macros, definitions and functions.
Defines empty classes that serves as labels.