CVD 0.8
Public Member Functions | Public Attributes | Related Functions
CVD::Rgba< T > Class Template Reference

A colour consisting of red, green, blue and alpha components. More...

#include <rgba.h>

List of all members.

Public Member Functions

 Rgba ()
 Rgba (T r, T g, T b, T a)
template<class S >
 Rgba (const Rgba< S > &rgba)
template<typename T2 >
Rgba< T > & operator= (const Rgba< T2 > &c)
bool operator== (const Rgba< T > &c) const
bool operator!= (const Rgba< T > &c) const

Public Attributes

red
green
blue
alpha

Related Functions

(Note that these are not member functions.)

template<typename T >
std::ostream & operator<< (std::ostream &os, const Rgba< T > &x)
std::ostream & operator<< (std::ostream &os, const Rgba< unsigned char > &x)

Detailed Description

template<typename T>
class CVD::Rgba< T >

A colour consisting of red, green, blue and alpha components.

Parameters:
TThe datatype of each component

Definition at line 38 of file rgba.h.


Constructor & Destructor Documentation

template<typename T>
CVD::Rgba< T >::Rgba ( r,
g,
b,
a 
) [inline, explicit]

Constructs a colour as specified.

Parameters:
rThe red component
gThe green component
bThe blue component
aThe alpha component

Definition at line 49 of file rgba.h.


Member Function Documentation

template<typename T>
template<typename T2 >
Rgba<T>& CVD::Rgba< T >::operator= ( const Rgba< T2 > &  c) [inline]

Assignment operator between two different storage types, using the standard casts as necessary.

Parameters:
cThe colour to copy from

Definition at line 60 of file rgba.h.

References CVD::Rgba< T >::alpha, CVD::Rgba< T >::blue, CVD::Rgba< T >::green, and CVD::Rgba< T >::red.

template<typename T>
bool CVD::Rgba< T >::operator== ( const Rgba< T > &  c) const [inline]

Logical equals operator.

Returns true if each component is the same.

Parameters:
cRgba to compare with

Definition at line 70 of file rgba.h.

References CVD::Rgba< T >::alpha, CVD::Rgba< T >::blue, CVD::Rgba< T >::green, and CVD::Rgba< T >::red.

template<typename T>
bool CVD::Rgba< T >::operator!= ( const Rgba< T > &  c) const [inline]

Logical not-equals operator.

Returns true unless each component is the same.

Parameters:
cRgba to compare with

Definition at line 75 of file rgba.h.

References CVD::Rgba< T >::alpha, CVD::Rgba< T >::blue, CVD::Rgba< T >::green, and CVD::Rgba< T >::red.


Friends And Related Function Documentation

template<typename T >
std::ostream & operator<< ( std::ostream &  os,
const Rgba< T > &  x 
) [related]

Write the colour to a stream in the format "(red,green,blue,alpha)".

Parameters:
osThe stream
xThe colour object

Definition at line 86 of file rgba.h.

template<typename T>
std::ostream & operator<< ( std::ostream &  os,
const Rgba< unsigned char > &  x 
) [related]

Write the colour to a stream in the format "(red,green,blue,alpha)".

Parameters:
osThe stream
xThe colour object

Definition at line 96 of file rgba.h.


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