Math API nvidia_logo_transpbg.gif Up
spectrum.h File Reference

Spectrum class with floating point elements and operations. More...

Go to the source code of this file.

Classes

class  mi::math::Spectrum
 Spectrum with floating point elements and operations. More...
 

Namespaces

namespace  mi
 Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH.
 
namespace  mi::math
 Namespace for the Math API.
 

Functions

bool mi::math::operator== (const Spectrum &lhs, const Spectrum &rhs)
 Returns true if lhs is elementwise equal to rhs. More...
 
bool mi::math::operator!= (const Spectrum &lhs, const Spectrum &rhs)
 Returns true if lhs is elementwise not equal to rhs. More...
 
bool mi::math::operator< (const Spectrum &lhs, const Spectrum &rhs)
 Returns true if lhs is lexicographically less than rhs. More...
 
bool mi::math::operator<= (const Spectrum &lhs, const Spectrum &rhs)
 Returns true if lhs is lexicographically less than or equal to rhs. More...
 
bool mi::math::operator> (const Spectrum &lhs, const Spectrum &rhs)
 Returns true if lhs is lexicographically greater than rhs. More...
 
bool mi::math::operator>= (const Spectrum &lhs, const Spectrum &rhs)
 Returns true if lhs is lexicographically greater than or equal to rhs. More...
 
Spectrum & mi::math::operator+= (Spectrum &lhs, const Spectrum &rhs)
 Adds rhs elementwise to lhs and returns the modified lhs. More...
 
Spectrum & mi::math::operator-= (Spectrum &lhs, const Spectrum &rhs)
 Subtracts rhs elementwise from lhs and returns the modified lhs. More...
 
Spectrum & mi::math::operator*= (Spectrum &lhs, const Spectrum &rhs)
 Multiplies rhs elementwise with lhs and returns the modified lhs. More...
 
Spectrum & mi::math::operator/= (Spectrum &lhs, const Spectrum &rhs)
 Divides lhs elementwise by rhs and returns the modified lhs. More...
 
Spectrum mi::math::operator+ (const Spectrum &lhs, const Spectrum &rhs)
 Adds lhs and rhs elementwise and returns the new result. More...
 
Spectrum mi::math::operator- (const Spectrum &lhs, const Spectrum &rhs)
 Subtracts rhs elementwise from lhs and returns the new result. More...
 
Spectrum mi::math::operator* (const Spectrum &lhs, const Spectrum &rhs)
 Multiplies rhs elementwise with lhs and returns the new result. More...
 
Spectrum mi::math::operator/ (const Spectrum &lhs, const Spectrum &rhs)
 Divides rhs elementwise by lhs and returns the new result. More...
 
Spectrum mi::math::operator- (const Spectrum &c)
 Negates the spectrum c elementwise and returns the new result. More...
 
Spectrum & mi::math::operator*= (Spectrum &c, Float32 s)
 Multiplies the spectrum c elementwise with the scalar s and returns the modified spectrum c. More...
 
Spectrum & mi::math::operator/= (Spectrum &c, Float32 s)
 Divides the spectrum c elementwise by the scalar s and returns the modified spectrum c. More...
 
Spectrum mi::math::operator* (const Spectrum &c, Float32 s)
 Multiplies the spectrum c elementwise with the scalar s and returns the new result. More...
 
Spectrum mi::math::operator* (Float32 s, const Spectrum &c)
 Multiplies the spectrum c elementwise with the scalar s and returns the new result. More...
 
Spectrum mi::math::operator/ (const Spectrum &c, Float32 s)
 Divides the spectrum c elementwise by the scalar s and returns the new result. More...
 
Spectrum mi::math::abs (const Spectrum &c)
 Returns a spectrum with the elementwise absolute values of the spectrum c. More...
 
Spectrum mi::math::acos (const Spectrum &c)
 Returns a spectrum with the elementwise arc cosine of the spectrum c. More...
 
