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

A colour consisting of red, green, blue and dummy components, in the order bgr dummy in memory. More...

#include <bgrx.h>

Public Member Functions

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

Public Attributes

blue
 The blue component.
 
green
 The green component.
 
red
 The red component.
 
dummy
 The dummy.
 

Related Functions

(Note that these are not member functions.)

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

Detailed Description

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

A colour consisting of red, green, blue and dummy components, in the order bgr dummy in memory.

Parameters
TThe datatype of each component

Constructor & Destructor Documentation

◆ Bgrx()

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

Constructs a colour as specified.

Parameters
rThe red component
gThe green component
bThe blue component

Member Function Documentation

◆ operator!=()

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

Logical not-equals operator.

Returns true unless each component is the same.

Parameters
cBgrx to compare with

◆ operator=()

template<typename T>
template<typename T2 >
Bgrx<T>& CVD::Bgrx< T >::operator= ( const Bgrx< 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::Bgrx< T >::operator== ( const Bgrx< T > &  c) const
inline

Logical equals operator.

Returns true if each component is the same.

Parameters
cBgrx to compare with

Friends And Related Function Documentation

◆ operator<<() [1/2]

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

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

Parameters
osThe stream
xThe colour object

◆ operator<<() [2/2]

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

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

Parameters
osThe stream
xThe colour object

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