DiCE API nvidia_logo_transpbg.gif Up
Spectrum Class

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

Classes

struct  mi::math::Spectrum_struct
 Generic storage class template for a Spectrum representation storing three floating point elements. More...
 
class  mi::math::Spectrum
 Spectrum with floating point elements and operations. More...
 

Typedefs

typedef Spectrum_struct mi::math::Spectrum::Pod_type
 POD class corresponding to this spectrum. More...
 
typedef Spectrum_struct mi::math::Spectrum::storage_type
 Storage class used by this spectrum. More...
 
typedef Float32 mi::math::Spectrum::value_type
 Element type. More...
 
typedef Size mi::math::Spectrum::size_type
 Size type, unsigned. More...
 
typedef Difference mi::math::Spectrum::difference_type
 Difference type, signed. More...
 
typedef Float32mi::math::Spectrum::pointer
 Mutable pointer to element. More...
 
typedef const Float32mi::math::Spectrum::const_pointer
 Const pointer to element. More...
 
typedef Float32mi::math::Spectrum::reference
 Mutable reference to element. More...
 
typedef const Float32mi::math::Spectrum::const_reference
 Const reference to element. More...
 

Functions

static Size mi::math::Spectrum::size ()
 Constant size of the spectrum. More...
 
static Size mi::math::Spectrum::max_size ()
 Constant maximum size of the spectrum. More...
 
Float32mi::math::Spectrum::begin ()
 Returns the pointer to the first spectrum element. More...
 
const Float32mi::math::Spectrum::begin () const
 Returns the pointer to the first spectrum element. More...
 
Float32mi::math::Spectrum::end ()
 Returns the past-the-end pointer. More...
 
const Float32mi::math::Spectrum::end () const
 Returns the past-the-end pointer. More...
 
 mi::math::Spectrum::Spectrum ()
 The default constructor leaves the spectrum elements uninitialized. More...
 
 mi::math::Spectrum::Spectrum (const Spectrum &s)=default
 Default copy constructor. More...
 
Spectrummi::math::Spectrum::operator= (const Spectrum &s)=default
 Default assignment operator. More...
 
 mi::math::Spectrum::Spectrum (const Spectrum_struct &s)
 Constructor from underlying storage type. More...
 
 mi::math::Spectrum::Spectrum (const Float32 s)
 Constructor initializes all vector elements to the value s. More...
 
 mi::math::Spectrum::Spectrum (Float32 nr, Float32 ng, Float32 nb)
 Constructor initializes (r,g,b) from (nr,ng,nb). More...
 
 mi::math::Spectrum::Spectrum (const Vector< Float32, 3 > &v3)
 Conversion from Vector<Float32,3>. More...
 
 mi::math::Spectrum::Spectrum (const Vector< Float32, 4 > &v4)
 Conversion from Vector<Float32,4>. More...
 
 mi::math::Spectrum::Spectrum (const Color &col)
 Conversion from Color. More...
 
Vector< Float32, 3 > mi::math::Spectrum::to_vector3 () const
 Conversion to Vector<Float32,3>. More...
 
Vector< Float32, 4 > mi::math::Spectrum::to_vector4 () const
 Conversion to Vector<Float32,4>. More...
 
MI_HOST_DEVICE_INLINE const Float32mi::math::Spectrum::operator[] (Size i) const
 Accesses the i-th spectrum element, 0 <= i < 3. More...
 
MI_HOST_DEVICE_INLINE Float32mi::math::Spectrum::operator[] (Size i)
 Accesses the i-th spectrum element, 0 <= i < 3. More...
 
Float32 mi::math::Spectrum::get (Size i) const
 Returns the i-th spectrum element, 0 <= i < 3. More...
 
void mi::math::Spectrum::set (Size i, Float32 value)
 Sets the i-th spectrum element to value, 0 <= i < 3. More...
 
bool mi::math::Spectrum::is_black () const
 Returns true if the spectrum is black ignoring the alpha value. More...
 
Float32 mi::math::Spectrum::linear_intensity () const
 Returns the intensity of the RGB components, equally weighted. More...
 
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...
 
Spectrummi::math::operator+= (Spectrum &lhs, const Spectrum &rhs)
 Adds rhs elementwise to lhs and returns the modified lhs. More...
 
Spectrummi::math::operator-= (Spectrum &lhs, const Spectrum &rhs)
 Subtracts rhs elementwise from lhs and returns the modified lhs. More...
 
Spectrummi::math::operator*= (Spectrum &lhs, const Spectrum &rhs)
 Multiplies rhs elementwise with lhs and returns the modified lhs. More...
 
