stmm-games-doc  0.32.0
Public Types | Public Member Functions | Static Public Member Functions | List of all members
stmg::TileColor Class Reference
Inheritance diagram for stmg::TileColor:
Inheritance graph
[legend]

Public Types

enum  COLOR_TYPE { COLOR_TYPE_EMPTY = 0, COLOR_TYPE_INDEX = 1, COLOR_TYPE_RGB = 2, COLOR_TYPE_PAL = 3 }
 
enum  { COLOR_INDEX_MIN = 0, COLOR_INDEX_MAX = ((1 << 24) - 1) }
 
enum  COLOR_PAL {
  COLOR_PAL_FIRST = 0, COLOR_PAL_STD_FIRST = 0, COLOR_PAL_STD_BLACK = 0, COLOR_PAL_STD_WHITE = 1,
  COLOR_PAL_STD_RED = 2, COLOR_PAL_STD_GREEN = 3, COLOR_PAL_STD_BLUE = 4, COLOR_PAL_STD_YELLOW = 5,
  COLOR_PAL_STD_MAGENTA = 6, COLOR_PAL_STD_CYAN = 7, COLOR_PAL_STD_ORANGE = 8, COLOR_PAL_STD_BROWN = 9,
  COLOR_PAL_STD_PINK = 10, COLOR_PAL_STD_GRAY = 11, COLOR_PAL_STD_LAST = 11, COLOR_PAL_LAST = ((1 << 24) - 1)
}
 The standard colors of a palette. More...
 

Public Member Functions

 TileColor () noexcept
 
bool isEmpty () const noexcept
 
bool operator== (const TileColor &oTileColor) const noexcept
 
void clear () noexcept
 
COLOR_TYPE getColorType () const noexcept
 
uint32_t getColorIndex () const noexcept
 
void setColorIndex (uint32_t nIdx) noexcept
 
uint32_t getColorPal () const noexcept
 
void setColorPal (uint32_t nColor) noexcept
 
void getColorRGB (uint8_t &nR, uint8_t &nG, uint8_t &nB) const noexcept
 
void setColorRGB (uint8_t nR, uint8_t nG, uint8_t nB) noexcept
 
double getColorRed1 () const noexcept
 
double getColorGreen1 () const noexcept
 
double getColorBlue1 () const noexcept
 
void setColorRGB1 (double fR, double fG, double fB) noexcept
 
void dump () const noexcept
 

Static Public Member Functions

static double colorUint8ToDouble1 (uint8_t nCol) noexcept
 
static int32_t rgbToInt32 (uint8_t nR, uint8_t nG, uint8_t nB) noexcept
 
static void int32ToRgb (int32_t nRgb, uint8_t &nR, uint8_t &nG, uint8_t &nB) noexcept
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
COLOR_INDEX_MIN 
COLOR_INDEX_MAX 

◆ COLOR_PAL

The standard colors of a palette.

Enumerator
COLOR_PAL_FIRST 
COLOR_PAL_STD_FIRST 
COLOR_PAL_STD_BLACK 
COLOR_PAL_STD_WHITE 
COLOR_PAL_STD_RED 
COLOR_PAL_STD_GREEN 
COLOR_PAL_STD_BLUE 
COLOR_PAL_STD_YELLOW 
COLOR_PAL_STD_MAGENTA 
COLOR_PAL_STD_CYAN 
COLOR_PAL_STD_ORANGE 
COLOR_PAL_STD_BROWN 
COLOR_PAL_STD_PINK 
COLOR_PAL_STD_GRAY 
COLOR_PAL_STD_LAST 
COLOR_PAL_LAST 

◆ COLOR_TYPE

Enumerator
COLOR_TYPE_EMPTY 

Empty tile.

COLOR_TYPE_INDEX 

Named index.

See Named::colors().

COLOR_TYPE_RGB 

8bit RGB (red green blue).

COLOR_TYPE_PAL 

Palette number.

The actual colors of the palette are defined by a theme somewhere else.

Constructor & Destructor Documentation

◆ TileColor()

stmg::TileColor::TileColor ( )
inlinenoexcept

Member Function Documentation

◆ clear()

void stmg::TileColor::clear ( )
inlinenoexcept

◆ colorUint8ToDouble1()

static double stmg::TileColor::colorUint8ToDouble1 ( uint8_t  nCol)
inlinestaticnoexcept

◆ dump()

void stmg::TileColor::dump ( ) const
inlinenoexcept

◆ getColorBlue1()

double stmg::TileColor::getColorBlue1 ( ) const
inlinenoexcept

◆ getColorGreen1()

double stmg::TileColor::getColorGreen1 ( ) const
inlinenoexcept

◆ getColorIndex()

uint32_t stmg::TileColor::getColorIndex ( ) const
inlinenoexcept

◆ getColorPal()

uint32_t stmg::TileColor::getColorPal ( ) const
inlinenoexcept

◆ getColorRed1()

double stmg::TileColor::getColorRed1 ( ) const
inlinenoexcept

◆ getColorRGB()

void stmg::TileColor::getColorRGB ( uint8_t &  nR,
uint8_t &  nG,
uint8_t &  nB 
) const
inlinenoexcept

◆ getColorType()

COLOR_TYPE stmg::TileColor::getColorType ( ) const
inlinenoexcept

◆ int32ToRgb()

static void stmg::TileColor::int32ToRgb ( int32_t  nRgb,
uint8_t &  nR,
uint8_t &  nG,
uint8_t &  nB 
)
inlinestaticnoexcept

◆ isEmpty()

bool stmg::TileColor::isEmpty ( ) const
inlinenoexcept

◆ operator==()

bool stmg::TileColor::operator== ( const TileColor oTileColor) const
inlinenoexcept

◆ rgbToInt32()

static int32_t stmg::TileColor::rgbToInt32 ( uint8_t  nR,
uint8_t  nG,
uint8_t  nB 
)
inlinestaticnoexcept

◆ setColorIndex()

void stmg::TileColor::setColorIndex ( uint32_t  nIdx)
inlinenoexcept

◆ setColorPal()

void stmg::TileColor::setColorPal ( uint32_t  nColor)
inlinenoexcept

◆ setColorRGB()

void stmg::TileColor::setColorRGB ( uint8_t  nR,
uint8_t  nG,
uint8_t  nB 
)
inlinenoexcept

◆ setColorRGB1()

void stmg::TileColor::setColorRGB1 ( double  fR,
double  fG,
double  fB 
)
inlinenoexcept