summaryrefslogtreecommitdiffstats
path: root/lib/picopng.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/picopng.h')
-rw-r--r--lib/picopng.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/lib/picopng.h b/lib/picopng.h
new file mode 100644
index 000000000..14c5e28bc
--- /dev/null
+++ b/lib/picopng.h
@@ -0,0 +1,34 @@
+#ifndef _PICOPNG_H
+#define _PICOPNG_H
+
+typedef struct {
+ uint32_t *data;
+ size_t size;
+ size_t allocsize;
+} vector32_t;
+
+typedef struct {
+ uint8_t *data;
+ size_t size;
+ size_t allocsize;
+} vector8_t;
+
+typedef struct {
+ uint32_t width, height;
+ uint32_t colorType, bitDepth;
+ uint32_t compressionMethod, filterMethod, interlaceMethod;
+ uint32_t key_r, key_g, key_b;
+ bool key_defined; // is a transparent color key given?
+ vector8_t *palette;
+ vector8_t *image;
+} PNG_info_t;
+
+PNG_info_t *PNG_decode(const uint8_t *in, uint32_t size);
+void png_alloc_free_all(void);
+
+unsigned picopng_zlib_decompress(unsigned char* out, size_t outsize,
+ const unsigned char* in, size_t insize);
+
+extern int PNG_error;
+
+#endif