Oops from previous commit
[lsnes.git] / include / library / framebuffer-pixfmt.hpp
blob3fa218b8f3bcad1e8fbc3f9137bdd462df294263
1 #ifndef _library__framebuffer_pixfmt__hpp__included__
2 #define _library__framebuffer_pixfmt__hpp__included__
4 #include <cstdint>
5 #include <cstdlib>
6 #include <stdexcept>
8 namespace framebuffer
10 template<bool X> class auxpalette;
12 /**
13 * Pixel format.
15 class pixfmt
17 public:
18 virtual ~pixfmt() throw();
19 /**
20 * Register the pixel format.
22 pixfmt() throw(std::bad_alloc);
23 /**
24 * Decode pixel format data into RGB data (0, R, G, B).
26 virtual void decode(uint32_t* target, const uint8_t* src, size_t width)
27 throw() = 0;
28 /**
29 * Decode pixel format data into RGB (with specified byte order).
31 virtual void decode(uint32_t* target, const uint8_t* src, size_t width,
32 const auxpalette<false>& auxp) throw() = 0;
33 /**
34 * Decode pixel format data into RGB (with specified byte order).
36 virtual void decode(uint64_t* target, const uint8_t* src, size_t width,
37 const auxpalette<true>& auxp) throw() = 0;
38 /**
39 * Create aux palette.
41 virtual void set_palette(auxpalette<false>& auxp, uint8_t rshift, uint8_t gshift,
42 uint8_t bshift) throw(std::bad_alloc) = 0;
43 /**
44 * Create aux palette.
46 virtual void set_palette(auxpalette<true>& auxp, uint8_t rshift, uint8_t gshift,
47 uint8_t bshift) throw(std::bad_alloc) = 0;
48 /**
49 * Bytes per pixel in data.
51 virtual uint8_t get_bpp() throw() = 0;
52 /**
53 * Bytes per pixel in ss data.
55 virtual uint8_t get_ss_bpp() throw() = 0;
56 /**
57 * Screenshot magic (0 for the old format).
59 virtual uint32_t get_magic() throw() = 0;
63 #endif