C:/Work/specialnumbers_svn/NumberLib/NumbersLib/utils.h File Reference

Go to the source code of this file.

Namespaces

namespace  luma
namespace  luma::numbers

Functions

template<class T>
clamp (const T &value, const T &minValue, const T &maxValue)
 Returns the given value clamped between the given minimum and maximum.
template<class T>
extreme (T v1, T v2, T center)
 Returns the value furthest from the center.
template<class T>
floor (T x)
 Returns the largest integer smaller than the argument given.
template<class T>
frac (T x)
 Returns the fractional part of a float or double.
template<unsigned int n, class T>
void integrate (T samples[])
 Integrates a sequence of numbers.
template<class T>
lerp (const T &value, const T &inputMin, const T &inputMax, const T &outputMin, const T &outputMax)
 Linearly interpolates a value between a given range.
template<class T>
line (const T &value, const T &inputMin, const T &inputMax, const T &outputMin, const T &outputMax)
 Otherwise, the returned value is outputMin + ((value - inputMin) / (inputMax - inputMin)) * (outputMax - outputMin).
template<class T>
max (const T &v1, const T &v2)
template<class T>
min (const T &v1, const T &v2)
template<class T>
mod (const T &value, const T &minValue, const T &maxValue)
 Returns the modulus of a number in a specified range, that is (min + value mod (max - min)).
template<class T>
ramp (const T &value, const T &inputMin, const T &inputMax, const T &outputMin, const T &outputMax)
 If the value is below the inputMin, the outputMin is returned.
template<class T>
reflect (const T &value, const T &minValue, const T &maxValue)
 Returns a number reflected between the bounds.
template<class T>
sigmoid (const T &value, const T &inputMin, const T &inputMax, const T &outputMin, const T &outputMax)
 This function is a smooth aproximation for lerp.
template<class T>
step (const T &input, const T &inputThreshold, const T &outputMin, const T &outputMax)
 Returns the one of two outputs, depending on whether the input value exceeds a given threshold.


Generated on Sun Sep 21 20:49:08 2008 for Numbers by  doxygen 1.5.6