OLD | NEW |
1 | 1 |
2 /* pngstruct.h - header file for PNG reference library | 2 /* pngstruct.h - header file for PNG reference library |
3 * | 3 * |
4 * Copyright (c) 1998-2013 Glenn Randers-Pehrson | 4 * Last changed in libpng 1.6.18 [July 23, 2015] |
| 5 * Copyright (c) 1998-2015 Glenn Randers-Pehrson |
5 * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) | 6 * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) |
6 * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) | 7 * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) |
7 * | 8 * |
8 * Last changed in libpng 1.6.1 [March 28, 2013] | |
9 * | |
10 * This code is released under the libpng license. | 9 * This code is released under the libpng license. |
11 * For conditions of distribution and use, see the disclaimer | 10 * For conditions of distribution and use, see the disclaimer |
12 * and license in png.h | 11 * and license in png.h |
13 */ | 12 */ |
14 | 13 |
15 /* The structure that holds the information to read and write PNG files. | 14 /* The structure that holds the information to read and write PNG files. |
16 * The only people who need to care about what is inside of this are the | 15 * The only people who need to care about what is inside of this are the |
17 * people who will be modifying the library for their own special needs. | 16 * people who will be modifying the library for their own special needs. |
18 * It should NOT be accessed directly by an application. | 17 * It should NOT be accessed directly by an application. |
19 */ | 18 */ |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 */ | 93 */ |
95 typedef struct png_XYZ | 94 typedef struct png_XYZ |
96 { | 95 { |
97 png_fixed_point red_X, red_Y, red_Z; | 96 png_fixed_point red_X, red_Y, red_Z; |
98 png_fixed_point green_X, green_Y, green_Z; | 97 png_fixed_point green_X, green_Y, green_Z; |
99 png_fixed_point blue_X, blue_Y, blue_Z; | 98 png_fixed_point blue_X, blue_Y, blue_Z; |
100 } png_XYZ; | 99 } png_XYZ; |
101 #endif /* COLORSPACE */ | 100 #endif /* COLORSPACE */ |
102 | 101 |
103 #if defined(PNG_COLORSPACE_SUPPORTED) || defined(PNG_GAMMA_SUPPORTED) | 102 #if defined(PNG_COLORSPACE_SUPPORTED) || defined(PNG_GAMMA_SUPPORTED) |
104 /* A colorspace is all the above plus, potentially, profile information, | 103 /* A colorspace is all the above plus, potentially, profile information; |
105 * however at present libpng does not use the profile internally so it is only | 104 * however at present libpng does not use the profile internally so it is only |
106 * stored in the png_info struct (if iCCP is supported.) The rendering intent | 105 * stored in the png_info struct (if iCCP is supported.) The rendering intent |
107 * is retained here and is checked. | 106 * is retained here and is checked. |
108 * | 107 * |
109 * The file gamma encoding information is also stored here and gamma correction | 108 * The file gamma encoding information is also stored here and gamma correction |
110 * is done by libpng, whereas color correction must currently be done by the | 109 * is done by libpng, whereas color correction must currently be done by the |
111 * application. | 110 * application. |
112 */ | 111 */ |
113 typedef struct png_colorspace | 112 typedef struct png_colorspace |
114 { | 113 { |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 | 212 |
214 png_uint_32 width; /* width of image in pixels */ | 213 png_uint_32 width; /* width of image in pixels */ |
215 png_uint_32 height; /* height of image in pixels */ | 214 png_uint_32 height; /* height of image in pixels */ |
216 png_uint_32 num_rows; /* number of rows in current pass */ | 215 png_uint_32 num_rows; /* number of rows in current pass */ |
217 png_uint_32 usr_width; /* width of row at start of write */ | 216 png_uint_32 usr_width; /* width of row at start of write */ |
218 png_size_t rowbytes; /* size of row in bytes */ | 217 png_size_t rowbytes; /* size of row in bytes */ |
219 png_uint_32 iwidth; /* width of current interlaced row in pixels */ | 218 png_uint_32 iwidth; /* width of current interlaced row in pixels */ |
220 png_uint_32 row_number; /* current row in interlace pass */ | 219 png_uint_32 row_number; /* current row in interlace pass */ |
221 png_uint_32 chunk_name; /* PNG_CHUNK() id of current chunk */ | 220 png_uint_32 chunk_name; /* PNG_CHUNK() id of current chunk */ |
222 png_bytep prev_row; /* buffer to save previous (unfiltered) row. | 221 png_bytep prev_row; /* buffer to save previous (unfiltered) row. |
223 * This is a pointer into big_prev_row | 222 * While reading this is a pointer into |
| 223 * big_prev_row; while writing it is separately |
| 224 * allocated if needed. |
224 */ | 225 */ |
225 png_bytep row_buf; /* buffer to save current (unfiltered) row. | 226 png_bytep row_buf; /* buffer to save current (unfiltered) row. |
226 * This is a pointer into big_row_buf | 227 * While reading, this is a pointer into |
| 228 * big_row_buf; while writing it is separately |
| 229 * allocated. |
227 */ | 230 */ |
228 #ifdef PNG_WRITE_SUPPORTED | 231 #ifdef PNG_WRITE_FILTER_SUPPORTED |
229 png_bytep sub_row; /* buffer to save "sub" row when filtering */ | 232 png_bytep try_row; /* buffer to save trial row when filtering */ |
230 png_bytep up_row; /* buffer to save "up" row when filtering */ | 233 png_bytep tst_row; /* buffer to save best trial row when filtering */ |
231 png_bytep avg_row; /* buffer to save "avg" row when filtering */ | |
232 png_bytep paeth_row; /* buffer to save "Paeth" row when filtering */ | |
233 #endif | 234 #endif |
234 png_size_t info_rowbytes; /* Added in 1.5.4: cache of updated row bytes */ | 235 png_size_t info_rowbytes; /* Added in 1.5.4: cache of updated row bytes */ |
235 | 236 |
236 png_uint_32 idat_size; /* current IDAT size for read */ | 237 png_uint_32 idat_size; /* current IDAT size for read */ |
237 png_uint_32 crc; /* current chunk CRC value */ | 238 png_uint_32 crc; /* current chunk CRC value */ |
238 png_colorp palette; /* palette from the input file */ | 239 png_colorp palette; /* palette from the input file */ |
239 png_uint_16 num_palette; /* number of color entries in palette */ | 240 png_uint_16 num_palette; /* number of color entries in palette */ |
240 | 241 |
241 /* Added at libpng-1.5.10 */ | 242 /* Added at libpng-1.5.10 */ |
242 #ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED | 243 #ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED |
(...skipping 12 matching lines...) Expand all Loading... |
255 png_byte pixel_depth; /* number of bits per pixel */ | 256 png_byte pixel_depth; /* number of bits per pixel */ |
256 png_byte channels; /* number of channels in file */ | 257 png_byte channels; /* number of channels in file */ |
257 #ifdef PNG_WRITE_SUPPORTED | 258 #ifdef PNG_WRITE_SUPPORTED |
258 png_byte usr_channels; /* channels at start of write: write only */ | 259 png_byte usr_channels; /* channels at start of write: write only */ |
259 #endif | 260 #endif |
260 png_byte sig_bytes; /* magic bytes read/written from start of file */ | 261 png_byte sig_bytes; /* magic bytes read/written from start of file */ |
261 png_byte maximum_pixel_depth; | 262 png_byte maximum_pixel_depth; |
262 /* pixel depth used for the row buffers */ | 263 /* pixel depth used for the row buffers */ |
263 png_byte transformed_pixel_depth; | 264 png_byte transformed_pixel_depth; |
264 /* pixel depth after read/write transforms */ | 265 /* pixel depth after read/write transforms */ |
| 266 #if PNG_ZLIB_VERNUM >= 0x1240 |
| 267 png_byte zstream_start; /* at start of an input zlib stream */ |
| 268 #endif /* Zlib >= 1.2.4 */ |
265 #if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) | 269 #if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) |
266 png_uint_16 filler; /* filler bytes for pixel expansion */ | 270 png_uint_16 filler; /* filler bytes for pixel expansion */ |
267 #endif | 271 #endif |
268 | 272 |
269 #if defined(PNG_bKGD_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) ||\ | 273 #if defined(PNG_bKGD_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) ||\ |
270 defined(PNG_READ_ALPHA_MODE_SUPPORTED) | 274 defined(PNG_READ_ALPHA_MODE_SUPPORTED) |
271 png_byte background_gamma_type; | 275 png_byte background_gamma_type; |
272 png_fixed_point background_gamma; | 276 png_fixed_point background_gamma; |
273 png_color_16 background; /* background color in screen gamma space */ | 277 png_color_16 background; /* background color in screen gamma space */ |
274 #ifdef PNG_READ_GAMMA_SUPPORTED | 278 #ifdef PNG_READ_GAMMA_SUPPORTED |
275 png_color_16 background_1; /* background normalized to gamma 1.0 */ | 279 png_color_16 background_1; /* background normalized to gamma 1.0 */ |
276 #endif | 280 #endif |
277 #endif /* PNG_bKGD_SUPPORTED */ | 281 #endif /* bKGD */ |
278 | 282 |
279 #ifdef PNG_WRITE_FLUSH_SUPPORTED | 283 #ifdef PNG_WRITE_FLUSH_SUPPORTED |
280 png_flush_ptr output_flush_fn; /* Function for flushing output */ | 284 png_flush_ptr output_flush_fn; /* Function for flushing output */ |
281 png_uint_32 flush_dist; /* how many rows apart to flush, 0 - no flush */ | 285 png_uint_32 flush_dist; /* how many rows apart to flush, 0 - no flush */ |
282 png_uint_32 flush_rows; /* number of rows written since last flush */ | 286 png_uint_32 flush_rows; /* number of rows written since last flush */ |
283 #endif | 287 #endif |
284 | 288 |
285 #ifdef PNG_READ_GAMMA_SUPPORTED | 289 #ifdef PNG_READ_GAMMA_SUPPORTED |
286 int gamma_shift; /* number of "insignificant" bits in 16-bit gamma */ | 290 int gamma_shift; /* number of "insignificant" bits in 16-bit gamma */ |
287 png_fixed_point screen_gamma; /* screen gamma value (display_exponent) */ | 291 png_fixed_point screen_gamma; /* screen gamma value (display_exponent) */ |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 png_bytep current_buffer; /* buffer for recently used data */ | 328 png_bytep current_buffer; /* buffer for recently used data */ |
325 png_uint_32 push_length; /* size of current input chunk */ | 329 png_uint_32 push_length; /* size of current input chunk */ |
326 png_uint_32 skip_length; /* bytes to skip in input data */ | 330 png_uint_32 skip_length; /* bytes to skip in input data */ |
327 png_size_t save_buffer_size; /* amount of data now in save_buffer */ | 331 png_size_t save_buffer_size; /* amount of data now in save_buffer */ |
328 png_size_t save_buffer_max; /* total size of save_buffer */ | 332 png_size_t save_buffer_max; /* total size of save_buffer */ |
329 png_size_t buffer_size; /* total amount of available input data */ | 333 png_size_t buffer_size; /* total amount of available input data */ |
330 png_size_t current_buffer_size; /* amount of data now in current_buffer */ | 334 png_size_t current_buffer_size; /* amount of data now in current_buffer */ |
331 int process_mode; /* what push library is currently doing */ | 335 int process_mode; /* what push library is currently doing */ |
332 int cur_palette; /* current push library palette index */ | 336 int cur_palette; /* current push library palette index */ |
333 | 337 |
334 #endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ | 338 #endif /* PROGRESSIVE_READ */ |
335 | 339 |
336 #if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__) | 340 #if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__) |
337 /* For the Borland special 64K segment handler */ | 341 /* For the Borland special 64K segment handler */ |
338 png_bytepp offset_table_ptr; | 342 png_bytepp offset_table_ptr; |
339 png_bytep offset_table; | 343 png_bytep offset_table; |
340 png_uint_16 offset_table_number; | 344 png_uint_16 offset_table_number; |
341 png_uint_16 offset_table_count; | 345 png_uint_16 offset_table_count; |
342 png_uint_16 offset_table_count_free; | 346 png_uint_16 offset_table_count_free; |
343 #endif | 347 #endif |
344 | 348 |
345 #ifdef PNG_READ_QUANTIZE_SUPPORTED | 349 #ifdef PNG_READ_QUANTIZE_SUPPORTED |
346 png_bytep palette_lookup; /* lookup table for quantizing */ | 350 png_bytep palette_lookup; /* lookup table for quantizing */ |
347 png_bytep quantize_index; /* index translation for palette files */ | 351 png_bytep quantize_index; /* index translation for palette files */ |
348 #endif | 352 #endif |
349 | 353 |
350 #ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED | 354 /* Options */ |
351 png_byte heuristic_method; /* heuristic for row filter selection */ | |
352 png_byte num_prev_filters; /* number of weights for previous rows */ | |
353 png_bytep prev_filters; /* filter type(s) of previous row(s) */ | |
354 png_uint_16p filter_weights; /* weight(s) for previous line(s) */ | |
355 png_uint_16p inv_filter_weights; /* 1/weight(s) for previous line(s) */ | |
356 png_uint_16p filter_costs; /* relative filter calculation cost */ | |
357 png_uint_16p inv_filter_costs; /* 1/relative filter calculation cost */ | |
358 #endif | |
359 | |
360 /* Options */ | |
361 #ifdef PNG_SET_OPTION_SUPPORTED | 355 #ifdef PNG_SET_OPTION_SUPPORTED |
362 png_byte options; /* On/off state (up to 4 options) */ | 356 png_byte options; /* On/off state (up to 4 options) */ |
363 #endif | 357 #endif |
364 | 358 |
365 #if PNG_LIBPNG_VER < 10700 | 359 #if PNG_LIBPNG_VER < 10700 |
366 /* To do: remove this from libpng-1.7 */ | 360 /* To do: remove this from libpng-1.7 */ |
367 #ifdef PNG_TIME_RFC1123_SUPPORTED | 361 #ifdef PNG_TIME_RFC1123_SUPPORTED |
368 char time_buffer[29]; /* String to hold RFC 1123 time text */ | 362 char time_buffer[29]; /* String to hold RFC 1123 time text */ |
369 #endif | 363 #endif |
370 #endif | 364 #endif |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 void (*read_filter[PNG_FILTER_VALUE_LAST-1])(png_row_infop row_info, | 474 void (*read_filter[PNG_FILTER_VALUE_LAST-1])(png_row_infop row_info, |
481 png_bytep row, png_const_bytep prev_row); | 475 png_bytep row, png_const_bytep prev_row); |
482 | 476 |
483 #ifdef PNG_READ_SUPPORTED | 477 #ifdef PNG_READ_SUPPORTED |
484 #if defined(PNG_COLORSPACE_SUPPORTED) || defined(PNG_GAMMA_SUPPORTED) | 478 #if defined(PNG_COLORSPACE_SUPPORTED) || defined(PNG_GAMMA_SUPPORTED) |
485 png_colorspace colorspace; | 479 png_colorspace colorspace; |
486 #endif | 480 #endif |
487 #endif | 481 #endif |
488 }; | 482 }; |
489 #endif /* PNGSTRUCT_H */ | 483 #endif /* PNGSTRUCT_H */ |
OLD | NEW |