#ifndef __COLOUR_PALETTE_HPP__
#define __COLOUR_PALETTE_HPP__
#include <vector>
#include <string>
#include "../emucore/m6502/src/bspf/src/bspf.hxx"
namespace ale {
class ColourPalette {
public:
ColourPalette();
void getRGB(int val, int& r, int& g, int& b) const;
uInt32 getRGB(int val) const;
uInt8 getGrayscale(int val) const;
void applyPaletteRGB(uInt8* dst_buffer, uInt8* src_buffer, size_t src_size);
void applyPaletteRGB(std::vector<unsigned char>& dst_buffer,
uInt8* src_buffer, size_t src_size);
void applyPaletteGrayscale(uInt8* dst_buffer, uInt8* src_buffer,
size_t src_size);
void applyPaletteGrayscale(std::vector<unsigned char>& dst_buffer,
uInt8* src_buffer, size_t src_size);
void setPalette(const std::string& type, const std::string& displayFormat);
void loadUserPalette(const std::string& paletteFile);
private:
uInt32* m_palette;
bool myUserPaletteDefined;
uInt32 m_userNTSCPalette[256];
uInt32 m_userPALPalette[256];
uInt32 m_userSECAMPalette[256];
};
}
#endif