| cgv
    | 
represent a color with components of given type and color and alpha model as specified. More...
#include <color.h>
 
  
| Public Types | |
| typedef T | component_type | 
| type of color components | |
|  Public Types inherited from cgv::media::color_base< T, cm, am > | |
| typedef T | component_type | 
| type of color components | |
| Public Member Functions | |
| color () | |
| standard constructor does not initialize components | |
| color (const T &c) | |
| set all components to given value | |
| color (const T &c0, const T &c1) | |
| set first two components to given values | |
| color (const T &c0, const T &c1, const T &c2) | |
| set first three components to given values | |
| color (const T &c0, const T &c1, const T &c2, const T &c3) | |
| set all four components to given values | |
| color (const color< T, cm > &c, T a) | |
| construct from non-alpha color plus alpha | |
| template<typename T2 , ColorModel cm2, AlphaModel am2> | |
| color (const color< T2, cm2, am2 > &c2) | |
| copy constructor uses color conversion if necessary | |
| template<typename T2 , ColorModel cm2, AlphaModel am2> | |
| color< T, cm, am > & | operator= (const color< T2, cm2, am2 > &c2) | 
| assign to color with potential color conversion | |
| color< T, cm, am > & | operator= (const T &c) | 
| assign all components including alpha to c | |
| color< T, cm > & | drop_alpha () | 
| drop the alpha component if any by a cast operator | |
| const color< T, cm > & | drop_alpha () const | 
| template<typename T2 , ColorModel cm2, AlphaModel am2> | |
| color< T, cm, am > & | operator*= (const color< T2, cm2, am2 > &c2) | 
| multiply with color | |
| template<typename T2 , ColorModel cm2, AlphaModel am2> | |
| color< T, cm, am > | operator* (const color< T2, cm2, am2 > &c2) | 
| post multiply with color | |
| color< T, cm, am > & | operator*= (const T &c) | 
| multiply with constant | |
| template<typename T2 > | |
| color< typename type::func::promote< T, T2 >::type, cm, am > | operator* (const T2 &c) const | 
| post multiply with constant | |
| template<typename T2 , ColorModel cm2, AlphaModel am2> | |
| color< T, cm, am > & | operator+= (const color< T2, cm2, am2 > &c2) | 
| add color | |
| template<typename T2 , ColorModel cm2, AlphaModel am2> | |
| color< T, cm, am > | operator+ (const color< T2, cm2, am2 > &c2) | 
| add color | |
| color< T, cm, am > & | operator+= (const T &c) | 
| add constant | |
| color< T, cm, am > | operator+ (const T &c) | 
| add constant | |
| template<typename T2 , ColorModel cm2, AlphaModel am2> | |
| color< T, cm, am > & | operator-= (const color< T2, cm2, am2 > &c2) | 
| subtract color | |
| template<typename T2 , ColorModel cm2, AlphaModel am2> | |
| color< T, cm, am > | operator- (const color< T2, cm2, am2 > &c2) | 
| subtract color | |
| color< T, cm, am > & | operator-= (const T &c) | 
| subtract constant | |
| color< T, cm, am > | operator- (const T &c) | 
| subtract constant | |
| void | clamp (const T &mn=0, const T &mx=color_one< T >::value(), bool skip_alpha=false) | 
| clamp to the given range, which defaults to [0,1] of the component type | |
| T & | operator[] (unsigned int i) | 
| access to components | |
| const T & | operator[] (unsigned int i) const | 
| const access to components | |
|  Public Member Functions inherited from cgv::media::extinction_alpha_interface< color< T, cm, am > > | |
| T | extinction () const | 
| convert alpha to extinction | |
|  Public Member Functions inherited from cgv::media::transparency_alpha_interface< color< T, cm, am > > | |
| T | transparency () const | 
| convert alpha to transparency | |
|  Public Member Functions inherited from cgv::media::opacity_alpha_interface< color< T, cm, am > > | |
| T | opacity () const | 
| convert alpha to opacity | |
|  Public Member Functions inherited from cgv::media::xyz_color_interface< color< T, cm, am > > | |
| T | X () const | 
| convert color to XYZ and return X component | |
| T | Y () const | 
| convert color to XYZ and return Y component | |
| T | Z () const | 
| convert color to XYZ and return Z component | |
|  Public Member Functions inherited from cgv::media::hls_color_interface< color< T, cm, am > > | |
| T | H () const | 
| convert color to HLS and return H component | |
| T | L () const | 
| convert color to HLS and return L component | |
| T | S () const | 
| convert color to HLS and return S component | |
|  Public Member Functions inherited from cgv::media::rgb_color_interface< color< T, cm, am > > | |
| T | R () const | 
| convert color to RGB and return R component | |
| T | G () const | 
| convert color to RGB and return G component | |
| T | B () const | 
| convert color to RGB and return B component | |
|  Public Member Functions inherited from cgv::media::color_base< T, cm, am > | |
| color_base () | |
| standard constructor does not initialize components | |
| color_base (const color_base< T2, cm2, am2 > &c2) | |
| copy constructor uses color conversion if necessary | |
| T & | at (unsigned int i) | 
| access to components | |
| const T & | at (unsigned int i) const | 
| const access to components | |
| T & | alpha () | 
| return alpha component | |
| const T & | alpha () const | 
| return alpha component | |
| Static Public Attributes | |
| static const ColorModel | clr_mod = cm | 
| static and const access to color model | |
| static const AlphaModel | alp_mod = am | 
| static and const access to alpha model | |
| static const unsigned int | nr_color_components = color_base<T,cm,am>::nr_color_components | 
| static and const access to number of color components | |
| static const unsigned int | nr_alpha_components = color_base<T, cm, am>::nr_alpha_components | 
| static and const access to number of alpha components | |
| static const unsigned int | nr_components = color_base<T, cm, am>::nr_components | 
| static and const access to total number of components | |
|  Static Public Attributes inherited from cgv::media::color_base< T, cm, am > | |
| static const unsigned int | nr_color_components | 
| static and const access to number of color components | |
| static const unsigned int | nr_alpha_components | 
| static and const access to number of alpha components | |
| static const unsigned int | nr_components | 
| static and const access to total number of components | |
| Additional Inherited Members | |
|  Protected Attributes inherited from cgv::media::color_base< T, cm, am > | |
| T | components [nr_components] | 
represent a color with components of given type and color and alpha model as specified.
| typedef T cgv::media::color< T, cm, am >::component_type | 
| 
 | inline | 
