Clarisse 5.0 SP8 SDK  5.0.5.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | List of all members
GMathStaticLut1< T, SIZE > Class Template Reference

Class allowing to create and manipulate a single dimension LUT. More...

Inheritance diagram for GMathStaticLut1< T, SIZE >:
GMathBasicLut1< T >

Public Types

typedef GMathBasicLut1< T >::Mode Mode
 
- Public Types inherited from GMathBasicLut1< T >
enum  Mode {
  RAW,
  CDF,
  INV_CDF
}
 

Public Member Functions

 GMathStaticLut1 ()
 Default constructor that creates an empty LUT.
 
template<class F >
 GMathStaticLut1 (const F &f, const T &t_min, const T &t_max, const Mode &mode)
 Constructor that creates a LUT from a given function.
 
eval (const T &t) const
 Evaluate the LUT.
 
eval (const T &t, const T &lerp_threshold) const
 Evaluate the LUT.
 
eval_abs (const T &t) const
 Evaluate the LUT.
 
eval_abs (const T &t, const T &lerp_threshold) const
 Evaluate the LUT.
 
eval_diff (const T &t, T &diff) const
 Evaluate the LUT.
 
eval_diff (const T &t, const T &lerp_threshold, T &diff) const
 Evaluate the LUT.
 
eval_diff_abs (const T &t, T &diff) const
 Evaluate the LUT.
 
eval_diff_abs (const T &t, const T &lerp_threshold, T &diff) const
 Evaluate the LUT.
 
void init (const CoreBasicArray< T > &values, const T &t_min, const T &t_max)
 Set the values of the LUT.
 
template<class F >
void init (const F &f, const T &t_min, const T &t_max, const Mode &mode)
 Fill the LUT with the given function.
 
template<class F >
void init_raw (const F &f, const T &t_min, const T &t_max)
 Fill the LUT by evaluating the given function.
 
template<class F >
void init_cdf (const F &f, const T &t_min, const T &t_max)
 Fill the LUT by computing the CDF of the given function.
 
template<class F >
void init_inv_cdf (const F &f, const T &t_min, const T &t_max, const unsigned int sample_count=8192)
 Fill the LUT by computing the inverse CDF of the given function.
 
void init_curve_cdf (const CoreBasicArray< GMathVec2< T > > &curve, const T &t_min, const T &t_max)
 Fill the LUT by computing the CDF of the given curve.
 
void init_curve_inv_cdf (const CoreBasicArray< GMathVec2< T > > &curve, const T &t_min, const T &t_max)
 Fill the LUT by computing the inverse CDF of the given curve.
 
unsigned int get_size () const
 
const T * get_data () const
 
const T & operator[] (const unsigned int &index) const
 
T & operator[] (const unsigned int &index)
 
- Public Member Functions inherited from GMathBasicLut1< T >
void set_range (const T &t_min, const T &t_max)
 Set the range of the LUT.
 
eval (const CoreBasicArray< T > &lut, const T &t) const
 Evaluate the LUT.
 
eval (const CoreBasicArray< T > &lut, const T &t, const T &lerp_threshold) const
 Evaluate the LUT.
 
template<class F >
eval_interpolate (const CoreBasicArray< T > &lut, const T &t, F &f) const
 Evaluate the LUT using interpolation info.
 
eval_abs (const CoreBasicArray< T > &lut, const T &t) const
 Evaluate the LUT.
 
eval_abs (const CoreBasicArray< T > &lut, const T &t, const T &lerp_threshold) const
 Evaluate the LUT.
 
eval_diff (const CoreBasicArray< T > &lut, const T &t, T &diff) const
 Evaluate the LUT.
 
eval_diff (const CoreBasicArray< T > &lut, const T &t, const T &lerp_threshold, T &diff) const
 Evaluate the LUT.
 
eval_diff_abs (const CoreBasicArray< T > &lut, const T &t, T &diff) const
 Evaluate the LUT.
 
eval_diff_abs (const CoreBasicArray< T > &lut, const T &t, const T &lerp_threshold, T &diff) const
 Evaluate the LUT.
 
