All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Nimble::LinearInterpolator< T > Class Template Reference

Performs linear interpolation of non-uniform samples. More...

#include <Nimble/Interpolation.hpp>

Public Types

typedef std::pair< float, T > Key
 Type of key.
 
typedef std::vector< KeyKeys
 Array of keys.
 

Public Member Functions

void addKey (float t, T value)
 Add a key to the interpolation. More...
 
void clear ()
 Remove all key-points.
 
interpolate (float t) const
 Return the interpolated value at given position. More...
 
const Keyskeys () const
 Gets a reference to the key-point list.
 
 LinearInterpolator ()
 Constructs an empty interpolator.
 

Detailed Description

template<class T>
class Nimble::LinearInterpolator< T >

Performs linear interpolation of non-uniform samples.

Member Function Documentation

template<class T >
void Nimble::LinearInterpolator< T >::addKey ( float  t,
value 
)
inline

Add a key to the interpolation.

Parameters
tposition to add the value
valuevalue
template<class T >
T Nimble::LinearInterpolator< T >::interpolate ( float  t) const
inline

Return the interpolated value at given position.

Parameters
tposition to interpolate at
Returns
interpolated value