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

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

#include <argb.h>

List of all members.

Public Member Functions

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

Public Attributes

blue
green
red
alpha

Related Functions

(Note that these are not member functions.)

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

Detailed Description

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

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

Parameters:
TThe datatype of each component

Definition at line 38 of file argb.h.


Constructor & Destructor Documentation

template<typename T>
CVD::Argb< T >::Argb ( a,
r,
g,
b 
) [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 argb.h.


Member Function Documentation

template<typename T>
template<typename T2 >
Argb<T>& CVD::Argb< T >::operator= ( const Argb< 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 59 of file argb.h.

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

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

Logical equals operator.

Returns true if each component is the same.

Parameters:
cArgb to compare with

Definition at line 69 of file argb.h.

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

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

Logical not-equals operator.

Returns true unless each component is the same.

Parameters:
cArgb to compare with

Definition at line 74 of file argb.h.

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


Friends And Related Function Documentation

template<typename T >
std::ostream & operator<< ( std::ostream &  os,
const Argb< 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 85 of file argb.h.

template<typename T>
std::ostream & operator<< ( std::ostream &  os,
const Argb< 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 95 of file argb.h.


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