Save bitmaps as PNG
[lsnes.git] / include / library / png-codec.hpp
blob976f3b2009217aaeb7a26bef40e3fe1c81fad641
1 #ifndef _library__png__hpp__included__
2 #define _library__png__hpp__included__
4 #include <cstdlib>
5 #include <cstdint>
6 #include <vector>
7 #include <string>
8 #include <iostream>
10 struct png_decoded_image
12 png_decoded_image();
13 png_decoded_image(std::istream& file);
14 png_decoded_image(const std::string& file);
15 size_t width;
16 size_t height;
17 bool has_palette;
18 std::vector<uint32_t> data;
19 std::vector<uint32_t> palette;
20 private:
21 void decode_png(std::istream& file);
24 struct png_encodedable_image
26 png_encodedable_image();
27 size_t width;
28 size_t height;
29 bool has_palette;
30 bool has_alpha;
31 uint32_t colorkey;
32 std::vector<uint32_t> data;
33 std::vector<uint32_t> palette;
34 void encode(const std::string& file) const;
35 void encode(std::ostream& file) const;
38 #endif