AliceVision
Photogrammetric Computer Vision Framework
Public Member Functions | Friends | List of all members
aliceVision::image::Rgba< T > Class Template Reference

RGBA templated pixel type. More...

#include <pixelTypes.hpp>

Inheritance diagram for aliceVision::image::Rgba< T >:

Public Member Functions

 Rgba (const T red, const T green, const T blue, const T alpha=T(1))
 Full constructor. More...
 
 Rgba (const Base &val)
 Copy constructor from internal data. More...
 
 Rgba (const T val)
 RGBA constructor with default alpha value to 1. More...
 
 Rgba ()
 Default RGBA constructor set all channels to zero (including the alpha channel) More...
 
 Rgba (const RGBColor &val, const T alpha)
 Copy constructor. More...
 
const T & r () const
 Get readonly Red channel value. More...
 
T & r ()
 Get rw Red channel value. More...
 
const T & g () const
 Get readonly Green channel value. More...
 
T & g ()
 Get rw Green channel value. More...
 
const T & b () const
 Get readonly Blue channel value. More...
 
T & b ()
 Get rw Blue channel value. More...
 
const T & a () const
 Get readonly Alpha channel value. More...
 
T & a ()
 Get rw Alpha channel value. More...
 
 operator T () const
 Get approximate Gray value using rec601 Luma conversion. More...
 
template<class Z >
Rgba operator/ (const Z &val) const
 scalar division More...
 
template<class Z >
Rgba operator* (const Z &val) const
 scalar multiplication More...
 
Rgba operator+ (const Rgba &other) const
 Elementwise addition. More...
 

Friends

std::ostream & operator<< (std::ostream &os, const Rgba &col)
 stream operator More...
 

Detailed Description

template<typename T>
class aliceVision::image::Rgba< T >

RGBA templated pixel type.

Constructor & Destructor Documentation

◆ Rgba() [1/5]

template<typename T >
aliceVision::image::Rgba< T >::Rgba ( const T  red,
const T  green,
const T  blue,
const T  alpha = T(1) 
)
inline

Full constructor.

Parameters
redRed component value
greenGreen component value
bluecomponent value
alphacomponent value

◆ Rgba() [2/5]

template<typename T >
aliceVision::image::Rgba< T >::Rgba ( const Base &  val)
inlineexplicit

Copy constructor from internal data.

Parameters
valSource RGBA value

◆ Rgba() [3/5]

template<typename T >
aliceVision::image::Rgba< T >::Rgba ( const T  val)
inlineexplicit

RGBA constructor with default alpha value to 1.

Parameters
valValue to set in each RGB component
Note
This is equivalent to RGBA( val , val , val , 1 )

◆ Rgba() [4/5]

template<typename T >
aliceVision::image::Rgba< T >::Rgba ( )
inlineexplicit

Default RGBA constructor set all channels to zero (including the alpha channel)

Warning
The alpha channel is initialized to 0. It is used in generic/templated code like "sampler" which creates an empty color and accumulate color contributions.

◆ Rgba() [5/5]

template<typename T >
aliceVision::image::Rgba< T >::Rgba ( const RGBColor val,
const T  alpha 
)
inline

Copy constructor.

Parameters
valSource RGBA value

Member Function Documentation

◆ a() [1/2]

template<typename T >
T& aliceVision::image::Rgba< T >::a ( )
inline

Get rw Alpha channel value.

Returns
Alpha channel value

◆ a() [2/2]

template<typename T >
const T& aliceVision::image::Rgba< T >::a ( ) const
inline

Get readonly Alpha channel value.

Returns
Alpha channel value

◆ b() [1/2]

template<typename T >
T& aliceVision::image::Rgba< T >::b ( )
inline

Get rw Blue channel value.

Returns
Blue channel value

◆ b() [2/2]

template<typename T >
const T& aliceVision::image::Rgba< T >::b ( ) const
inline

Get readonly Blue channel value.

Returns
Blue channel value

◆ g() [1/2]

template<typename T >
T& aliceVision::image::Rgba< T >::g ( )
inline

Get rw Green channel value.

Returns
Green channel value

◆ g() [2/2]

template<typename T >
const T& aliceVision::image::Rgba< T >::g ( ) const
inline

Get readonly Green channel value.

Returns
Green channel value

◆ operator T()

template<typename T >
aliceVision::image::Rgba< T >::operator T ( ) const
inline

Get approximate Gray value using rec601 Luma conversion.

Returns
Luminance value of pixel

◆ operator*()

template<typename T >
template<class Z >
Rgba aliceVision::image::Rgba< T >::operator* ( const Z &  val) const
inline

scalar multiplication

Parameters
valScale multiplication factor
Returns
Rgba color after scalar multiplication
Note
This does not modify the Rgba value (ie: only return a modified copy)

◆ operator+()

template<typename T >
Rgba aliceVision::image::Rgba< T >::operator+ ( const Rgba< T > &  other) const
inline

Elementwise addition.

Parameters
otherthe other element to substract
Returns
Rgb color after addition
Note
This does not modify the Rgb value (ie: only return a modified copy)

◆ operator/()

template<typename T >
template<class Z >
Rgba aliceVision::image::Rgba< T >::operator/ ( const Z &  val) const
inline

scalar division

Parameters
valScalar divisor factor
Returns
Rgba color after scalar division
Note
This does not modify the Rgba value (ie: only return a modified copy)

◆ r() [1/2]

template<typename T >
T& aliceVision::image::Rgba< T >::r ( )
inline

Get rw Red channel value.

Returns
Red channel value

◆ r() [2/2]

template<typename T >
const T& aliceVision::image::Rgba< T >::r ( ) const
inline

Get readonly Red channel value.

Returns
Red channel value

Friends And Related Function Documentation

◆ operator<<

template<typename T >
std::ostream& operator<< ( std::ostream &  os,
const Rgba< T > &  col 
)
friend

stream operator

Parameters
osStream in which rgb value is outputted
colColor to store into the stream
Returns
stream after output

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