Spectrummi::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...
 
Spectrummi::math::operator*= (Spectrum &c, Float32 s)
 Multiplies the spectrum c elementwise with the scalar s and returns the modified spectrum c. More...
 
Spectrummi::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...
 

Variables

static const Size mi::math::Spectrum::SIZE = 3
 Constant size of the spectrum. More...
 

Detailed Description

Spectrum class with floating point elements and operations.

Include File:
#include <mi/math/spectrum.h>

Typedef Documentation

 const_pointer

Const pointer to element.

 const_reference

Const reference to element.

 difference_type

Difference type, signed.

 Pod_type

POD class corresponding to this spectrum.

 pointer

Mutable pointer to element.

 reference

Mutable reference to element.

 size_type

Size type, unsigned.

 storage_type

Storage class used by this spectrum.

 value_type

Element type.

Function Documentation

 abs()

Spectrum mi::math::abs ( const Spectrum c)
inline

Returns a spectrum with the elementwise absolute values of the spectrum c.

 acos()

Spectrum mi::math::acos ( const Spectrum c)
inline

Returns a spectrum with the elementwise arc cosine of the spectrum c.

 all()

bool mi::math::all ( const Spectrum c)
inline

Returns true if all elements of c are not equal to zero.

 any()

bool mi::math::any ( const Spectrum c)
inline

Returns true if any element of c is not equal to zero.

 asin()

Spectrum mi::math::asin ( const Spectrum c)
inline

Returns a spectrum with the elementwise arc sine of the spectrum c.

 atan()

Spectrum mi::math::atan ( const Spectrum c)
inline

Returns a spectrum with the elementwise arc tangent of the spectrum c.

 atan2()

Spectrum mi::math::atan2 ( const Spectrum c,
const Spectrum d 
)
inline

Returns a spectrum with the elementwise arc tangent of the spectrum c / d.

The signs of the elements of c and d are used to determine the quadrant of the results.

 begin() [1/2]

Float32 * mi::math::Spectrum::begin ( )
inline

Returns the pointer to the first spectrum element.

 begin() [2/2]

const Float32 * mi::math::Spectrum::begin ( ) const
inline

Returns the pointer to the first spectrum element.

 ceil()

Spectrum mi::math::ceil ( const Spectrum c)
inline

Returns a spectrum with the elementwise smallest integral value that is not less than the element in spectrum c.

 clamp() [1/4]

Spectrum mi::math::clamp ( const Spectrum c,
const Spectrum low,
const Spectrum high 
)
inline

Returns the spectrum c elementwise clamped to the range [low, high].

 clamp() [2/4]

Spectrum mi::math::clamp ( const Spectrum c,
const Spectrum low,
Float32  high 
)
inline

Returns the spectrum c elementwise clamped to the range [low, high].

 clamp() [3/4]

Spectrum mi::math::clamp ( const Spectrum c,
Float32  low,
const Spectrum high 
)
inline

Returns the spectrum c elementwise clamped to the range [low, high].

 clamp() [4/4]

Spectrum mi::math::clamp ( const Spectrum c,
Float32  low,
Float32  high 
)
inline

Returns the spectrum c elementwise clamped to the range [low, high].

 cos()

Spectrum mi::math::cos ( const Spectrum c)
inline

Returns a spectrum with the elementwise cosine of the spectrum c.

 degrees()

Spectrum mi::math::degrees ( const Spectrum c)
inline

Converts elementwise radians in c to degrees.

 elementwise_max()

Spectrum mi::math::elementwise_max ( const Spectrum lhs,
const Spectrum rhs 
)
inline

Returns elementwise max for each element in spectrum lhs that is less than the corresponding element in spectrum rhs.

 elementwise_min()

Spectrum mi::math::elementwise_min ( const Spectrum lhs,
const Spectrum rhs 
)
inline

Returns elementwise min for each element in spectrum lhs that is less than the corresponding element in spectrum rhs.

 end() [1/2]

Float32 * mi::math::Spectrum::end ( )
inline

Returns the past-the-end pointer.

The range [begin(),end()) forms the range over all spectrum elements.

 end() [2/2]

const Float32 * mi::math::Spectrum::end ( ) const
inline

Returns the past-the-end pointer.

The range [begin(),end()) forms the range over all spectrum elements.

 exp()

Spectrum mi::math::exp ( const Spectrum c)
inline

Returns a spectrum with elementwise e to the power of the element in the spectrum c.

 exp2()

Spectrum mi::math::exp2 ( const Spectrum c)
inline

Returns a spectrum with elementwise 2 to the power of the element in the spectrum c.

 floor()

