Allolib  1.0
C++ Components For Interactive Multimedia
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Modules Pages
al::RGB Struct Reference

Color represented by red, green, and blue components. More...

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

Public Member Functions

 RGB (float r, float g, float b)
 
template<class T >
 RGB (const T *rgb)
 
 RGB (float gray=1.f)
 
 RGB (const Color &v)
 
 RGB (const Colori &v)
 
 RGB (const HSV &hsv)
 
 RGB (const CIE_XYZ &xyz)
 
 RGB (const Lab &lab)
 
 RGB (const HCLab &hclab)
 
 RGB (const Luv &luv)
 
 RGB (const HCLuv &hcluv)
 
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.
 
RGBset (const RGB &v)
 Set from another RGB.
 
RGBset (float re, float gr, float bl)
 Set from RGB components.
 
RGBset (float v)
 Set from gray value.
 
template<class T >
RGBset (const T *rgb)
 Set from an array of RGB components.
 
RGBoperator= (float v)
 Set from gray value.
 
RGBoperator= (double v)
 
RGBoperator= (const HSV &v)
 Set RGB components from HSV.
 
RGBoperator= (const Color &v)
 Set RGB components from Color.
 
RGBoperator= (const Colori &v)
 Set RGB components from Colori.
 
RGBoperator= (const CIE_XYZ &v)
 Set RGB components from CIE_XYZ.
 
RGBoperator= (const Lab &v)
 Set RGB components from Lab.
 
RGBoperator= (const HCLab &v)
 Set RGB components from HCLab.
 
RGBoperator= (const Luv &v)
 Set RGB components from Luv.
 
RGBoperator= (const HCLuv &v)
 Set RGB components from HCLuv.
 
bool operator== (const RGB &v) const
 Return true if all components are equal, false otherwise.
 
bool operator!= (const RGB &v) const
 Return true if components are not equal, false otherwise.
 
RGBoperator+= (const RGB &v)
 
RGBoperator-= (const RGB &v)
 
RGBoperator*= (const RGB &v)
 
RGBoperator/= (const RGB &v)
 
RGBoperator+= (float v)
 
RGBoperator-= (float v)
 
RGBoperator*= (float v)
 
RGBoperator/= (float v)
 
RGB operator- () const
 
RGB operator+ (const RGB &v) const
 
RGB operator- (const RGB &v) const
 
RGB operator* (const RGB &v) const
 
RGB operator/ (const RGB &v) const
 
RGB operator+ (float v) const
 
RGB operator- (float v) const
 
RGB operator* (float v) const
 
RGB operator/ (float v) const
 
RGBclamp (float max=1.f)
 Clamp all components into [0,max] range.
 
RGB inverse () const
 Returns inverted color.
 
RGBinvert ()
 Invert RGB components.
 
float luminance () const
 Returns luminance value (following ITU-R BT.601)
 
RGB mix (const RGB &v, 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   components [3]
 RGB component vector.
 
}; 
 

Detailed Description

Color represented by red, green, and blue components.

This offers an alternative to the Color class where the alpha component is not required for computation.

Definition at line 503 of file al_Color.hpp.

Constructor & Destructor Documentation

◆ RGB() [1/11]

al::RGB::RGB ( float  r,
float  g,
float  b 
)
inline
Parameters
[in]rred component
[in]ggreen component
[in]bblue component

Definition at line 516 of file al_Color.hpp.

◆ RGB() [2/11]

template<class T >
al::RGB::RGB ( const T *  rgb)
inline
Parameters
[in]rgb3-vector of RGB components

Definition at line 520 of file al_Color.hpp.

◆ RGB() [3/11]

al::RGB::RGB ( float  gray = 1.f)
inline
Parameters
[in]grayred/green/blue components

Definition at line 523 of file al_Color.hpp.

◆ RGB() [4/11]

al::RGB::RGB ( const Color v)
inline
Parameters
[in]vRGB color to convert from

Definition at line 526 of file al_Color.hpp.

◆ RGB() [5/11]

al::RGB::RGB ( const Colori v)
inline
Parameters
[in]vColori to convert from

Definition at line 529 of file al_Color.hpp.

◆ RGB() [6/11]

al::RGB::RGB ( const HSV hsv)
inline
Parameters
[in]hsvHSV value

Definition at line 532 of file al_Color.hpp.

◆ RGB() [7/11]

al::RGB::RGB ( const CIE_XYZ xyz)
inline
Parameters
[in]xyzCIE_XYZ value

Definition at line 535 of file al_Color.hpp.

◆ RGB() [8/11]

al::RGB::RGB ( const Lab lab)
inline
Parameters
[in]labLab value

Definition at line 538 of file al_Color.hpp.

◆ RGB() [9/11]

al::RGB::RGB ( const HCLab hclab)
inline
Parameters
[in]hclabHCLab value

Definition at line 541 of file al_Color.hpp.

◆ RGB() [10/11]

al::RGB::RGB ( const Luv luv)
inline
Parameters
[in]luvLuv value

Definition at line 544 of file al_Color.hpp.

◆ RGB() [11/11]

al::RGB::RGB ( const HCLuv hcluv)
inline
Parameters
[in]hcluvHCLuv value

Definition at line 547 of file al_Color.hpp.


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