spectrum.h File Reference

#include "pbrt.h"
#include "parallel.h"

Go to the source code of this file.

Classes

class  CoefficientSpectrum< nSamples >
class  SampledSpectrum
class  RGBSpectrum

Enumerations

enum  SpectrumType { SPECTRUM_REFLECTANCE, SPECTRUM_ILLUMINANT }

Functions

bool SpectrumSamplesSorted (const float *lambda, const float *vals, int n)
void SortSpectrumSamples (float *lambda, float *vals, int n)
float AverageSpectrumSamples (const float *lambda, const float *vals, int n, float lambdaStart, float lambdaEnd)
void XYZToRGB (const float xyz[3], float rgb[3])
void RGBToXYZ (const float rgb[3], float xyz[3])
void Blackbody (const float *wl, int n, float temp, float *vals)
float InterpolateSpectrumSamples (const float *lambda, const float *vals, int n, float l)
template<int nSamples>
CoefficientSpectrum< nSamples > Pow (const CoefficientSpectrum< nSamples > &s, float e)
Spectrum Lerp (float t, const Spectrum &s1, const Spectrum &s2)

Variables

static const int sampledLambdaStart = 400
static const int sampledLambdaEnd = 700
static const int nSpectralSamples = 30
static const int nCIESamples = 471
const float CIE_X [nCIESamples]
const float CIE_Y [nCIESamples]
const float CIE_Z [nCIESamples]
const float CIE_lambda [nCIESamples]
static const int nRGB2SpectSamples = 32
const float RGB2SpectLambda [nRGB2SpectSamples]
const float RGBRefl2SpectWhite [nRGB2SpectSamples]
const float RGBRefl2SpectCyan [nRGB2SpectSamples]
const float RGBRefl2SpectMagenta [nRGB2SpectSamples]
const float RGBRefl2SpectYellow [nRGB2SpectSamples]
const float RGBRefl2SpectRed [nRGB2SpectSamples]
const float RGBRefl2SpectGreen [nRGB2SpectSamples]
const float RGBRefl2SpectBlue [nRGB2SpectSamples]
const float RGBIllum2SpectWhite [nRGB2SpectSamples]
const float RGBIllum2SpectCyan [nRGB2SpectSamples]
const float RGBIllum2SpectMagenta [nRGB2SpectSamples]
const float RGBIllum2SpectYellow [nRGB2SpectSamples]
const float RGBIllum2SpectRed [nRGB2SpectSamples]
const float RGBIllum2SpectGreen [nRGB2SpectSamples]
const float RGBIllum2SpectBlue [nRGB2SpectSamples]

Enumeration Type Documentation

Enumerator:
SPECTRUM_REFLECTANCE 
SPECTRUM_ILLUMINANT 

Definition at line 57 of file spectrum.h.


Function Documentation

float AverageSpectrumSamples ( const float *  lambda,
const float *  vals,
int  n,
float  lambdaStart,
float  lambdaEnd 
)

Definition at line 50 of file spectrum.cpp.

References Assert, and SEG_AVG.

Referenced by SampledSpectrum::FromSampled(), and SampledSpectrum::Init().

void Blackbody ( const float *  wl,
int  n,
float  temp,
float *  vals 
)

Definition at line 187 of file spectrum.cpp.

Referenced by ParamSet::AddBlackbodySpectrum().

float InterpolateSpectrumSamples ( const float *  lambda,
const float *  vals,
int  n,
float  l 
)

Definition at line 199 of file spectrum.cpp.

References Assert, Lerp(), and Severe().

Referenced by RGBSpectrum::FromSampled().

Spectrum Lerp ( float  t,
const Spectrum s1,
const Spectrum s2 
) [inline]

Definition at line 457 of file spectrum.h.

template<int nSamples>
CoefficientSpectrum<nSamples> Pow ( const CoefficientSpectrum< nSamples > &  s,
float  e 
) [inline]
void RGBToXYZ ( const float  rgb[3],
float  xyz[3] 
) [inline]

Definition at line 50 of file spectrum.h.

Referenced by RGBSpectrum::ToXYZ().

void SortSpectrumSamples ( float *  lambda,
float *  vals,
int  n 
)

Definition at line 37 of file spectrum.cpp.

Referenced by RGBSpectrum::FromSampled(), and SampledSpectrum::FromSampled().

bool SpectrumSamplesSorted ( const float *  lambda,
const float *  vals,
int  n 
)

Definition at line 30 of file spectrum.cpp.

Referenced by RGBSpectrum::FromSampled(), and SampledSpectrum::FromSampled().

void XYZToRGB ( const float  xyz[3],
float  rgb[3] 
) [inline]

Variable Documentation

const float CIE_lambda[nCIESamples]
const float CIE_X[nCIESamples]

Definition at line 215 of file spectrum.cpp.

Referenced by RGBSpectrum::FromSampled(), and SampledSpectrum::Init().

const float CIE_Y[nCIESamples]

Definition at line 338 of file spectrum.cpp.

Referenced by RGBSpectrum::FromSampled(), and SampledSpectrum::Init().

const float CIE_Z[nCIESamples]

Definition at line 461 of file spectrum.cpp.

Referenced by RGBSpectrum::FromSampled(), and SampledSpectrum::Init().

const int nCIESamples = 471 [static]
const int nRGB2SpectSamples = 32 [static]

Definition at line 68 of file spectrum.h.

Referenced by SampledSpectrum::Init().

const int nSpectralSamples = 30 [static]

Definition at line 639 of file spectrum.cpp.

Referenced by SampledSpectrum::Init().

Definition at line 883 of file spectrum.cpp.

Referenced by SampledSpectrum::Init().

Definition at line 793 of file spectrum.cpp.

Referenced by SampledSpectrum::Init().

Definition at line 865 of file spectrum.cpp.

Referenced by SampledSpectrum::Init().

Definition at line 811 of file spectrum.cpp.

Referenced by SampledSpectrum::Init().

Definition at line 847 of file spectrum.cpp.

Referenced by SampledSpectrum::Init().

Definition at line 775 of file spectrum.cpp.

Referenced by SampledSpectrum::Init().

Definition at line 829 of file spectrum.cpp.

Referenced by SampledSpectrum::Init().

Definition at line 758 of file spectrum.cpp.

Referenced by SampledSpectrum::Init().

Definition at line 668 of file spectrum.cpp.

Referenced by SampledSpectrum::Init().

Definition at line 740 of file spectrum.cpp.

Referenced by SampledSpectrum::Init().

Definition at line 686 of file spectrum.cpp.

Referenced by SampledSpectrum::Init().

Definition at line 722 of file spectrum.cpp.

Referenced by SampledSpectrum::Init().

Definition at line 650 of file spectrum.cpp.

Referenced by SampledSpectrum::Init().

Definition at line 704 of file spectrum.cpp.

Referenced by SampledSpectrum::Init().

const int sampledLambdaEnd = 700 [static]

Definition at line 37 of file spectrum.h.

Referenced by SampledSpectrum::FromSampled(), and SampledSpectrum::Init().

const int sampledLambdaStart = 400 [static]

Definition at line 36 of file spectrum.h.

Referenced by SampledSpectrum::FromSampled(), and SampledSpectrum::Init().

Generated on Sat Aug 28 20:00:12 2010 for pbrt by  doxygen 1.6.3