Functions |
template<typename T , typename R > |
const T & | pin (const T &min, const T &x, const T &max, R r) |
template<typename T > |
const T & | pin (const T &min, const T &x, const T &max) |
template<typename T , typename R > |
const T & | pin_safe (const T &min, const T &x, const T &max, R r) |
template<typename T , typename R > |
const T & | pin_safe (const T &min, const T &x, const T &max) |
Detailed Description
- Deprecated:
- The
pin()
and pin_unsafe()
functions have been deprecated in favor of clamp()
and clamp_unordered()
. Note that the parameter order is different.
If x
is outside the range (min, max)
then the closest of either min
or max
is returned. If x
is within the range specified then x
is returned.
- Precondition:
min <= max
- Postcondition:
min <= result <= max
pin_safe is similar to pin but should be used when you are not sure which bound is the minimum and which is the maximum. It is 'safe' in that, at the cost of an extra comparison, will assert the min and max bounds are placed where they should be when the actual pin is executed.
Function Documentation
const T& adobe::pin |
( |
const T & |
min, |
|
|
const T & |
x, |
|
|
const T & |
max, |
|
|
R |
r |
|
) |
| |
pin implementation
Definition at line 53 of file pin.hpp.
const T& adobe::pin |
( |
const T & |
min, |
|
|
const T & |
x, |
|
|
const T & |
max |
|
) |
| |
pin implementation
Definition at line 63 of file pin.hpp.
const T& adobe::pin_safe |
( |
const T & |
min, |
|
|
const T & |
x, |
|
|
const T & |
max, |
|
|
R |
r |
|
) |
| |
pin_safe implementation
Definition at line 74 of file pin.hpp.
const T& adobe::pin_safe |
( |
const T & |
min, |
|
|
const T & |
x, |
|
|
const T & |
max |
|
) |
| |
pin_safe implementation
Definition at line 84 of file pin.hpp.