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
GMathBasicLut1< T > Class Template Reference
Inheritance diagram for GMathBasicLut1< T >:
GMathLut1< T > GMathStaticLut1< T, SIZE >

Public Types

enum  Mode {
  RAW,
  CDF,
  INV_CDF
}
 

Public Member Functions

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
 

Member Function Documentation

template<class T>
T GMathBasicLut1< T >::eval ( const CoreBasicArray< T > &  lut,
const T &  t 
) const
inline

Evaluate the LUT.

Parameters
[in]lutvalues to use
[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 GMathBasicLut1< T >::eval ( const CoreBasicArray< T > &  lut,
const T &  t,
const T &  lerp_threshold 
) const
inline

Evaluate the LUT.

Parameters
[in]lutvalues to use
[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 GMathBasicLut1< T >::eval_abs ( const CoreBasicArray< T > &  lut,
const T &  t 
) const
inline

Evaluate the LUT.

Parameters
[in]lutvalues to use
[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 GMathBasicLut1< T >::eval_abs ( const CoreBasicArray< T > &  lut,
const T &  t,
const T &  lerp_threshold 
) const
inline

Evaluate the LUT.

Parameters
[in]lutvalues to use
[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 GMathBasicLut1< T >::eval_diff ( const CoreBasicArray< T > &  lut,
const T &  t,
T &  diff 
) const
inline

Evaluate the LUT.

Parameters
[in]lutvalues to use
[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 GMathBasicLut1< T >::eval_diff ( const CoreBasicArray< T > &  lut,
const T &  t,
const T &  lerp_threshold,
T &  diff 
) const
inline

Evaluate the LUT.

Parameters
[in]lutvalues to use
[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 GMathBasicLut1< T >::eval_diff_abs ( const CoreBasicArray< T > &  lut,
const T &  t,
T &  diff 
) const
inline

Evaluate the LUT.

Parameters
[in]lutvalues to use
[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 GMathBasicLut1< T >::eval_diff_abs ( const CoreBasicArray< T > &  lut,
const T &  t,
const T &  lerp_threshold,
T &  diff 
) const
inline

Evaluate the LUT.

Parameters
[in]lutvalues to use
[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 GMathBasicLut1< T >::eval_interpolate ( const CoreBasicArray< T > &  lut,
const T &  t,
F &  f 
) const
inline

Evaluate the LUT using interpolation info.

Parameters
[in]lutvalues to use
[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 GMathBasicLut1< T >::init ( CoreBasicArray< T > &  lut,
const CoreBasicArray< T > &  values,
const T &  t_min,
const T &  t_max 
)
inline

Set the values of the LUT.

Parameters
[out]lutoutput values
[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 GMathBasicLut1< T >::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.

Parameters
[out]lutoutput values
[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
template<class T>
template<class F >
void GMathBasicLut1< T >::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.

Parameters
[out]lutoutput values
[in]fthe functor defining the function
[in]t_minthe minimum bound of the function
[in]t_maxthe maximum bound of the function
template<class T>
void GMathBasicLut1< T >::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.

Parameters
[out]lutoutput values
[in]curvearray of points defining the curve
[in]t_minthe minimum bound of the curve
[in]t_maxthe maximum bound of the curve
template<class T>
void GMathBasicLut1< T >::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.

Parameters
[out]lutoutput values
[in]curvearray of points defining the curve
[in]t_minthe minimum bound of the curve
[in]t_maxthe maximum bound of the curve
template<class T>
template<class F >
void GMathBasicLut1< T >::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.

Parameters
[out]lutoutput values
[in]fthe functor defining the function
[in]t_minthe minimum bound of the function
[in]t_maxthe maximum bound of the function
[in]sample_countthe number of samples to use to estimate the CDF
template<class T>
template<class F >
void GMathBasicLut1< T >::init_raw ( CoreBasicArray< T > &  lut,
const F &  f,
const T &  t_min,
const T &  t_max 
)

Fill the LUT by evaluating the given function.

Parameters
[out]lutoutput values
[in]fthe functor defining the function
[in]t_minthe minimum bound of the function
[in]t_maxthe maximum bound of the function
template<class T>
void GMathBasicLut1< T >::set_range ( const T &  t_min,
const T &  t_max 
)
inline

Set the range of the LUT.

Parameters
[in]t_minthe minimum bound of the LUT
[in]t_maxthe maximum bound of the LUT