Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cColorRef Class Reference

#include <cColorRef.h>

Public Member Functions

 cColorRef (COLORREF color=0) noexcept
 
 cColorRef (COLOR_ELEM_t r, COLOR_ELEM_t g, COLOR_ELEM_t b) noexcept
 
bool isValidColor () const noexcept
 
COLOR_ELEM_t GetElem (ITERATE_t i) const noexcept
 
 operator COLORREF () const noexcept
 
COLOR_ELEM_t get_R () const noexcept
 
COLOR_ELEM_t get_G () const noexcept
 
COLOR_ELEM_t get_B () const noexcept
 
COLOR16_t get_Grey16 () const noexcept
 
COLORREF get_ColorRef () const noexcept
 
D3DCOLOR get_ColorDX () const noexcept
 

Static Public Member Functions

static COLORREF GetRGB (COLOR_ELEM_t r, COLOR_ELEM_t g, COLOR_ELEM_t b) noexcept
 
static COLOR_ELEM_t GetR (COLORREF color) noexcept
 
static COLOR_ELEM_t GetG (COLORREF color) noexcept
 
static COLOR_ELEM_t GetB (COLORREF color) noexcept
 
static D3DCOLOR ToD3D (COLORREF color) noexcept
 
static COLORREF FromD3D (D3DCOLOR color) noexcept
 

Public Attributes

COLORREF m_color
 32 bit color. GDI format. [0]=red,[1]=green,[2]=blue,[3] = maybe alpha or ignored. More...
 

Detailed Description

_WIN32 GDI 32 bit COLORREF format. GDI RGBA (high to low [0] to [3] ) or ABGR (high to low value bytes) SURF_FORM_ABGR8888 Can use RGB() macro on these as well. GetGValue(), GetRValue() = UINT32 BGR (high to low bytes)

Note
D3DCOLOR type is backwards of this! D3DCOLOR_ARGB = ARGB (high to low)
Same as OpenGL = GL_RGBA8UI (byte order on disk).
This is just for GDI functions NOT for GDI texture raw data !

Constructor & Destructor Documentation

◆ cColorRef() [1/2]

GrayLib::cColorRef::cColorRef ( COLORREF  color = 0)
inlinenoexcept

◆ cColorRef() [2/2]

GrayLib::cColorRef::cColorRef ( COLOR_ELEM_t  r,
COLOR_ELEM_t  g,
COLOR_ELEM_t  b 
)
inlinenoexcept

Member Function Documentation

◆ FromD3D()

static COLORREF GrayLib::cColorRef::FromD3D ( D3DCOLOR  color)
inlinestaticnoexcept

< just reverse B&R

◆ get_B()

COLOR_ELEM_t GrayLib::cColorRef::get_B ( ) const
inlinenoexcept

◆ get_ColorDX()

D3DCOLOR GrayLib::cColorRef::get_ColorDX ( ) const
inlinenoexcept

◆ get_ColorRef()

COLORREF GrayLib::cColorRef::get_ColorRef ( ) const
inlinenoexcept

◆ get_G()

COLOR_ELEM_t GrayLib::cColorRef::get_G ( ) const
inlinenoexcept

◆ get_Grey16()

COLOR16_t GrayLib::cColorRef::get_Grey16 ( ) const
inlinenoexcept

◆ get_R()

COLOR_ELEM_t GrayLib::cColorRef::get_R ( ) const
inlinenoexcept

◆ GetB()

static COLOR_ELEM_t GrayLib::cColorRef::GetB ( COLORREF  color)
inlinestaticnoexcept

get the blue component. replace _WIN32 GetBValue()

◆ GetElem()

COLOR_ELEM_t GrayLib::cColorRef::GetElem ( ITERATE_t  i) const
inlinenoexcept

i= 0=red,1=g,2=b,3=a low to high bytes on little endian value.

◆ GetG()

static COLOR_ELEM_t GrayLib::cColorRef::GetG ( COLORREF  color)
inlinestaticnoexcept

get the green component. replace _WIN32 GetGValue()

◆ GetR()

static COLOR_ELEM_t GrayLib::cColorRef::GetR ( COLORREF  color)
inlinestaticnoexcept

get the red component. replace _WIN32 GetRValue()

◆ GetRGB()

static COLORREF GrayLib::cColorRef::GetRGB ( COLOR_ELEM_t  r,
COLOR_ELEM_t  g,
COLOR_ELEM_t  b 
)
inlinestaticnoexcept

replace _WIN32 RGB() macro. GDI ABGR (hi to lo bytes)

◆ isValidColor()

bool GrayLib::cColorRef::isValidColor ( ) const
inlinenoexcept

◆ operator COLORREF()

GrayLib::cColorRef::operator COLORREF ( ) const
inlinenoexcept

◆ ToD3D()

static D3DCOLOR GrayLib::cColorRef::ToD3D ( COLORREF  color)
inlinestaticnoexcept

< just reverse B&R

Member Data Documentation

◆ m_color

COLORREF GrayLib::cColorRef::m_color

32 bit color. GDI format. [0]=red,[1]=green,[2]=blue,[3] = maybe alpha or ignored.


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