bool mi::math::all (const Spectrum &c)
 Returns true if all elements of c are not equal to zero. More...
 
bool mi::math::any (const Spectrum &c)
 Returns true if any element of c is not equal to zero. More...
 
Spectrum mi::math::asin (const Spectrum &c)
 Returns a spectrum with the elementwise arc sine of the spectrum c. More...
 
Spectrum mi::math::atan (const Spectrum &c)
 Returns a spectrum with the elementwise arc tangent of the spectrum c. More...
 
Spectrum mi::math::atan2 (const Spectrum &c, const Spectrum &d)
 Returns a spectrum with the elementwise arc tangent of the spectrum c / d. More...
 
Spectrum mi::math::ceil (const Spectrum &c)
 Returns a spectrum with the elementwise smallest integral value that is not less than the element in spectrum c. More...
 
Spectrum mi::math::clamp (const Spectrum &c, const Spectrum &low, const Spectrum &high)
 Returns the spectrum c elementwise clamped to the range [low, high]. More...
 
Spectrum mi::math::clamp (const Spectrum &c, const Spectrum &low, Float32 high)
 Returns the spectrum c elementwise clamped to the range [low, high]. More...
 
Spectrum mi::math::clamp (const Spectrum &c, Float32 low, const Spectrum &high)
 Returns the spectrum c elementwise clamped to the range [low, high]. More...
 
Spectrum mi::math::clamp (const Spectrum &c, Float32 low, Float32 high)
 Returns the spectrum c elementwise clamped to the range [low, high]. More...
 
Spectrum mi::math::cos (const Spectrum &c)
 Returns a spectrum with the elementwise cosine of the spectrum c. More...
 
Spectrum mi::math::degrees (const Spectrum &c)
 Converts elementwise radians in c to degrees. More...
 
Spectrum mi::math::elementwise_max (const Spectrum &lhs, const Spectrum &rhs)
 Returns elementwise max for each element in spectrum lhs that is less than the corresponding element in spectrum rhs. More...
 
Spectrum mi::math::elementwise_min (const Spectrum &lhs, const Spectrum &rhs)
 Returns elementwise min for each element in spectrum lhs that is less than the corresponding element in spectrum rhs. More...
 
Spectrum mi::math::exp (const Spectrum &c)
 Returns a spectrum with elementwise e to the power of the element in the spectrum c. More...
 
Spectrum mi::math::exp2 (const Spectrum &c)
 Returns a spectrum with elementwise 2 to the power of the element in the spectrum c. More...
 
Spectrum mi::math::floor (const Spectrum &c)
 Returns a spectrum with the elementwise largest integral value that is not greater than the element in spectrum c. More...
 
Spectrum mi::math::fmod (const Spectrum &a, const Spectrum &b)
 Returns elementwise a modulo b, in other words, the remainder of a/b. More...
 
Spectrum mi::math::fmod (const Spectrum &a, Float32 b)
 Returns elementwise a modulo b, in other words, the remainder of a/b. More...
 
Spectrum mi::math::frac (const Spectrum &c)
 Returns a spectrum with the elementwise positive fractional part of the spectrum c. More...
 
Spectrum mi::math::gamma_correction (const Spectrum &spectrum, Float32 gamma_factor)
 Returns a gamma corrected spectrum. More...
 
bool mi::math::is_approx_equal (const Spectrum &lhs, const Spectrum &rhs, Float32 e)
 Compares the two given values elementwise for equality within the given epsilon. More...
 
Spectrum mi::math::lerp (const Spectrum &c1, const Spectrum &c2, const Spectrum &t)
 Returns the elementwise linear interpolation between c1 and c2, i.e., it returns (1-t) * c1 + t * c2. More...
 
Spectrum mi::math::lerp (const Spectrum &c1, const Spectrum &c2, Float32 t)
 Returns the linear interpolation between c1 and c2, i.e., it returns (1-t) * c1 + t * c2. More...
 