void init (CoreBasicArray< T > &lut, const CoreBasicArray< T > &values, const T &t_min, const T &t_max)
 Set the values of the LUT.
 
template<class F >
void init (CoreBasicArray< T > &lut, const F &f, const T &t_min, const T &t_max, const Mode &mode)
 Fill the LUT with the given function.
 
template<class F >
void init_raw (CoreBasicArray< T > &lut, const F &f, const T &t_min, const T &t_max)
 Fill the LUT by evaluating the given function.
 
template<class F >
void init_cdf (CoreBasicArray< T > &lut, const F &f, const T &t_min, const T &t_max)
 Fill the LUT by computing the CDF of the given function.
 
template<class F >
void init_inv_cdf (CoreBasicArray< T > &lut, const F &f, const T &t_min, const T &t_max, const unsigned int sample_count)
 Fill the LUT by computing the inverse CDF of the given function.
 
void init_curve_cdf (CoreBasicArray< T > &lut, const CoreBasicArray< GMathVec2< T > > &curve, const T &t_min, const T &t_max)
 Fill the LUT by computing the CDF of the given curve.
 
void init_curve_inv_cdf (CoreBasicArray< T > &lut, const CoreBasicArray< GMathVec2< T > > &curve, const T &t_min, const T &t_max)
 Fill the LUT by computing the inverse CDF of the given curve.
 
const T & get_t_min () const
 
const T & get_t_max () const
 

Detailed Description

template<class T, unsigned int SIZE>
class GMathStaticLut1< T, SIZE >

Class allowing to create and manipulate a single dimension LUT.

Constructor & Destructor Documentation

template<class T , unsigned int SIZE>
template<class F >
GMathStaticLut1< T, SIZE >::GMathStaticLut1 ( const F &  f,
const T &  t_min,
const T &  t_max,
const Mode &  mode 
)
inline

Constructor that creates a LUT from a given function.

Parameters
[in]fthe functor defining the function
[in]t_minthe minimum bound of the function
[in]t_maxthe maximum bound of the function
[in]modethe creation mode of the LUT
[in]lut_sizethe size of the LUT

Member Function Documentation

template<class T , unsigned int SIZE>
T GMathStaticLut1< T, SIZE >::eval ( const T &  t) const
inline

Evaluate the LUT.

Parameters
[in]tthe position at which the LUT has to be evaluated (must be between 0 and 1)
Returns
the resulting value
template<class T , unsigned int SIZE>
T GMathStaticLut1< T, SIZE >::eval ( const T &  t,
const T &  lerp_threshold 
) const
inline

Evaluate the LUT.

Parameters
[in]tthe position at which the LUT has to be evaluated (must be between 0 and 1)
[in]lerp_thresholdthreshold between 2 values over which the lerp is not used
Returns
the resulting value
template<class T , unsigned int SIZE>
T GMathStaticLut1< T, SIZE >::eval_abs ( const T &  t) const
inline

Evaluate the LUT.

Parameters
[in]tthe absolute t value at which the LUT has to be evaluated (must be between t_min and t_max)
Returns
the resulting value
template<class T , unsigned int SIZE>
T GMathStaticLut1< T, SIZE >::eval_abs ( const T &  t,
const T &  lerp_threshold 
) const
inline

Evaluate the LUT.

Parameters
[in]tthe absolute t value at which the LUT has to be evaluated (must be between t_min and t_max)
[in]lerp_thresholdthreshold between 2 values over which the lerp is not used
Returns
the resulting value
template<class T , unsigned int SIZE>
T GMathStaticLut1< T, SIZE >::eval_diff ( const T &  t,
T &  diff 
) const
inline

Evaluate the LUT.

Parameters
[in]tthe position at which the LUT has to be evaluated (must be between 0 and 1)
[out]diffthe differential of the resulting value
Returns
the resulting value
template<class T , unsigned int SIZE>
T GMathStaticLut1< T, SIZE >::eval_diff ( const T &  t,
const T &  lerp_threshold,
T &  diff 
) const
inline

Evaluate the LUT.

