summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util/png.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/util/png.h')
-rw-r--r--src/lib/util/png.h49
1 files changed, 6 insertions, 43 deletions
diff --git a/src/lib/util/png.h b/src/lib/util/png.h
index 9d54b2d30b5..9721df4ca94 100644
--- a/src/lib/util/png.h
+++ b/src/lib/util/png.h
@@ -17,7 +17,10 @@
#include "corefile.h"
#include "osdcore.h"
+#include <list>
#include <memory>
+#include <string>
+#include <utility>
@@ -25,40 +28,6 @@
CONSTANTS
***************************************************************************/
-#define PNG_Signature "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A"
-#define MNG_Signature "\x8A\x4D\x4E\x47\x0D\x0A\x1A\x0A"
-
-/* Chunk names */
-#define PNG_CN_IHDR 0x49484452L
-#define PNG_CN_PLTE 0x504C5445L
-#define PNG_CN_IDAT 0x49444154L
-#define PNG_CN_IEND 0x49454E44L
-#define PNG_CN_gAMA 0x67414D41L
-#define PNG_CN_sBIT 0x73424954L
-#define PNG_CN_cHRM 0x6348524DL
-#define PNG_CN_tRNS 0x74524E53L
-#define PNG_CN_bKGD 0x624B4744L
-#define PNG_CN_hIST 0x68495354L
-#define PNG_CN_tEXt 0x74455874L
-#define PNG_CN_zTXt 0x7A545874L
-#define PNG_CN_pHYs 0x70485973L
-#define PNG_CN_oFFs 0x6F464673L
-#define PNG_CN_tIME 0x74494D45L
-#define PNG_CN_sCAL 0x7343414CL
-
-/* MNG Chunk names */
-#define MNG_CN_MHDR 0x4D484452L
-#define MNG_CN_MEND 0x4D454E44L
-#define MNG_CN_TERM 0x5445524DL
-#define MNG_CN_BACK 0x4241434BL
-
-/* Prediction filters */
-#define PNG_PF_None 0
-#define PNG_PF_Sub 1
-#define PNG_PF_Up 2
-#define PNG_PF_Average 3
-#define PNG_PF_Paeth 4
-
/* Error types */
enum png_error
{
@@ -81,17 +50,11 @@ enum png_error
TYPE DEFINITIONS
***************************************************************************/
-struct png_text
-{
- png_text * next;
- const char * keyword; /* this is allocated */
- const char * text; /* this points to a part of keyword */
-};
-
-
class png_info
{
public:
+ using png_text = std::pair<std::string, std::string>;
+
~png_info() { free_data(); }
png_error read_file(util::core_file &fp);
@@ -122,7 +85,7 @@ public:
std::unique_ptr<std::uint8_t []> trans = 0;
std::uint32_t num_trans = 0;
- png_text * textlist = nullptr;
+ std::list<png_text> textlist;
private:
png_info &operator=(png_info &&) = default;