Spectrum mi::math::floor ( const Spectrum c)
inline

Returns a spectrum with the elementwise largest integral value that is not greater than the element in spectrum c.

 fmod() [1/2]

Spectrum mi::math::fmod ( const Spectrum a,
const Spectrum b 
)
inline

Returns elementwise a modulo b, in other words, the remainder of a/b.

The elementwise result has the same sign as a.

 fmod() [2/2]

Spectrum mi::math::fmod ( const Spectrum a,
Float32  b 
)
inline

Returns elementwise a modulo b, in other words, the remainder of a/b.

The elementwise result has the same sign as a.

 frac()

Spectrum mi::math::frac ( const Spectrum c)
inline

Returns a spectrum with the elementwise positive fractional part of the spectrum c.

 from_rgbe() [1/2]

MI_HOST_DEVICE_INLINE void mi::math::from_rgbe ( const Uint32  rgbe,
Spectrum c 
)

Decodes a color from RGBE representation.

 from_rgbe() [2/2]

MI_HOST_DEVICE_INLINE void mi::math::from_rgbe ( const Uint8  rgbe[4],
Spectrum c 
)

Decodes a color from RGBE representation.

 gamma_correction()

Spectrum mi::math::gamma_correction ( const Spectrum spectrum,
Float32  gamma_factor 
)
inline

Returns a gamma corrected spectrum.

Gamma factors are used to correct for non-linear input and output devices; for example, monitors typically have gamma factors between 1.7 and 2.2, meaning that one-half of the peak voltage does not give one half of the brightness. This is corrected for by raising the spectrum components to the gamma exponent. Gamma factors greater than 1 make an image brighter; less than 1 make it darker. The inverse of gamma_correction(factor) is gamma_correction(1.0/factor).

Parameters
spectrumspectrum to be corrected
gamma_factorgamma factor, must be greater than zero.

 get()

Float32 mi::math::Spectrum::get ( Size  i) const
inline

Returns the i-th spectrum element, 0 <= i < 3.

 is_approx_equal()

bool mi::math::is_approx_equal ( const Spectrum lhs,
const Spectrum rhs,
Float32  e 
)
inline

Compares the two given values elementwise for equality within the given epsilon.

 is_black()

bool mi::math::Spectrum::is_black ( ) const
inline

Returns true if the spectrum is black ignoring the alpha value.

 isfinite()

bool mi::math::isfinite ( const Spectrum c)
inline

Indicates whether all components of the spectrum are finite.

 isinfinite()

bool mi::math::isinfinite ( const Spectrum c)
inline

Indicates whether any component of the spectrum is infinite.

 isnan()

bool mi::math::isnan ( const Spectrum c)
inline

Indicates whether any component of the spectrum is "not a number".

 lerp() [1/2]

Spectrum mi::math::lerp ( const Spectrum c1,
const Spectrum c2,
const Spectrum t 
)
inline

Returns the elementwise linear interpolation between c1 and c2, i.e., it returns (1-t) * c1 + t * c2.

Parameters
c1one spectrum
c2second spectrum
tinterpolation parameter in [0,1]

 lerp() [2/2]

Spectrum mi::math::lerp ( const Spectrum c1,
const Spectrum c2,
Float32  t 
)
inline

Returns the linear interpolation between c1 and c2, i.e., it returns (1-t) * c1 + t * c2.

Parameters
c1one spectrum
c2second spectrum
tinterpolation parameter in [0,1]

 linear_intensity()

Float32 mi::math::Spectrum::linear_intensity ( ) const
inline

Returns the intensity of the RGB components, equally weighted.

 log()

Spectrum mi::math::log ( const Spectrum c)
inline

Returns a spectrum with elementwise natural logarithm of the spectrum c.

 log10()

Spectrum mi::math::log10 ( const Spectrum c)
inline

Returns a spectrum with elementwise base 10 logarithm of the spectrum c.

 log2()

Spectrum mi::math::log2 ( const Spectrum c)
inline

Returns a spectrum with elementwise base 2 logarithm of the spectrum c.

 max_size()

static Size mi::math::Spectrum::max_size ( )
inlinestatic

Constant maximum size of the spectrum.

 modf()

Spectrum mi::math::modf ( const Spectrum c,
Spectrum i 
)
inline

Returns the elementwise fractional part of c and stores the elementwise integral part of c in i.

Both parts have elementwise the same sign as c.

 operator!=()

bool mi::math::operator!= ( const Spectrum lhs,
const Spectrum rhs 
)
inline

Returns true if lhs is elementwise not equal to rhs.

 operator*() [1/3]

