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

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

Public Member Functions

 Color (float r, float g, float b, float a=1.f)
 
template<class T >
 Color (const T *rgba)
 
 Color (float gray=1.f, float a=1.f)
 
 Color (const Colori &c)
 
 Color (const HSV &hsv, float a=1.f)
 
 Color (const RGB &rgb, float a=1.f)
 
 Color (const CIE_XYZ &xyz, float a=1.f)
 
 Color (const Lab &lab, float a=1.f)
 
 Color (const HCLab &hclab, float a=1.f)
 
 Color (const Luv &luv, float a=1.f)
 
 Color (const HCLuv &hcluv, float a=1.f)
 
float & operator[] (int i)
 Set color component at index with no bounds checking.
 
const float & operator[] (int i) const
 Get color component at index with no bounds checking.
 
RGB & rgb ()
 
const RGB & rgb () const
 
Color & set (const Color &c, float al)
 Set RGB from another color and alpha from argument.
 
Color & set (float re, float gr, float bl, float al)
 Set RGBA components.
 
Color & set (float re, float gr, float bl)
 Set RGB components.
 
Color & set (float v)
 Set from gray value.
 
Color & set (float v, float al)
 Set from gray value and alpha.
 
template<class T >
Color & set (const T *rgba)
 Set from an array of RGBA components.
 
Color & operator= (float v)
 Set from gray value.
 
Color & operator= (double v)
 
Color & operator= (const Colori &v)
 Set components from integer color.
 
Color & operator= (const HSV &v)
 Set RGB components from HSV.
 
Color & operator= (const RGB &v)
 Set RGB components from RGB.
 
Color & operator= (const CIE_XYZ &v)
 Set RGB components from CIE_XYZ.
 
Color & operator= (const Lab &v)
 Set RGB components from Lab.
 
Color & operator= (const HCLab &v)
 Set RGB components from HCLab.
 
Color & operator= (const Luv &v)
 Set RGB components from Luv.
 
Color & operator= (const HCLuv &v)
 Set RGB components from HCLuv.
 
bool operator== (const Color &v) const
 Return true if all components are equal, false otherwise.
 
bool operator!= (const Color &v) const
 Return true if components are not equal, false otherwise.
 
Color & operator+= (const Color &v)
 
Color & operator-= (const Color &v)
 
Color & operator*= (const Color &v)
 
Color & operator/= (const Color &v)
 
Color & operator+= (float v)
 
Color & operator-= (float v)
 
Color & operator*= (float v)
 
Color & operator/= (float v)
 
Color operator- () const
 
Color operator+ (const Color &v) const
 
Color operator- (const Color &v) const
 
Color operator* (const Color &v) const
 
Color operator/ (const Color &v) const
 
Color operator+ (float v) const
 
Color operator- (float v) const
 
Color operator* (float v) const
 
Color operator/ (float v) const
 
Color & clamp (float max=1.f)
 Clamp all components into [0,max] range.
 
Color inverse () const
 Returns inverted color.
 
Color & invert ()
 Invert RGB components.
 
float luminance () const
 Returns luminance value.
 
Color blackAndWhite () const
 Returns nearest black or white color.
 
Color mix (const Color &c, float amt=0.5f) const
 Returns self linearly mixed with another color (0 = none)
 

Public Attributes

union {
   struct {
      float   r
 Red component in [0, 1].
 
      float   g
 Green component in [0, 1].
 
      float   b
 Blue component in [0, 1].
 
      float   a
 Alpha component in [0, 1].
 
   } 
 
   float   components [4]
 RGBA component vector.
 
}; 
 

Detailed Description

Color represented by red, green, blue, and alpha components

Definition at line 68 of file al_Color.hpp.

Constructor & Destructor Documentation

◆ Color() [1/11]

al::Color::Color ( float  r,
float  g,
float  b,
float  a = 1.f 
)
inline
Parameters
[in]rred component
[in]ggreen component
[in]bblue component
[in]aalpha component

Definition at line 83 of file al_Color.hpp.

◆ Color() [2/11]

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

Definition at line 87 of file al_Color.hpp.

◆ Color() [3/11]

al::Color::Color ( float  gray = 1.f,
float  a = 1.f 
)
inline
Parameters
[in]grayred/green/blue components
[in]aalpha component

Definition at line 91 of file al_Color.hpp.

◆ Color() [4/11]

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

Definition at line 94 of file al_Color.hpp.

◆ Color() [5/11]

al::Color::Color ( const HSV &  hsv,
float  a = 1.f 
)
inline
Parameters
[in]hsvHSV value
[in]aalpha component

Definition at line 98 of file al_Color.hpp.

◆ Color() [6/11]

al::Color::Color ( const RGB &  rgb,
float  a = 1.f 
)
inline
Parameters
[in]rgbRGB value
[in]aalpha component

Definition at line 102 of file al_Color.hpp.

◆ Color() [7/11]

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

Definition at line 106 of file al_Color.hpp.

◆ Color() [8/11]

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

Definition at line 110 of file al_Color.hpp.

◆ Color() [9/11]

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

Definition at line 114 of file al_Color.hpp.

◆ Color() [10/11]

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

Definition at line 118 of file al_Color.hpp.

◆ Color() [11/11]

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

Definition at line 122 of file al_Color.hpp.


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