| 
 | inline | 
| 
 | inline | 
set first two components to given values
Definition at line 594 of file color.h.
References cgv::media::color< T, cm, am >::nr_components.
| 
 | inline | 
set first three components to given values
Definition at line 600 of file color.h.
References cgv::media::color< T, cm, am >::nr_components.
| 
 | inline | 
set all four components to given values
Definition at line 608 of file color.h.
References cgv::media::color< T, cm, am >::nr_components.
| 
 | inline | 
construct from non-alpha color plus alpha
Definition at line 618 of file color.h.
References cgv::media::color_base< T, cm, am >::at(), and cgv::media::color< T, cm, am >::nr_color_components.
| 
 | inline | 
| 
 | inline | 
clamp to the given range, which defaults to [0,1] of the component type
Definition at line 726 of file color.h.
References cgv::media::color_base< T, cm, am >::at(), cgv::media::color< T, cm, am >::nr_color_components, and cgv::media::color< T, cm, am >::nr_components.
| 
 | inline | 
| 
 | inline | 
| 
 | inline | 
| 
 | inline | 
post multiply with constant
Definition at line 665 of file color.h.
References cgv::media::color_base< T, cm, am >::at(), and cgv::media::color< T, cm, am >::nr_components.
| 
 | inline | 
multiply with color
Definition at line 644 of file color.h.
References cgv::media::color_base< T, cm, am >::at(), and cgv::media::color< T, cm, am >::nr_components.
| 
 | inline | 
multiply with constant
Definition at line 658 of file color.h.
References cgv::media::color_base< T, cm, am >::at(), and cgv::media::color< T, cm, am >::nr_components.
| 
 | inline | 
| 
 | inline | 
| 
 | inline | 
add color
Definition at line 673 of file color.h.
References cgv::media::color_base< T, cm, am >::at(), and cgv::media::color< T, cm, am >::nr_components.
| 
 | inline | 
add constant
Definition at line 687 of file color.h.
References cgv::media::color_base< T, cm, am >::at(), and cgv::media::color< T, cm, am >::nr_components.
| 
 | inline | 
| 
 | inline | 
| 
 | inline | 
subtract color
Definition at line 700 of file color.h.
References cgv::media::color_base< T, cm, am >::at(), and cgv::media::color< T, cm, am >::nr_components.
| 
 | inline | 
subtract constant
Definition at line 714 of file color.h.
References cgv::media::color_base< T, cm, am >::at(), and cgv::media::color< T, cm, am >::nr_components.
| 
 | inline | 
| 
 | inline | 
assign all components including alpha to c 
Definition at line 635 of file color.h.
References cgv::media::color< T, cm, am >::nr_components.
| 
 | inline | 
access to components
Definition at line 735 of file color.h.
References cgv::media::color_base< T, cm, am >::at().
| 
 | inline | 
const access to components
Definition at line 737 of file color.h.
References cgv::media::color_base< T, cm, am >::at().
| 
 | static | 
| 
 | static | 
| 
 | static | 
| 
 | static | 
static and const access to number of color components
Definition at line 582 of file color.h.
Referenced by cgv::media::color< T, cm, am >::clamp(), and cgv::media::color< T, cm, am >::color().
| 
 | static | 
static and const access to total number of components
Definition at line 586 of file color.h.
Referenced by cgv::media::color< T, cm, am >::clamp(), cgv::media::color< T, cm, am >::color(), cgv::media::color< T, cm, am >::color(), cgv::media::color< T, cm, am >::color(), cgv::media::color< T, cm, am >::operator*(), cgv::media::color< T, cm, am >::operator*=(), cgv::media::color< T, cm, am >::operator*=(), cgv::media::color< T, cm, am >::operator+=(), cgv::media::color< T, cm, am >::operator+=(), cgv::media::color< T, cm, am >::operator-=(), cgv::media::color< T, cm, am >::operator-=(), and cgv::media::color< T, cm, am >::operator=().