Spectrum mi::math::log (const Spectrum &c)
 Returns a spectrum with elementwise natural logarithm of the spectrum c. More...
 
Spectrum mi::math::log2 (const Spectrum &c)
 Returns a spectrum with elementwise base 2 logarithm of the spectrum c. More...
 
Spectrum mi::math::log10 (const Spectrum &c)
 Returns a spectrum with elementwise base 10 logarithm of the spectrum c. More...
 
Spectrum mi::math::modf (const Spectrum &c, Spectrum &i)
 Returns the elementwise fractional part of c and stores the elementwise integral part of c in i. More...
 
Spectrum mi::math::pow (const Spectrum &a, const Spectrum &b)
 Returns the spectrum a elementwise to the power of b. More...
 
Spectrum mi::math::pow (const Spectrum &a, Float32 b)
 Returns the spectrum a elementwise to the power of b. More...
 
Spectrum mi::math::radians (const Spectrum &c)
 Converts elementwise degrees in c to radians. More...
 
Spectrum mi::math::round (const Spectrum &c)
 Returns a spectrum with the elements of spectrum c rounded to nearest integers. More...
 
Spectrum mi::math::rsqrt (const Spectrum &c)
 Returns the reciprocal of the square root of each element of c. More...
 
Spectrum mi::math::saturate (const Spectrum &c)
 Returns the spectrum c clamped elementwise to the range [0,1]. More...
 
Spectrum mi::math::sign (const Spectrum &c)
 Returns the elementwise sign of spectrum c. More...
 
Spectrum mi::math::sin (const Spectrum &c)
 Returns a spectrum with the elementwise sine of the spectrum c. More...
 
void mi::math::sincos (const Spectrum &a, Spectrum &s, Spectrum &c)
 Computes elementwise the sine s and cosine c of angles a simultaneously. More...
 
Spectrum mi::math::smoothstep (const Spectrum &a, const Spectrum &b, const Spectrum &c)
 Returns 0 if c is less than a and 1 if c is greater than b in an elementwise fashion. More...
 
Spectrum mi::math::smoothstep (const Spectrum &a, const Spectrum &b, Float32 x)
 Returns 0 if c is less than a and 1 if c is greater than b in an elementwise fashion. More...
 
Spectrum mi::math::sqrt (const Spectrum &c)
 Returns the square root of each element of c. More...
 
Spectrum mi::math::step (const Spectrum &a, const Spectrum &c)
 Returns elementwise 0 if c is less than a and 1 otherwise. More...
 
Spectrum mi::math::tan (const Spectrum &c)
 Returns a spectrum with the elementwise tangent of the spectrum c. More...
 
bool mi::math::isfinite (const Spectrum &c)
 Indicates whether all components of the spectrum are finite. More...
 
bool mi::math::isinfinite (const Spectrum &c)
 Indicates whether any component of the spectrum is infinite. More...
 
bool mi::math::isnan (const Spectrum &c)
 Indicates whether any component of the spectrum is "not a number". More...
 
MI_HOST_DEVICE_INLINE void mi::math::to_rgbe (const Spectrum &c, Uint32 &rgbe)
 Encodes a spectrum into RGBE representation. More...
 
MI_HOST_DEVICE_INLINE void mi::math::to_rgbe (const Spectrum &c, Uint8 rgbe[4])
 Encodes a spectrum into RGBE representation. More...
 
MI_HOST_DEVICE_INLINE void mi::math::from_rgbe (const Uint8 rgbe[4], Spectrum &c)
 Decodes a color from RGBE representation. More...
 
MI_HOST_DEVICE_INLINE void mi::math::from_rgbe (const Uint32 rgbe, Spectrum &c)
 Decodes a color from RGBE representation. More...
 

Detailed Description

Spectrum class with floating point elements and operations.

See Spectrum Class.