Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members | Related Pages

vlColor3< T > Class Template Reference

Class to store color with 3 components (RGB or HSV or CMY etc.). More...

#include <vlcolor.h>

Inheritance diagram for vlColor3< T >:

vlTriple< T > vlColor4< T > vlColorRGB< T > vlColorRGBA< T > List of all members.

Public Types

typedef enum vlColor3::_ColorType ColorType
 Enum to define what type of color it is : RGB, HSV etc.

enum  _ColorType { RGB, HSV, UnknownColorType }
 Enum to define what type of color it is : RGB, HSV etc. More...


Public Member Functions

 vlColor3 (T x=0.0, T y=0.0, T z=0.0)
 Default constructor.

 ~vlColor3 ()
 Default destructor.

ColorType type ()
 Returns the type of the color : RGB, CMY etc.


Detailed Description

template<class T>
class vlColor3< T >

Use this class when you want to store a color w/o the explicit knowledge of the type of color: RGB, HSV, etc. You can access the components by x(), y(), z() etc. just like for vlColor4.

For storing/using RGB color, use vlColorRGB. The components of vlColorRGB can be accessed using r(), g() and b() making your code more readable. If you want a 4 component color (RGB/HSV/CMY etc + Alpha), then use vlColor4 (generic) or vlColorRGBA.

Other types of color HSV, CMY, etc. will be implemented as and when needed. Please feel free to add their support. Constructors will be added to each color type to convert between the colors.

Definition at line 53 of file vlcolor.h.


Member Typedef Documentation

template<class T>
typedef enum vlColor3::_ColorType vlColor3< T >::ColorType
 

Referenced by vlColor3< uint8 >::type().


Member Enumeration Documentation

template<class T>
enum vlColor3::_ColorType
 

Enumeration values:
RGB 
HSV 
UnknownColorType 

Definition at line 58 of file vlcolor.h.


Constructor & Destructor Documentation

template<class T>
vlColor3< T >::vlColor3 x = 0.0,
y = 0.0,
z = 0.0
[inline]
 

template<class T>
vlColor3< T >::~vlColor3  )  [inline]
 


Member Function Documentation

template<class T>
ColorType vlColor3< T >::type  )  [inline]
 

The base class will always return UnknownColorType. Only when you use one of the derived classes will it tell you which color it is. This is because the color type is not stored in the base class.. as it increases the storage space needed for the class. This makes it possible to defined a volume of vlColor w/o additional space overhead.

Reimplemented in vlColorRGB< T >.

Definition at line 81 of file vlcolor.h.


The documentation for this class was generated from the following file:
Generated on Fri Mar 18 11:33:18 2005 for OpenVL by doxygen 1.3.3