HoverRace  2.0
Typedefs | Functions | Variables
HoverRace::VideoServices::ColorPalette Namespace Reference

Typedefs

using paletteEntry_t = SDL_Color
 

Functions

const paletteEntry_tConvertColor (MR_UInt8 pRed, MR_UInt8 pGreen, MR_UInt8 pBlue, double pGamma, double pIntensity, double pIntensityBase) noexcept
 Generate a palette entry from RGB components. More...
 
paletteEntry_tGetColors (double pGamma, double pIntensity, double pIntensityBase)
 Generate the "basic" range of the color palette. More...
 
std::ostream & operator<< (std::ostream &os, const paletteEntry_t &ent)
 
constexpr MR_UInt8PalB (paletteEntry_t &ent) noexcept
 
constexpr MR_UInt8PalG (paletteEntry_t &ent) noexcept
 
constexpr MR_UInt8PalR (paletteEntry_t &ent) noexcept
 

Variables

double basicPalette [][3]
 
int basicPaletteSize = 68
 
MR_DllDeclare MR_UInt8 colorAdditionTable [MR_NB_COLORS][MR_NB_COLORS]
 
MR_DllDeclare MR_UInt8 colorTable [MR_NB_COLOR_INTENSITY][MR_NB_COLORS]
 

Typedef Documentation

Function Documentation

MR_DllDeclare const paletteEntry_t & HoverRace::VideoServices::ColorPalette::ConvertColor ( MR_UInt8  pRed,
MR_UInt8  pGreen,
MR_UInt8  pBlue,
double  pGamma,
double  pIntensity,
double  pIntensityBase 
)
noexcept

Generate a palette entry from RGB components.

This is usually to apply color correction to the background palette.

Parameters
pRedThe red component.
pGreenThe green component.
pBlueThe blue component.
pGammaThe gamma correction (the inverse of the configuration gamma).
pIntensityThe color intensity (contrast * brightness).
pIntensityBaseThe base intensity (brightness - intensity).
Returns
The generated palette entry.
MR_DllDeclare paletteEntry_t * HoverRace::VideoServices::ColorPalette::GetColors ( double  pGamma,
double  pIntensity,
double  pIntensityBase 
)

Generate the "basic" range of the color palette.

The "basic" range starts at index MR_RESERVED_COLORS_BEGINNING and contains MR_BASIC_COLORS entries. The "background" range follows the "basic" range.

Parameters
pGammaThe gamma correction (the inverse of the configuration gamma).
pIntensityThe color intensity (contrast * brightness).
pIntensityBaseThe base intensity (brightness - intensity).
Returns
An array of size MR_BASIC_COLORS defining the "basic" range.
std::ostream & HoverRace::VideoServices::ColorPalette::operator<< ( std::ostream &  os,
const paletteEntry_t ent 
)
constexpr MR_UInt8& HoverRace::VideoServices::ColorPalette::PalB ( paletteEntry_t ent)
inlinenoexcept
constexpr MR_UInt8& HoverRace::VideoServices::ColorPalette::PalG ( paletteEntry_t ent)
inlinenoexcept
constexpr MR_UInt8& HoverRace::VideoServices::ColorPalette::PalR ( paletteEntry_t ent)
inlinenoexcept

Variable Documentation

double HoverRace::VideoServices::ColorPalette::basicPalette
int HoverRace::VideoServices::ColorPalette::basicPaletteSize = 68
MR_UInt8 HoverRace::VideoServices::ColorPalette::colorAdditionTable
MR_UInt8 HoverRace::VideoServices::ColorPalette::colorTable