Abstract spectral power distribution data type. More...
#include <mitsuba/core/spectrum.h>
Public Types | |
typedef T | Scalar |
Public Member Functions | |
TSpectrum () | |
Create a new spectral power distribution, but don't initialize the contents. More... | |
TSpectrum (Scalar v) | |
Create a new spectral power distribution with all samples set to the given value. More... | |
TSpectrum (Scalar spec[N]) | |
Copy a spectral power distribution. More... | |
TSpectrum (Stream *stream) | |
Unserialize a spectral power distribution from a binary data stream. More... | |
template<typename AltScalar > | |
TSpectrum (const TSpectrum< AltScalar, N > &v) | |
Initialize with a TSpectrum data type based on a alternate representation. More... | |
TSpectrum | operator+ (const TSpectrum &spec) const |
Add two spectral power distributions. More... | |
TSpectrum & | operator+= (const TSpectrum &spec) |
Add a spectral power distribution to this instance. More... | |
TSpectrum | operator- (const TSpectrum &spec) const |
Subtract a spectral power distribution. More... | |
TSpectrum & | operator-= (const TSpectrum &spec) |
Subtract a spectral power distribution from this instance. More... | |
TSpectrum | operator* (Scalar f) const |
Multiply by a scalar. More... | |
TSpectrum & | operator*= (Scalar f) |
Multiply by a scalar. More... | |
TSpectrum | operator* (const TSpectrum &spec) const |
Perform a component-wise multiplication by another spectrum. More... | |
TSpectrum & | operator*= (const TSpectrum &spec) |
Perform a component-wise multiplication by another spectrum. More... | |
TSpectrum & | operator/= (const TSpectrum &spec) |
Perform a component-wise division by another spectrum. More... | |
TSpectrum | operator/ (const TSpectrum &spec) const |
Perform a component-wise division by another spectrum. More... | |
TSpectrum | operator/ (Scalar f) const |
Divide by a scalar. More... | |
bool | operator== (const TSpectrum &spec) const |
Equality test. More... | |
bool | operator!= (const TSpectrum &spec) const |
Inequality test. More... | |
TSpectrum & | operator/= (Scalar f) |
Divide by a scalar. More... | |
bool | isNaN () const |
Check for NaNs. More... | |
bool | isValid () const |
Returns whether the spectrum only contains valid (non-NaN, nonnegative) samples. More... | |
void | addWeighted (Scalar weight, const TSpectrum &spec) |
Multiply-accumulate operation, adds weight * spec. More... | |
Scalar | average () const |
Return the average over all wavelengths. More... | |
TSpectrum | abs () const |
Component-wise absolute value. More... | |
TSpectrum | sqrt () const |
Component-wise square root. More... | |
TSpectrum | safe_sqrt () const |
Component-wise square root. More... | |
TSpectrum | log () const |
Component-wise logarithm. More... | |
TSpectrum | exp () const |
Component-wise exponentation. More... | |
TSpectrum | pow (Scalar f) const |
Component-wise power. More... | |
void | clampNegative () |
Clamp negative values. More... | |
Scalar | max () const |
Return the highest-valued spectral sample. More... | |
Scalar | min () const |
Return the lowest-valued spectral sample. More... | |
TSpectrum | operator- () const |
Negate. More... | |
Scalar & | operator[] (int entry) |
Indexing operator. More... | |
Scalar | operator[] (int entry) const |
Indexing operator. More... | |
bool | isZero () const |
Check if this spectrum is zero at all wavelengths. More... | |
void | serialize (Stream *stream) const |
Serialize this spectrum to a stream. More... | |
std::string | toString () const |
Static Public Attributes | |
static const int | dim = N |
Number of dimensions. More... | |
Protected Attributes | |
Scalar | s [N] |
Friends | |
TSpectrum | operator* (Scalar f, const TSpectrum &spec) |
Multiply by a scalar. More... | |
TSpectrum | operator/ (Scalar f, TSpectrum &spec) |
Divide by a scalar. More... | |
Abstract spectral power distribution data type.
This class defines a vector-like data type that can be used for computations involving radiance. A concrete instantiation for the precision and spectral discretization chosen at compile time is given by the Spectrum data type.
typedef T mitsuba::TSpectrum< T, N >::Scalar |
|
inline |
Create a new spectral power distribution, but don't initialize the contents.
|
inlineexplicit |
Create a new spectral power distribution with all samples set to the given value.
|
inlineexplicit |
Copy a spectral power distribution.
|
inlineexplicit |
Unserialize a spectral power distribution from a binary data stream.
|
inlineexplicit |
Initialize with a TSpectrum data type based on a alternate representation.
|
inline |
Component-wise absolute value.
|
inline |
Multiply-accumulate operation, adds weight * spec.
|
inline |
Return the average over all wavelengths.
|
inline |
Clamp negative values.
|
inline |
Component-wise exponentation.
|
inline |
Check for NaNs.
|
inline |
Returns whether the spectrum only contains valid (non-NaN, nonnegative) samples.
|
inline |
Check if this spectrum is zero at all wavelengths.
|
inline |
Component-wise logarithm.
|
inline |
Return the highest-valued spectral sample.
|
inline |
Return the lowest-valued spectral sample.
|
inline |
Inequality test.
|
inline |
Multiply by a scalar.
|
inline |
Perform a component-wise multiplication by another spectrum.
|
inline |
Multiply by a scalar.
|
inline |
Perform a component-wise multiplication by another spectrum.
|
inline |
Add two spectral power distributions.
|
inline |
Add a spectral power distribution to this instance.
|
inline |
Subtract a spectral power distribution.
|
inline |
Negate.
|
inline |
Subtract a spectral power distribution from this instance.
|
inline |
Perform a component-wise division by another spectrum.
|
inline |
Divide by a scalar.
|
inline |
Perform a component-wise division by another spectrum.
|
inline |
Divide by a scalar.
|
inline |
Equality test.
|
inline |
Indexing operator.
|
inline |
Indexing operator.
|
inline |
Component-wise power.
|
inline |
Component-wise square root.
|
inline |
Serialize this spectrum to a stream.
|
inline |
Component-wise square root.
|
inline |
Multiply by a scalar.
Divide by a scalar.
|
static |
Number of dimensions.
|
protected |