23#ifndef BAGEL_BOFLIB_GFX_PALETTE_H
24#define BAGEL_BOFLIB_GFX_PALETTE_H
26#include "graphics/palette.h"
27#include "bagel/afxwin.h"
28#include "bagel/boflib/error.h"
29#include "bagel/boflib/object.h"
30#include "bagel/boflib/stdinc.h"
36 byte _data[Graphics::PALETTE_SIZE];
60#define GetRed(rgb) ((byte)((rgb) & 0x000000FF))
61#define GetGreen(rgb) ((byte)(((rgb) >> 8) & 0x000000FF))
62#define GetBlue(rgb) ((byte)(((rgb) >> 16) & 0x000000FF))
69 static char _szSharedPalFile[MAX_FNAME];
99 ErrorCode
loadPalette(
const char *pszFileName, uint16 nFlags = PAL_DEFAULT);
101 ErrorCode createDefault(uint16 nFlags = PAL_DEFAULT);
103 byte getNearestIndex(COLORREF cColor);
105 COLORREF getColor(
byte nIndex);
117 const byte *getData()
const {
118 return _palette._data;
121 void setData(
const byte* colors) {
122 memcpy(_palette._data, colors, Graphics::PALETTE_SIZE);
125 virtual ~CBofPalette();
CBofPalette(const PaletteData &paletteData)
CBofPalette * copyPalette()
CBofPalette(const char *pszFileName)
void setPalette(const PaletteData &PaletteData)
static CBofPalette * getSharedPalette()
ErrorCode loadPalette(const char *pszFileName, uint16 nFlags=PAL_DEFAULT)
static ErrorCode setSharedPalette(const char *pszFileName)
constexpr int PALETTE_COUNT
Definition: palette.h:42