SpectralSampleSet Class Reference

Templated set of spectral values (wavelength-dependeht), sampled at N distinct wavelengths. Specific SpectralSampleSet instances include SpectralRadianceSet, in which each sample represents the radiance at a single wavelength with units Watts / (m^2 sr), and SpectralScalarSet, where each wavelength-dependent sample represents a unitless scalar that can be used to attenuate SpectralRadianceSet. More...

#include <SpectralSampleSet.h>

List of all members.

Public Member Functions

Constructors
 SpectralSampleSet (const real_t *data)
 SpectralSampleSet ()
 SpectralSampleSet (const real_t &r, const real_t &g, const real_t &b)
 SpectralSampleSet (const Vector3 &v)
 SpectralSampleSet (const RgbaHDR &rgba)
 SpectralSampleSet (const SpectralSampleSet &v)
 Copy Constructor.
 ~SpectralSampleSet ()
Accessor Operators
const SpectralSampleoperator[] (const unsigned index) const
SpectralSampleoperator[] (const unsigned index)
unsigned getN () const
Equality Operators
bool operator== (const SpectralSampleSet &v) const
bool operator!= (const SpectralSampleSet &v) const
Relational Operators
bool operator>= (const SpectralSampleSet &v) const
bool operator<= (const SpectralSampleSet &v) const
Mutator Operators
SpectralSampleSetoperator= (const SpectralSampleSet &v)
SpectralSampleSetoperator+= (const SpectralSampleSet &rhs)
SpectralSampleSetoperator-= (const SpectralSampleSet &rhs)
Scalar Mutator Operators
SpectralSampleSetoperator*= (const real_t &scale)
SpectralSampleSetoperator/= (const real_t &scale)
Arithmetic Operators
SpectralSampleSet operator+ (const SpectralSampleSet &rhs) const
SpectralSampleSet operator- (const SpectralSampleSet &rhs) const
SpectralSampleSet operator* (const SpectralSampleSet &rhs) const
SpectralSampleSet operator/ (const SpectralSampleSet &rhs) const
Scalar Arithmetic Operators
SpectralSampleSet operator* (const real_t &scale) const
SpectralSampleSet operator/ (const real_t &scale) const
Misc Functionality
bool isZero () const
real_t getSum () const
real_t getAverage () const
unsigned getMaxSample () const
unsigned getMinSample () const
Conversions
RgbaHDR getRGB () const
 operator RgbaHDR () const

Static Public Member Functions

Static convenience constructors to generate common spectra
static SpectralSampleSet black ()
static SpectralSampleSet identity ()
static SpectralSampleSet fill (const real_t &value)


Detailed Description

Templated set of spectral values (wavelength-dependeht), sampled at N distinct wavelengths. Specific SpectralSampleSet instances include SpectralRadianceSet, in which each sample represents the radiance at a single wavelength with units Watts / (m^2 sr), and SpectralScalarSet, where each wavelength-dependent sample represents a unitless scalar that can be used to attenuate SpectralRadianceSet.

Author:
Travis Fischer (fisch0920@gmail.com)

Matthew Jacobs (jacobs.mh@gmail.com)

Date:
Fall 2008
Note:
Throughout Milton, currently only RGB spectra are used, but this abstraction is in place and used ubiquitously s.t. we can eventually come back and implement spectrally-aware rendering with the majority of the changes taking place in this one class.

Definition at line 67 of file SpectralSampleSet.h.


Constructor & Destructor Documentation

SpectralSampleSet::SpectralSampleSet ( const real_t data  )  [inline, explicit]

Constructs a SpectralSampleSet sampled at the three canonical RGB wavelengths, with the sample values specified in the given 3- element array

Definition at line 34 of file SpectralSampleSet.inl.

SpectralSampleSet::SpectralSampleSet (  )  [inline, explicit]

Constructs a SpectralSampleSet sampled at the three canonical RGB wavelengths, with zero values

Definition at line 46 of file SpectralSampleSet.inl.

SpectralSampleSet::SpectralSampleSet ( const real_t r,
const real_t g,
const real_t b 
) [inline, explicit]

Constructs a SpectralSampleSet sampled at the three canonical RGB wavelengths, with the sample values given

Definition at line 58 of file SpectralSampleSet.inl.

SpectralSampleSet::SpectralSampleSet ( const Vector3 v  )  [inline]

Constructs a SpectralSampleSet sampled at the three canonical RGB wavelengths, with the sample values specified in the given 3- element vector

Definition at line 76 of file SpectralSampleSet.inl.

SpectralSampleSet::SpectralSampleSet ( const RgbaHDR rgba  )  [inline]

Constructs a SpectralSampleSet sampled at the three canonical RGB wavelengths, with the sample values specified by the given RgbaHDR

Definition at line 88 of file SpectralSampleSet.inl.

SpectralSampleSet::SpectralSampleSet ( const SpectralSampleSet v  )  [inline]

Copy Constructor.

Definition at line 103 of file SpectralSampleSet.inl.

SpectralSampleSet::~SpectralSampleSet (  ) 

Definition at line 30 of file SpectralSampleSet.cpp.


Member Function Documentation

static SpectralSampleSet SpectralSampleSet::black (  )  [inline, static]

