stlab.adobe.com Adobe Systems Incorporated

Functions

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

Detailed Description

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:

Function Documentation

const T& adobe::clamp ( const T &  x,
const T &  min,
const T &  max,
r 
)

clamp implementation

Precondition:
!r(max, min)

Definition at line 46 of file clamp.hpp.

const T& adobe::clamp ( const T &  x,
const T &  min,
const T &  max 
)

clamp implementation

Precondition:
!(max < min)

Definition at line 58 of file clamp.hpp.

const T& adobe::clamp_unordered ( const T &  x,
const T &  min,
const T &  max,
r 
)

clamp_unordered implementation

Definition at line 69 of file clamp.hpp.

const T& adobe::clamp_unordered ( const T &  x,
const T &  min,
const T &  max 
)

clamp_unordered implementation

Definition at line 78 of file clamp.hpp.

Copyright © 2006-2007 Adobe Systems Incorporated.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.

Search powered by Google