Debian Codegraph @

advancecomp-1.15/lib/png.h

raw symbols SCIP
1 /*
2 * This file is part of the Advance project.
3 *
4 * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Andrea Mazzoleni
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21 /** \file
22 * PNG file support.
23 */
24
25 #ifndef __PNG_H
26 #define __PNG_H
27
28 #include "extra.h"
29 #include "fz.h"
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35 /** \name PNG_CHUNK */
36 /*@{*/
37 #define ADV_PNG_CN_IHDR 0x49484452
38 #define ADV_PNG_CN_PLTE 0x504C5445
39 #define ADV_PNG_CN_IDAT 0x49444154
40 #define ADV_PNG_CN_IEND 0x49454E44
41 #define ADV_PNG_CN_tRNS 0x74524e53
42 /*@}*/
43
44 adv_error adv_png_read_chunk(adv_fz* f, unsigned char** data, unsigned* size, unsigned* type);
45 adv_error adv_png_write_chunk(adv_fz* f, unsigned type, const unsigned char* data, unsigned size, unsigned* count);
46
47 adv_error adv_png_read_signature(adv_fz* f);
48 adv_error adv_png_write_signature(adv_fz* f, unsigned* count);
49
50 adv_error adv_png_read_iend(adv_fz* f, const unsigned char* data, unsigned data_size, unsigned type);
51 adv_error adv_png_write_iend(adv_fz* f, unsigned* count);
52
53 adv_error adv_png_read_ihdr(
54 unsigned* pix_width, unsigned* pix_height, unsigned* pix_pixel,
55 unsigned char** dat_ptr, unsigned* dat_size,
56 unsigned char** pix_ptr, unsigned* pix_scanline,
57 unsigned char** pal_ptr, unsigned* pal_size,
58 unsigned char** rns_ptr, unsigned* rns_size,
59 adv_fz* f, const unsigned char* data, unsigned data_size
60 );
61
62 adv_error adv_png_write_ihdr(
63 unsigned pix_width, unsigned pix_height,
64 unsigned pix_depth, unsigned pix_type,
65 adv_fz* f, unsigned* count
66 );
67
68 adv_error adv_png_write_idat(
69 unsigned pix_width, unsigned pix_height, unsigned pix_pixel,
70 const uint8* pix_ptr, int pix_pixel_pitch, int pix_scanline_pitch,
71 adv_bool fast,
72 adv_fz* f, unsigned* count
73 );
74
75 adv_error adv_png_write_raw(
76 unsigned pix_width, unsigned pix_height, unsigned pix_pixel,
77 const unsigned char* pix_ptr, int pix_pixel_pitch, int pix_scanline_pitch,
78 const unsigned char* pal_ptr, unsigned pal_size,
79 const unsigned char* rns_ptr, unsigned rns_size,
80 adv_bool fast,
81 adv_fz* f, unsigned* count
82 );
83
84 void adv_png_expand_4(unsigned width, unsigned height, unsigned char* ptr);
85 void adv_png_expand_2(unsigned width, unsigned height, unsigned char* ptr);
86 void adv_png_expand_1(unsigned width, unsigned height, unsigned char* ptr);
87 void adv_png_unfilter_8(unsigned width, unsigned height, unsigned char* ptr, unsigned line);
88 void adv_png_unfilter_24(unsigned width, unsigned height, unsigned char* ptr, unsigned line);
89 void adv_png_unfilter_32(unsigned width, unsigned height, unsigned char* ptr, unsigned line);
90
91 /** \addtogroup VideoFile */
92 /*@{*/
93
94 adv_error adv_png_read(
95 unsigned* pix_width, unsigned* pix_height, unsigned* pix_pixel,
96 unsigned char** dat_ptr, unsigned* dat_size,
97 unsigned char** pix_ptr, unsigned* pix_scanline,
98 unsigned char** pal_ptr, unsigned* pal_size,
99 adv_fz* f
100 );
101
102 adv_error adv_png_read_rns(
103 unsigned* pix_width, unsigned* pix_height, unsigned* pix_pixel,
104 unsigned char** dat_ptr, unsigned* dat_size,
105 unsigned char** pix_ptr, unsigned* pix_scanline,
106 unsigned char** pal_ptr, unsigned* pal_size,
107 unsigned char** rns_ptr, unsigned* rns_size,
108 adv_fz* f
109 );
110
111 adv_error adv_png_write(
112 unsigned pix_width, unsigned pix_height, unsigned pix_pixel,
113 const unsigned char* pix_ptr, int pix_pixel_pitch, int pix_scanline_pitch,
114 const unsigned char* pal_ptr, unsigned pal_size,
115 adv_bool fast,
116 adv_fz* f, unsigned* count
117 );
118
119 adv_error adv_png_write_rns(
120 unsigned pix_width, unsigned pix_height, unsigned pix_pixel,
121 const unsigned char* pix_ptr, int pix_pixel_pitch, int pix_scanline_pitch,
122 const unsigned char* pal_ptr, unsigned pal_size,
123 const unsigned char* rns_ptr, unsigned rns_size,
124 adv_bool fast,
125 adv_fz* f, unsigned* count
126 );
127
128 /*@}*/
129
130 #ifdef __cplusplus
131 };
132 #endif
133
134 #endif
135