ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ecvColor::RgbTpl< Type > Class Template Reference

RGB color structure. More...

#include <ecvColorTypes.h>

Public Member Functions

constexpr RgbTpl ()
 Default constructor. More...
 
constexpr RgbTpl (Type red, Type green, Type blue)
 Constructor from a triplet of r,g,b values. More...
 
constexpr RgbTpl (const Type col[3])
 Constructor from an array of 3 values. More...
 
constexpr Type & operator() (unsigned i)
 Direct coordinate access. More...
 
constexpr Type & operator() (unsigned i) const
 Direct coordinate access (const) More...
 
constexpr RgbTploperator+= (const RgbTpl< Type > &c)
 In-place addition operator. More...
 
constexpr RgbTploperator-= (const RgbTpl< Type > &c)
 In-place subtraction operator. More...
 
bool operator!= (const RgbTpl< Type > &t) const
 Comparison operator. More...
 

Static Public Member Functions

static Eigen::Vector3d ToEigen (const Type col[3])
 
static Eigen::Vector3d ToEigen (const RgbTpl< Type > &t)
 
constexpr static RgbTpl FromEigen (const Eigen::Vector3d &t)
 

Public Attributes

union {
   struct {
      Type   r
 
      Type   g
 
      Type   b
 
   } 
 
   Type   rgb [3]
 
}; 
 3-tuple as a union More...
 

Detailed Description

template<typename Type>
class ecvColor::RgbTpl< Type >

RGB color structure.

Definition at line 49 of file ecvColorTypes.h.

Constructor & Destructor Documentation

◆ RgbTpl() [1/3]

template<typename Type >
constexpr ecvColor::RgbTpl< Type >::RgbTpl ( )
inlineconstexpr

Default constructor.

Inits color to (0,0,0).

Definition at line 62 of file ecvColorTypes.h.

Referenced by ecvColor::RgbTpl< Type >::FromEigen().

◆ RgbTpl() [2/3]

template<typename Type >
constexpr ecvColor::RgbTpl< Type >::RgbTpl ( Type  red,
Type  green,
Type  blue 
)
inlineexplicitconstexpr

Constructor from a triplet of r,g,b values.

Definition at line 65 of file ecvColorTypes.h.

◆ RgbTpl() [3/3]

template<typename Type >
constexpr ecvColor::RgbTpl< Type >::RgbTpl ( const Type  col[3])
inlineexplicitconstexpr

Constructor from an array of 3 values.

Definition at line 69 of file ecvColorTypes.h.

Member Function Documentation

◆ FromEigen()

◆ operator!=()

template<typename Type >
bool ecvColor::RgbTpl< Type >::operator!= ( const RgbTpl< Type > &  t) const
inline

Comparison operator.

Definition at line 131 of file ecvColorTypes.h.

References ecvColor::RgbTpl< Type >::b, ecvColor::RgbTpl< Type >::g, and ecvColor::RgbTpl< Type >::r.

◆ operator()() [1/2]

template<typename Type >
constexpr Type& ecvColor::RgbTpl< Type >::operator() ( unsigned  i)
inlineconstexpr

Direct coordinate access.

Definition at line 112 of file ecvColorTypes.h.

References ecvColor::RgbTpl< Type >::rgb.

◆ operator()() [2/2]

template<typename Type >
constexpr Type& ecvColor::RgbTpl< Type >::operator() ( unsigned  i) const
inlineconstexpr

Direct coordinate access (const)

Definition at line 114 of file ecvColorTypes.h.

References ecvColor::RgbTpl< Type >::rgb.

◆ operator+=()

template<typename Type >
constexpr RgbTpl& ecvColor::RgbTpl< Type >::operator+= ( const RgbTpl< Type > &  c)
inlineconstexpr

In-place addition operator.

Definition at line 117 of file ecvColorTypes.h.

References ecvColor::RgbTpl< Type >::b, ecvColor::RgbTpl< Type >::g, and ecvColor::RgbTpl< Type >::r.

◆ operator-=()

template<typename Type >
constexpr RgbTpl& ecvColor::RgbTpl< Type >::operator-= ( const RgbTpl< Type > &  c)
inlineconstexpr

In-place subtraction operator.

Definition at line 124 of file ecvColorTypes.h.

References ecvColor::RgbTpl< Type >::b, ecvColor::RgbTpl< Type >::g, and ecvColor::RgbTpl< Type >::r.

◆ ToEigen() [1/2]

template<typename Type >
static Eigen::Vector3d ecvColor::RgbTpl< Type >::ToEigen ( const RgbTpl< Type > &  t)
inlinestatic

◆ ToEigen() [2/2]

Member Data Documentation

◆ 

union { ... }

3-tuple as a union

◆ b

◆ g

◆ r

◆ rgb


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