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

#include <pixelTypes.hpp>

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

Public Member Functions

 Rgb (T red, T green, T blue)
 Full constructor. More...
 
 Rgb (const Base &val)
 Copy constructor. More...
 
 Rgb (const T val=0)
 Single value construction. 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...
 
 operator T () const
 Get approximate Gray value using rec601 Luma conversion. More...
 
Rgb operator- (const Rgb &other) const
 Elementwise substraction. More...
 
Rgb operator+ (const Rgb &other) const
 Elementwise addition. More...
 
Rgb operator* (const Rgb &other) const
 Elementwise multiplication. More...
 
template<typename Z >
Rgb operator/ (const Z &val) const
 scalar division More...
 
template<typename Z >
Rgb operator* (const Z &val) const
 scalar multiplication More...
 

Friends

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

Detailed Description

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

Red Greeen Blue template pixel type

Template Parameters
Ttype of each channel

Constructor & Destructor Documentation

◆ Rgb() [1/3]

template<typename T >
aliceVision::image::Rgb< T >::Rgb ( red,
green,
blue 
)
inline

Full constructor.

Parameters
redRed value
greenvalue
bluevalue

◆ Rgb() [2/3]

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

Copy constructor.

Parameters
valSource RGB value

◆ Rgb() [3/3]

template<typename T >
aliceVision::image::Rgb< T >::Rgb ( const T  val = 0)
inlineexplicit

Single value construction.

Parameters
valValue to set in each channel
Note
This is equivalent to Rgb( val , val , val )

Member Function Documentation

◆ b() [1/2]

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

Get rw Blue channel value.

Returns
Blue channel value

◆ b() [2/2]

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

Get readonly Blue channel value.

Returns
Blue channel value

◆ g() [1/2]

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

Get rw Green channel value.

Returns
Green channel value

◆ g() [2/2]

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

Get readonly Green channel value.

Returns
Green channel value

◆ operator T()

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

Get approximate Gray value using rec601 Luma conversion.

Returns
Luminance value of pixel

◆ operator*() [1/2]

template<typename T >
Rgb aliceVision::image::Rgb< T >::operator* ( const Rgb< T > &  other) const
inline

Elementwise multiplication.

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

◆ operator*() [2/2]

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

scalar multiplication

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

◆ operator+()

template<typename T >
Rgb aliceVision::image::Rgb< T >::operator+ ( const Rgb< 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 >
Rgb aliceVision::image::Rgb< T >::operator- ( const Rgb< T > &  other) const
inline

Elementwise substraction.

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

◆ operator/()

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

scalar division

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

◆ r() [1/2]

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

Get rw Red channel value.

Returns
Red channel value

◆ r() [2/2]

template<typename T >
const T& aliceVision::image::Rgb< 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 Rgb< 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: