Adobe Source Libraries 1.49.0
A collection of C++ libraries.
Loading...
Searching...
No Matches

Functions

template<typename T, typename R>
const T & pin (const T &min, const T &x, const T &max, R r)
 pin implementation
template<typename T>
const T & pin (const T &min, const T &x, const T &max)
 pin implementation
template<typename T, typename R>
const T & pin_safe (const T &min, const T &x, const T &max, R r)
 pin_safe implementation
template<typename T, typename R>
const T & pin_safe (const T &min, const T &x, const T &max)
 pin_safe implementation

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

◆ pin() [1/2]

template<typename T, typename R>
const T & pin ( const T & min,
const T & x,
const T & max,
R r )

Definition at line 53 of file pin.hpp.

◆ pin() [2/2]

template<typename T>
const T & pin ( const T & min,
const T & x,
const T & max )

Definition at line 64 of file pin.hpp.

◆ pin_safe() [1/2]

template<typename T, typename R>
const T & pin_safe ( const T & min,
const T & x,
const T & max,
R r )

Definition at line 76 of file pin.hpp.

◆ pin_safe() [2/2]

template<typename T, typename R>
const T & pin_safe ( const T & min,
const T & x,
const T & max )

Definition at line 87 of file pin.hpp.