#include <vuColour.h>
Inheritance diagram for vuColour< S >:
Public Member Functions | |
vuColour () | |
default constructor Sets all values to zero and alpha to one. | |
vuColour (const vuColour< S > &inst) | |
copy constructor | |
vuColour (const float *f) | |
initialize all components (including alpha at N-1) with values from array f | |
vuColour (const double *f) | |
initialize all components (from double*) (including alpha at N-1) with values from array f | |
vuColour (const float f) | |
initialize all values (including alpha) with f | |
~vuColour () | |
destructor | |
float | getAlpha (void) |
get alpha value | |
void | setAlpha (const float a) |
set alpha value | |
float & | operator[] (unsigned int index) |
provides direct random access to the components | |
float | operator[] (unsigned int index) const |
provides direct reading access to the components | |
float * | getData () |
returns a pointer to the float array containing the data | |
float const * | getData () const |
const version of getData() | |
vuColour< S > & | operator= (const double *rhs) |
assignment from double* without alpha | |
vuColour< S > & | operator= (double *rhs) |
assignment from double* without alpha | |
vuColour< S > & | operator= (const vuColour< S > &rhs) |
assignment operator | |
vuColour< S > & | operator= (float rhs) |
assignment operator, This will set each compenent to rhs | |
vuColour< S > & | operator= (const float *rhs) |
assignment operator, This will set the ith colour component to be the ith float pointed to by rhs | |
bool | operator== (const vuColour< S > &rhs) const |
operator ==, | |
vuColour< S > | operator+ (const vuColour< S > &rhs) const |
addition operator, | |
vuColour< S > | operator+ (float a) const |
operator, This will add a to the first S-1 components | |
vuColour< S > | operator- (const vuColour< S > &rhs) const |
operator, This will perform a component wise subtraction on the first S-1 components | |
vuColour< S > | operator * (const vuColour< S > &rhs) const |
operator, This will perform a component wise multiplication on the first S-1 components | |
vuColour< S > | operator/ (const vuColour< S > &rhs) const |
operator, This will perform a component wise division on the first S-1 components | |
vuColour< S > | operator * (float rhs) const |
operator multiplication with scalar In comparision to *= this operator creates a copy where the result written to. | |
vuColour< S > & | operator+= (const vuColour< S > &rhs) |
operator for component wise addition | |
vuColour< S > & | operator-= (const vuColour< S > &rhs) |
operator for component wise subtraction | |
vuColour< S > & | operator *= (const vuColour< S > &rhs) |
operator for component wise multiplication | |
vuColour< S > & | operator/= (const vuColour< S > &rhs) |
operator for component wise division | |
vuColour< S > & | operator *= (float rhs) |
operator for multiplication with scalar | |
vuColour< S > & | operator/= (float rhs) |
operator for division by scalar | |
vuColour< S > & | clampTo01 () |
Set values above one to one and values below zero to zero. | |
vuColour< S > & | clampTo1 () |
Set values above one to one. | |
vuColour | oneMinus () const |
return a color with all components set to their distance from one | |
word | nComponents () const |
returns the number of components. | |
float | maxComponent () const |
returns value of maximal component This is used for a pretty ineffective version of early ray termination. | |
float | minComponent () const |
returns value of minimal component This is used for a pretty inefficient version of early ray termination. | |
vuColour< S > & | multAlpha () |
weight components by alpha value alpha value (last component) is set to one | |
void | print () const |
this will write each colour component on the screen, in comma separated format | |
istream & | read (istream &is) |
a friend, read colour from stream | |
ostream & | write (ostream &os) const |
a friend, write colour to stream | |
Protected Member Functions | |
template<int T> | |
vuColour< S > & | fromColourN (const vuColour< T > &src, const float *xfmat) |
this will assign colour src to this colour, compensating for any format problems | |
template<int T> | |
vuColour< T > & | toColourN (vuColour< T > &dstcol, const float *xfmat) const |
This will write this colour to the equivalent value in dstcol's format and write the value there. | |
Protected Attributes | |
float | m_Data [S] |
these are the colour component values | |
Friends | |
vuColour< S > | operator * (float lhs, const vuColour< S > &rhs) |
operator for commutative multiplication with a float. | |
ostream & | operator<< (ostream &os, const vuColour< S > &A) |
a friend, write colour to stream | |
istream & | operator>> (istream &is, vuColour< S > &A) |
a friend, read colour from stream |
The argument S to this template class gives the number of components including the alpha value. The indexing via the [] operator starts at 0 with alpha at position S-1. Derived classes like vuColourRGBa, vuColourXYZa, vuColour31a... use the protected From() and To() functions to provide conversions to other colour models.
Definition at line 66 of file vuColour.h.
|
default constructor Sets all values to zero and alpha to one.
Definition at line 71 of file vuColour.h. |
|
copy constructor
Definition at line 80 of file vuColour.h. |
|
initialize all components (including alpha at N-1) with values from array f
Definition at line 89 of file vuColour.h. |
|
initialize all components (from double*) (including alpha at N-1) with values from array f
Definition at line 98 of file vuColour.h. |
|
initialize all values (including alpha) with f
Definition at line 106 of file vuColour.h. |
|
destructor
Definition at line 114 of file vuColour.h. |
|
Set values above one to one and values below zero to zero.
Definition at line 328 of file vuColour.h. Referenced by vu1512112::drawSlice(), vuSpectralImage::get_rgb(), ns_vu1112112::SpectralImage::get_rgb(), vuTFIntensity::getRGBa(), vuSpecPalette::PaintColours(), vuImage::set_xy(), ns_vu1112116::Image::set_xy(), ns_vu1112112::vu1112112::shootRays(), and vu1112113::shootRays(). |
|
Set values above one to one.
Definition at line 337 of file vuColour.h. Referenced by ns_vu1112112::SpectralImage::get_rgb(). |
|
this will assign colour src to this colour, compensating for any format problems
Definition at line 444 of file vuColour.h. |
|
get alpha value
Definition at line 119 of file vuColour.h. Referenced by vu1112113::Cast(), and vu1512113::renderImage(). |
|
const version of getData()
Reimplemented from vuColourN. Definition at line 145 of file vuColour.h. |
|
returns a pointer to the float array containing the data
Reimplemented from vuColourN. Definition at line 143 of file vuColour.h. Referenced by FrameBuffer< 4 >::addColourWithM1subM2(), FrameBuffer< 4 >::addColourWithMask(), vuTFDesignSpec::generateLight(), vuSpectralImage::get_xy_data(), vuTransferCanvas::render(), vuKeyFrameCanvas::render(), vu1112115::setLightColour(), vuColour< 8 >::toColourN(), and vuTFDesignSpec::updateFromPalette(). |
|
returns value of maximal component This is used for a pretty ineffective version of early ray termination.
Definition at line 362 of file vuColour.h. Referenced by ns_vu1112112::vu1112112::Cast(), ns_vu1112112::Material::check_absorption(), vuSpectralImage::create_black_mask(), ns_vu1112112::SpectralImage::create_black_mask(), and vuSpecPalette::PaintSpectrum(). |
|
returns value of minimal component This is used for a pretty inefficient version of early ray termination.
Definition at line 372 of file vuColour.h. Referenced by ns_vu1112112::Material::check_absorption(), and vuSpecPalette::PaintSpectrum(). |
|
weight components by alpha value alpha value (last component) is set to one
Definition at line 382 of file vuColour.h. |
|
returns the number of components. This depends on the number given during creation of the template. Reimplemented from vuColourN. Definition at line 355 of file vuColour.h. Referenced by ns_vu1112112::vu1112112::vu1112112(). |
|
return a color with all components set to their distance from one
Definition at line 345 of file vuColour.h. Referenced by ns_vu1112112::vu1112112::Cast(). |
|
operator multiplication with scalar In comparision to *= this operator creates a copy where the result written to.
Definition at line 259 of file vuColour.h. |
|
operator, This will perform a component wise multiplication on the first S-1 components
Definition at line 237 of file vuColour.h. |
|
operator for multiplication with scalar
Definition at line 312 of file vuColour.h. |
|
operator for component wise multiplication
Definition at line 296 of file vuColour.h. |
|
operator, This will add a to the first S-1 components
Definition at line 217 of file vuColour.h. |
|
addition operator, This performs a component wise addition of each component of the 2 colours and returns the result. Definition at line 207 of file vuColour.h. |
|
operator for component wise addition
Definition at line 280 of file vuColour.h. |
|
operator, This will perform a component wise subtraction on the first S-1 components
Definition at line 227 of file vuColour.h. |
|
operator for component wise subtraction
Definition at line 288 of file vuColour.h. |
|
operator, This will perform a component wise division on the first S-1 components
Definition at line 247 of file vuColour.h. |
|
operator for division by scalar
Definition at line 320 of file vuColour.h. |
|
operator for component wise division
Definition at line 304 of file vuColour.h. |
|
assignment operator, This will set the ith colour component to be the ith float pointed to by rhs
Definition at line 186 of file vuColour.h. |
|
assignment operator, This will set each compenent to rhs
Definition at line 177 of file vuColour.h. |
|
assignment operator
Definition at line 165 of file vuColour.h. |
|
assignment from double* without alpha
Definition at line 156 of file vuColour.h. |
|
assignment from double* without alpha
Definition at line 148 of file vuColour.h. |
|
operator ==, This returns true if the two colours are equivalent. Definition at line 196 of file vuColour.h. |
|
provides direct reading access to the components
Reimplemented from vuColourN. Definition at line 137 of file vuColour.h. |
|
provides direct random access to the components
Reimplemented from vuColourN. Definition at line 131 of file vuColour.h. |
|
this will write each colour component on the screen, in comma separated format
Reimplemented from vuColourN. Definition at line 393 of file vuColour.h. |
|
a friend, read colour from stream
Definition at line 423 of file vuColour.h. |
|
set alpha value
Definition at line 125 of file vuColour.h. Referenced by vu1112113::Cast(), and vu1512113::renderImage(). |
|
This will write this colour to the equivalent value in dstcol's format and write the value there.
Definition at line 459 of file vuColour.h. |
|
a friend, write colour to stream
Definition at line 432 of file vuColour.h. |
|
operator for commutative multiplication with a float. In comparision to *= this operator creates a copy where the result written to. Definition at line 271 of file vuColour.h. |
|
a friend, write colour to stream
Definition at line 403 of file vuColour.h. |
|
a friend, read colour from stream
Definition at line 414 of file vuColour.h. |
|
these are the colour component values
Definition at line 473 of file vuColour.h. Referenced by vuColour< 8 >::oneMinus(), vuColour< 8 >::operator *(), vuColour< 8 >::operator *=(), vuColour< 8 >::operator+(), vuColour< 8 >::operator+=(), vuColour< 8 >::operator-(), vuColour< 8 >::operator-=(), vuColour< 8 >::operator/(), vuColour< 8 >::operator/=(), vuColour< 8 >::operator=(), and vuColour< 8 >::vuColour(). |