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

Clamping
[Library Functions]


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 T> ShGeneric< N, T > SH::mod (const ShGeneric< N, T > &left, const ShGeneric< N, T > &right)
 Float modulus.

template<int N, typename T> ShGeneric< N, T > mod (const ShGeneric< N, T > &left, const ShGeneric< 1, T > &right)
template<typename T> ShGeneric< 1, T > mod (const ShGeneric< 1, T > &left, const ShGeneric< 1, T > &right)
template<int N, typename T> ShGeneric< N, T > operator% (const ShGeneric< N, T > &left, const ShGeneric< N, T > &right)
template<int N, typename T> ShGeneric< N, T > operator% (const ShGeneric< N, T > &left, const ShGeneric< 1, T > &right)
template<typename T> ShGeneric< 1, T > operator% (const ShGeneric< 1, T > &left, const ShGeneric< 1, T > &right)
 SH_SHLIB_CONST_SCALAR_OP (mod)
 SH_SHLIB_CONST_N_OP_LEFT (mod)
 SH_SHLIB_CONST_SCALAR_OP (operator%)
 SH_SHLIB_CONST_N_OP_LEFT (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 T> ShGeneric< N, T > SH::max (const ShGeneric< N, T > &left, const ShGeneric< N, T > &right)
 Maximum.

 SH_SHLIB_CONST_SCALAR_OP (max)
template<int N, typename T> ShGeneric< N, T > SH::min (const ShGeneric< N, T > &left, const ShGeneric< N, T > &right)
 Minimum.

 SH_SHLIB_CONST_SCALAR_OP (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 T> ShGeneric< N, T > SH::clamp (const ShGeneric< N, T > &a, const ShGeneric< N, T > &b, const ShGeneric< N, T > &c)
 Componentwise clamping.

template<int N, typename T> ShGeneric< N, T > clamp (const ShGeneric< N, T > &a, const ShGeneric< 1, T > &b, const ShGeneric< 1, T > &c)
template<typename T> ShGeneric< 1, T > clamp (const ShGeneric< 1, T > &a, const ShGeneric< 1, T > &b, const ShGeneric< 1, T > &c)
 SH_SHLIB_CONST_TRINARY_OP_011 (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 T>
ShGeneric< N, T > SH::clamp const ShGeneric< N, T > &  a,
const ShGeneric< N, T > &  b,
const ShGeneric< N, T > &  c
[inline]
 

Componentwise clamping.

Clamps a between b and c.

Definition at line 195 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 119 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 T>
ShGeneric< N, T > SH::max const ShGeneric< N, T > &  left,
const ShGeneric< N, T > &  right
[inline]
 

Maximum.

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

Definition at line 135 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 T>
ShGeneric< N, T > SH::min const ShGeneric< N, T > &  left,
const ShGeneric< N, T > &  right
[inline]
 

Minimum.

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

Definition at line 144 of file ShLibClampImpl.hpp.

Referenced by SH::clamp(), ShUtil::groupEvenOddSort(), SH::min(), SH::operator &&(), and SH::sat().

template<int N, typename T>
ShGeneric< N, T > SH::mod const ShGeneric< N, T > &  left,
const ShGeneric< N, T > &  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 128 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 218 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 225 of file ShLibClampImpl.hpp.


Generated on Fri Nov 5 16:51:41 2004 for Sh by doxygen 1.3.7