CVD::Rgb< T > Class Template Reference
[Image storage and manipulation]

#include <rgb.h>

List of all members.

Public Member Functions

bool operator!= (const Rgb< T > &c) const
template<class T2 >
Rgb< T > & operator= (const Rgb< T2 > &c)
Rgb< T > & operator= (const Rgb< T > &c)
bool operator== (const Rgb< T > &c) const
template<class S >
 Rgb (const Rgb< S > &rgb)
 Rgb (T r, T g, T b)
 Rgb ()
 Default constructor. Does nothing.

Public Attributes

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

Related Functions

(Note that these are not member functions.)



std::ostream & operator<< (std::ostream &os, const Rgb< byte > &x)
std::ostream & operator<< (std::ostream &os, const Rgb< char > &x)
template<class T >
std::ostream & operator<< (std::ostream &os, const Rgb< T > &x)

Detailed Description

template<class T>
class CVD::Rgb< T >

A colour consisting of red, green and blue components. Often used to store 24-bit colour information, i.e. CVD::Rgb<CVD::byte>

Parameters:
T The datatype of each component

Definition at line 46 of file rgb.h.


Constructor & Destructor Documentation

template<class T>
CVD::Rgb< T >::Rgb (  )  [inline]

Default constructor. Does nothing.

Definition at line 50 of file rgb.h.

template<class T>
CVD::Rgb< T >::Rgb ( r,
g,
b 
) [inline]

Constructs a colour as specified

Parameters:
r The red component
g The green component
b The blue component

Definition at line 55 of file rgb.h.

template<class T>
template<class S >
CVD::Rgb< T >::Rgb ( const Rgb< S > &  rgb  )  [inline, explicit]

Definition at line 56 of file rgb.h.


Member Function Documentation

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

Logical not-equals operator. Returns true unless each component is the same.

Parameters:
c Rgb to compare with

Definition at line 74 of file rgb.h.

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

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

Parameters:
c The colour to copy from

Definition at line 80 of file rgb.h.

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

Assignment operator

Parameters:
c The colour to copy from

Definition at line 64 of file rgb.h.

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

Logical equals operator. Returns true if each component is the same.

Parameters:
c Rgb to compare with

Definition at line 69 of file rgb.h.


Friends And Related Function Documentation

template<class T>
std::ostream & operator<< ( std::ostream &  os,
const Rgb< byte > &  x 
) [related]

Read a colour from a stream, interpreting three numbers as bytes

Parameters:
os The stream
x The colour object

Definition at line 111 of file rgb.h.

template<class T>
std::ostream & operator<< ( std::ostream &  os,
const Rgb< char > &  x 
) [related]

Read a colour from a stream, interpreting three numbers as chars

Parameters:
os The stream
x The colour object

Definition at line 100 of file rgb.h.

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

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

Parameters:
os The stream
x The colour object

Definition at line 90 of file rgb.h.


Member Data Documentation

template<class T>
T CVD::Rgb< T >::blue

The blue component.

Definition at line 60 of file rgb.h.

template<class T>
T CVD::Rgb< T >::green

The green component.

Definition at line 59 of file rgb.h.

template<class T>
T CVD::Rgb< T >::red

The red component.

Definition at line 58 of file rgb.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


libcvd
Author(s): Edward Rosten, Paul Smith, Tom Drummond, Gerhard Reitmayr, Ethan Eade, Timothy Gan, Chris Kemp, Georg Klein
autogenerated on Fri Jan 11 09:13:52 2013