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

#include <cColorRef.h>

Public Member Functions

 cColorDX (D3DCOLOR color=0) noexcept
 
 cColorDX (COLOR_ELEM_t r, COLOR_ELEM_t g, COLOR_ELEM_t b) noexcept
 
 cColorDX (COLOR_ELEM_t a, COLOR_ELEM_t r, COLOR_ELEM_t g, COLOR_ELEM_t b) noexcept
 
 operator D3DCOLOR () const noexcept
 
COLOR_ELEM_t GetElem (ITERATE_t i) const
 
COLOR_ELEM_t get_R () const noexcept
 
COLOR_ELEM_t get_G () const noexcept
 
COLOR_ELEM_t get_B () const noexcept
 
COLOR_ELEM_t get_A () const noexcept
 
void put_A (COLOR_ELEM_t a) noexcept
 
void put_RGB (D3DCOLOR c) noexcept
 
COLOR16_t get_Grey16 () const noexcept
 
COLORREF get_ColorRef () const noexcept
 
D3DCOLOR get_ColorDX () const noexcept
 

Static Public Member Functions

static COLOR_ELEM_t GetA (D3DCOLOR color) noexcept
 
static COLOR_ELEM_t GetR (D3DCOLOR color) noexcept
 
static COLOR_ELEM_t GetG (D3DCOLOR color) noexcept
 
static COLOR_ELEM_t GetB (D3DCOLOR color) noexcept
 
static D3DCOLOR GetAC (COLOR_ELEM_t alpha, D3DCOLOR color) noexcept
 
static D3DCOLOR GetARGB (COLOR_ELEM_t a, COLOR_ELEM_t r, COLOR_ELEM_t g, COLOR_ELEM_t b) noexcept
 
static D3DCOLOR GetXRGB (COLOR_ELEM_t r, COLOR_ELEM_t g, COLOR_ELEM_t b) noexcept
 

Public Attributes

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

Static Public Attributes

static const D3DCOLOR k_ALPHA_MASK = 0xFF000000
 
static const int k_ALPHA_SHIFT = 24
 

Detailed Description

D3D 32 bit color format. BGRA ( [0] to [3] index bytes) or ARGB (hi to lo value bytes) GdiplusColor.h Color uses this format as well. similar to RGBQUAD and tagRGBTRIPLE D3DCOLOR assumes D3DFMT_A8R8G8B8 = SURF_FORM_ARGB8888 maps unsigned 8 bits/channel to D3DCOLOR. from "#include <d3d9types.h>" D3DCOLOR macros for color are D3DCOLOR_XRGB(20,240,20) or D3DCOLOR_ARGB()

Constructor & Destructor Documentation

◆ cColorDX() [1/3]

GrayLib::cColorDX::cColorDX ( D3DCOLOR  color = 0)
inlinenoexcept

◆ cColorDX() [2/3]

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

◆ cColorDX() [3/3]

GrayLib::cColorDX::cColorDX ( COLOR_ELEM_t  a,
COLOR_ELEM_t  r,
COLOR_ELEM_t  g,
COLOR_ELEM_t  b 
)
inlinenoexcept

Member Function Documentation

◆ get_A()

COLOR_ELEM_t GrayLib::cColorDX::get_A ( ) const
inlinenoexcept

◆ get_B()

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

◆ get_ColorDX()

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

◆ get_ColorRef()

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

◆ get_G()

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

◆ get_Grey16()

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

◆ get_R()

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

◆ GetA()

static COLOR_ELEM_t GrayLib::cColorDX::GetA ( D3DCOLOR  color)
inlinestaticnoexcept

get the alpha component.

◆ GetAC()

static D3DCOLOR GrayLib::cColorDX::GetAC ( COLOR_ELEM_t  alpha,
D3DCOLOR  color 
)
inlinestaticnoexcept

overwrite the alpha on a color.

◆ GetARGB()

static D3DCOLOR GrayLib::cColorDX::GetARGB ( COLOR_ELEM_t  a,
COLOR_ELEM_t  r,
COLOR_ELEM_t  g,
COLOR_ELEM_t  b 
)
inlinestaticnoexcept

maps unsigned 8 bits/channel to D3DCOLOR. from "#include <d3d9types.h>" ARGB (hi to lo bytes) Replaces DirectX D3DCOLOR_ARGB() macro

◆ GetB()

static COLOR_ELEM_t GrayLib::cColorDX::GetB ( D3DCOLOR  color)
inlinestaticnoexcept

get the blue component.

◆ GetElem()

COLOR_ELEM_t GrayLib::cColorDX::GetElem ( ITERATE_t  i) const
inline
  • i = 0=b,1=g,2=r,3=a

◆ GetG()

static COLOR_ELEM_t GrayLib::cColorDX::GetG ( D3DCOLOR  color)
inlinestaticnoexcept

get the green component.

◆ GetR()

static COLOR_ELEM_t GrayLib::cColorDX::GetR ( D3DCOLOR  color)
inlinestaticnoexcept

get the red component.

◆ GetXRGB()

static D3DCOLOR GrayLib::cColorDX::GetXRGB ( COLOR_ELEM_t  r,
COLOR_ELEM_t  g,
COLOR_ELEM_t  b 
)
inlinestaticnoexcept

Replaces DirectX D3DCOLOR_XRGB() macro

◆ operator D3DCOLOR()

GrayLib::cColorDX::operator D3DCOLOR ( ) const
inlinenoexcept

◆ put_A()

void GrayLib::cColorDX::put_A ( COLOR_ELEM_t  a)
inlinenoexcept

Set just the alpha. leave the rest.

◆ put_RGB()

void GrayLib::cColorDX::put_RGB ( D3DCOLOR  c)
inlinenoexcept

Set just the diffuse color elements. leave the alpha.

Member Data Documentation

◆ k_ALPHA_MASK

const D3DCOLOR GrayLib::cColorDX::k_ALPHA_MASK = 0xFF000000
static

◆ k_ALPHA_SHIFT

const int GrayLib::cColorDX::k_ALPHA_SHIFT = 24
static

◆ m_color

D3DCOLOR GrayLib::cColorDX::m_color

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


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