Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Clamping
[Library Functions]

Collaboration diagram for Clamping:


Functions

template<int N, typename T>
ShGeneric< N, T > SH::abs (const ShGeneric< N, T > &var)
 Absolute value.
template<int N, typename T>
ShGeneric< N, T > SH::ceil (const ShGeneric< N, T > &var)
 Ceiling.
template<int N, typename T>
ShGeneric< N, T > SH::floor (const ShGeneric< N, T > &var)
 Floor.
template<int N, typename T>
ShGeneric< N, T > SH::round (const ShGeneric< N, T > &var)
 Round.
template<int N, typename T1, typename T2>
ShGeneric< N, CT1T2 > SH::mod (const ShGeneric< N, T1 > &left, const ShGeneric< N, T2 > &right)
 Float modulus.
template<int N, typename T1, typename T2>
ShGeneric< N, CT1T2 > mod (const ShGeneric< N, T1 > &left, const ShGeneric< 1, T2 > &right)
template<typename T1, typename T2>
ShGeneric< 1, CT1T2 > mod (const ShGeneric< 1, T1 > &left, const ShGeneric< 1, T2 > &right)
template<int N, typename T1, typename T2>
ShGeneric< N, CT1T2 > operator% (const ShGeneric< N, T1 > &left, const ShGeneric< N, T2 > &right)
template<int N, typename T1, typename T2>
ShGeneric< N, CT1T2 > operator% (const ShGeneric< N, T1 > &left, const ShGeneric< 1, T2 > &right)
template<typename T1, typename T2>
ShGeneric< 1, CT1T2 > operator% (const ShGeneric< 1, T1 > &left, const ShGeneric< 1, T2 > &right)
 SH_SHLIB_CONST_SCALAR_OP_DECL (mod)
 SH_SHLIB_CONST_N_OP_LEFT_DECL (mod)
 SH_SHLIB_CONST_SCALAR_OP_DECL (operator%)
 SH_SHLIB_CONST_N_OP_LEFT_DECL (operator%)
template<int N, typename T>
ShGeneric< N, T > SH::frac (const ShGeneric< N, T > &var)
 Fractional part.
template<int N, typename T>
ShGeneric< N, T > SH::pos (const ShGeneric< N, T > &x)
 Take positive part.
template<int N, typename T1, typename T2>
ShGeneric< N, CT1T2 > SH::max (const ShGeneric< N, T1 > &left, const ShGeneric< N, T2 > &right)
 Maximum.
 SH_SHLIB_CONST_SCALAR_OP_DECL (max)
template<int N, typename T1, typename T2>
ShGeneric< N, CT1T2 > SH::min (const ShGeneric< N, T1 > &left, const ShGeneric< N, T2 > &right)
 Minimum.
 SH_SHLIB_CONST_SCALAR_OP_DECL (min)
template<int N, typename T>
ShGeneric< 1, T > SH::max (const ShGeneric< N, T > &a)
 Maximum of all components.
template<int N, typename T>
ShGeneric< 1, T > SH::min (const ShGeneric< N, T > &a)
 Minimum of all components.
template<int N, typename T1, typename T2, typename T3>
ShGeneric< N, CT1T2T3 > SH::clamp (const ShGeneric< N, T1 > &a, const ShGeneric< N, T2 > &b, const ShGeneric< N, T3 > &c)
 Componentwise clamping.
template<int N, typename T1, typename T2, typename T3>
ShGeneric< N, CT1T2T3 > clamp (const ShGeneric< N, T1 > &a, const ShGeneric< 1, T2 > &b, const ShGeneric< 1, T3 > &c)
template<typename T1, typename T2, typename T3>
ShGeneric< 1, CT1T2T3 > clamp (const ShGeneric< 1, T1 > &a, const ShGeneric< 1, T2 > &b, const ShGeneric< 1, T3 > &c)
 SH_SHLIB_CONST_TRINARY_OP_011_DECL (clamp)
template<int N, typename T>
ShGeneric< N, T > SH::sat (const ShGeneric< N, T > &a)
 Componentwise saturation.
template<int N, typename T>
ShGeneric< N, T > SH::sign (const ShGeneric< N, T > &var)
 Componentwise sign.

Detailed Description

Various operations that reduce information in values somehow, e.g. clamping them to ranges, throwing away their sign, or selecting one out of two tuples.

Function Documentation

template<int N, typename T>
ShGeneric< N, T > SH::abs const ShGeneric< N, T > &  var  )  [inline]
 

Absolute value.

