ManaPlus
|
#include <dyepalette.h>
Public Member Functions | |
DyePalette (const std::string &pallete, const uint8_t blockSize) | |
void | getColor (const unsigned int intensity, unsigned int(&color)[3]) const |
void | getColor (double intensity, int(&color)[3]) const |
void | replaceSColorDefault (uint32_t *pixels, const int bufSize) const |
void | replaceAColorDefault (uint32_t *pixels, const int bufSize) const |
void | replaceSOGLColorDefault (uint32_t *pixels, const int bufSize) const |
void | replaceAOGLColorDefault (uint32_t *pixels, const int bufSize) const |
Static Public Member Functions | |
static unsigned int | hexDecode (const signed char c) A_CONST |
static void | hexToColor (const std::string &hexStr, const uint8_t blockSize, DyeColor &color) |
static void | initFunctions () |
Static Public Attributes | |
static DyeFunctionPtr | funcReplaceSOGLColor = 0 |
static DyeFunctionPtr | funcReplaceSOGLColorSse2 = 0 |
static DyeFunctionPtr | funcReplaceSOGLColorAvx2 = 0 |
static DyeFunctionPtr | funcReplaceAOGLColor = 0 |
static DyeFunctionPtr | funcReplaceAOGLColorSse2 = 0 |
static DyeFunctionPtr | funcReplaceAOGLColorAvx2 = 0 |
static DyeFunctionPtr | funcReplaceSColor = 0 |
static DyeFunctionPtr | funcReplaceSColorSse2 = 0 |
static DyeFunctionPtr | funcReplaceSColorAvx2 = 0 |
static DyeFunctionPtr | funcReplaceAColor = 0 |
static DyeFunctionPtr | funcReplaceAColorSse2 = 0 |
static DyeFunctionPtr | funcReplaceAColorAvx2 = 0 |
Private Attributes | |
std::vector< DyeColor > | mColors |
Class for performing a linear interpolation between colors.
Definition at line 46 of file dyepalette.h.
DyePalette::DyePalette | ( | const std::string & | pallete, |
const uint8_t | blockSize | ||
) |
Creates a palette based on the given string. The string is either a file name or a sequence of hexadecimal RGB values separated by ',' and starting with '#'.
Definition at line 68 of file dyepalette.cpp.
References CAST_SIZE, CAST_U8, FOR_EACH, PaletteDB::getColor(), hexDecode(), hexToColor(), Logger::log(), logger, mColors, EmoteDB::size(), splitToStringVector(), and DyeColor::value.
void DyePalette::getColor | ( | const unsigned int | intensity, |
unsigned int(&) | color[3] | ||
) | const |
Gets a pixel color depending on its intensity. First color is implicitly black (0, 0, 0).
Definition at line 152 of file dyepalette.cpp.
References CAST_S32, anonymous_namespace{palettedb.cpp}::mColors, and DyeColor::value.
Referenced by Theme::getProgressColor().
void DyePalette::getColor | ( | double | intensity, |
int(&) | color[3] | ||
) | const |
Gets a pixel color depending on its intensity.
Definition at line 210 of file dyepalette.cpp.
References CAST_S32, anonymous_namespace{palettedb.cpp}::mColors, and DyeColor::value.
|
static |
|
static |
|
static |
Definition at line 253 of file dyepalette.cpp.
References Cpu::FEATURE_AVX2, Cpu::FEATURE_SSE2, funcReplaceAColor, funcReplaceAColorAvx2, funcReplaceAColorSse2, funcReplaceAOGLColor, funcReplaceAOGLColorAvx2, funcReplaceAOGLColorSse2, funcReplaceSColor, funcReplaceSColorAvx2, funcReplaceSColorSse2, funcReplaceSOGLColor, funcReplaceSOGLColorAvx2, funcReplaceSOGLColorSse2, Cpu::getFlags(), replaceAColorDefault(), replaceAOGLColorDefault(), replaceSColorDefault(), and replaceSOGLColorDefault().
Referenced by Client::gameInit(), and main().
void DyePalette::replaceAColorDefault | ( | uint32_t * | pixels, |
const int | bufSize | ||
) | const |
replace colors for SDL for A dye.
Definition at line 40 of file dyepalette_replaceacolor.cpp.
References CAST_SIZE, data, anonymous_namespace{palettedb.cpp}::mColors, and DyeColor::value.
Referenced by initFunctions().
void DyePalette::replaceAOGLColorDefault | ( | uint32_t * | pixels, |
const int | bufSize | ||
) | const |
replace colors for OpenGL for A dye.
Definition at line 42 of file dyepalette_replaceaoglcolor.cpp.
References CAST_SIZE, data, anonymous_namespace{palettedb.cpp}::mColors, and DyeColor::value.
Referenced by initFunctions().
void DyePalette::replaceSColorDefault | ( | uint32_t * | pixels, |
const int | bufSize | ||
) | const |
replace colors for SDL for S dye.
Definition at line 40 of file dyepalette_replacescolor.cpp.
References CAST_SIZE, data, anonymous_namespace{palettedb.cpp}::mColors, and DyeColor::value.
Referenced by initFunctions().
void DyePalette::replaceSOGLColorDefault | ( | uint32_t * | pixels, |
const int | bufSize | ||
) | const |
replace colors for OpenGL for S dye.
Definition at line 42 of file dyepalette_replacesoglcolor.cpp.
References CAST_SIZE, data, anonymous_namespace{palettedb.cpp}::mColors, and DyeColor::value.
Referenced by initFunctions().
|
static |
Definition at line 178 of file dyepalette.h.
Referenced by initFunctions().
|
static |
Definition at line 180 of file dyepalette.h.
Referenced by initFunctions().
|
static |
Definition at line 179 of file dyepalette.h.
Referenced by initFunctions().
|
static |
Definition at line 170 of file dyepalette.h.
Referenced by initFunctions().
|
static |
Definition at line 172 of file dyepalette.h.
Referenced by initFunctions().
|
static |
Definition at line 171 of file dyepalette.h.
Referenced by initFunctions().
|
static |
Definition at line 175 of file dyepalette.h.
Referenced by initFunctions().
|
static |
Definition at line 177 of file dyepalette.h.
Referenced by initFunctions().
|
static |
Definition at line 176 of file dyepalette.h.
Referenced by initFunctions().
|
static |
Definition at line 167 of file dyepalette.h.
Referenced by initFunctions().
|
static |
Definition at line 169 of file dyepalette.h.
Referenced by initFunctions().
|
static |
Definition at line 168 of file dyepalette.h.
Referenced by initFunctions().
|
private |
Definition at line 185 of file dyepalette.h.
Referenced by DyePalette().