Skip to content

Commit 9a9c585

Browse files
committed
Changed the header file to allow PNGdec to coexist with PNGenc
1 parent 4bd0a90 commit 9a9c585

File tree

2 files changed

+24
-19
lines changed

2 files changed

+24
-19
lines changed

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=PNGdec
2-
version=1.1.5
2+
version=1.1.6
33
author=Larry Bank
44
maintainer=Larry Bank
55
sentence=Universal PNG decoder for MCUs with at least 48K of RAM.

src/PNGdec.h

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@
5454
#ifndef PNG_MAX_BUFFERED_PIXELS
5555
#define PNG_MAX_BUFFERED_PIXELS ((320*4 + 1)*2)
5656
#endif
57+
58+
#ifndef __PNGENC__
5759
// PNG filter type
5860
enum {
5961
PNG_FILTER_NONE=0,
@@ -78,16 +80,6 @@ enum {
7880
PNG_PIXEL_GRAY_ALPHA=4,
7981
PNG_PIXEL_TRUECOLOR_ALPHA=6
8082
};
81-
// RGB565 endianness
82-
enum {
83-
PNG_RGB565_LITTLE_ENDIAN = 0,
84-
PNG_RGB565_BIG_ENDIAN
85-
};
86-
87-
enum {
88-
PNG_MEM_RAM=0,
89-
PNG_MEM_FLASH
90-
};
9183

9284
// Error codes returned by getLastError()
9385
enum {
@@ -102,6 +94,27 @@ enum {
10294
PNG_QUIT_EARLY
10395
};
10496

97+
typedef struct png_file_tag
98+
{
99+
int32_t iPos; // current file position
100+
int32_t iSize; // file size
101+
uint8_t *pData; // memory file pointer
102+
void * fHandle; // class pointer to File/SdFat or whatever you want
103+
} PNGFILE;
104+
105+
#endif // !__PNGENC__
106+
107+
// RGB565 endianness
108+
enum {
109+
PNG_RGB565_LITTLE_ENDIAN = 0,
110+
PNG_RGB565_BIG_ENDIAN
111+
};
112+
113+
enum {
114+
PNG_MEM_RAM=0,
115+
PNG_MEM_FLASH
116+
};
117+
105118
typedef struct png_draw_tag
106119
{
107120
int y; // starting x,y of this line
@@ -116,14 +129,6 @@ typedef struct png_draw_tag
116129
uint8_t *pPixels;
117130
} PNGDRAW;
118131

119-
typedef struct png_file_tag
120-
{
121-
int32_t iPos; // current file position
122-
int32_t iSize; // file size
123-
uint8_t *pData; // memory file pointer
124-
void * fHandle; // class pointer to File/SdFat or whatever you want
125-
} PNGFILE;
126-
127132
// Callback function prototypes
128133
typedef int32_t (PNG_READ_CALLBACK)(PNGFILE *pFile, uint8_t *pBuf, int32_t iLen);
129134
typedef int32_t (PNG_SEEK_CALLBACK)(PNGFILE *pFile, int32_t iPosition);

0 commit comments

Comments
 (0)