Eidolon
Public Member Functions | Protected Attributes | List of all members
Spectrum Class Reference

#include <RenderTypes.h>

Inheritance diagram for Spectrum:
Inheritance graph
Collaboration diagram for Spectrum:
Collaboration graph

Public Member Functions

 Spectrum (const std::string &name="")
 
virtual const char * getName () const
 
virtual void clearSpectrum ()
 
virtual void copySpectrumFrom (const Spectrum *s)
 
virtual color getDefaultColor () const
 
virtual real getAlpha () const
 
virtual void updateSpectrum ()
 
virtual void addSpectrumValue (real pos, color value)
 Add a color value to the spectrum at the given position then resort the spectrum. More...
 
virtual real getSpectrumPos (indexval index) const throw (IndexException)
 Get the position of the spectrum value at the given index in the list. More...
 
virtual color getSpectrumValue (indexval index) const throw (IndexException)
 Get the color of the spectrum value at the given index in the list. More...
 
virtual indexval getSpectrumIndex (real pos, color value) const
 Get the index of the spectrum value with the given position and color, returns numSpectrumValues() if not found. More...
 
virtual void setSpectrumValue (sval index, real pos, color value) throw (IndexException)
 Set the spectrum value at the given list index. More...
 
virtual sval numSpectrumValues () const
 Get the number of spectrum values. More...
 
virtual void removeSpectrumValue (indexval index) throw (IndexException)
 Remove the spectrum value at the given index. More...
 
virtual sval numAlphaCtrls () const
 
virtual vec3 getAlphaCtrl (indexval index) const throw (IndexException)
 
virtual void addAlphaCtrl (vec3 v)
 
virtual void removeAlphaCtrl (indexval index) throw (IndexException)
 
virtual void setAlphaCtrl (vec3 v, indexval index) throw (IndexException)
 
virtual void setAlphaCurve (const Vec3Matrix *pts)
 
virtual void setLinearAlpha (bool b)
 
virtual bool isLinearAlpha () const
 
virtual color interpolateColor (real pos) const
 
virtual void fillColorMatrix (ColorMatrix *col, const RealMatrix *mat, bool useValAsAlpha=false) throw (IndexException)
 

Protected Attributes

PositionQueue< colorspec
 
Vec3Curve alphacurve
 
std::string name
 

Constructor & Destructor Documentation

◆ Spectrum()

Spectrum ( const std::string &  name = "")
inline

Member Function Documentation

◆ addAlphaCtrl()

virtual void addAlphaCtrl ( vec3  v)
inlinevirtual
Here is the call graph for this function:

◆ addSpectrumValue()

virtual void addSpectrumValue ( real  pos,
color  value 
)
inlinevirtual

Add a color value to the spectrum at the given position then resort the spectrum.

Here is the call graph for this function:

◆ clearSpectrum()

virtual void clearSpectrum ( )
inlinevirtual
Here is the call graph for this function:

◆ copySpectrumFrom()

virtual void copySpectrumFrom ( const Spectrum s)
inlinevirtual
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fillColorMatrix()

virtual void fillColorMatrix ( ColorMatrix col,
const RealMatrix mat,
bool  useValAsAlpha = false 
)
throw (IndexException
)
inlinevirtual

Interpolate the colors from the material's spectrum into `col' using the unit values in the first column of `mat'. If `mat' has two columns, multiply the resulting color's alpha channel by the second column value.

Here is the call graph for this function:

◆ getAlpha()

virtual real getAlpha ( ) const
inlinevirtual

Reimplemented in Material.

◆ getAlphaCtrl()

virtual vec3 getAlphaCtrl ( indexval  index) const
throw (IndexException
)
inlinevirtual
Here is the call graph for this function:

◆ getDefaultColor()

virtual color getDefaultColor ( ) const
inlinevirtual

Reimplemented in Material.

◆ getName()

virtual const char* getName ( ) const
inlinevirtual

Reimplemented in OgreMaterial.

Here is the caller graph for this function:

◆ getSpectrumIndex()

virtual indexval getSpectrumIndex ( real  pos,
color  value 
) const
inlinevirtual

Get the index of the spectrum value with the given position and color, returns numSpectrumValues() if not found.

Here is the call graph for this function:

◆ getSpectrumPos()

virtual real getSpectrumPos ( indexval  index) const
throw (IndexException
)
inlinevirtual

Get the position of the spectrum value at the given index in the list.

Here is the call graph for this function:

◆ getSpectrumValue()

virtual color getSpectrumValue ( indexval  index) const
throw (IndexException
)
inlinevirtual

Get the color of the spectrum value at the given index in the list.

Here is the call graph for this function:

◆ interpolateColor()

virtual color interpolateColor ( real  pos) const
inlinevirtual

Interpolate a color with the spectrum at the given position. If `pos' is less than or equal to the position of the first spectrum value, that color is returned, if greater than or equal that of the last spectrum value, that color is returned. If neither is true, there exists two values cmin and cmax such that the position of cmin is less than `pos' and that of cmax is greater. This method will then use the distance `pos' is from these other positions to interpolate between cmin and cmax.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isLinearAlpha()

virtual bool isLinearAlpha ( ) const
inlinevirtual
Here is the call graph for this function:

◆ numAlphaCtrls()

virtual sval numAlphaCtrls ( ) const
inlinevirtual
Here is the call graph for this function:

◆ numSpectrumValues()

virtual sval numSpectrumValues ( ) const
inlinevirtual

Get the number of spectrum values.

Here is the call graph for this function:

◆ removeAlphaCtrl()

virtual void removeAlphaCtrl ( indexval  index)
throw (IndexException
)
inlinevirtual
Here is the call graph for this function:

◆ removeSpectrumValue()

virtual void removeSpectrumValue ( indexval  index)
throw (IndexException
)
inlinevirtual

Remove the spectrum value at the given index.

Here is the call graph for this function:

◆ setAlphaCtrl()

virtual void setAlphaCtrl ( vec3  v,
indexval  index 
)
throw (IndexException
)
inlinevirtual
Here is the call graph for this function:

◆ setAlphaCurve()

virtual void setAlphaCurve ( const Vec3Matrix pts)
inlinevirtual
Here is the call graph for this function:

◆ setLinearAlpha()

virtual void setLinearAlpha ( bool  b)
inlinevirtual
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setSpectrumValue()

virtual void setSpectrumValue ( sval  index,
real  pos,
color  value 
)
throw (IndexException
)
inlinevirtual

Set the spectrum value at the given list index.

Here is the call graph for this function:

◆ updateSpectrum()

virtual void updateSpectrum ( )
inlinevirtual

Reimplemented in Material, and OgreMaterial.

Member Data Documentation

◆ alphacurve

Vec3Curve alphacurve
protected

◆ name

std::string name
protected

◆ spec

PositionQueue<color> spec
protected

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