libcvd
Public Member Functions | Public Attributes | Related Functions | List of all members
CVD::Argb< T > Class Template Reference

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

#include <argb.h>

Public Member Functions

 Argb ()
 Default constructor. Sets everything to 0.
 
 Argb (T a, T r, T g, T b)
 Constructs a colour as specified. More...
 
template<typename T2 >
Argb< T > & operator= (const Argb< T2 > &c)
 Assignment operator between two different storage types, using the standard casts as necessary. More...
 
bool operator== (const Argb< T > &c) const
 Logical equals operator. More...
 
bool operator!= (const Argb< T > &c) const
 Logical not-equals operator. More...
 

Public Attributes

blue
 The blue component.
 
green
 The green component.
 
red
 The red component.
 
alpha
 The alpha component.
 

Related Functions

(Note that these are not member functions.)

template<typename T >
std::ostream & operator<< (std::ostream &os, const Argb< T > &x)
 Write the colour to a stream in the format "(red,green,blue,alpha)". More...
 
std::ostream & operator<< (std::ostream &os, const Argb< unsigned char > &x)
 Write the colour to a stream in the format "(red,green,blue,alpha)". More...
 

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

Constructor & Destructor Documentation

◆ Argb()

template<typename T>
CVD::Argb< T >::Argb ( a,
r,
g,
b 
)
inlineexplicit

Constructs a colour as specified.

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

Member Function Documentation

◆ operator!=()

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

◆ operator=()

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

◆ operator==()

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

Friends And Related Function Documentation

◆ operator<<() [1/2]

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

◆ operator<<() [2/2]

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

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