Developer Documentation
|
Public Member Functions | |
TextureMath (const bool _abs, const bool _clamp, const double _clampMin, const double _clampMax, const bool _repeat, const double _minRepeat, const double _maxRepeat, const bool _center, const bool _scale, const double _minimalInput, const double _maximalInput) | |
TextureMath (const TexParameters &_parameters, const double _minimalInput, const double _maximalInput) | |
Convenience constructor. More... | |
double | transform (const double _input) const |
Modify given values based on the specified parameters given to the constructor. More... | |
Private Attributes | |
bool | abs_ |
bool | clamp_ |
double | clampMin_ |
double | clampMax_ |
bool | repeat_ |
double | repeatMin_ |
double | repeatMax_ |
bool | center_ |
bool | scale_ |
double | minInput_ |
double | maxInput_ |
Definition at line 55 of file TextureMath.hh.
TextureMath::TextureMath | ( | const bool | _abs, |
const bool | _clamp, | ||
const double | _clampMin, | ||
const double | _clampMax, | ||
const bool | _repeat, | ||
const double | _minRepeat, | ||
const double | _maxRepeat, | ||
const bool | _center, | ||
const bool | _scale, | ||
const double | _minimalInput, | ||
const double | _maximalInput | ||
) |
\ brief Initialize converter
The values are modified in the following way:
First the absolute value of the property is taken if requested (_abs)
Then this value is clamped against the given values (_clamp,_clampMin,_clampMax)
If the texture should be repeated, the values are translated such that the minimum is at min_val(0.0 by default) and than scaled such that the maximum is at max_val. This data is than passed to the rendering (_repeat,_minRepeat,_maxRepeat)
If the texture should not be repeated you could choose to center the data around 0.5. The negative values are than mapped to 0..0.5 and the positive values to 0.5..1 (_center)
Otherwise, the values are mapped directly to 0..1. You can also disable that final scaling with (_scale)
_abs | Take absolute value? |
_clamp | Clamp values? |
_clampMin | Minimal clamping value |
_clampMax | Maximal Clamping value |
_repeat | Repeat Texture? |
_minRepeat | Minimal value for repeat |
_maxRepeat | Maximal value for repeat |
_center | Center values? |
_scale | Scale values? |
_minimalInput | Minimal input value given |
_maximalInput | Maximal input value given |
Definition at line 54 of file TextureMath.cc.
TextureMath::TextureMath | ( | const TexParameters & | _parameters, |
const double | _minimalInput, | ||
const double | _maximalInput | ||
) |
Convenience constructor.
_parameters | texture parameters |
_minimalInput | |
_maximalInput |
Definition at line 80 of file TextureMath.cc.
double TextureMath::transform | ( | const double | _input | ) | const |
Modify given values based on the specified parameters given to the constructor.
_input | Input value |
Definition at line 95 of file TextureMath.cc.