annotate lib/libpng/pngstruct.h @ 2575:a76d408c5132 tip

DrawTranslucent -> DrawTextureGrayShade Removed old texture drawing stuff
author a.parshin
date Wed, 09 Mar 2016 01:39:52 +0200
parents 6e178010fc29
children
rev   line source
2296
Ritor1
parents:
diff changeset
1
Ritor1
parents:
diff changeset
2 /* pngstruct.h - header file for PNG reference library
Ritor1
parents:
diff changeset
3 *
Ritor1
parents:
diff changeset
4 * Copyright (c) 1998-2013 Glenn Randers-Pehrson
Ritor1
parents:
diff changeset
5 * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
Ritor1
parents:
diff changeset
6 * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
Ritor1
parents:
diff changeset
7 *
Ritor1
parents:
diff changeset
8 * Last changed in libpng 1.6.1 [March 28, 2013]
Ritor1
parents:
diff changeset
9 *
Ritor1
parents:
diff changeset
10 * This code is released under the libpng license.
Ritor1
parents:
diff changeset
11 * For conditions of distribution and use, see the disclaimer
Ritor1
parents:
diff changeset
12 * and license in png.h
Ritor1
parents:
diff changeset
13 */
Ritor1
parents:
diff changeset
14
Ritor1
parents:
diff changeset
15 /* The structure that holds the information to read and write PNG files.
Ritor1
parents:
diff changeset
16 * The only people who need to care about what is inside of this are the
Ritor1
parents:
diff changeset
17 * people who will be modifying the library for their own special needs.
Ritor1
parents:
diff changeset
18 * It should NOT be accessed directly by an application.
Ritor1
parents:
diff changeset
19 */
Ritor1
parents:
diff changeset
20
Ritor1
parents:
diff changeset
21 #ifndef PNGSTRUCT_H
Ritor1
parents:
diff changeset
22 #define PNGSTRUCT_H
Ritor1
parents:
diff changeset
23 /* zlib.h defines the structure z_stream, an instance of which is included
Ritor1
parents:
diff changeset
24 * in this structure and is required for decompressing the LZ compressed
Ritor1
parents:
diff changeset
25 * data in PNG files.
Ritor1
parents:
diff changeset
26 */
Ritor1
parents:
diff changeset
27 #ifndef ZLIB_CONST
Ritor1
parents:
diff changeset
28 /* We must ensure that zlib uses 'const' in declarations. */
Ritor1
parents:
diff changeset
29 # define ZLIB_CONST
Ritor1
parents:
diff changeset
30 #endif
Ritor1
parents:
diff changeset
31 #include "../../lib/zlib/zlib.h"
Ritor1
parents:
diff changeset
32 #ifdef const
Ritor1
parents:
diff changeset
33 /* zlib.h sometimes #defines const to nothing, undo this. */
Ritor1
parents:
diff changeset
34 # undef const
Ritor1
parents:
diff changeset
35 #endif
Ritor1
parents:
diff changeset
36
Ritor1
parents:
diff changeset
37 /* zlib.h has mediocre z_const use before 1.2.6, this stuff is for compatibility
Ritor1
parents:
diff changeset
38 * with older builds.
Ritor1
parents:
diff changeset
39 */
Ritor1
parents:
diff changeset
40 #if ZLIB_VERNUM < 0x1260
Ritor1
parents:
diff changeset
41 # define PNGZ_MSG_CAST(s) png_constcast(char*,s)
Ritor1
parents:
diff changeset
42 # define PNGZ_INPUT_CAST(b) png_constcast(png_bytep,b)
Ritor1
parents:
diff changeset
43 #else
Ritor1
parents:
diff changeset
44 # define PNGZ_MSG_CAST(s) (s)
Ritor1
parents:
diff changeset
45 # define PNGZ_INPUT_CAST(b) (b)
Ritor1
parents:
diff changeset
46 #endif
Ritor1
parents:
diff changeset
47
Ritor1
parents:
diff changeset
48 /* zlib.h declares a magic type 'uInt' that limits the amount of data that zlib
Ritor1
parents:
diff changeset
49 * can handle at once. This type need be no larger than 16 bits (so maximum of
Ritor1
parents:
diff changeset
50 * 65535), this define allows us to discover how big it is, but limited by the
Ritor1
parents:
diff changeset
51 * maximuum for png_size_t. The value can be overriden in a library build
Ritor1
parents:
diff changeset
52 * (pngusr.h, or set it in CPPFLAGS) and it works to set it to a considerably
Ritor1
parents:
diff changeset
53 * lower value (e.g. 255 works). A lower value may help memory usage (slightly)
Ritor1
parents:
diff changeset
54 * and may even improve performance on some systems (and degrade it on others.)
Ritor1
parents:
diff changeset
55 */
Ritor1
parents:
diff changeset
56 #ifndef ZLIB_IO_MAX
Ritor1
parents:
diff changeset
57 # define ZLIB_IO_MAX ((uInt)-1)
Ritor1
parents:
diff changeset
58 #endif
Ritor1
parents:
diff changeset
59
Ritor1
parents:
diff changeset
60 #ifdef PNG_WRITE_SUPPORTED
Ritor1
parents:
diff changeset
61 /* The type of a compression buffer list used by the write code. */
Ritor1
parents:
diff changeset
62 typedef struct png_compression_buffer
Ritor1
parents:
diff changeset
63 {
Ritor1
parents:
diff changeset
64 struct png_compression_buffer *next;
Ritor1
parents:
diff changeset
65 png_byte output[1]; /* actually zbuf_size */
Ritor1
parents:
diff changeset
66 } png_compression_buffer, *png_compression_bufferp;
Ritor1
parents:
diff changeset
67
Ritor1
parents:
diff changeset
68 #define PNG_COMPRESSION_BUFFER_SIZE(pp)\
Ritor1
parents:
diff changeset
69 (offsetof(png_compression_buffer, output) + (pp)->zbuffer_size)
Ritor1
parents:
diff changeset
70 #endif
Ritor1
parents:
diff changeset
71
Ritor1
parents:
diff changeset
72 /* Colorspace support; structures used in png_struct, png_info and in internal
Ritor1
parents:
diff changeset
73 * functions to hold and communicate information about the color space.
Ritor1
parents:
diff changeset
74 *
Ritor1
parents:
diff changeset
75 * PNG_COLORSPACE_SUPPORTED is only required if the application will perform
Ritor1
parents:
diff changeset
76 * colorspace corrections, otherwise all the colorspace information can be
Ritor1
parents:
diff changeset
77 * skipped and the size of libpng can be reduced (significantly) by compiling
Ritor1
parents:
diff changeset
78 * out the colorspace support.
Ritor1
parents:
diff changeset
79 */
Ritor1
parents:
diff changeset
80 #ifdef PNG_COLORSPACE_SUPPORTED
Ritor1
parents:
diff changeset
81 /* The chromaticities of the red, green and blue colorants and the chromaticity
Ritor1
parents:
diff changeset
82 * of the corresponding white point (i.e. of rgb(1.0,1.0,1.0)).
Ritor1
parents:
diff changeset
83 */
Ritor1
parents:
diff changeset
84 typedef struct png_xy
Ritor1
parents:
diff changeset
85 {
Ritor1
parents:
diff changeset
86 png_fixed_point redx, redy;
Ritor1
parents:
diff changeset
87 png_fixed_point greenx, greeny;
Ritor1
parents:
diff changeset
88 png_fixed_point bluex, bluey;
Ritor1
parents:
diff changeset
89 png_fixed_point whitex, whitey;
Ritor1
parents:
diff changeset
90 } png_xy;
Ritor1
parents:
diff changeset
91
Ritor1
parents:
diff changeset
92 /* The same data as above but encoded as CIE XYZ values. When this data comes
Ritor1
parents:
diff changeset
93 * from chromaticities the sum of the Y values is assumed to be 1.0
Ritor1
parents:
diff changeset
94 */
Ritor1
parents:
diff changeset
95 typedef struct png_XYZ
Ritor1
parents:
diff changeset
96 {
Ritor1
parents:
diff changeset
97 png_fixed_point red_X, red_Y, red_Z;
Ritor1
parents:
diff changeset
98 png_fixed_point green_X, green_Y, green_Z;
Ritor1
parents:
diff changeset
99 png_fixed_point blue_X, blue_Y, blue_Z;
Ritor1
parents:
diff changeset
100 } png_XYZ;
Ritor1
parents:
diff changeset
101 #endif /* COLORSPACE */
Ritor1
parents:
diff changeset
102
Ritor1
parents:
diff changeset
103 #if defined(PNG_COLORSPACE_SUPPORTED) || defined(PNG_GAMMA_SUPPORTED)
Ritor1
parents:
diff changeset
104 /* A colorspace is all the above plus, potentially, profile information,
Ritor1
parents:
diff changeset
105 * however at present libpng does not use the profile internally so it is only
Ritor1
parents:
diff changeset
106 * stored in the png_info struct (if iCCP is supported.) The rendering intent
Ritor1
parents:
diff changeset
107 * is retained here and is checked.
Ritor1
parents:
diff changeset
108 *
Ritor1
parents:
diff changeset
109 * The file gamma encoding information is also stored here and gamma correction
Ritor1
parents:
diff changeset
110 * is done by libpng, whereas color correction must currently be done by the
Ritor1
parents:
diff changeset
111 * application.
Ritor1
parents:
diff changeset
112 */
Ritor1
parents:
diff changeset
113 typedef struct png_colorspace
Ritor1
parents:
diff changeset
114 {
Ritor1
parents:
diff changeset
115 #ifdef PNG_GAMMA_SUPPORTED
Ritor1
parents:
diff changeset
116 png_fixed_point gamma; /* File gamma */
Ritor1
parents:
diff changeset
117 #endif
Ritor1
parents:
diff changeset
118
Ritor1
parents:
diff changeset
119 #ifdef PNG_COLORSPACE_SUPPORTED
Ritor1
parents:
diff changeset
120 png_xy end_points_xy; /* End points as chromaticities */
Ritor1
parents:
diff changeset
121 png_XYZ end_points_XYZ; /* End points as CIE XYZ colorant values */
Ritor1
parents:
diff changeset
122 png_uint_16 rendering_intent; /* Rendering intent of a profile */
Ritor1
parents:
diff changeset
123 #endif
Ritor1
parents:
diff changeset
124
Ritor1
parents:
diff changeset
125 /* Flags are always defined to simplify the code. */
Ritor1
parents:
diff changeset
126 png_uint_16 flags; /* As defined below */
Ritor1
parents:
diff changeset
127 } png_colorspace, * PNG_RESTRICT png_colorspacerp;
Ritor1
parents:
diff changeset
128
Ritor1
parents:
diff changeset
129 typedef const png_colorspace * PNG_RESTRICT png_const_colorspacerp;
Ritor1
parents:
diff changeset
130
Ritor1
parents:
diff changeset
131 /* General flags for the 'flags' field */
Ritor1
parents:
diff changeset
132 #define PNG_COLORSPACE_HAVE_GAMMA 0x0001
Ritor1
parents:
diff changeset
133 #define PNG_COLORSPACE_HAVE_ENDPOINTS 0x0002
Ritor1
parents:
diff changeset
134 #define PNG_COLORSPACE_HAVE_INTENT 0x0004
Ritor1
parents:
diff changeset
135 #define PNG_COLORSPACE_FROM_gAMA 0x0008
Ritor1
parents:
diff changeset
136 #define PNG_COLORSPACE_FROM_cHRM 0x0010
Ritor1
parents:
diff changeset
137 #define PNG_COLORSPACE_FROM_sRGB 0x0020
Ritor1
parents:
diff changeset
138 #define PNG_COLORSPACE_ENDPOINTS_MATCH_sRGB 0x0040
Ritor1
parents:
diff changeset
139 #define PNG_COLORSPACE_MATCHES_sRGB 0x0080 /* exact match on profile */
Ritor1
parents:
diff changeset
140 #define PNG_COLORSPACE_INVALID 0x8000
Ritor1
parents:
diff changeset
141 #define PNG_COLORSPACE_CANCEL(flags) (0xffff ^ (flags))
Ritor1
parents:
diff changeset
142 #endif /* COLORSPACE || GAMMA */
Ritor1
parents:
diff changeset
143
Ritor1
parents:
diff changeset
144 struct png_struct_def
Ritor1
parents:
diff changeset
145 {
Ritor1
parents:
diff changeset
146 #ifdef PNG_SETJMP_SUPPORTED
Ritor1
parents:
diff changeset
147 jmp_buf jmp_buf_local; /* New name in 1.6.0 for jmp_buf in png_struct */
Ritor1
parents:
diff changeset
148 png_longjmp_ptr longjmp_fn;/* setjmp non-local goto function. */
Ritor1
parents:
diff changeset
149 jmp_buf *jmp_buf_ptr; /* passed to longjmp_fn */
Ritor1
parents:
diff changeset
150 size_t jmp_buf_size; /* size of the above, if allocated */
Ritor1
parents:
diff changeset
151 #endif
Ritor1
parents:
diff changeset
152 png_error_ptr error_fn; /* function for printing errors and aborting */
Ritor1
parents:
diff changeset
153 #ifdef PNG_WARNINGS_SUPPORTED
Ritor1
parents:
diff changeset
154 png_error_ptr warning_fn; /* function for printing warnings */
Ritor1
parents:
diff changeset
155 #endif
Ritor1
parents:
diff changeset
156 png_voidp error_ptr; /* user supplied struct for error functions */
Ritor1
parents:
diff changeset
157 png_rw_ptr write_data_fn; /* function for writing output data */
Ritor1
parents:
diff changeset
158 png_rw_ptr read_data_fn; /* function for reading input data */
Ritor1
parents:
diff changeset
159 png_voidp io_ptr; /* ptr to application struct for I/O functions */
Ritor1
parents:
diff changeset
160
Ritor1
parents:
diff changeset
161 #ifdef PNG_READ_USER_TRANSFORM_SUPPORTED
Ritor1
parents:
diff changeset
162 png_user_transform_ptr read_user_transform_fn; /* user read transform */
Ritor1
parents:
diff changeset
163 #endif
Ritor1
parents:
diff changeset
164
Ritor1
parents:
diff changeset
165 #ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED
Ritor1
parents:
diff changeset
166 png_user_transform_ptr write_user_transform_fn; /* user write transform */
Ritor1
parents:
diff changeset
167 #endif
Ritor1
parents:
diff changeset
168
Ritor1
parents:
diff changeset
169 /* These were added in libpng-1.0.2 */
Ritor1
parents:
diff changeset
170 #ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED
Ritor1
parents:
diff changeset
171 #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
Ritor1
parents:
diff changeset
172 defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
Ritor1
parents:
diff changeset
173 png_voidp user_transform_ptr; /* user supplied struct for user transform */
Ritor1
parents:
diff changeset
174 png_byte user_transform_depth; /* bit depth of user transformed pixels */
Ritor1
parents:
diff changeset
175 png_byte user_transform_channels; /* channels in user transformed pixels */
Ritor1
parents:
diff changeset
176 #endif
Ritor1
parents:
diff changeset
177 #endif
Ritor1
parents:
diff changeset
178
Ritor1
parents:
diff changeset
179 png_uint_32 mode; /* tells us where we are in the PNG file */
Ritor1
parents:
diff changeset
180 png_uint_32 flags; /* flags indicating various things to libpng */
Ritor1
parents:
diff changeset
181 png_uint_32 transformations; /* which transformations to perform */
Ritor1
parents:
diff changeset
182
Ritor1
parents:
diff changeset
183 png_uint_32 zowner; /* ID (chunk type) of zstream owner, 0 if none */
Ritor1
parents:
diff changeset
184 z_stream zstream; /* decompression structure */
Ritor1
parents:
diff changeset
185
Ritor1
parents:
diff changeset
186 #ifdef PNG_WRITE_SUPPORTED
Ritor1
parents:
diff changeset
187 png_compression_bufferp zbuffer_list; /* Created on demand during write */
Ritor1
parents:
diff changeset
188 uInt zbuffer_size; /* size of the actual buffer */
Ritor1
parents:
diff changeset
189
Ritor1
parents:
diff changeset
190 int zlib_level; /* holds zlib compression level */
Ritor1
parents:
diff changeset
191 int zlib_method; /* holds zlib compression method */
Ritor1
parents:
diff changeset
192 int zlib_window_bits; /* holds zlib compression window bits */
Ritor1
parents:
diff changeset
193 int zlib_mem_level; /* holds zlib compression memory level */
Ritor1
parents:
diff changeset
194 int zlib_strategy; /* holds zlib compression strategy */
Ritor1
parents:
diff changeset
195 #endif
Ritor1
parents:
diff changeset
196 /* Added at libpng 1.5.4 */
Ritor1
parents:
diff changeset
197 #ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED
Ritor1
parents:
diff changeset
198 int zlib_text_level; /* holds zlib compression level */
Ritor1
parents:
diff changeset
199 int zlib_text_method; /* holds zlib compression method */
Ritor1
parents:
diff changeset
200 int zlib_text_window_bits; /* holds zlib compression window bits */
Ritor1
parents:
diff changeset
201 int zlib_text_mem_level; /* holds zlib compression memory level */
Ritor1
parents:
diff changeset
202 int zlib_text_strategy; /* holds zlib compression strategy */
Ritor1
parents:
diff changeset
203 #endif
Ritor1
parents:
diff changeset
204 /* End of material added at libpng 1.5.4 */
Ritor1
parents:
diff changeset
205 /* Added at libpng 1.6.0 */
Ritor1
parents:
diff changeset
206 #ifdef PNG_WRITE_SUPPORTED
Ritor1
parents:
diff changeset
207 int zlib_set_level; /* Actual values set into the zstream on write */
Ritor1
parents:
diff changeset
208 int zlib_set_method;
Ritor1
parents:
diff changeset
209 int zlib_set_window_bits;
Ritor1
parents:
diff changeset
210 int zlib_set_mem_level;
Ritor1
parents:
diff changeset
211 int zlib_set_strategy;
Ritor1
parents:
diff changeset
212 #endif
Ritor1
parents:
diff changeset
213
Ritor1
parents:
diff changeset
214 png_uint_32 width; /* width of image in pixels */
Ritor1
parents:
diff changeset
215 png_uint_32 height; /* height of image in pixels */
Ritor1
parents:
diff changeset
216 png_uint_32 num_rows; /* number of rows in current pass */
Ritor1
parents:
diff changeset
217 png_uint_32 usr_width; /* width of row at start of write */
Ritor1
parents:
diff changeset
218 png_size_t rowbytes; /* size of row in bytes */
Ritor1
parents:
diff changeset
219 png_uint_32 iwidth; /* width of current interlaced row in pixels */
Ritor1
parents:
diff changeset
220 png_uint_32 row_number; /* current row in interlace pass */
Ritor1
parents:
diff changeset
221 png_uint_32 chunk_name; /* PNG_CHUNK() id of current chunk */
Ritor1
parents:
diff changeset
222 png_bytep prev_row; /* buffer to save previous (unfiltered) row.
Ritor1
parents:
diff changeset
223 * This is a pointer into big_prev_row
Ritor1
parents:
diff changeset
224 */
Ritor1
parents:
diff changeset
225 png_bytep row_buf; /* buffer to save current (unfiltered) row.
Ritor1
parents:
diff changeset
226 * This is a pointer into big_row_buf
Ritor1
parents:
diff changeset
227 */
Ritor1
parents:
diff changeset
228 #ifdef PNG_WRITE_SUPPORTED
Ritor1
parents:
diff changeset
229 png_bytep sub_row; /* buffer to save "sub" row when filtering */
Ritor1
parents:
diff changeset
230 png_bytep up_row; /* buffer to save "up" row when filtering */
Ritor1
parents:
diff changeset
231 png_bytep avg_row; /* buffer to save "avg" row when filtering */
Ritor1
parents:
diff changeset
232 png_bytep paeth_row; /* buffer to save "Paeth" row when filtering */
Ritor1
parents:
diff changeset
233 #endif
Ritor1
parents:
diff changeset
234 png_size_t info_rowbytes; /* Added in 1.5.4: cache of updated row bytes */
Ritor1
parents:
diff changeset
235
Ritor1
parents:
diff changeset
236 png_uint_32 idat_size; /* current IDAT size for read */
Ritor1
parents:
diff changeset
237 png_uint_32 crc; /* current chunk CRC value */
Ritor1
parents:
diff changeset
238 png_colorp palette; /* palette from the input file */
Ritor1
parents:
diff changeset
239 png_uint_16 num_palette; /* number of color entries in palette */
Ritor1
parents:
diff changeset
240
Ritor1
parents:
diff changeset
241 /* Added at libpng-1.5.10 */
Ritor1
parents:
diff changeset
242 #ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED
Ritor1
parents:
diff changeset
243 int num_palette_max; /* maximum palette index found in IDAT */
Ritor1
parents:
diff changeset
244 #endif
Ritor1
parents:
diff changeset
245
Ritor1
parents:
diff changeset
246 png_uint_16 num_trans; /* number of transparency values */
Ritor1
parents:
diff changeset
247 png_byte compression; /* file compression type (always 0) */
Ritor1
parents:
diff changeset
248 png_byte filter; /* file filter type (always 0) */
Ritor1
parents:
diff changeset
249 png_byte interlaced; /* PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */
Ritor1
parents:
diff changeset
250 png_byte pass; /* current interlace pass (0 - 6) */
Ritor1
parents:
diff changeset
251 png_byte do_filter; /* row filter flags (see PNG_FILTER_ below ) */
Ritor1
parents:
diff changeset
252 png_byte color_type; /* color type of file */
Ritor1
parents:
diff changeset
253 png_byte bit_depth; /* bit depth of file */
Ritor1
parents:
diff changeset
254 png_byte usr_bit_depth; /* bit depth of users row: write only */
Ritor1
parents:
diff changeset
255 png_byte pixel_depth; /* number of bits per pixel */
Ritor1
parents:
diff changeset
256 png_byte channels; /* number of channels in file */
Ritor1
parents:
diff changeset
257 #ifdef PNG_WRITE_SUPPORTED
Ritor1
parents:
diff changeset
258 png_byte usr_channels; /* channels at start of write: write only */
Ritor1
parents:
diff changeset
259 #endif
Ritor1
parents:
diff changeset
260 png_byte sig_bytes; /* magic bytes read/written from start of file */
Ritor1
parents:
diff changeset
261 png_byte maximum_pixel_depth;
Ritor1
parents:
diff changeset
262 /* pixel depth used for the row buffers */
Ritor1
parents:
diff changeset
263 png_byte transformed_pixel_depth;
Ritor1
parents:
diff changeset
264 /* pixel depth after read/write transforms */
Ritor1
parents:
diff changeset
265 #if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED)
Ritor1
parents:
diff changeset
266 png_uint_16 filler; /* filler bytes for pixel expansion */
Ritor1
parents:
diff changeset
267 #endif
Ritor1
parents:
diff changeset
268
Ritor1
parents:
diff changeset
269 #if defined(PNG_bKGD_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) ||\
Ritor1
parents:
diff changeset
270 defined(PNG_READ_ALPHA_MODE_SUPPORTED)
Ritor1
parents:
diff changeset
271 png_byte background_gamma_type;
Ritor1
parents:
diff changeset
272 png_fixed_point background_gamma;
Ritor1
parents:
diff changeset
273 png_color_16 background; /* background color in screen gamma space */
Ritor1
parents:
diff changeset
274 #ifdef PNG_READ_GAMMA_SUPPORTED
Ritor1
parents:
diff changeset
275 png_color_16 background_1; /* background normalized to gamma 1.0 */
Ritor1
parents:
diff changeset
276 #endif
Ritor1
parents:
diff changeset
277 #endif /* PNG_bKGD_SUPPORTED */
Ritor1
parents:
diff changeset
278
Ritor1
parents:
diff changeset
279 #ifdef PNG_WRITE_FLUSH_SUPPORTED
Ritor1
parents:
diff changeset
280 png_flush_ptr output_flush_fn; /* Function for flushing output */
Ritor1
parents:
diff changeset
281 png_uint_32 flush_dist; /* how many rows apart to flush, 0 - no flush */
Ritor1
parents:
diff changeset
282 png_uint_32 flush_rows; /* number of rows written since last flush */
Ritor1
parents:
diff changeset
283 #endif
Ritor1
parents:
diff changeset
284
Ritor1
parents:
diff changeset
285 #ifdef PNG_READ_GAMMA_SUPPORTED
Ritor1
parents:
diff changeset
286 int gamma_shift; /* number of "insignificant" bits in 16-bit gamma */
Ritor1
parents:
diff changeset
287 png_fixed_point screen_gamma; /* screen gamma value (display_exponent) */
Ritor1
parents:
diff changeset
288
Ritor1
parents:
diff changeset
289 png_bytep gamma_table; /* gamma table for 8-bit depth files */
Ritor1
parents:
diff changeset
290 png_uint_16pp gamma_16_table; /* gamma table for 16-bit depth files */
Ritor1
parents:
diff changeset
291 #if defined(PNG_READ_BACKGROUND_SUPPORTED) || \
Ritor1
parents:
diff changeset
292 defined(PNG_READ_ALPHA_MODE_SUPPORTED) || \
Ritor1
parents:
diff changeset
293 defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)
Ritor1
parents:
diff changeset
294 png_bytep gamma_from_1; /* converts from 1.0 to screen */
Ritor1
parents:
diff changeset
295 png_bytep gamma_to_1; /* converts from file to 1.0 */
Ritor1
parents:
diff changeset
296 png_uint_16pp gamma_16_from_1; /* converts from 1.0 to screen */
Ritor1
parents:
diff changeset
297 png_uint_16pp gamma_16_to_1; /* converts from file to 1.0 */
Ritor1
parents:
diff changeset
298 #endif /* READ_BACKGROUND || READ_ALPHA_MODE || RGB_TO_GRAY */
Ritor1
parents:
diff changeset
299 #endif
Ritor1
parents:
diff changeset
300
Ritor1
parents:
diff changeset
301 #if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_sBIT_SUPPORTED)
Ritor1
parents:
diff changeset
302 png_color_8 sig_bit; /* significant bits in each available channel */
Ritor1
parents:
diff changeset
303 #endif
Ritor1
parents:
diff changeset
304
Ritor1
parents:
diff changeset
305 #if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED)
Ritor1
parents:
diff changeset
306 png_color_8 shift; /* shift for significant bit tranformation */
Ritor1
parents:
diff changeset
307 #endif
Ritor1
parents:
diff changeset
308
Ritor1
parents:
diff changeset
309 #if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) \
Ritor1
parents:
diff changeset
310 || defined(PNG_READ_EXPAND_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
Ritor1
parents:
diff changeset
311 png_bytep trans_alpha; /* alpha values for paletted files */
Ritor1
parents:
diff changeset
312 png_color_16 trans_color; /* transparent color for non-paletted files */
Ritor1
parents:
diff changeset
313 #endif
Ritor1
parents:
diff changeset
314
Ritor1
parents:
diff changeset
315 png_read_status_ptr read_row_fn; /* called after each row is decoded */
Ritor1
parents:
diff changeset
316 png_write_status_ptr write_row_fn; /* called after each row is encoded */
Ritor1
parents:
diff changeset
317 #ifdef PNG_PROGRESSIVE_READ_SUPPORTED
Ritor1
parents:
diff changeset
318 png_progressive_info_ptr info_fn; /* called after header data fully read */
Ritor1
parents:
diff changeset
319 png_progressive_row_ptr row_fn; /* called after a prog. row is decoded */
Ritor1
parents:
diff changeset
320 png_progressive_end_ptr end_fn; /* called after image is complete */
Ritor1
parents:
diff changeset
321 png_bytep save_buffer_ptr; /* current location in save_buffer */
Ritor1
parents:
diff changeset
322 png_bytep save_buffer; /* buffer for previously read data */
Ritor1
parents:
diff changeset
323 png_bytep current_buffer_ptr; /* current location in current_buffer */
Ritor1
parents:
diff changeset
324 png_bytep current_buffer; /* buffer for recently used data */
Ritor1
parents:
diff changeset
325 png_uint_32 push_length; /* size of current input chunk */
Ritor1
parents:
diff changeset
326 png_uint_32 skip_length; /* bytes to skip in input data */
Ritor1
parents:
diff changeset
327 png_size_t save_buffer_size; /* amount of data now in save_buffer */
Ritor1
parents:
diff changeset
328 png_size_t save_buffer_max; /* total size of save_buffer */
Ritor1
parents:
diff changeset
329 png_size_t buffer_size; /* total amount of available input data */
Ritor1
parents:
diff changeset
330 png_size_t current_buffer_size; /* amount of data now in current_buffer */
Ritor1
parents:
diff changeset
331 int process_mode; /* what push library is currently doing */
Ritor1
parents:
diff changeset
332 int cur_palette; /* current push library palette index */
Ritor1
parents:
diff changeset
333
Ritor1
parents:
diff changeset
334 #endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
Ritor1
parents:
diff changeset
335
Ritor1
parents:
diff changeset
336 #if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__)
Ritor1
parents:
diff changeset
337 /* For the Borland special 64K segment handler */
Ritor1
parents:
diff changeset
338 png_bytepp offset_table_ptr;
Ritor1
parents:
diff changeset
339 png_bytep offset_table;
Ritor1
parents:
diff changeset
340 png_uint_16 offset_table_number;
Ritor1
parents:
diff changeset
341 png_uint_16 offset_table_count;
Ritor1
parents:
diff changeset
342 png_uint_16 offset_table_count_free;
Ritor1
parents:
diff changeset
343 #endif
Ritor1
parents:
diff changeset
344
Ritor1
parents:
diff changeset
345 #ifdef PNG_READ_QUANTIZE_SUPPORTED
Ritor1
parents:
diff changeset
346 png_bytep palette_lookup; /* lookup table for quantizing */
Ritor1
parents:
diff changeset
347 png_bytep quantize_index; /* index translation for palette files */
Ritor1
parents:
diff changeset
348 #endif
Ritor1
parents:
diff changeset
349
Ritor1
parents:
diff changeset
350 #ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
Ritor1
parents:
diff changeset
351 png_byte heuristic_method; /* heuristic for row filter selection */
Ritor1
parents:
diff changeset
352 png_byte num_prev_filters; /* number of weights for previous rows */
Ritor1
parents:
diff changeset
353 png_bytep prev_filters; /* filter type(s) of previous row(s) */
Ritor1
parents:
diff changeset
354 png_uint_16p filter_weights; /* weight(s) for previous line(s) */
Ritor1
parents:
diff changeset
355 png_uint_16p inv_filter_weights; /* 1/weight(s) for previous line(s) */
Ritor1
parents:
diff changeset
356 png_uint_16p filter_costs; /* relative filter calculation cost */
Ritor1
parents:
diff changeset
357 png_uint_16p inv_filter_costs; /* 1/relative filter calculation cost */
Ritor1
parents:
diff changeset
358 #endif
Ritor1
parents:
diff changeset
359
Ritor1
parents:
diff changeset
360 /* Options */
Ritor1
parents:
diff changeset
361 #ifdef PNG_SET_OPTION_SUPPORTED
Ritor1
parents:
diff changeset
362 png_byte options; /* On/off state (up to 4 options) */
Ritor1
parents:
diff changeset
363 #endif
Ritor1
parents:
diff changeset
364
Ritor1
parents:
diff changeset
365 #if PNG_LIBPNG_VER < 10700
Ritor1
parents:
diff changeset
366 /* To do: remove this from libpng-1.7 */
Ritor1
parents:
diff changeset
367 #ifdef PNG_TIME_RFC1123_SUPPORTED
Ritor1
parents:
diff changeset
368 char time_buffer[29]; /* String to hold RFC 1123 time text */
Ritor1
parents:
diff changeset
369 #endif
Ritor1
parents:
diff changeset
370 #endif
Ritor1
parents:
diff changeset
371
Ritor1
parents:
diff changeset
372 /* New members added in libpng-1.0.6 */
Ritor1
parents:
diff changeset
373
Ritor1
parents:
diff changeset
374 png_uint_32 free_me; /* flags items libpng is responsible for freeing */
Ritor1
parents:
diff changeset
375
Ritor1
parents:
diff changeset
376 #ifdef PNG_USER_CHUNKS_SUPPORTED
Ritor1
parents:
diff changeset
377 png_voidp user_chunk_ptr;
Ritor1
parents:
diff changeset
378 #ifdef PNG_READ_USER_CHUNKS_SUPPORTED
Ritor1
parents:
diff changeset
379 png_user_chunk_ptr read_user_chunk_fn; /* user read chunk handler */
Ritor1
parents:
diff changeset
380 #endif
Ritor1
parents:
diff changeset
381 #endif
Ritor1
parents:
diff changeset
382
Ritor1
parents:
diff changeset
383 #ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED
Ritor1
parents:
diff changeset
384 int unknown_default; /* As PNG_HANDLE_* */
Ritor1
parents:
diff changeset
385 unsigned int num_chunk_list; /* Number of entries in the list */
Ritor1
parents:
diff changeset
386 png_bytep chunk_list; /* List of png_byte[5]; the textual chunk name
Ritor1
parents:
diff changeset
387 * followed by a PNG_HANDLE_* byte */
Ritor1
parents:
diff changeset
388 #endif
Ritor1
parents:
diff changeset
389
Ritor1
parents:
diff changeset
390 /* New members added in libpng-1.0.3 */
Ritor1
parents:
diff changeset
391 #ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
Ritor1
parents:
diff changeset
392 png_byte rgb_to_gray_status;
Ritor1
parents:
diff changeset
393 /* Added in libpng 1.5.5 to record setting of coefficients: */
Ritor1
parents:
diff changeset
394 png_byte rgb_to_gray_coefficients_set;
Ritor1
parents:
diff changeset
395 /* These were changed from png_byte in libpng-1.0.6 */
Ritor1
parents:
diff changeset
396 png_uint_16 rgb_to_gray_red_coeff;
Ritor1
parents:
diff changeset
397 png_uint_16 rgb_to_gray_green_coeff;
Ritor1
parents:
diff changeset
398 /* deleted in 1.5.5: rgb_to_gray_blue_coeff; */
Ritor1
parents:
diff changeset
399 #endif
Ritor1
parents:
diff changeset
400
Ritor1
parents:
diff changeset
401 /* New member added in libpng-1.0.4 (renamed in 1.0.9) */
Ritor1
parents:
diff changeset
402 #if defined(PNG_MNG_FEATURES_SUPPORTED)
Ritor1
parents:
diff changeset
403 /* Changed from png_byte to png_uint_32 at version 1.2.0 */
Ritor1
parents:
diff changeset
404 png_uint_32 mng_features_permitted;
Ritor1
parents:
diff changeset
405 #endif
Ritor1
parents:
diff changeset
406
Ritor1
parents:
diff changeset
407 /* New member added in libpng-1.0.9, ifdef'ed out in 1.0.12, enabled in 1.2.0 */
Ritor1
parents:
diff changeset
408 #ifdef PNG_MNG_FEATURES_SUPPORTED
Ritor1
parents:
diff changeset
409 png_byte filter_type;
Ritor1
parents:
diff changeset
410 #endif
Ritor1
parents:
diff changeset
411
Ritor1
parents:
diff changeset
412 /* New members added in libpng-1.2.0 */
Ritor1
parents:
diff changeset
413
Ritor1
parents:
diff changeset
414 /* New members added in libpng-1.0.2 but first enabled by default in 1.2.0 */
Ritor1
parents:
diff changeset
415 #ifdef PNG_USER_MEM_SUPPORTED
Ritor1
parents:
diff changeset
416 png_voidp mem_ptr; /* user supplied struct for mem functions */
Ritor1
parents:
diff changeset
417 png_malloc_ptr malloc_fn; /* function for allocating memory */
Ritor1
parents:
diff changeset
418 png_free_ptr free_fn; /* function for freeing memory */
Ritor1
parents:
diff changeset
419 #endif
Ritor1
parents:
diff changeset
420
Ritor1
parents:
diff changeset
421 /* New member added in libpng-1.0.13 and 1.2.0 */
Ritor1
parents:
diff changeset
422 png_bytep big_row_buf; /* buffer to save current (unfiltered) row */
Ritor1
parents:
diff changeset
423
Ritor1
parents:
diff changeset
424 #ifdef PNG_READ_QUANTIZE_SUPPORTED
Ritor1
parents:
diff changeset
425 /* The following three members were added at version 1.0.14 and 1.2.4 */
Ritor1
parents:
diff changeset
426 png_bytep quantize_sort; /* working sort array */
Ritor1
parents:
diff changeset
427 png_bytep index_to_palette; /* where the original index currently is
Ritor1
parents:
diff changeset
428 in the palette */
Ritor1
parents:
diff changeset
429 png_bytep palette_to_index; /* which original index points to this
Ritor1
parents:
diff changeset
430 palette color */
Ritor1
parents:
diff changeset
431 #endif
Ritor1
parents:
diff changeset
432
Ritor1
parents:
diff changeset
433 /* New members added in libpng-1.0.16 and 1.2.6 */
Ritor1
parents:
diff changeset
434 png_byte compression_type;
Ritor1
parents:
diff changeset
435
Ritor1
parents:
diff changeset
436 #ifdef PNG_USER_LIMITS_SUPPORTED
Ritor1
parents:
diff changeset
437 png_uint_32 user_width_max;
Ritor1
parents:
diff changeset
438 png_uint_32 user_height_max;
Ritor1
parents:
diff changeset
439
Ritor1
parents:
diff changeset
440 /* Added in libpng-1.4.0: Total number of sPLT, text, and unknown
Ritor1
parents:
diff changeset
441 * chunks that can be stored (0 means unlimited).
Ritor1
parents:
diff changeset
442 */
Ritor1
parents:
diff changeset
443 png_uint_32 user_chunk_cache_max;
Ritor1
parents:
diff changeset
444
Ritor1
parents:
diff changeset
445 /* Total memory that a zTXt, sPLT, iTXt, iCCP, or unknown chunk
Ritor1
parents:
diff changeset
446 * can occupy when decompressed. 0 means unlimited.
Ritor1
parents:
diff changeset
447 */
Ritor1
parents:
diff changeset
448 png_alloc_size_t user_chunk_malloc_max;
Ritor1
parents:
diff changeset
449 #endif
Ritor1
parents:
diff changeset
450
Ritor1
parents:
diff changeset
451 /* New member added in libpng-1.0.25 and 1.2.17 */
Ritor1
parents:
diff changeset
452 #ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
Ritor1
parents:
diff changeset
453 /* Temporary storage for unknown chunk that the library doesn't recognize,
Ritor1
parents:
diff changeset
454 * used while reading the chunk.
Ritor1
parents:
diff changeset
455 */
Ritor1
parents:
diff changeset
456 png_unknown_chunk unknown_chunk;
Ritor1
parents:
diff changeset
457 #endif
Ritor1
parents:
diff changeset
458
Ritor1
parents:
diff changeset
459 /* New member added in libpng-1.2.26 */
Ritor1
parents:
diff changeset
460 png_size_t old_big_row_buf_size;
Ritor1
parents:
diff changeset
461
Ritor1
parents:
diff changeset
462 #ifdef PNG_READ_SUPPORTED
Ritor1
parents:
diff changeset
463 /* New member added in libpng-1.2.30 */
Ritor1
parents:
diff changeset
464 png_bytep read_buffer; /* buffer for reading chunk data */
Ritor1
parents:
diff changeset
465 png_alloc_size_t read_buffer_size; /* current size of the buffer */
Ritor1
parents:
diff changeset
466 #endif
Ritor1
parents:
diff changeset
467 #ifdef PNG_SEQUENTIAL_READ_SUPPORTED
Ritor1
parents:
diff changeset
468 uInt IDAT_read_size; /* limit on read buffer size for IDAT */
Ritor1
parents:
diff changeset
469 #endif
Ritor1
parents:
diff changeset
470
Ritor1
parents:
diff changeset
471 #ifdef PNG_IO_STATE_SUPPORTED
Ritor1
parents:
diff changeset
472 /* New member added in libpng-1.4.0 */
Ritor1
parents:
diff changeset
473 png_uint_32 io_state;
Ritor1
parents:
diff changeset
474 #endif
Ritor1
parents:
diff changeset
475
Ritor1
parents:
diff changeset
476 /* New member added in libpng-1.5.6 */
Ritor1
parents:
diff changeset
477 png_bytep big_prev_row;
Ritor1
parents:
diff changeset
478
Ritor1
parents:
diff changeset
479 /* New member added in libpng-1.5.7 */
Ritor1
parents:
diff changeset
480 void (*read_filter[PNG_FILTER_VALUE_LAST-1])(png_row_infop row_info,
Ritor1
parents:
diff changeset
481 png_bytep row, png_const_bytep prev_row);
Ritor1
parents:
diff changeset
482
Ritor1
parents:
diff changeset
483 #ifdef PNG_READ_SUPPORTED
Ritor1
parents:
diff changeset
484 #if defined(PNG_COLORSPACE_SUPPORTED) || defined(PNG_GAMMA_SUPPORTED)
Ritor1
parents:
diff changeset
485 png_colorspace colorspace;
Ritor1
parents:
diff changeset
486 #endif
Ritor1
parents:
diff changeset
487 #endif
Ritor1
parents:
diff changeset
488 };
Ritor1
parents:
diff changeset
489 #endif /* PNGSTRUCT_H */