util::Color< T > Class Template Reference

A utility class to encapsulate color data. More...

#include <util/color.h>

Inheritance diagram for util::Color< T >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

void a (const T &val)
 Set the alpha component.
const T & a () const
 Return the alpha component.
T & a ()
 Return the alpha component.
void b (const T &val)
 Set the blue component.
const T & b () const
 Return the blue component.
T & b ()
 Return the blue component.
 Color (const T &r=T(), const T &g=T(), const T &b=T(), const T &a=T())
 Constructor.
 Color (const QColor &c)
 Color (const Vector< 4, T > &copy)
template<typename T1 >
 Color (const Vector< 4, T1 > &color, const T1 &scale)
template<typename T1 >
 Color (const Vector< 4, T1 > &color, const T &scale=1)
 Constructor to convert from one color type to another.
void g (const T &val)
 Set the green component.
const T & g () const
 Return the green component.
T & g ()
 Return the green component.
 operator QColor () const
Coloroperator= (const T &val)
 Set all the elements to value.
Coloroperator= (const Vector< 4, T > &c)
Coloroperator= (const Color &c)
 Assignment of color data.
void r (const T &val)
 Set the red component.
const T & r () const
 Return the red component.
T & r ()
 Return the red component.

Detailed Description

template<class T>
class util::Color< T >

A utility class to encapsulate color data.

Definition at line 19 of file color.h.


Constructor & Destructor Documentation

template<class T>
template<typename T1 >
util::Color< T >::Color ( const Vector< 4, T1 > &  color,
const T &  scale = 1 
) [inline, explicit]

Constructor to convert from one color type to another.

Definition at line 26 of file color.h.

00027       : Vector<4,T>(color[0]*scale, color[1]*scale, color[2]*scale, color[3]*scale)
00028     { }

template<class T>
util::Color< T >::Color ( const T &  r = T(),
const T &  g = T(),
const T &  b = T(),
const T &  a = T() 
) [inline]

Constructor.

Parameters:
r Value for red.
g Value for green.
b Value for blue.
a Value for alpha.

Definition at line 55 of file color.h.

00056       : Vector<4,T>(r,g,b,a) { }


Member Function Documentation

template<class T>
void util::Color< T >::a ( const T &  val  )  [inline]

Set the alpha component.

Definition at line 118 of file color.h.

00118 {this->t(val);}

template<class T>
const T& util::Color< T >::a (  )  const [inline]

Return the alpha component.

Definition at line 97 of file color.h.

00097 {return this->t();}

template<class T>
T& util::Color< T >::a (  )  [inline]

Return the alpha component.

Definition at line 76 of file color.h.

Referenced by util::Palette::blend(), util::convertHSVtoRGB(), and util::Palette::getColor().

00076 {return this->t();}

template<class T>
void util::Color< T >::b ( const T &  val  )  [inline]

Set the blue component.

Definition at line 113 of file color.h.

00113 {this->z(val);}

template<class T>
const T& util::Color< T >::b (  )  const [inline]

Return the blue component.

Definition at line 92 of file color.h.

00092 {return this->z();}

template<class T>
T& util::Color< T >::b (  )  [inline]
template<class T>
void util::Color< T >::g ( const T &  val  )  [inline]

Set the green component.

Definition at line 108 of file color.h.

00108 {this->y(val);}

template<class T>
const T& util::Color< T >::g (  )  const [inline]

Return the green component.

Definition at line 87 of file color.h.

00087 {return this->y();}

template<class T>
T& util::Color< T >::g (  )  [inline]
template<class T>
Color< T > & util::Color< T >::operator= ( const T &  value  )  [inline]

Set all the elements to value.

Reimplemented from util::Vector< 4, T >.

Definition at line 173 of file color.h.

References util::Color< T >::operator=().

00173                                               {
00174       this->Vector<4,T>::operator=(val);
00175       return *this;
00176     }

template<class T >
Color< T > & util::Color< T >::operator= ( const Color< T > &  c  )  [inline]

Assignment of color data.

Definition at line 167 of file color.h.

Referenced by util::Color< T >::operator=().

00167                                                    {
00168       this->Vector<4,T>::operator=(c);
00169       return *this;
00170     }

template<class T>
void util::Color< T >::r ( const T &  val  )  [inline]

Set the red component.

Definition at line 103 of file color.h.

00103 {this->x(val);}

template<class T>
const T& util::Color< T >::r (  )  const [inline]

Return the red component.

Definition at line 82 of file color.h.

00082 {return this->x();}

template<class T>
T& util::Color< T >::r (  )  [inline]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Fri May 31 15:38:26 2013 for VVE by  doxygen 1.6.3