Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 1 | |
| 2 | /* pngstruct.h - header file for PNG reference library |
| 3 | * |
| 4 | * Copyright (c) 1998-2010 Glenn Randers-Pehrson |
| 5 | * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) |
| 6 | * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) |
| 7 | * |
Glenn Randers-Pehrson | c6fecfb | 2010-03-09 22:27:26 -0600 | [diff] [blame] | 8 | * Last changed in libpng version 1.5.0 - March 10, 2010 |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 9 | * |
| 10 | * This code is released under the libpng license. |
| 11 | * For conditions of distribution and use, see the disclaimer |
| 12 | * and license in png.h |
| 13 | */ |
| 14 | |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 15 | /* 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 |
| 17 | * people who will be modifying the library for their own special needs. |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 18 | * It should NOT be accessed directly by an application. |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 19 | */ |
| 20 | |
Glenn Randers-Pehrson | c957b6b | 2010-03-08 21:47:07 -0600 | [diff] [blame] | 21 | #ifndef PNGSTRUCT_H |
| 22 | #define PNGSTRUCT_H |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 23 | struct png_struct_def |
| 24 | { |
| 25 | #ifdef PNG_SETJMP_SUPPORTED |
Glenn Randers-Pehrson | 95ca51b | 2010-02-19 14:09:09 -0600 | [diff] [blame] | 26 | jmp_buf png_jmpbuf; /* used in png_error */ |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 27 | png_longjmp_ptr longjmp_fn;/* setjmp non-local goto function. */ |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 28 | #endif |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 29 | png_error_ptr error_fn; /* function for printing errors and aborting */ |
| 30 | png_error_ptr warning_fn; /* function for printing warnings */ |
| 31 | png_voidp error_ptr; /* user supplied struct for error functions */ |
| 32 | png_rw_ptr write_data_fn; /* function for writing output data */ |
| 33 | png_rw_ptr read_data_fn; /* function for reading input data */ |
| 34 | png_voidp io_ptr; /* ptr to application struct for I/O functions */ |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 35 | |
| 36 | #ifdef PNG_READ_USER_TRANSFORM_SUPPORTED |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 37 | png_user_transform_ptr read_user_transform_fn; /* user read transform */ |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 38 | #endif |
| 39 | |
| 40 | #ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 41 | png_user_transform_ptr write_user_transform_fn; /* user write transform */ |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 42 | #endif |
| 43 | |
| 44 | /* These were added in libpng-1.0.2 */ |
| 45 | #ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED |
| 46 | #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ |
| 47 | defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 48 | png_voidp user_transform_ptr; /* user supplied struct for user transform */ |
| 49 | png_byte user_transform_depth; /* bit depth of user transformed pixels */ |
| 50 | png_byte user_transform_channels; /* channels in user transformed pixels */ |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 51 | #endif |
| 52 | #endif |
| 53 | |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 54 | png_uint_32 mode; /* tells us where we are in the PNG file */ |
| 55 | png_uint_32 flags; /* flags indicating various things to libpng */ |
| 56 | png_uint_32 transformations; /* which transformations to perform */ |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 57 | |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 58 | z_stream zstream; /* pointer to decompression structure (below) */ |
| 59 | png_bytep zbuf; /* buffer for zlib */ |
| 60 | png_size_t zbuf_size; /* size of zbuf */ |
| 61 | int zlib_level; /* holds zlib compression level */ |
| 62 | int zlib_method; /* holds zlib compression method */ |
| 63 | int zlib_window_bits; /* holds zlib compression window bits */ |
| 64 | int zlib_mem_level; /* holds zlib compression memory level */ |
| 65 | int zlib_strategy; /* holds zlib compression strategy */ |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 66 | |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 67 | png_uint_32 width; /* width of image in pixels */ |
| 68 | png_uint_32 height; /* height of image in pixels */ |
| 69 | png_uint_32 num_rows; /* number of rows in current pass */ |
| 70 | png_uint_32 usr_width; /* width of row at start of write */ |
| 71 | png_size_t rowbytes; /* size of row in bytes */ |
| 72 | png_uint_32 iwidth; /* width of current interlaced row in pixels */ |
| 73 | png_uint_32 row_number; /* current row in interlace pass */ |
| 74 | png_bytep prev_row; /* buffer to save previous (unfiltered) row */ |
| 75 | png_bytep row_buf; /* buffer to save current (unfiltered) row */ |
| 76 | png_bytep sub_row; /* buffer to save "sub" row when filtering */ |
| 77 | png_bytep up_row; /* buffer to save "up" row when filtering */ |
| 78 | png_bytep avg_row; /* buffer to save "avg" row when filtering */ |
| 79 | png_bytep paeth_row; /* buffer to save "Paeth" row when filtering */ |
| 80 | png_row_info row_info; /* used for transformation routines */ |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 81 | |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 82 | png_uint_32 idat_size; /* current IDAT size for read */ |
| 83 | png_uint_32 crc; /* current chunk CRC value */ |
| 84 | png_colorp palette; /* palette from the input file */ |
| 85 | png_uint_16 num_palette; /* number of color entries in palette */ |
| 86 | png_uint_16 num_trans; /* number of transparency values */ |
| 87 | png_byte chunk_name[5]; /* null-terminated name of current chunk */ |
| 88 | png_byte compression; /* file compression type (always 0) */ |
| 89 | png_byte filter; /* file filter type (always 0) */ |
| 90 | png_byte interlaced; /* PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */ |
| 91 | png_byte pass; /* current interlace pass (0 - 6) */ |
| 92 | png_byte do_filter; /* row filter flags (see PNG_FILTER_ below ) */ |
| 93 | png_byte color_type; /* color type of file */ |
| 94 | png_byte bit_depth; /* bit depth of file */ |
| 95 | png_byte usr_bit_depth; /* bit depth of users row */ |
| 96 | png_byte pixel_depth; /* number of bits per pixel */ |
| 97 | png_byte channels; /* number of channels in file */ |
| 98 | png_byte usr_channels; /* channels at start of write */ |
| 99 | png_byte sig_bytes; /* magic bytes read/written from start of file */ |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 100 | |
| 101 | #if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 102 | png_uint_16 filler; /* filler bytes for pixel expansion */ |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 103 | #endif |
| 104 | |
| 105 | #ifdef PNG_bKGD_SUPPORTED |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 106 | png_byte background_gamma_type; |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 107 | # ifdef PNG_FLOATING_POINT_SUPPORTED |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 108 | float background_gamma; |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 109 | # endif |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 110 | png_color_16 background; /* background color in screen gamma space */ |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 111 | #ifdef PNG_READ_GAMMA_SUPPORTED |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 112 | png_color_16 background_1; /* background normalized to gamma 1.0 */ |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 113 | #endif |
| 114 | #endif /* PNG_bKGD_SUPPORTED */ |
| 115 | |
| 116 | #ifdef PNG_WRITE_FLUSH_SUPPORTED |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 117 | png_flush_ptr output_flush_fn; /* Function for flushing output */ |
| 118 | png_uint_32 flush_dist; /* how many rows apart to flush, 0 - no flush */ |
| 119 | png_uint_32 flush_rows; /* number of rows written since last flush */ |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 120 | #endif |
| 121 | |
| 122 | #if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 123 | int gamma_shift; /* number of "insignificant" bits in 16-bit gamma */ |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 124 | #ifdef PNG_FLOATING_POINT_SUPPORTED |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 125 | float gamma; /* file gamma value */ |
| 126 | float screen_gamma; /* screen gamma value (display_exponent) */ |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 127 | #endif |
| 128 | #endif |
| 129 | |
| 130 | #if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 131 | png_bytep gamma_table; /* gamma table for 8-bit depth files */ |
| 132 | png_bytep gamma_from_1; /* converts from 1.0 to screen */ |
| 133 | png_bytep gamma_to_1; /* converts from file to 1.0 */ |
| 134 | png_uint_16pp gamma_16_table; /* gamma table for 16-bit depth files */ |
| 135 | png_uint_16pp gamma_16_from_1; /* converts from 1.0 to screen */ |
| 136 | png_uint_16pp gamma_16_to_1; /* converts from file to 1.0 */ |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 137 | #endif |
| 138 | |
| 139 | #if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_sBIT_SUPPORTED) |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 140 | png_color_8 sig_bit; /* significant bits in each available channel */ |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 141 | #endif |
| 142 | |
| 143 | #if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED) |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 144 | png_color_8 shift; /* shift for significant bit tranformation */ |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 145 | #endif |
| 146 | |
| 147 | #if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) \ |
| 148 | || defined(PNG_READ_EXPAND_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 149 | png_bytep trans_alpha; /* alpha values for paletted files */ |
| 150 | png_color_16 trans_color; /* transparent color for non-paletted files */ |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 151 | #endif |
| 152 | |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 153 | png_read_status_ptr read_row_fn; /* called after each row is decoded */ |
| 154 | png_write_status_ptr write_row_fn; /* called after each row is encoded */ |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 155 | #ifdef PNG_PROGRESSIVE_READ_SUPPORTED |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 156 | png_progressive_info_ptr info_fn; /* called after header data fully read */ |
| 157 | png_progressive_row_ptr row_fn; /* called after each prog. row is decoded */ |
| 158 | png_progressive_end_ptr end_fn; /* called after image is complete */ |
| 159 | png_bytep save_buffer_ptr; /* current location in save_buffer */ |
| 160 | png_bytep save_buffer; /* buffer for previously read data */ |
| 161 | png_bytep current_buffer_ptr; /* current location in current_buffer */ |
| 162 | png_bytep current_buffer; /* buffer for recently used data */ |
| 163 | png_uint_32 push_length; /* size of current input chunk */ |
| 164 | png_uint_32 skip_length; /* bytes to skip in input data */ |
| 165 | png_size_t save_buffer_size; /* amount of data now in save_buffer */ |
| 166 | png_size_t save_buffer_max; /* total size of save_buffer */ |
| 167 | png_size_t buffer_size; /* total amount of available input data */ |
| 168 | png_size_t current_buffer_size; /* amount of data now in current_buffer */ |
| 169 | int process_mode; /* what push library is currently doing */ |
| 170 | int cur_palette; /* current push library palette index */ |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 171 | |
| 172 | # ifdef PNG_TEXT_SUPPORTED |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 173 | png_size_t current_text_size; /* current size of text input data */ |
| 174 | png_size_t current_text_left; /* how much text left to read in input */ |
| 175 | png_charp current_text; /* current text chunk buffer */ |
| 176 | png_charp current_text_ptr; /* current location in current_text */ |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 177 | # endif /* PNG_PROGRESSIVE_READ_SUPPORTED && PNG_TEXT_SUPPORTED */ |
| 178 | |
| 179 | #endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ |
| 180 | |
| 181 | #if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__) |
| 182 | /* For the Borland special 64K segment handler */ |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 183 | png_bytepp offset_table_ptr; |
| 184 | png_bytep offset_table; |
| 185 | png_uint_16 offset_table_number; |
| 186 | png_uint_16 offset_table_count; |
| 187 | png_uint_16 offset_table_count_free; |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 188 | #endif |
| 189 | |
| 190 | #ifdef PNG_READ_DITHER_SUPPORTED |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 191 | png_bytep palette_lookup; /* lookup table for dithering */ |
| 192 | png_bytep dither_index; /* index translation for palette files */ |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 193 | #endif |
| 194 | |
| 195 | #if defined(PNG_READ_DITHER_SUPPORTED) || defined(PNG_hIST_SUPPORTED) |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 196 | png_uint_16p hist; /* histogram */ |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 197 | #endif |
| 198 | |
| 199 | #ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 200 | png_byte heuristic_method; /* heuristic for row filter selection */ |
| 201 | png_byte num_prev_filters; /* number of weights for previous rows */ |
| 202 | png_bytep prev_filters; /* filter type(s) of previous row(s) */ |
| 203 | png_uint_16p filter_weights; /* weight(s) for previous line(s) */ |
| 204 | png_uint_16p inv_filter_weights; /* 1/weight(s) for previous line(s) */ |
| 205 | png_uint_16p filter_costs; /* relative filter calculation cost */ |
| 206 | png_uint_16p inv_filter_costs; /* 1/relative filter calculation cost */ |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 207 | #endif |
| 208 | |
| 209 | #ifdef PNG_TIME_RFC1123_SUPPORTED |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 210 | png_charp time_buffer; /* String to hold RFC 1123 time text */ |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 211 | #endif |
| 212 | |
| 213 | /* New members added in libpng-1.0.6 */ |
| 214 | |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 215 | png_uint_32 free_me; /* flags items libpng is responsible for freeing */ |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 216 | |
| 217 | #ifdef PNG_USER_CHUNKS_SUPPORTED |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 218 | png_voidp user_chunk_ptr; |
| 219 | png_user_chunk_ptr read_user_chunk_fn; /* user read chunk handler */ |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 220 | #endif |
| 221 | |
| 222 | #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 223 | int num_chunk_list; |
| 224 | png_bytep chunk_list; |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 225 | #endif |
| 226 | |
| 227 | /* New members added in libpng-1.0.3 */ |
| 228 | #ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 229 | png_byte rgb_to_gray_status; |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 230 | /* These were changed from png_byte in libpng-1.0.6 */ |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 231 | png_uint_16 rgb_to_gray_red_coeff; |
| 232 | png_uint_16 rgb_to_gray_green_coeff; |
| 233 | png_uint_16 rgb_to_gray_blue_coeff; |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 234 | #endif |
| 235 | |
| 236 | /* New member added in libpng-1.0.4 (renamed in 1.0.9) */ |
| 237 | #if defined(PNG_MNG_FEATURES_SUPPORTED) || \ |
| 238 | defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \ |
| 239 | defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED) |
| 240 | /* Changed from png_byte to png_uint_32 at version 1.2.0 */ |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 241 | png_uint_32 mng_features_permitted; |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 242 | #endif |
| 243 | |
| 244 | /* New member added in libpng-1.0.7 */ |
| 245 | #if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 246 | png_fixed_point int_gamma; |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 247 | #endif |
| 248 | |
| 249 | /* New member added in libpng-1.0.9, ifdef'ed out in 1.0.12, enabled in 1.2.0 */ |
| 250 | #ifdef PNG_MNG_FEATURES_SUPPORTED |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 251 | png_byte filter_type; |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 252 | #endif |
| 253 | |
| 254 | /* New members added in libpng-1.2.0 */ |
| 255 | |
| 256 | /* New members added in libpng-1.0.2 but first enabled by default in 1.2.0 */ |
| 257 | #ifdef PNG_USER_MEM_SUPPORTED |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 258 | png_voidp mem_ptr; /* user supplied struct for mem functions */ |
| 259 | png_malloc_ptr malloc_fn; /* function for allocating memory */ |
| 260 | png_free_ptr free_fn; /* function for freeing memory */ |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 261 | #endif |
| 262 | |
| 263 | /* New member added in libpng-1.0.13 and 1.2.0 */ |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 264 | png_bytep big_row_buf; /* buffer to save current (unfiltered) row */ |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 265 | |
| 266 | #ifdef PNG_READ_DITHER_SUPPORTED |
| 267 | /* The following three members were added at version 1.0.14 and 1.2.4 */ |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 268 | png_bytep dither_sort; /* working sort array */ |
| 269 | png_bytep index_to_palette; /* where the original index currently is |
| 270 | in the palette */ |
| 271 | png_bytep palette_to_index; /* which original index points to this |
| 272 | palette color */ |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 273 | #endif |
| 274 | |
| 275 | /* New members added in libpng-1.0.16 and 1.2.6 */ |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 276 | png_byte compression_type; |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 277 | |
| 278 | #ifdef PNG_USER_LIMITS_SUPPORTED |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 279 | png_uint_32 user_width_max; |
| 280 | png_uint_32 user_height_max; |
| 281 | |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 282 | /* Added in libpng-1.4.0: Total number of sPLT, text, and unknown |
| 283 | * chunks that can be stored (0 means unlimited). |
| 284 | */ |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 285 | png_uint_32 user_chunk_cache_max; |
| 286 | |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 287 | /* Total memory that a zTXt, sPLT, iTXt, iCCP, or unknown chunk |
| 288 | * can occupy when decompressed. 0 means unlimited. |
| 289 | */ |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 290 | png_uint_32 user_chunk_malloc_max; |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 291 | #endif |
| 292 | |
| 293 | /* New member added in libpng-1.0.25 and 1.2.17 */ |
| 294 | #ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED |
| 295 | /* Storage for unknown chunk that the library doesn't recognize. */ |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 296 | png_unknown_chunk unknown_chunk; |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 297 | #endif |
| 298 | |
| 299 | /* New members added in libpng-1.2.26 */ |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 300 | png_uint_32 old_big_row_buf_size; |
| 301 | png_uint_32 old_prev_row_size; |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 302 | |
| 303 | /* New member added in libpng-1.2.30 */ |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 304 | png_charp chunkdata; /* buffer for reading chunk data */ |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 305 | |
| 306 | #ifdef PNG_IO_STATE_SUPPORTED |
| 307 | /* New member added in libpng-1.4.0 */ |
Glenn Randers-Pehrson | 3f506b7 | 2010-02-09 00:36:08 -0600 | [diff] [blame] | 308 | png_uint_32 io_state; |
Glenn Randers-Pehrson | e3f3c4e | 2010-02-07 18:08:50 -0600 | [diff] [blame] | 309 | #endif |
| 310 | }; |
Glenn Randers-Pehrson | c957b6b | 2010-03-08 21:47:07 -0600 | [diff] [blame] | 311 | #endif /* PNGSTRUCT_H */ |