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

A colour consisting of luminance and alpha components. More...

#include <la.h>

Public Member Functions

 La ()
 Default constructor. Does nothing.
 
 La (T l, T a)
 Constructs a colour as specified. More...
 
La< T > & operator= (const La< T > &c)
 Assignment operator. More...
 
template<typename T2 >
La< T > & operator= (const La< T2 > &c)
 Assignment operator between two different storage types, using the standard casts as necessary. More...
 
bool operator== (const La< T > &c) const
 Logical equals operator. More...
 
bool operator!= (const La< T > &c) const
 Logical not-equals operator. More...
 

Public Attributes

luminance
 The luminance component.
 
alpha
 The alpha component.
 

Related Functions

(Note that these are not member functions.)

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

Detailed Description

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

A colour consisting of luminance and alpha components.

Parameters
TThe datatype of each component

Constructor & Destructor Documentation

◆ La()

template<typename T>
CVD::La< T >::La ( l,
a 
)
inline

Constructs a colour as specified.

Parameters
lThe luminance component
aThe alpha component

Member Function Documentation

◆ operator!=()

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

Logical not-equals operator.

Returns true unless each component is the same.

Parameters
cLa to compare with

◆ operator=() [1/2]

template<typename T>
La<T>& CVD::La< T >::operator= ( const La< T > &  c)
inline

Assignment operator.

Parameters
cThe colour to copy from

◆ operator=() [2/2]

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

Logical equals operator.

Returns true if each component is the same.

Parameters
cLa to compare with

Friends And Related Function Documentation

◆ operator<<() [1/2]

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

Write the colour to a stream in the format "(luminance,alpha)".

Parameters
osThe stream
xThe colour object

◆ operator<<() [2/2]

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

Write the colour to a stream in the format "(luminance,alpha)".

Parameters
osThe stream
xThe colour object

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