Go to the source code of this file.
Namespaces | |
namespace | luma |
namespace | luma::numbers |
Functions | |
template<class T> | |
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> | |
T | extreme (T v1, T v2, T center) |
Returns the value furthest from the center. | |
template<class T> | |
T | floor (T x) |
Returns the largest integer smaller than the argument given. | |
template<class T> | |
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> | |
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> | |
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> | |
T | max (const T &v1, const T &v2) |
template<class T> | |
T | min (const T &v1, const T &v2) |
template<class T> | |
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> | |
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> | |
T | reflect (const T &value, const T &minValue, const T &maxValue) |
Returns a number reflected between the bounds. | |
template<class T> | |
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> | |
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. |