Spectrum mi::math::operator* ( const Spectrum c,
Float32  s 
)
inline

Multiplies the spectrum c elementwise with the scalar s and returns the new result.

 operator*() [2/3]

Spectrum mi::math::operator* ( const Spectrum lhs,
const Spectrum rhs 
)
inline

Multiplies rhs elementwise with lhs and returns the new result.

 operator*() [3/3]

Spectrum mi::math::operator* ( Float32  s,
const Spectrum c 
)
inline

Multiplies the spectrum c elementwise with the scalar s and returns the new result.

 operator*=() [1/2]

Spectrum & mi::math::operator*= ( Spectrum c,
Float32  s 
)
inline

Multiplies the spectrum c elementwise with the scalar s and returns the modified spectrum c.

 operator*=() [2/2]

Spectrum & mi::math::operator*= ( Spectrum lhs,
const Spectrum rhs 
)
inline

Multiplies rhs elementwise with lhs and returns the modified lhs.

 operator+()

Spectrum mi::math::operator+ ( const Spectrum lhs,
const Spectrum rhs 
)
inline

Adds lhs and rhs elementwise and returns the new result.

 operator+=()

Spectrum & mi::math::operator+= ( Spectrum lhs,
const Spectrum rhs 
)
inline

Adds rhs elementwise to lhs and returns the modified lhs.

 operator-() [1/2]

Spectrum mi::math::operator- ( const Spectrum c)
inline

Negates the spectrum c elementwise and returns the new result.

 operator-() [2/2]

Spectrum mi::math::operator- ( const Spectrum lhs,
const Spectrum rhs 
)
inline

Subtracts rhs elementwise from lhs and returns the new result.

 operator-=()

Spectrum & mi::math::operator-= ( Spectrum lhs,
const Spectrum rhs 
)
inline

Subtracts rhs elementwise from lhs and returns the modified lhs.

 operator/() [1/2]

Spectrum mi::math::operator/ ( const Spectrum c,
Float32  s 
)
inline

Divides the spectrum c elementwise by the scalar s and returns the new result.

 operator/() [2/2]

Spectrum mi::math::operator/ ( const Spectrum lhs,
const Spectrum rhs 
)
inline

Divides rhs elementwise by lhs and returns the new result.

 operator/=() [1/2]

Spectrum & mi::math::operator/= ( Spectrum c,
Float32  s 
)
inline

Divides the spectrum c elementwise by the scalar s and returns the modified spectrum c.

 operator/=() [2/2]

Spectrum & mi::math::operator/= ( Spectrum lhs,
const Spectrum rhs 
)
inline

Divides lhs elementwise by rhs and returns the modified lhs.

 operator<()

bool mi::math::operator< ( const Spectrum lhs,
const Spectrum rhs 
)
inline

Returns true if lhs is lexicographically less than rhs.

See also
Definition: Lexicographic order and comparison

 operator<=()

bool mi::math::operator<= ( const Spectrum lhs,
const Spectrum rhs 
)
inline

Returns true if lhs is lexicographically less than or equal to rhs.

See also
Definition: Lexicographic order and comparison

 operator=()

Spectrum & mi::math::Spectrum::operator= ( const Spectrum s)
default

Default assignment operator.

 operator==()

bool mi::math::operator== ( const Spectrum lhs,
const Spectrum rhs 
)
inline

Returns true if lhs is elementwise equal to rhs.

 operator>()

bool mi::math::operator> ( const Spectrum lhs,
const Spectrum rhs 
)
inline

Returns true if lhs is lexicographically greater than rhs.

See also
Definition: Lexicographic order and comparison

 operator>=()

bool mi::math::operator>= ( const Spectrum lhs,
const Spectrum rhs 
)
inline

Returns true if lhs is lexicographically greater than or equal to rhs.

See also
Definition: Lexicographic order and comparison

 operator[]() [1/2]

MI_HOST_DEVICE_INLINE Float32 & mi::math::Spectrum::operator[] ( Size  i)
inline

Accesses the i-th spectrum element, 0 <= i < 3.

 operator[]() [2/2]

MI_HOST_DEVICE_INLINE const Float32 & mi::math::Spectrum::operator[] ( Size  i) const
inline

Accesses the i-th spectrum element, 0 <= i < 3.

 pow() [1/2]

Spectrum mi::math::pow ( const Spectrum a,
const Spectrum b 
)
inline

Returns the spectrum a elementwise to the power of b.

 pow() [2/2]

Spectrum mi::math::pow ( const Spectrum a,
Float32  b 
)
inline

Returns the spectrum a elementwise to the power of b.

 radians()