Returns the magnitude. Operates componentwise on tuples.

Definition at line 39 of file ShLibClampImpl.hpp.

Referenced by ShUtil::distance(), SH::fwidth(), ShUtil::lInfDistance(), ShUtil::lOneDistance(), and ShUtil::sturbulence().

template<int N, typename T>
ShGeneric< N, T > SH::ceil const ShGeneric< N, T > &  var  )  [inline]
 

Ceiling.

Returns the least integer >= argument. Operates componentwise on tuples.

Definition at line 48 of file ShLibClampImpl.hpp.

template<int N, typename T1, typename T2, typename T3>
ShGeneric< N, CT1T2T3 > SH::clamp const ShGeneric< N, T1 > &  a,
const ShGeneric< N, T2 > &  b,
const ShGeneric< N, T3 > &  c
[inline]
 

Componentwise clamping.

Clamps a between b and c.

Definition at line 201 of file ShLibClampImpl.hpp.

References SH::max(), and SH::min().

Referenced by SH::refract(), and ShUtil::smoothstep().

template<int N, typename T>
ShGeneric< N, T > SH::floor const ShGeneric< N, T > &  var  )  [inline]
 

Floor.

Returns the greatest integer <= argument. Operates componentwise on tuples.

Definition at line 57 of file ShLibClampImpl.hpp.

Referenced by ShUtil::ShNoise< M, T, P >::cellnoise(), and ShUtil::ShNoise< M, T, P >::perlin().

template<int N, typename T>
ShGeneric< N, T > SH::frac const ShGeneric< N, T > &  var  )  [inline]
 

Fractional part.

Discards the integer part of each componenent in var.

Definition at line 123 of file ShLibClampImpl.hpp.

Referenced by ShUtil::ShNoise< M, T, P >::cellnoise(), ShUtil::hashlcg(), ShUtil::hashmrg(), and ShUtil::ShNoise< M, T, P >::perlin().

template<int N, typename T1, typename T2>
ShGeneric< N, CT1T2 > SH::max const ShGeneric< N, T1 > &  left,
const ShGeneric< N, T2 > &  right
[inline]
 

Maximum.

Creates a tuple of componentwise maximums of a pair of input tuples.

Definition at line 139 of file ShLibClampImpl.hpp.

Referenced by SH::clamp(), SH::fwidth(), ShUtil::groupEvenOddSort(), ShUtil::lInfDistance(), SH::max(), SH::operator||(), and SH::pos().

template<int N, typename T1, typename T2>
ShGeneric< N, CT1T2 > SH::min const ShGeneric< N, T1 > &  left,
const ShGeneric< N, T2 > &  right
[inline]
 

Minimum.

Creates a tuple of componentwise minimums of a pair of input tuples.

Definition at line 149 of file ShLibClampImpl.hpp.

Referenced by SH::cast(), ShUtil::groupEvenOddSort(), and SH::min().

template<int N, typename T1, typename T2>
ShGeneric< N, CT1T2 > SH::mod const ShGeneric< N, T1 > &  left,
const ShGeneric< N, T2 > &  right
[inline]
 

Float modulus.

The result is always positive.

Definition at line 75 of file ShLibClampImpl.hpp.

template<int N, typename T>
ShGeneric< N, T > SH::pos const ShGeneric< N, T > &  x  )  [inline]
 

Take positive part.

Clamps a value to zero if it is negative. This is useful to wrap dot products in lighting models.

Definition at line 132 of file ShLibClampImpl.hpp.

References SH::max().

Referenced by SH::lit().

template<int N, typename T>
ShGeneric< N, T > SH::round const ShGeneric< N, T > &  var  )  [inline]
 

Round.

Returns the nearest integer to the argument. Operates componentwise on tuples.

Definition at line 66 of file ShLibClampImpl.hpp.

template<int N, typename T>
ShGeneric< N, T > SH::sat const ShGeneric< N, T > &  a  )  [inline]
 

Componentwise saturation.

Equivalent to componentwise minimum with 1.

Definition at line 225 of file ShLibClampImpl.hpp.

References SH::min().

template<int N, typename T>
ShGeneric< N, T > SH::sign const ShGeneric< N, T > &  var  )  [inline]
 

Componentwise sign.

Returns -1.0 if argument is less than 0.0, 1.0 if argument is greater than 0.0, 0.0 otherwise. Operates componentwise on tuples.

Definition at line 232 of file ShLibClampImpl.hpp.


Generated on Mon Jan 24 18:37:59 2005 for Sh by  doxygen 1.4.1