Parameters
[in]tthe position at which the LUT has to be evaluated (must be between 0 and 1)
[in]lerp_thresholdthreshold between 2 values over which the lerp is not used
[out]diffthe differential of the resulting value
Returns
the resulting value
template<class T , unsigned int SIZE>
T GMathStaticLut1< T, SIZE >::eval_diff_abs ( const T &  t,
T &  diff 
) const
inline

Evaluate the LUT.

Parameters
[in]tthe absolute t value at which the LUT has to be evaluated (must be between t_min and t_max)
[out]diffthe differential of the resulting value
Returns
the resulting value
template<class T , unsigned int SIZE>
T GMathStaticLut1< T, SIZE >::eval_diff_abs ( const T &  t,
const T &  lerp_threshold,
T &  diff 
) const
inline

Evaluate the LUT.

Parameters
[in]tthe absolute t value at which the LUT has to be evaluated (must be between t_min and t_max)
[in]lerp_thresholdthreshold between 2 values over which the lerp is not used
[out]diffthe differential of the resulting value
Returns
the resulting value
template<class T , unsigned int SIZE>
void GMathStaticLut1< T, SIZE >::init ( const CoreBasicArray< T > &  values,
const T &  t_min,
const T &  t_max 
)
inline

Set the values of the LUT.

Parameters
[in]valuesvalues to store in the LUT
[in]t_minthe minimum bound of the LUT
[in]t_maxthe maximum bound of the LUT
template<class T , unsigned int SIZE>
template<class F >
void GMathStaticLut1< T, SIZE >::init ( const F &  f,
const T &  t_min,
const T &  t_max,
const Mode &  mode 
)
inline

Fill the LUT with the given function.

Parameters
[in]fthe functor defining the function
[in]t_minthe minimum bound of the function
[in]t_maxthe maximum bound of the function
[in]modethe creation mode of the LUT
[in]lut_sizethe size of the LUT
template<class T , unsigned int SIZE>
template<class F >
void GMathStaticLut1< T, SIZE >::init_cdf ( const F &  f,
const T &  t_min,
const T &  t_max 
)
inline

Fill the LUT by computing the CDF of the given function.

Parameters
[in]fthe functor defining the function
[in]t_minthe minimum bound of the function
[in]t_maxthe maximum bound of the function
[in]lut_sizethe size of the LUT
template<class T , unsigned int SIZE>
void GMathStaticLut1< T, SIZE >::init_curve_cdf ( const CoreBasicArray< GMathVec2< T > > &  curve,
const T &  t_min,
const T &  t_max 
)
inline

Fill the LUT by computing the CDF of the given curve.

Parameters
[in]curvearray of points defining the curve
[in]t_minthe minimum bound of the curve
[in]t_maxthe maximum bound of the curve
[in]lut_sizethe size of the LUT
template<class T , unsigned int SIZE>
void GMathStaticLut1< T, SIZE >::init_curve_inv_cdf ( const CoreBasicArray< GMathVec2< T > > &  curve,
const T &  t_min,
const T &  t_max 
)
inline

Fill the LUT by computing the inverse CDF of the given curve.

Parameters
[in]curvearray of points defining the curve
[in]t_minthe minimum bound of the curve
[in]t_maxthe maximum bound of the curve
[in]lut_sizethe size of the LUT
template<class T , unsigned int SIZE>
template<class F >
void GMathStaticLut1< T, SIZE >::init_inv_cdf ( const F &  f,
const T &  t_min,
const T &  t_max,
const unsigned int  sample_count = 8192 
)
inline

Fill the LUT by computing the inverse CDF of the given function.

Parameters
[in]fthe functor defining the function
[in]t_minthe minimum bound of the function
[in]t_maxthe maximum bound of the function
[in]lut_sizethe size of the LUT
[in]sample_countthe number of samples to use to estimate the CDF
template<class T , unsigned int SIZE>
template<class F >
void GMathStaticLut1< T, SIZE >::init_raw ( const F &  f,
const T &  t_min,
const T &  t_max 
)
inline

Fill the LUT by evaluating the given function.

Parameters
[in]fthe functor defining the function
[in]t_minthe minimum bound of the function
[in]t_maxthe maximum bound of the function
[in]lut_sizethe size of the LUT