| 494 |
theseven |
1 |
//
|
|
|
2 |
//
|
|
|
3 |
// Copyright 2011 TheSeven
|
|
|
4 |
//
|
|
|
5 |
//
|
|
|
6 |
// This file is part of emCORE.
|
|
|
7 |
//
|
|
|
8 |
// emCORE is free software: you can redistribute it and/or
|
|
|
9 |
// modify it under the terms of the GNU General Public License as
|
|
|
10 |
// published by the Free Software Foundation, either version 2 of the
|
|
|
11 |
// License, or (at your option) any later version.
|
|
|
12 |
//
|
|
|
13 |
// emCORE is distributed in the hope that it will be useful,
|
|
|
14 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
15 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
16 |
// See the GNU General Public License for more details.
|
|
|
17 |
//
|
|
|
18 |
// You should have received a copy of the GNU General Public License along
|
|
|
19 |
// with emCORE. If not, see <http://www.gnu.org/licenses/>.
|
|
|
20 |
//
|
|
|
21 |
//
|
|
|
22 |
|
|
|
23 |
|
|
|
24 |
#ifndef __PNG_DECODER_H__
|
|
|
25 |
#define __PNG_DECODER_H__
|
|
|
26 |
|
|
|
27 |
|
|
|
28 |
#include "emcorelib.h"
|
|
|
29 |
|
|
|
30 |
|
|
|
31 |
/* PNG chunk types signatures */
|
|
|
32 |
/* critical chunks */
|
|
|
33 |
#define PNG_CHUNK_IHDR 0x49484452
|
|
|
34 |
#define PNG_CHUNK_PLTE 0x504c5445
|
|
|
35 |
#define PNG_CHUNK_IDAT 0x49444154
|
|
|
36 |
#define PNG_CHUNK_IEND 0x49454e44
|
|
|
37 |
|
|
|
38 |
/* ancillary chunks */
|
|
|
39 |
#define PNG_CHUNK_bKGD 0x624b4744
|
|
|
40 |
#define PNG_CHUNK_cHRM 0x6348524d
|
|
|
41 |
#define PNG_CHUNK_gAMA 0x67414d41
|
|
|
42 |
#define PNG_CHUNK_hIST 0x68495354
|
|
|
43 |
#define PNG_CHUNK_iCCP 0x69434350
|
|
|
44 |
#define PNG_CHUNK_pHYs 0x70485973
|
|
|
45 |
#define PNG_CHUNK_sBIT 0x73424954
|
|
|
46 |
#define PNG_CHUNK_sPLT 0x73504c54
|
|
|
47 |
#define PNG_CHUNK_sRGB 0x73524742
|
|
|
48 |
#define PNG_CHUNK_tEXt 0x74455874
|
|
|
49 |
#define PNG_CHUNK_tIME 0x74494d45
|
|
|
50 |
#define PNG_CHUNK_tRNS 0x74524e53
|
|
|
51 |
#define PNG_CHUNK_zTXt 0x7a545874
|
|
|
52 |
|
|
|
53 |
/* PNG color types */
|
|
|
54 |
#define PNG_COLORTYPE_GREY 0
|
|
|
55 |
#define PNG_COLORTYPE_RGB 2
|
|
|
56 |
#define PNG_COLORTYPE_PALETTE 3
|
|
|
57 |
#define PNG_COLORTYPE_GREYA 4
|
|
|
58 |
#define PNG_COLORTYPE_RGBA 6
|
|
|
59 |
|
|
|
60 |
/* PNG filter types */
|
|
|
61 |
#define PNG_FILTERTYPE_NONE 0
|
|
|
62 |
#define PNG_FILTERTYPE_SUB 1
|
|
|
63 |
#define PNG_FILTERTYPE_UP 2
|
|
|
64 |
#define PNG_FILTERTYPE_AVERAGE 3
|
|
|
65 |
#define PNG_FILTERTYPE_PAETH 4
|
|
|
66 |
|
|
|
67 |
|
|
|
68 |
#endif
|