Spectrum mi::math::radians ( const Spectrum c)
inline

Converts elementwise degrees in c to radians.

 round()

Spectrum mi::math::round ( const Spectrum c)
inline

Returns a spectrum with the elements of spectrum c rounded to nearest integers.

 rsqrt()

Spectrum mi::math::rsqrt ( const Spectrum c)
inline

Returns the reciprocal of the square root of each element of c.

 saturate()

Spectrum mi::math::saturate ( const Spectrum c)
inline

Returns the spectrum c clamped elementwise to the range [0,1].

 set()

void mi::math::Spectrum::set ( Size  i,
Float32  value 
)
inline

Sets the i-th spectrum element to value, 0 <= i < 3.

 sign()

Spectrum mi::math::sign ( const Spectrum c)
inline

Returns the elementwise sign of spectrum c.

 sin()

Spectrum mi::math::sin ( const Spectrum c)
inline

Returns a spectrum with the elementwise sine of the spectrum c.

 sincos()

void mi::math::sincos ( const Spectrum a,
Spectrum s,
Spectrum c 
)
inline

Computes elementwise the sine s and cosine c of angles a simultaneously.

The angles a are specified in radians.

 size()

static Size mi::math::Spectrum::size ( )
inlinestatic

Constant size of the spectrum.

 smoothstep() [1/2]

Spectrum mi::math::smoothstep ( const Spectrum a,
const Spectrum b,
const Spectrum c 
)
inline

Returns 0 if c is less than a and 1 if c is greater than b in an elementwise fashion.

A smooth curve is applied in-between so that the return values vary continuously from 0 to 1 as elements in c vary from a to b.

 smoothstep() [2/2]

Spectrum mi::math::smoothstep ( const Spectrum a,
const Spectrum b,
Float32  x 
)
inline

Returns 0 if c is less than a and 1 if c is greater than b in an elementwise fashion.

A smooth curve is applied in-between so that the return values vary continuously from 0 to 1 as x varies from a to b.

 Spectrum() [1/8]

mi::math::Spectrum::Spectrum ( )
inline

The default constructor leaves the spectrum elements uninitialized.

 Spectrum() [2/8]

mi::math::Spectrum::Spectrum ( const Color col)
inlineexplicit

Conversion from Color.

 Spectrum() [3/8]

mi::math::Spectrum::Spectrum ( const Float32  s)
inlineexplicit

Constructor initializes all vector elements to the value s.

 Spectrum() [4/8]

mi::math::Spectrum::Spectrum ( const Spectrum s)
default

Default copy constructor.

 Spectrum() [5/8]

mi::math::Spectrum::Spectrum ( const Spectrum_struct s)
inline

Constructor from underlying storage type.

 Spectrum() [6/8]

mi::math::Spectrum::Spectrum ( const Vector< Float32, 3 > &  v3)
inlineexplicit

Conversion from Vector<Float32,3>.

 Spectrum() [7/8]

mi::math::Spectrum::Spectrum ( const Vector< Float32, 4 > &  v4)
inlineexplicit

Conversion from Vector<Float32,4>.

 Spectrum() [8/8]

mi::math::Spectrum::Spectrum ( Float32  nr,
Float32  ng,
Float32  nb 
)
inline

Constructor initializes (r,g,b) from (nr,ng,nb).

 sqrt()

Spectrum mi::math::sqrt ( const Spectrum c)
inline

Returns the square root of each element of c.

 step()

Spectrum mi::math::step ( const Spectrum a,
const Spectrum c 
)
inline

Returns elementwise 0 if c is less than a and 1 otherwise.

 tan()

Spectrum mi::math::tan ( const Spectrum c)
inline

Returns a spectrum with the elementwise tangent of the spectrum c.

 to_rgbe() [1/2]

MI_HOST_DEVICE_INLINE void mi::math::to_rgbe ( const Spectrum c,
Uint32 rgbe 
)

Encodes a spectrum into RGBE representation.

 to_rgbe() [2/2]

MI_HOST_DEVICE_INLINE void mi::math::to_rgbe ( const Spectrum c,
Uint8  rgbe[4] 
)

Encodes a spectrum into RGBE representation.

 to_vector3()

Vector< Float32, 3 > mi::math::Spectrum::to_vector3 ( ) const
inline

Conversion to Vector<Float32,3>.

 to_vector4()

Vector< Float32, 4 > mi::math::Spectrum::to_vector4 ( ) const
inline

Conversion to Vector<Float32,4>.

Variable Documentation

 SIZE

const Size mi::math::Spectrum::SIZE = 3
static

Constant size of the spectrum.