|
template<typename T > |
T | math::bound_mirror (T const &v, T const &min, T const &max) |
|
template<typename T > |
T const & | math::clamp (T const &v, T const &min=T(0), T const &max=T(1)) |
| Returns value 'v' clamped to the interval specified by 'min' and 'max'.
|
|
template<typename T > |
T | math::fastpow (T const &base, unsigned int exp) |
| Takes base to the integer power of 'exp'.
|
|
int | math::from_gray_code (int gc) |
|
template<typename T > |
T | math::gaussian (T const &x, T const &sigma) |
| Gaussian function g(x) = exp( -1/2 * (x/sigma)^2 ).
|
|
template<typename T > |
T | math::gaussian_2d (T const &x, T const &y, T const &sigma_x, T const &sigma_y) |
| Gaussian function in 2D.
|
|
template<typename T > |
T | math::gaussian_xx (T const &xx, T const &sigma) |
| Gaussian function that expects x to be squared.
|
|
template<typename T > |
T | math::interpolate (T const &v1, float w1) |
| Generic interpolation (weighting) of a single value.
|
|
template<typename T > |
T | math::interpolate (T const &v1, T const &v2, float w1, float w2) |
| Generic interpolation between two values.
|
|
template<typename T > |
T | math::interpolate (T const &v1, T const &v2, T const &v3, float w1, float w2, float w3) |
| Generic interpolation between three values.
|
|
template<typename T > |
T | math::interpolate (T const &v1, T const &v2, T const &v3, T const &v4, float w1, float w2, float w3, float w4) |
| Generic interpolation between four values.
|
|
template<> |
unsigned char | math::interpolate (unsigned char const &v1, float w1) |
| Specific interpolation (weighting) of a value for unsigned char.
|
|
template<> |
unsigned char | math::interpolate (unsigned char const &v1, unsigned char const &v2, float w1, float w2) |
| Specific interpolation between two unsigned char values.
|
|
template<> |
unsigned char | math::interpolate (unsigned char const &v1, unsigned char const &v2, unsigned char const &v3, float w1, float w2, float w3) |
| Specific interpolation between three unsigned char values.
|
|
template<> |
unsigned char | math::interpolate (unsigned char const &v1, unsigned char const &v2, unsigned char const &v3, unsigned char const &v4, float w1, float w2, float w3, float w4) |
| Specific interpolation between four unsigned char values.
|
|
template<typename T > |
T const & | math::max (T const &a, T const &b, T const &c) |
| Returns the maximum value of three arguments.
|
|
template<typename T > |
T const & | math::min (T const &a, T const &b, T const &c) |
| Returns the minimum value of three arguments.
|
|
template<typename T > |
std::size_t constexpr | math::popcount (T const x) |
| Returns the number of one bits of an integer.
|
|
template<typename T > |
T | math::round (T const &x) |
| Removes the fractional part of the value to the closest integer.
|
|
template<typename T > |
T | math::sinc (T const &x) |
| Sinc function.
|
|
int | math::to_gray_code (int bin) |
|