RetroArch
rpng_internal.h
Go to the documentation of this file.
1 /* Copyright (C) 2010-2018 The RetroArch team
2  *
3  * ---------------------------------------------------------------------------------------
4  * The following license statement only applies to this file (rpng_internal.h).
5  * ---------------------------------------------------------------------------------------
6  *
7  * Permission is hereby granted, free of charge,
8  * to any person obtaining a copy of this software and associated documentation files (the "Software"),
9  * to deal in the Software without restriction, including without limitation the rights to
10  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
11  * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
16  * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
19  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21  */
22 
23 #ifndef _RPNG_COMMON_H
24 #define _RPNG_COMMON_H
25 
26 #include <stdint.h>
27 #include <filters.h>
28 #include <formats/rpng.h>
29 
30 #undef GOTO_END_ERROR
31 #define GOTO_END_ERROR() do { \
32  fprintf(stderr, "[RPNG]: Error in line %d.\n", __LINE__); \
33  ret = false; \
34  goto end; \
35 } while(0)
36 
37 #ifndef ARRAY_SIZE
38 #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
39 #endif
40 
41 static const uint8_t png_magic[8] = {
42  0x89, 'P', 'N', 'G', 0x0d, 0x0a, 0x1a, 0x0a,
43 };
44 
45 struct png_ihdr
46 {
54 };
55 
56 #endif
uint8_t interlace
Definition: rpng_internal.h:53
static const uint8_t png_magic[8]
Definition: rpng_internal.h:41
uint32_t width
Definition: rpng_internal.h:47
uint8_t depth
Definition: rpng_internal.h:49
Definition: rpng_internal.h:45
uint32_t height
Definition: rpng_internal.h:48
uint8_t compression
Definition: rpng_internal.h:51
uint8_t filter
Definition: rpng_internal.h:52
uint8_t color_type
Definition: rpng_internal.h:50
unsigned char uint8_t
Definition: stdint.h:124
unsigned int uint32_t
Definition: stdint.h:126