Public Member Functions

Interpolate::Applier2D< T > Struct Template Reference

specification for a 2D interpolator More...

Inheritance diagram for Interpolate::Applier2D< T >:
Interpolate::LinearReg2D< T > Interpolate::LinearReg2DWithUdf< T > Interpolate::PolyReg2D< T > Interpolate::PolyReg2DWithUdf< T >

List of all members.

Public Member Functions

virtual void set (const T *)=0
virtual T apply (float x, float y) const =0

Detailed Description

template<class T>
struct Interpolate::Applier2D< T >

specification for a 2D interpolator

The 'set' method accepts values arranged like this:

    7 9
  5 1 3 11
  4 0 2 10
    6 8

The interpolation is supposed to take place in the 0-1-3-2 'base square'. This looks crazy but the idea is that 0-3 are always needed, and the rest is provided bottom-left to top-right.

In some cases, you don't have or don't want to provide data outside the base square. If you want to be 100% sure that any applier is able to use the data, make sure that the size is at least 5, that 0-3 are filled (possibly with undefineds) and set the v[4] to -mUdf(T) (that is a minus there).

The 'apply' method needs the relative distance in x and y direction from the origin (where v[0] is located), and should therefore generally be between 0 and 1, although you can also use the classes for near extrapolation.


Member Function Documentation

template<class T >
virtual T Interpolate::Applier2D< T >::apply ( float  x,
float  y 
) const [pure virtual]
template<class T >
virtual void Interpolate::Applier2D< T >::set ( const T *   )  [pure virtual]