Generates a SpectralSampleSet sampled at the three canonical RGB wavelengths, filled with zeros

Definition at line 107 of file SpectralSampleSet.h.

static SpectralSampleSet SpectralSampleSet::identity (  )  [inline, static]

Generates a SpectralSampleSet sampled at the three canonical RGB wavelengths, filled with ones (multiplicative identity)

Definition at line 113 of file SpectralSampleSet.h.

static SpectralSampleSet SpectralSampleSet::fill ( const real_t value  )  [inline, static]

Generates a SpectralSampleSet sampled at the three canonical RGB wavelengths, filled with the specified value

Definition at line 119 of file SpectralSampleSet.h.

const SpectralSample & SpectralSampleSet::operator[] ( const unsigned  index  )  const [inline]

Returns:
a reference to the element at the given index

Definition at line 115 of file SpectralSampleSet.inl.

SpectralSample & SpectralSampleSet::operator[] ( const unsigned  index  )  [inline]

Returns:
a reference to the element at the given index
Note:
changes to the returned element will affect this spectrum

Definition at line 125 of file SpectralSampleSet.inl.

unsigned SpectralSampleSet::getN (  )  const [inline]

Returns:
the number of spectral samples contained in this set

Definition at line 134 of file SpectralSampleSet.inl.

bool SpectralSampleSet::operator== ( const SpectralSampleSet v  )  const [inline]

Definition at line 141 of file SpectralSampleSet.inl.

bool SpectralSampleSet::operator!= ( const SpectralSampleSet v  )  const [inline]

Definition at line 155 of file SpectralSampleSet.inl.

bool SpectralSampleSet::operator>= ( const SpectralSampleSet v  )  const [inline]

Definition at line 164 of file SpectralSampleSet.inl.

bool SpectralSampleSet::operator<= ( const SpectralSampleSet v  )  const [inline]

Definition at line 179 of file SpectralSampleSet.inl.

SpectralSampleSet & SpectralSampleSet::operator= ( const SpectralSampleSet v  )  [inline]

Definition at line 197 of file SpectralSampleSet.inl.

SpectralSampleSet & SpectralSampleSet::operator+= ( const SpectralSampleSet rhs  )  [inline]

Definition at line 212 of file SpectralSampleSet.inl.

SpectralSampleSet & SpectralSampleSet::operator-= ( const SpectralSampleSet rhs  )  [inline]

Definition at line 226 of file SpectralSampleSet.inl.

SpectralSampleSet & SpectralSampleSet::operator*= ( const real_t scale  )  [inline]

Definition at line 243 of file SpectralSampleSet.inl.

SpectralSampleSet & SpectralSampleSet::operator/= ( const real_t scale  )  [inline]

Definition at line 250 of file SpectralSampleSet.inl.

SpectralSampleSet SpectralSampleSet::operator+ ( const SpectralSampleSet rhs  )  const [inline]

Definition at line 263 of file SpectralSampleSet.inl.

SpectralSampleSet SpectralSampleSet::operator- ( const SpectralSampleSet rhs  )  const [inline]

Definition at line 271 of file SpectralSampleSet.inl.

SpectralSampleSet SpectralSampleSet::operator* ( const SpectralSampleSet rhs  )  const [inline]

Returns:
element-wise multiplication

Definition at line 294 of file SpectralSampleSet.inl.

SpectralSampleSet SpectralSampleSet::operator/ ( const SpectralSampleSet rhs  )  const [inline]

Returns:
element-wise division

Definition at line 279 of file SpectralSampleSet.inl.

SpectralSampleSet SpectralSampleSet::operator* ( const real_t scale  )  const [inline]

Definition at line 310 of file SpectralSampleSet.inl.

SpectralSampleSet SpectralSampleSet::operator/ ( const real_t scale  )  const [inline]

Definition at line 317 of file SpectralSampleSet.inl.

bool SpectralSampleSet::isZero (  )  const [inline]

Returns:
whether or not all samples in this set are zero

Definition at line 329 of file SpectralSampleSet.inl.

real_t SpectralSampleSet::getSum (  )  const [inline]

Returns:
the sum of the components in this SpectralSampleSet

Definition at line 338 of file SpectralSampleSet.inl.

real_t SpectralSampleSet::getAverage (  )  const [inline]

Returns:
the average of the components in this SpectralSampleSet

Definition at line 348 of file SpectralSampleSet.inl.

unsigned SpectralSampleSet::getMaxSample (  )  const [inline]

Returns:
dimension (0,1,...,N) of maximum value

Definition at line 380 of file SpectralSampleSet.inl.

unsigned SpectralSampleSet::getMinSample (  )  const [inline]

Returns:
dimension (0,1,...,N) of minimum value

Definition at line 395 of file SpectralSampleSet.inl.

RgbaHDR SpectralSampleSet::getRGB (  )  const [inline]

Returns:
this SpectralSampleSet converted to RGB format

Definition at line 410 of file SpectralSampleSet.inl.

SpectralSampleSet::operator RgbaHDR (  )  const [inline]

Returns:
this SpectralSampleSet as a HDR floating-point rgba struct (implicit conversion)

Definition at line 416 of file SpectralSampleSet.inl.


The documentation for this class was generated from the following files:

Generated on 28 Feb 2009 for Milton by doxygen 1.5.6