1 | #ifndef _PICOPNG_H␊ |
2 | #define _PICOPNG_H␊ |
3 | ␊ |
4 | #include <stdint.h>␊ |
5 | #include <mach-o/loader.h>␊ |
6 | #include <stdarg.h>␊ |
7 | #include <stddef.h>␊ |
8 | #include <stdbool.h>␊ |
9 | typedef struct {␊ |
10 | ␉uint32_t *data;␊ |
11 | ␉size_t size;␊ |
12 | ␉size_t allocsize;␊ |
13 | } vector32_t;␊ |
14 | ␊ |
15 | typedef struct {␊ |
16 | ␉uint8_t *data;␊ |
17 | ␉size_t size;␊ |
18 | ␉size_t allocsize;␊ |
19 | } vector8_t;␊ |
20 | ␊ |
21 | typedef struct {␊ |
22 | ␉uint32_t width, height;␊ |
23 | ␉uint32_t colorType, bitDepth;␊ |
24 | ␉uint32_t compressionMethod, filterMethod, interlaceMethod;␊ |
25 | ␉uint32_t key_r, key_g, key_b;␊ |
26 | ␉bool key_defined; // is a transparent color key given?␊ |
27 | ␉vector8_t *palette;␊ |
28 | ␉vector8_t *image;␊ |
29 | } PNG_info_t;␊ |
30 | ␊ |
31 | PNG_info_t *PNG_decode(const uint8_t *in, uint32_t size);␊ |
32 | void png_alloc_free_all(void);␊ |
33 | ␊ |
34 | extern int PNG_error;␊ |
35 | ␊ |
36 | ␊ |
37 | int loadPngImage(const char *filename, uint16_t *width, uint16_t *height,␊ |
38 | ␉␉␉␉ uint8_t **imageData);␊ |
39 | int loadEmbeddedPngImage(uint8_t *pngData, int pngSize, uint16_t *width, uint16_t *height, uint8_t **imageData);␊ |
40 | ␊ |
41 | ␊ |
42 | #endif␊ |
43 | |