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 | Static Public Member Functions | List of all members
GMathLut1< T > Class Template Reference

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

Inheritance diagram for GMathLut1< T >:
CoreBaseType GMathBasicLut1< T >

Public Types

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

Public Member Functions

 GMathLut1 ()
 Default constructor that creates an empty LUT.
 
template<class F >
 GMathLut1 (const F &f, const T &t_min, const T &t_max, const Mode &mode, const unsigned int lut_size=512)
 Constructor that creates a LUT from a given function.
 
template<class F >
eval_interpolate (const T &t, const F &f) const
 Evaluate the LUT using information about interpolation.
 
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 unsigned int lut_size, const T &t_min=GMath< T >::zero(), const T &t_max=GMath< T >::one())
 Set the size of the LUT but leave it empty.
 
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, const unsigned int lut_size=512)
 Fill the LUT with the given function.
 
template<class F >
void init_raw (const F &f, const T &t_min, const T &t_max, const unsigned int lut_size=512)
 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, const unsigned int lut_size=512)
 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 lut_size=512, 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, const unsigned int lut_size=512)
 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, const unsigned int lut_size=512)
 Fill the LUT by computing the inverse CDF of the given curve.
 
size_t get_memory_size () const
 
const unsigned int & get_size () const
 
const T * get_data () const
 
const T & operator[] (const unsigned int &index) const
 
T & operator[] (const unsigned int &index)
 
const CoreClassInfoget_class_info () const
 
- Public Member Functions inherited from CoreBaseType
bool is_kindof (const CoreClassInfo &cinfo) const
 
- 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
 

Static Public Member Functions

static const CoreClassInfoclass_info ()
 
- Static Public Member Functions inherited from CoreBaseType
static const CoreClassInfoclass_info ()
 Get the type descriptor of this instance.
 

Detailed Description

template<class T>
class GMathLut1< T >

Class allowing to create and manipulate a single dimension LUT.

Constructor & Destructor Documentation

template<class T>
template<class F >
GMathLut1< T >::GMathLut1 ( const F &  f,
const T &  t_min,
const T &  t_max,
const Mode &  mode,
const unsigned int  lut_size = 512 
)
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>
T GMathLut1< T >::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>
T GMathLut1< T >::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>
T GMathLut1< T >::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>
T GMathLut1< T >::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>
T GMathLut1< T >::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>
T GMathLut1< T >::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>
T GMathLut1< T >::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>
T GMathLut1< T >::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>
template<class F >
T GMathLut1< T >::eval_interpolate ( const T &  t,
const F &  f 
) const
inline

Evaluate the LUT using information about interpolation.

Parameters
[in]tthe position at which the LUT has to be evaluated (must be between 0 and 1)
[in]ffunctor which interpolates the lut
Returns
the resulting value
template<class T>
void GMathLut1< T >::init ( const unsigned int  lut_size,
const T &  t_min = GMath<T>::zero(),
const T &  t_max = GMath<T>::one() 
)
inline

Set the size of the LUT but leave it empty.

Parameters
[in]lut_sizethe size of the LUT
[in]t_minthe minimum bound of the LUT
[in]t_maxthe maximum bound of the LUT
template<class T>
void GMathLut1< T >::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>
template<class F >
void GMathLut1< T >::init ( const F &  f,
const T &  t_min,
const T &  t_max,
const Mode &  mode,
const unsigned int  lut_size = 512 
)
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>
template<class F >
void GMathLut1< T >::init_cdf ( const F &  f,
const T &  t_min,
const T &  t_max,
const unsigned int  lut_size = 512 
)
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>
void GMathLut1< T >::init_curve_cdf ( const CoreBasicArray< GMathVec2< T > > &  curve,
const T &  t_min,
const T &  t_max,
const unsigned int  lut_size = 512 
)
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>
void GMathLut1< T >::init_curve_inv_cdf ( const CoreBasicArray< GMathVec2< T > > &  curve,
const T &  t_min,
const T &  t_max,
const unsigned int  lut_size = 512 
)
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>
template<class F >
void GMathLut1< T >::init_inv_cdf ( const F &  f,
const T &  t_min,
const T &  t_max,
const unsigned int  lut_size = 512,
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>
template<class F >
void GMathLut1< T >::init_raw ( const F &  f,
const T &  t_min,
const T &  t_max,
const unsigned int  lut_size = 512 
)
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