Library of Assembled Shared Sources
|
Basic Operators.
Functions | |
template<typename T> | |
T | lass::num::abs (const T &x) |
if x < 0 return -x, else return x. | |
template<typename T> | |
T | lass::num::sign (const T &x) |
if x < 0 return -1, else if x > 0 return 1, else return 0. | |
template<typename T> | |
T | lass::num::sqr (const T &x) |
return x * x | |
template<typename T> | |
T | lass::num::cubic (const T &x) |
return x * x * x | |
template<typename T> | |
T | lass::num::inv (const T &x) |
return x ^ -1 | |
template<typename T> | |
T | lass::num::pow (const T &x, const T &p) |
return exp(p * log(x)); | |
template<typename T> | |
T | lass::num::log2 (const T &x) |
return log(x) / log(2) | |
template<typename T> | |
T | lass::num::log10 (const T &x) |
return log(x) / log(10) | |
template<typename T> | |
T | lass::num::norm (const T &x) |
return norm of x as if x is real part of complex number: sqr(x) | |
template<typename T> | |
const T & | lass::num::clamp (const T &x, const T &min, const T &max) |
if x < min return min, else if x > max return max, else return x. | |
template<typename T> | |
T | lass::num::lerp (const T &a, const T &b, const T &f) |
linear interpolation between a and b | |
template<typename T> | |
T | abs (const T &x) |
if x < 0 return -x, else return x. | |
template<typename T> | |
T | sign (const T &x) |
if x < 0 return -1, else if x > 0 return 1, else return 0. | |
template<typename T> | |
T | sqr (const T &x) |
return x * x | |
template<typename T> | |
T | cubic (const T &x) |
return x * x * x | |
template<typename T> | |
T | inv (const T &x) |
return x ^ -1 | |
template<typename T> | |
T | pow (const T &x, const T &p) |
return exp(p * log(x)); | |
template<typename T> | |
T | log2 (const T &x) |
return log(x) / log(2) | |
template<typename T> | |
T | log10 (const T &x) |
return log(x) / log(10) | |
template<typename T> | |
T | norm (const T &x) |
return norm of x as if x is real part of complex number: sqr(x) | |
template<typename T> | |
const T & | clamp (const T &x, const T &min, const T &max) |
if x < min return min, else if x > max return max, else return x. | |
template<typename T> | |
T | lerp (const T &a, const T &b, const T &f) |
linear interpolation between a and b | |
|
inline |
return exp(p * log(x));
Definition at line 187 of file basic_ops.h.
Referenced by lass::prim::ColorRGBA::gammaCorrected().
|
inline |
return exp(p * log(x));
Definition at line 187 of file basic_ops.inl.