MRPT  2.0.3
List of all members | Public Member Functions | Static Public Member Functions | Public Attributes | Related Functions
mrpt::img::TColor Struct Reference

Detailed Description

A RGB color - 8bit.

Struct pack=1 is ensured.

Definition at line 25 of file TColor.h.

#include <mrpt/img/TColor.h>

Public Member Functions

constexpr TColor ()=default
 
constexpr TColor (uint8_t r, uint8_t g, uint8_t b, uint8_t alpha=255)
 
constexpr TColor (const unsigned int color_RGB_24bit)
 
constexpr TColor (const unsigned int color_RGB_24bit, const uint8_t alpha)
 
 operator unsigned int () const
 Operator for implicit conversion into an int binary representation 0xRRGGBB. More...
 
 TColor (const TColor &other)
 
TColoroperator= (const TColor &other)
 
TColoroperator+= (const TColor &other)
 
TColoroperator-= (const TColor &other)
 

Static Public Member Functions

static constexpr TColor red ()
 Predefined colors. More...
 
static constexpr TColor green ()
 
static constexpr TColor blue ()
 
static constexpr TColor black ()
 
static constexpr TColor white ()
 
static constexpr TColor gray ()
 

Public Attributes

uint8_t R {0}
 
uint8_t G {0}
 
uint8_t B {0}
 
uint8_t A {255}
 

Related Functions

(Note that these are not member functions.)

returning TColor
 

Constructor & Destructor Documentation

◆ TColor() [1/5]

constexpr mrpt::img::TColor::TColor ( )
inlineconstexprdefault

Referenced by black(), blue(), gray(), green(), red(), and white().

◆ TColor() [2/5]

constexpr mrpt::img::TColor::TColor ( uint8_t  r,
uint8_t  g,
uint8_t  b,
uint8_t  alpha = 255 
)
inlineconstexpr

Definition at line 28 of file TColor.h.

◆ TColor() [3/5]

constexpr mrpt::img::TColor::TColor ( const unsigned int  color_RGB_24bit)
inlineexplicitconstexpr

Definition at line 34 of file TColor.h.

◆ TColor() [4/5]

constexpr mrpt::img::TColor::TColor ( const unsigned int  color_RGB_24bit,
const uint8_t  alpha 
)
inlineconstexpr

Definition at line 42 of file TColor.h.

◆ TColor() [5/5]

mrpt::img::TColor::TColor ( const TColor other)
inline

Definition at line 60 of file TColor.h.

Member Function Documentation

◆ black()

static constexpr TColor mrpt::img::TColor::black ( )
inlinestaticconstexpr

◆ blue()

static constexpr TColor mrpt::img::TColor::blue ( )
inlinestaticconstexpr

◆ gray()

static constexpr TColor mrpt::img::TColor::gray ( )
inlinestaticconstexpr

Definition at line 71 of file TColor.h.

References TColor().

◆ green()

static constexpr TColor mrpt::img::TColor::green ( )
inlinestaticconstexpr

◆ operator unsigned int()

mrpt::img::TColor::operator unsigned int ( ) const
inline

Operator for implicit conversion into an int binary representation 0xRRGGBB.

Definition at line 55 of file TColor.h.

References B, G, and R.

◆ operator+=()

TColor & TColor::operator+= ( const TColor other)

Definition at line 45 of file TColor.cpp.

References A, B, G, and R.

◆ operator-=()

TColor & TColor::operator-= ( const TColor other)

Definition at line 55 of file TColor.cpp.

References A, B, G, and R.

◆ operator=()

TColor & TColor::operator= ( const TColor other)
default

◆ red()

static constexpr TColor mrpt::img::TColor::red ( )
inlinestaticconstexpr

◆ white()

static constexpr TColor mrpt::img::TColor::white ( )
inlinestaticconstexpr

Definition at line 70 of file TColor.h.

References TColor().

Referenced by mrpt::opengl::CColorBar::onUpdateBuffers_all().

Friends And Related Function Documentation

◆ TColor()

returning mrpt::img::TColor
related

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Member Data Documentation

◆ A

uint8_t mrpt::img::TColor::A {255}

◆ B

uint8_t mrpt::img::TColor::B {0}

◆ G

uint8_t mrpt::img::TColor::G {0}

◆ R

uint8_t mrpt::img::TColor::R {0}



Page generated by Doxygen 1.8.17 for MRPT 2.0.3 at Fri May 15 23:51:15 UTC 2020