Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mitsuba::Color3 Struct Reference

RGB color data type. More...

#include <mitsuba/core/spectrum.h>

+ Inheritance diagram for mitsuba::Color3:

Public Types

typedef TSpectrum< Float, 3 > Parent
 
- Public Types inherited from mitsuba::TSpectrum< Float, 3 >
typedef Float Scalar
 

Public Member Functions

 Color3 ()
 Create a new color value, but don't initialize the contents. More...
 
 Color3 (const Parent &s)
 Copy constructor. More...
 
 Color3 (Float value)
 Initialize to a constant value. More...
 
 Color3 (Float r, Float g, Float b)
 Initialize to the given RGB value. More...
 
Float getLuminance () const
 Return the luminance (assuming the color value is expressed in linear sRGB) More...
 
- Public Member Functions inherited from mitsuba::TSpectrum< Float, 3 >
 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...
 
 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...
 
TSpectrumoperator+= (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
 Negate. More...
 
TSpectrumoperator-= (const TSpectrum &spec)
 Subtract a spectral power distribution from this instance. More...
 
TSpectrum operator* (Scalar f) const
 Multiply by a scalar. More...
 
TSpectrum operator* (const TSpectrum &spec) const
 Perform a component-wise multiplication by another spectrum. More...
 
TSpectrumoperator*= (Scalar f)
 Multiply by a scalar. More...
 
TSpectrumoperator*= (const TSpectrum &spec)
 Perform a component-wise multiplication by another spectrum. More...
 
TSpectrumoperator/= (const TSpectrum &spec)
 Perform a component-wise division by another spectrum. More...
 
TSpectrumoperator/= (Scalar f)
 Divide by a scalar. 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...
 
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...
 
Scalaroperator[] (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
 

Additional Inherited Members

- Static Public Attributes inherited from mitsuba::TSpectrum< Float, 3 >
static const int dim
 Number of dimensions. More...
 
- Protected Attributes inherited from mitsuba::TSpectrum< Float, 3 >
Scalar s [N]
 

Detailed Description

RGB color data type.

Member Typedef Documentation

Constructor & Destructor Documentation

mitsuba::Color3::Color3 ( )
inline

Create a new color value, but don't initialize the contents.

mitsuba::Color3::Color3 ( const Parent s)
inline

Copy constructor.

mitsuba::Color3::Color3 ( Float  value)
inline

Initialize to a constant value.

mitsuba::Color3::Color3 ( Float  r,
Float  g,
Float  b 
)
inline

Initialize to the given RGB value.

Member Function Documentation

Float mitsuba::Color3::getLuminance ( ) const
inline

Return the luminance (assuming the color value is expressed in linear sRGB)


The documentation for this struct was generated from the following file: