|
template<typename T, typename R> |
const T & | clamp (const T &x, const T &min, const T &max, R r) |
| clamp implementation
|
template<typename T, typename R> |
T & | clamp (T &x, T &min, T &max, R r) |
| clamp implementation
|
template<typename T> |
const T & | clamp (const T &x, const T &min, const T &max) |
| clamp implementation
|
template<typename T> |
T & | clamp (T &x, T &min, T &max) |
| clamp implementation
|
template<typename T, typename R> |
const T & | clamp_unordered (const T &x, const T &min, const T &max, R r) |
| clamp_unordered implementation
|
template<typename T, typename R> |
T & | clamp_unordered (T &x, T &min, T &max, R r) |
| clamp_unordered implementation
|
template<typename T> |
const T & | clamp_unordered (const T &x, const T &min, const T &max) |
| clamp_unordered implementation
|
template<typename T> |
T & | clamp_unordered (T &x, T &min, T &max) |
| clamp_unordered implementation
|
As with adobe::min and adobe::max, clamp is a select algorithm. The clamp algorithm returns min if x
is less than min
and max
if x
is greater than max.
The clamp algorithm is stable with respect to the order min, x, max
.
The clamp_unorderd algorithm does not presume an ordering between min
and max
. It is equivalent to median(min, x, max)
.
- See also
-
◆ clamp() [1/4]
template<typename T, typename R>
const T & clamp |
( |
const T & | x, |
|
|
const T & | min, |
|
|
const T & | max, |
|
|
R | r ) |
- Precondition
!r(max, min)
Definition at line 46 of file clamp.hpp.
◆ clamp() [2/4]
template<typename T, typename R>
T & clamp |
( |
T & | x, |
|
|
T & | min, |
|
|
T & | max, |
|
|
R | r ) |
- Precondition
!r(max, min)
Definition at line 57 of file clamp.hpp.
◆ clamp() [3/4]
template<typename T>
const T & clamp |
( |
const T & | x, |
|
|
const T & | min, |
|
|
const T & | max ) |
- Precondition
!(max < min)
Definition at line 68 of file clamp.hpp.
◆ clamp() [4/4]
template<typename T>
T & clamp |
( |
T & | x, |
|
|
T & | min, |
|
|
T & | max ) |
- Precondition
!(max < min)
Definition at line 79 of file clamp.hpp.
◆ clamp_unordered() [1/4]
template<typename T, typename R>
const T & clamp_unordered |
( |
const T & | x, |
|
|
const T & | min, |
|
|
const T & | max, |
|
|
R | r ) |
◆ clamp_unordered() [2/4]
template<typename T, typename R>
T & clamp_unordered |
( |
T & | x, |
|
|
T & | min, |
|
|
T & | max, |
|
|
R | r ) |
◆ clamp_unordered() [3/4]
template<typename T>
const T & clamp_unordered |
( |
const T & | x, |
|
|
const T & | min, |
|
|
const T & | max ) |
◆ clamp_unordered() [4/4]
template<typename T>
T & clamp_unordered |
( |
T & | x, |
|
|
T & | min, |
|
|
T & | max ) |