10 #ifndef mrpt_utils_tcolor_H
11 #define mrpt_utils_tcolor_H
27 inline TColor() : R(0),G(0),B(0),A(255) { }
28 inline TColor(uint8_t r,uint8_t g,uint8_t b, uint8_t alpha=255) : R(r),G(g),B(b),A(alpha) { }
29 inline explicit TColor(
const unsigned int color_RGB_24bit) : R(uint8_t(color_RGB_24bit>>16)),G(uint8_t(color_RGB_24bit>>8)),B(uint8_t(color_RGB_24bit)),A(255) { }
30 inline TColor(
const unsigned int color_RGB_24bit,
const uint8_t alpha) : R(uint8_t(color_RGB_24bit>>16)),G(uint8_t(color_RGB_24bit>>8)),B(uint8_t(color_RGB_24bit)),A(alpha) { }
34 inline operator unsigned int(
void)
const {
return (((
unsigned int)R)<<16) | (((
unsigned int)G)<<8) | B; }
54 TColorf(
float r=0,
float g=0,
float b=0,
float alpha=1.0f) : R(r),G(g),B(b),A(alpha) { }
55 explicit TColorf(
const TColor &col) : R(col.R*(1.f/255)),G(col.G*(1.f/255)),B(col.B*(1.f/255)),A(col.A*(1.f/255)) { }
CStream BASE_IMPEXP & operator<<(mrpt::utils::CStream &s, const char *a)
static TColor green
Predefined colors.
TColorf(float r=0, float g=0, float b=0, float alpha=1.0f)
static TColor gray
Predefined colors.
class BASE_IMPEXP CStream
static TColor white
Predefined colors.
::mrpt::utils::CStream & operator>>(mrpt::utils::CStream &in, CImagePtr &pObj)
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
TColor(const unsigned int color_RGB_24bit, const uint8_t alpha)
static TColor red
Predefined colors.
TColor(uint8_t r, uint8_t g, uint8_t b, uint8_t alpha=255)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
TColorf(const TColor &col)
A RGB color - floats in the range [0,1].
TColor(const unsigned int color_RGB_24bit)
static TColor blue
Predefined colors.
static TColor black
Predefined colors.