Allolib  1.0
C++ Components For Interactive Multimedia
al::Colori Struct Reference

#include <C:/Users/Andres/source/repos/casm_viewer/external/tinc/external/allolib/include/al/types/al_Color.hpp>

Public Member Functions

 Colori (uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)
 
template<class T >
 Colori (const T *rgba)
 
 Colori (uint8_t gray=255, uint8_t a=255)
 
 Colori (const Color &c)
 
 Colori (const HSV &hsv, uint8_t a=255)
 
 Colori (const RGB &rgb, uint8_t a=255)
 
 Colori (const CIE_XYZ &xyz, float a=1.f)
 
 Colori (const Lab &lab, float a=1.f)
 
 Colori (const HCLab &hclab, float a=1.f)
 
 Colori (const Luv &luv, float a=1.f)
 
 Colori (const HCLuv &hcluv, float a=1.f)
 
uint8_t & operator[] (int i)
 Set color component at index with no bounds checking.
 
const uint8_t & operator[] (int i) const
 Get color component at index with no bounds checking.
 
Colorioperator= (const Color &v)
 Set from floating-point color.
 
Colorioperator= (const HSV &v)
 Set RGB components from HSV.
 
Colorioperator= (const RGB &v)
 Set RGB components from RGB.
 
Colorioperator= (const CIE_XYZ &v)
 Set RGB components from CIE_XYZ.
 
Colorioperator= (const Lab &v)
 Set RGB components from Lab.
 
Colorioperator= (const HCLab &v)
 Set RGB components from HCLab.
 
Colorioperator= (const Luv &v)
 Set RGB components from Luv.
 
Colorioperator= (const HCLuv &v)
 Set RGB components from HCLuv.
 
Coloriset (uint8_t re, uint8_t gr, uint8_t bl)
 Set RGB components.
 
Coloriset (uint8_t re, uint8_t gr, uint8_t bl, uint8_t al)
 Set RGBA components.
 
Coloriset (uint8_t v)
 Set from gray value.
 
Coloriset (uint8_t v, uint8_t al)
 Set from gray value and alpha.
 
Colori inverse () const
 Returns inverted color.
 
Coloriinvert ()
 Invert RGB components.
 

Public Attributes

union {
   struct {
      uint8_t   r
 Red component in [0, 255].
 
      uint8_t   g
 Green component in [0, 255].
 
      uint8_t   b
 Blue component in [0, 255].
 
      uint8_t   a
 Alpha component in [0, 255].
 
   } 
 
   uint8_t   components [4]
 RGBA component vector.
 
   uint32_t   rgba
 RGBA components packed into 32-bit integer.
 
}; 
 

Detailed Description

Color represented by red, green, blue, and alpha components packed into 32-bit integer The component accessor methods operate exclusively with integer types. To convert to and from floating point values in the interval [0, 1], use the overloaded assignment (=) operators.

Definition at line 265 of file al_Color.hpp.

Constructor & Destructor Documentation

◆ Colori() [1/11]

al::Colori::Colori ( uint8_t  r,
uint8_t  g,
uint8_t  b,
uint8_t  a = 255 
)
inline
Parameters
[in]rred component
[in]ggreen component
[in]bblue component
[in]aalpha component

Definition at line 281 of file al_Color.hpp.

◆ Colori() [2/11]

template<class T >
al::Colori::Colori ( const T *  rgba)
inline
Parameters
[in]rgba4-vector of RGBA components

Definition at line 286 of file al_Color.hpp.

◆ Colori() [3/11]

al::Colori::Colori ( uint8_t  gray = 255,
uint8_t  a = 255 
)
inline
Parameters
[in]grayred/green/blue components
[in]aalpha component

Definition at line 290 of file al_Color.hpp.

◆ Colori() [4/11]

al::Colori::Colori ( const Color c)
inline
Parameters
[in]cRGBA color to convert from

Definition at line 294 of file al_Color.hpp.

◆ Colori() [5/11]

al::Colori::Colori ( const HSV hsv,
uint8_t  a = 255 
)
inline
Parameters
[in]hsvHSV color
[in]aalpha component

Definition at line 298 of file al_Color.hpp.

◆ Colori() [6/11]

al::Colori::Colori ( const RGB rgb,
uint8_t  a = 255 
)
inline
Parameters
[in]rgbRGB color
[in]aalpha component

Definition at line 302 of file al_Color.hpp.

◆ Colori() [7/11]

al::Colori::Colori ( const CIE_XYZ xyz,
float  a = 1.f 
)
inline
Parameters
[in]xyzCIE_XYZ color
[in]aalpha component

Definition at line 306 of file al_Color.hpp.

◆ Colori() [8/11]

al::Colori::Colori ( const Lab lab,
float  a = 1.f 
)
inline
Parameters
[in]labLab color
[in]aalpha component

Definition at line 312 of file al_Color.hpp.

◆ Colori() [9/11]

al::Colori::Colori ( const HCLab hclab,
float  a = 1.f 
)
inline
Parameters
[in]hclabHCLab value
[in]aalpha component

Definition at line 318 of file al_Color.hpp.

◆ Colori() [10/11]

al::Colori::Colori ( const Luv luv,
float  a = 1.f 
)
inline
Parameters
[in]luvLuv value
[in]aalpha component

Definition at line 324 of file al_Color.hpp.

◆ Colori() [11/11]

al::Colori::Colori ( const HCLuv hcluv,
float  a = 1.f 
)
inline
Parameters
[in]hcluvHCLuv value
[in]aalpha component

Definition at line 330 of file al_Color.hpp.


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