21 #if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) 23 #ifdef PNG_bKGD_SUPPORTED 28 png_debug1(1,
"in %s storage function",
"bKGD");
30 if (png_ptr == NULL || info_ptr == NULL)
38 #ifdef PNG_cHRM_SUPPORTED 45 png_debug1(1,
"in %s storage function",
"cHRM fixed");
47 if (png_ptr == NULL || info_ptr == NULL)
50 # ifdef PNG_CHECK_cHRM_SUPPORTED 52 white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y))
55 info_ptr->x_white = white_x;
56 info_ptr->y_white = white_y;
57 info_ptr->x_red = red_x;
58 info_ptr->y_red = red_y;
59 info_ptr->x_green = green_x;
60 info_ptr->y_green = green_y;
61 info_ptr->x_blue = blue_x;
62 info_ptr->y_blue = blue_y;
67 # ifdef PNG_FLOATING_POINT_SUPPORTED 70 double white_x,
double white_y,
double red_x,
double red_y,
71 double green_x,
double green_y,
double blue_x,
double blue_y)
74 png_fixed(png_ptr, white_x,
"cHRM White X"),
75 png_fixed(png_ptr, white_y,
"cHRM White Y"),
78 png_fixed(png_ptr, green_x,
"cHRM Green X"),
79 png_fixed(png_ptr, green_y,
"cHRM Green Y"),
80 png_fixed(png_ptr, blue_x,
"cHRM Blue X"),
81 png_fixed(png_ptr, blue_y,
"cHRM Blue Y"));
87 #ifdef PNG_gAMA_SUPPORTED 92 png_debug1(1,
"in %s storage function",
"gAMA");
94 if (png_ptr == NULL || info_ptr == NULL)
104 else if (file_gamma <= 0)
105 png_warning(png_ptr,
"Negative or zero gamma ignored");
109 info_ptr->gamma = file_gamma;
114 # ifdef PNG_FLOATING_POINT_SUPPORTED 124 #ifdef PNG_hIST_SUPPORTED 130 png_debug1(1,
"in %s storage function",
"hIST");
132 if (png_ptr == NULL || info_ptr == NULL)
135 if (info_ptr->num_palette == 0 || info_ptr->num_palette
139 "Invalid palette size, hIST allocation skipped");
152 if (png_ptr->hist == NULL)
154 png_warning(png_ptr,
"Insufficient memory for hIST chunk data");
158 for (i = 0; i < info_ptr->num_palette; i++)
159 png_ptr->hist[i] = hist[i];
161 info_ptr->hist = png_ptr->hist;
170 int color_type,
int interlace_type,
int compression_type,
173 png_debug1(1,
"in %s storage function",
"IHDR");
175 if (png_ptr == NULL || info_ptr == NULL)
178 info_ptr->width = width;
179 info_ptr->height = height;
180 info_ptr->bit_depth = (
png_byte)bit_depth;
181 info_ptr->color_type = (
png_byte)color_type;
182 info_ptr->compression_type = (
png_byte)compression_type;
183 info_ptr->filter_type = (
png_byte)filter_type;
184 info_ptr->interlace_type = (
png_byte)interlace_type;
187 info_ptr->bit_depth, info_ptr->color_type, info_ptr->interlace_type,
188 info_ptr->compression_type, info_ptr->filter_type);
191 info_ptr->channels = 1;
194 info_ptr->channels = 3;
197 info_ptr->channels = 1;
200 info_ptr->channels++;
202 info_ptr->pixel_depth = (
png_byte)(info_ptr->channels * info_ptr->bit_depth);
211 info_ptr->rowbytes = 0;
213 info_ptr->rowbytes =
PNG_ROWBYTES(info_ptr->pixel_depth, width);
216 #ifdef PNG_oFFs_SUPPORTED 221 png_debug1(1,
"in %s storage function",
"oFFs");
223 if (png_ptr == NULL || info_ptr == NULL)
226 info_ptr->x_offset = offset_x;
227 info_ptr->y_offset = offset_y;
228 info_ptr->offset_unit_type = (
png_byte)unit_type;
233 #ifdef PNG_pCAL_SUPPORTED 242 png_debug1(1,
"in %s storage function",
"pCAL");
244 if (png_ptr == NULL || info_ptr == NULL)
248 png_debug1(3,
"allocating purpose for info (%lu bytes)",
249 (
unsigned long)length);
254 if (type < 0 || type > 3)
255 png_error(png_ptr,
"Invalid pCAL equation type");
258 for (i=0; i<nparams; ++i)
260 png_error(png_ptr,
"Invalid format for pCAL parameter");
262 info_ptr->pcal_purpose = (
png_charp)png_malloc_warn(png_ptr, length);
264 if (info_ptr->pcal_purpose == NULL)
266 png_warning(png_ptr,
"Insufficient memory for pCAL purpose");
270 png_memcpy(info_ptr->pcal_purpose, purpose, length);
272 png_debug(3,
"storing X0, X1, type, and nparams in info");
273 info_ptr->pcal_X0 = X0;
274 info_ptr->pcal_X1 = X1;
275 info_ptr->pcal_type = (
png_byte)type;
276 info_ptr->pcal_nparams = (
png_byte)nparams;
279 png_debug1(3,
"allocating units for info (%lu bytes)",
280 (
unsigned long)length);
282 info_ptr->pcal_units = (
png_charp)png_malloc_warn(png_ptr, length);
284 if (info_ptr->pcal_units == NULL)
286 png_warning(png_ptr,
"Insufficient memory for pCAL units");
290 png_memcpy(info_ptr->pcal_units, units, length);
292 info_ptr->pcal_params = (
png_charpp)png_malloc_warn(png_ptr,
295 if (info_ptr->pcal_params == NULL)
297 png_warning(png_ptr,
"Insufficient memory for pCAL params");
303 for (i = 0; i < nparams; i++)
306 png_debug2(3,
"allocating parameter %d for info (%lu bytes)", i,
307 (
unsigned long)length);
309 info_ptr->pcal_params[i] = (
png_charp)png_malloc_warn(png_ptr, length);
311 if (info_ptr->pcal_params[i] == NULL)
313 png_warning(png_ptr,
"Insufficient memory for pCAL parameter");
317 png_memcpy(info_ptr->pcal_params[i], params[i], length);
325 #ifdef PNG_sCAL_SUPPORTED 332 png_debug1(1,
"in %s storage function",
"sCAL");
334 if (png_ptr == NULL || info_ptr == NULL)
340 if (unit != 1 && unit != 2)
341 png_error(png_ptr,
"Invalid sCAL unit");
343 if (swidth == NULL || (lengthw =
png_strlen(swidth)) <= 0 ||
345 png_error(png_ptr,
"Invalid sCAL width");
347 if (sheight == NULL || (lengthh =
png_strlen(sheight)) <= 0 ||
349 png_error(png_ptr,
"Invalid sCAL height");
351 info_ptr->scal_unit = (
png_byte)unit;
355 png_debug1(3,
"allocating unit for info (%u bytes)", (
unsigned int)lengthw);
357 info_ptr->scal_s_width = (
png_charp)png_malloc_warn(png_ptr, lengthw);
359 if (info_ptr->scal_s_width == NULL)
361 png_warning(png_ptr,
"Memory allocation failed while processing sCAL");
365 png_memcpy(info_ptr->scal_s_width, swidth, lengthw);
369 png_debug1(3,
"allocating unit for info (%u bytes)", (
unsigned int)lengthh);
371 info_ptr->scal_s_height = (
png_charp)png_malloc_warn(png_ptr, lengthh);
373 if (info_ptr->scal_s_height == NULL)
375 png_free (png_ptr, info_ptr->scal_s_width);
376 info_ptr->scal_s_width = NULL;
378 png_warning(png_ptr,
"Memory allocation failed while processing sCAL");
382 png_memcpy(info_ptr->scal_s_height, sheight, lengthh);
388 # ifdef PNG_FLOATING_POINT_SUPPORTED 393 png_debug1(1,
"in %s storage function",
"sCAL");
397 png_warning(png_ptr,
"Invalid sCAL width ignored");
399 else if (height <= 0)
400 png_warning(png_ptr,
"Invalid sCAL height ignored");
418 # ifdef PNG_FIXED_POINT_SUPPORTED 423 png_debug1(1,
"in %s storage function",
"sCAL");
427 png_warning(png_ptr,
"Invalid sCAL width ignored");
429 else if (height <= 0)
430 png_warning(png_ptr,
"Invalid sCAL height ignored");
447 #ifdef PNG_pHYs_SUPPORTED 452 png_debug1(1,
"in %s storage function",
"pHYs");
454 if (png_ptr == NULL || info_ptr == NULL)
457 info_ptr->x_pixels_per_unit = res_x;
458 info_ptr->y_pixels_per_unit = res_y;
459 info_ptr->phys_unit_type = (
png_byte)unit_type;
469 png_debug1(1,
"in %s storage function",
"PLTE");
471 if (png_ptr == NULL || info_ptr == NULL)
477 png_error(png_ptr,
"Invalid palette length");
496 png_ptr->palette = (
png_colorp)png_calloc(png_ptr,
500 info_ptr->palette = png_ptr->palette;
501 info_ptr->num_palette = png_ptr->num_palette = (
png_uint_16)num_palette;
508 #ifdef PNG_sBIT_SUPPORTED 513 png_debug1(1,
"in %s storage function",
"sBIT");
515 if (png_ptr == NULL || info_ptr == NULL)
523 #ifdef PNG_sRGB_SUPPORTED 527 png_debug1(1,
"in %s storage function",
"sRGB");
529 if (png_ptr == NULL || info_ptr == NULL)
532 info_ptr->srgb_intent = (
png_byte)srgb_intent;
540 png_debug1(1,
"in %s storage function",
"sRGB_gAMA_and_cHRM");
542 if (png_ptr == NULL || info_ptr == NULL)
547 # ifdef PNG_gAMA_SUPPORTED 551 # ifdef PNG_cHRM_SUPPORTED 564 #ifdef PNG_iCCP_SUPPORTED 574 png_debug1(1,
"in %s storage function",
"iCCP");
576 if (png_ptr == NULL || info_ptr == NULL || name == NULL || profile == NULL)
580 new_iccp_name = (
png_charp)png_malloc_warn(png_ptr, length);
582 if (new_iccp_name == NULL)
584 png_warning(png_ptr,
"Insufficient memory to process iCCP chunk");
589 new_iccp_profile = (
png_bytep)png_malloc_warn(png_ptr, proflen);
591 if (new_iccp_profile == NULL)
595 "Insufficient memory to process iCCP profile");
603 info_ptr->iccp_proflen = proflen;
604 info_ptr->iccp_name = new_iccp_name;
605 info_ptr->iccp_profile = new_iccp_profile;
609 info_ptr->iccp_compression = (
png_byte)compression_type;
615 #ifdef PNG_TEXT_SUPPORTED 624 png_error(png_ptr,
"Insufficient memory to store text");
633 png_debug1(1,
"in %s storage function", ((png_ptr == NULL ||
634 png_ptr->chunk_name[0] ==
'\0') ?
637 if (png_ptr == NULL || info_ptr == NULL || num_text == 0)
643 if (info_ptr->num_text + num_text > info_ptr->max_text)
645 if (info_ptr->text != NULL)
650 old_max = info_ptr->max_text;
651 info_ptr->max_text = info_ptr->num_text + num_text + 8;
652 old_text = info_ptr->text;
653 info_ptr->text = (
png_textp)png_malloc_warn(png_ptr,
656 if (info_ptr->text == NULL)
669 info_ptr->max_text = num_text + 8;
670 info_ptr->num_text = 0;
671 info_ptr->text = (
png_textp)png_malloc_warn(png_ptr,
673 if (info_ptr->text == NULL)
678 png_debug1(3,
"allocated %d entries for info_ptr->text",
681 for (i = 0; i < num_text; i++)
685 png_textp textp = &(info_ptr->text[info_ptr->num_text]);
687 if (text_ptr[i].key == NULL)
693 png_warning(png_ptr,
"text compression mode is out of range");
699 if (text_ptr[i].compression <= 0)
706 # ifdef PNG_iTXt_SUPPORTED 710 if (text_ptr[i].lang != NULL)
716 if (text_ptr[i].lang_key != NULL)
717 lang_key_len =
png_strlen(text_ptr[i].lang_key);
729 if (text_ptr[i].text == NULL || text_ptr[i].text[0] ==
'\0')
732 # ifdef PNG_iTXt_SUPPORTED 733 if (text_ptr[i].compression > 0)
744 textp->compression = text_ptr[i].compression;
747 textp->key = (
png_charp)png_malloc_warn(png_ptr,
749 (key_len + text_length + lang_len + lang_key_len + 4));
751 if (textp->key == NULL)
754 png_debug2(2,
"Allocated %lu bytes at %p in png_set_text",
756 (key_len + lang_len + lang_key_len + text_length + 4),
760 *(textp->key + key_len) =
'\0';
762 if (text_ptr[i].compression > 0)
764 textp->lang = textp->key + key_len + 1;
765 png_memcpy(textp->lang, text_ptr[i].lang, lang_len);
766 *(textp->lang + lang_len) =
'\0';
767 textp->lang_key = textp->lang + lang_len + 1;
768 png_memcpy(textp->lang_key, text_ptr[i].lang_key, lang_key_len);
769 *(textp->lang_key + lang_key_len) =
'\0';
770 textp->text = textp->lang_key + lang_key_len + 1;
776 textp->lang_key=NULL;
777 textp->text = textp->key + key_len + 1;
784 *(textp->text + text_length) =
'\0';
786 # ifdef PNG_iTXt_SUPPORTED 787 if (textp->compression > 0)
789 textp->text_length = 0;
790 textp->itxt_length = text_length;
796 textp->text_length = text_length;
797 textp->itxt_length = 0;
800 info_ptr->num_text++;
801 png_debug1(3,
"transferred text chunk %d", info_ptr->num_text);
807 #ifdef PNG_tIME_SUPPORTED 811 png_debug1(1,
"in %s storage function",
"tIME");
813 if (png_ptr == NULL || info_ptr == NULL ||
822 #ifdef PNG_tRNS_SUPPORTED 827 png_debug1(1,
"in %s storage function",
"tRNS");
829 if (png_ptr == NULL || info_ptr == NULL)
832 if (trans_alpha != NULL)
842 png_ptr->trans_alpha = info_ptr->trans_alpha =
849 if (trans_color != NULL)
851 int sample_max = (1 << info_ptr->bit_depth);
854 (
int)trans_color->gray > sample_max) ||
856 ((int)trans_color->red > sample_max ||
857 (
int)trans_color->green > sample_max ||
858 (int)trans_color->blue > sample_max)))
860 "tRNS chunk has out-of-range samples for bit_depth");
862 png_memcpy(&(info_ptr->trans_color), trans_color,
879 #ifdef PNG_sPLT_SUPPORTED 895 if (png_ptr == NULL || info_ptr == NULL)
899 (info_ptr->splt_palettes_num + nentries) *
904 png_warning(png_ptr,
"No memory for sPLT palettes");
911 png_free(png_ptr, info_ptr->splt_palettes);
912 info_ptr->splt_palettes=NULL;
914 for (i = 0; i < nentries; i++)
916 png_sPLT_tp to = np + info_ptr->splt_palettes_num + i;
923 if (to->name == NULL)
926 "Out of memory while processing sPLT chunk");
934 if (to->entries == NULL)
937 "Out of memory while processing sPLT chunk");
946 to->nentries = from->nentries;
947 to->depth = from->depth;
950 info_ptr->splt_palettes = np;
951 info_ptr->splt_palettes_num += nentries;
957 #ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED 965 if (png_ptr == NULL || info_ptr == NULL || num_unknowns == 0)
969 (
png_size_t)(info_ptr->unknown_chunks_num + num_unknowns) *
975 "Out of memory while processing unknown chunk");
983 png_free(png_ptr, info_ptr->unknown_chunks);
984 info_ptr->unknown_chunks = NULL;
986 for (i = 0; i < num_unknowns; i++)
993 to->size = from->size;
996 to->location = (
png_byte)(png_ptr->mode & 0xff);
1003 to->data = (
png_bytep)png_malloc_warn(png_ptr,
1006 if (to->data == NULL)
1009 "Out of memory while processing unknown chunk");
1014 png_memcpy(to->data, from->data, from->size);
1018 info_ptr->unknown_chunks = np;
1019 info_ptr->unknown_chunks_num += num_unknowns;
1025 int chunk,
int location)
1027 if (png_ptr != NULL && info_ptr != NULL && chunk >= 0 && chunk <
1028 info_ptr->unknown_chunks_num)
1029 info_ptr->unknown_chunks[chunk].location = (
png_byte)location;
1034 #ifdef PNG_MNG_FEATURES_SUPPORTED 1038 png_debug(1,
"in png_permit_mng_features");
1040 if (png_ptr == NULL)
1043 png_ptr->mng_features_permitted =
1046 return (
png_uint_32)png_ptr->mng_features_permitted;
1050 #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED 1053 chunk_list,
int num_chunks)
1056 int i, old_num_chunks;
1057 if (png_ptr == NULL)
1060 if (num_chunks == 0)
1077 if (chunk_list == NULL)
1080 old_num_chunks = png_ptr->num_chunk_list;
1082 (
png_size_t)(5*(num_chunks + old_num_chunks)));
1084 if (png_ptr->chunk_list != NULL)
1088 png_free(png_ptr, png_ptr->chunk_list);
1089 png_ptr->chunk_list=NULL;
1092 png_memcpy(new_list + 5*old_num_chunks, chunk_list,
1095 for (p = new_list + 5*old_num_chunks + 4, i = 0; i<num_chunks; i++, p += 5)
1098 png_ptr->num_chunk_list = old_num_chunks + num_chunks;
1099 png_ptr->chunk_list = new_list;
1104 #ifdef PNG_READ_USER_CHUNKS_SUPPORTED 1107 png_user_chunk_ptr read_user_chunk_fn)
1109 png_debug(1,
"in png_set_read_user_chunk_fn");
1111 if (png_ptr == NULL)
1114 png_ptr->read_user_chunk_fn = read_user_chunk_fn;
1115 png_ptr->user_chunk_ptr = user_chunk_ptr;
1119 #ifdef PNG_INFO_IMAGE_SUPPORTED 1123 png_debug1(1,
"in %s storage function",
"rows");
1125 if (png_ptr == NULL || info_ptr == NULL)
1128 if (info_ptr->row_pointers && (info_ptr->row_pointers != row_pointers))
1131 info_ptr->row_pointers = row_pointers;
1141 if (png_ptr == NULL)
1148 png_warning(png_ptr,
"Attempt to set buffer size beyond max ignored");
1154 png_ptr->zbuf_size = (
uInt)size;
1156 png_ptr->zbuf = (
png_bytep)png_malloc(png_ptr, size);
1161 png_ptr->zstream.next_out = png_ptr->zbuf;
1162 png_ptr->zstream.avail_out = 0;
1163 png_ptr->zstream.avail_in = 0;
1169 if (png_ptr && info_ptr)
1170 info_ptr->valid &= ~mask;
1175 #ifdef PNG_SET_USER_LIMITS_SUPPORTED 1185 if (png_ptr == NULL)
1188 png_ptr->user_width_max = user_width_max;
1189 png_ptr->user_height_max = user_height_max;
1198 png_ptr->user_chunk_cache_max = user_chunk_cache_max;
1207 png_ptr->user_chunk_malloc_max = user_chunk_malloc_max;
1212 #ifdef PNG_BENIGN_ERRORS_SUPPORTED 1216 png_debug(1,
"in png_set_benign_errors");
#define PNG_TEXT_COMPRESSION_LAST
void PNGAPI png_set_IHDR(png_structp png_ptr, png_infop info_ptr, png_uint_32 width, png_uint_32 height, int bit_depth, int color_type, int interlace_type, int compression_type, int filter_type)
void PNGAPI png_set_sCAL_s(png_structp png_ptr, png_infop info_ptr, int unit, png_const_charp swidth, png_const_charp sheight)
#define PNG_ALL_MNG_FEATURES
void PNGAPI png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask, int num)
void PNGAPI png_set_tIME(png_structp png_ptr, png_infop info_ptr, png_const_timep mod_time)
PNG_CONST png_time FAR * png_const_timep
void png_ascii_from_fp(png_structp png_ptr, png_charp ascii, png_size_t size, double fp, unsigned int precision)
#define PNG_MAX_PALETTE_LENGTH
void PNGAPI png_set_rows(png_structp png_ptr, png_infop info_ptr, png_bytepp row_pointers)
#define PNG_sCAL_PRECISION
#define PNG_COLOR_TYPE_RGB
#define PNG_COLOR_TYPE_PALETTE
png_fixed_point png_fixed(png_structp png_ptr, double fp, png_const_charp text)
void PNGAPI png_set_unknown_chunks(png_structp png_ptr, png_infop info_ptr, png_const_unknown_chunkp unknowns, int num_unknowns)
void PNGAPI png_set_user_limits(png_structp png_ptr, png_uint_32 user_width_max, png_uint_32 user_height_max)
void PNGFAPI png_set_gAMA_fixed(png_structp png_ptr, png_infop info_ptr, png_fixed_point file_gamma)
PNG_CONST png_color FAR * png_const_colorp
#define PNG_FLAG_KEEP_UNKNOWN_CHUNKS
PNG_CONST char FAR * png_const_charp
void PNGAPI png_set_sCAL(png_structp png_ptr, png_infop info_ptr, int unit, double width, double height)
PNG_CONST png_color_8 FAR * png_const_color_8p
void PNGAPI png_set_unknown_chunk_location(png_structp png_ptr, png_infop info_ptr, int chunk, int location)
void PNGAPI png_set_gAMA(png_structp png_ptr, png_infop info_ptr, double file_gamma)
png_uint_32 PNGAPI png_permit_mng_features(png_structp png_ptr, png_uint_32 mng_features)
void PNGAPI png_set_oFFs(png_structp png_ptr, png_infop info_ptr, png_int_32 offset_x, png_int_32 offset_y, int unit_type)
png_size_t png_alloc_size_t
void PNGAPI png_set_compression_buffer_size(png_structp png_ptr, png_size_t size)
png_byte FAR *FAR * png_bytepp
void PNGAPI png_set_sRGB_gAMA_and_cHRM(png_structp png_ptr, png_infop info_ptr, int srgb_intent)
void PNGAPI png_set_bKGD(png_structp png_ptr, png_infop info_ptr, png_const_color_16p background)
void PNGAPI png_set_sCAL_fixed(png_structp png_ptr, png_infop info_ptr, int unit, png_fixed_point width, png_fixed_point height)
unsigned long png_uint_32
#define PNG_TEXT_COMPRESSION_NONE
void png_check_IHDR(png_structp png_ptr, png_uint_32 width, png_uint_32 height, int bit_depth, int color_type, int interlace_type, int compression_type, int filter_type)
void PNGAPI png_set_sBIT(png_structp png_ptr, png_infop info_ptr, png_const_color_8p sig_bit)
png_struct FAR * png_structp
#define PNG_HANDLE_CHUNK_ALWAYS
PNG_CONST png_text FAR * png_const_textp
void PNGAPI png_set_PLTE(png_structp png_ptr, png_infop info_ptr, png_const_colorp palette, int num_palette)
#define PNG_COLOR_MASK_COLOR
#define PNG_ITXT_COMPRESSION_NONE
void PNGAPI png_set_sPLT(png_structp png_ptr, png_infop info_ptr, png_const_sPLT_tp entries, int nentries)
unsigned short png_uint_16
void PNGAPI png_set_cHRM(png_structp png_ptr, png_infop info_ptr, double white_x, double white_y, double red_x, double red_y, double green_x, double green_y, double blue_x, double blue_y)
void PNGAPI png_set_text(png_structp png_ptr, png_infop info_ptr, png_const_textp text_ptr, int num_text)
#define PNG_COLOR_TYPE_GRAY
png_sPLT_entry FAR * png_sPLT_entryp
void PNGAPI png_warning(png_structp png_ptr, png_const_charp warning_message)
int png_check_cHRM_fixed(png_structp png_ptr, png_fixed_point white_x, png_fixed_point white_y, png_fixed_point red_x, png_fixed_point red_y, png_fixed_point green_x, png_fixed_point green_y, png_fixed_point blue_x, png_fixed_point blue_y)
void png_ascii_from_fixed(png_structp png_ptr, png_charp ascii, png_size_t size, png_fixed_point fp)
png_uint_16 FAR * png_uint_16p
void PNGAPI png_set_chunk_malloc_max(png_structp png_ptr, png_alloc_size_t user_chunk_malloc_max)
#define PNG_FLAG_BENIGN_ERRORS_WARN
PNG_CONST png_byte FAR * png_const_bytep
#define png_debug1(l, m, p1)
void PNGFAPI png_set_cHRM_fixed(png_structp png_ptr, png_infop info_ptr, png_fixed_point white_x, png_fixed_point white_y, png_fixed_point red_x, png_fixed_point red_y, png_fixed_point green_x, png_fixed_point green_y, png_fixed_point blue_x, png_fixed_point blue_y)
PNG_CONST png_color_16 FAR * png_const_color_16p
int png_set_text_2(png_structp png_ptr, png_infop info_ptr, png_const_textp text_ptr, int num_text)
PNG_CONST png_unknown_chunk FAR * png_const_unknown_chunkp
#define PNG_HANDLE_CHUNK_IF_SAFE
void PNGAPI png_set_hIST(png_structp png_ptr, png_infop info_ptr, png_const_uint_16p hist)
#define PNG_COLOR_MASK_ALPHA
void PNGAPI png_set_tRNS(png_structp png_ptr, png_infop info_ptr, png_const_bytep trans_alpha, int num_trans, png_const_color_16p trans_color)
png_sPLT_t FAR * png_sPLT_tp
png_int_32 png_fixed_point
char FAR *FAR * png_charpp
void PNGAPI png_set_invalid(png_structp png_ptr, png_infop info_ptr, int mask)
#define PNG_sCAL_MAX_DIGITS
PNG_CONST png_sPLT_t FAR * png_const_sPLT_tp
void PNGAPI png_set_read_user_chunk_fn(png_structp png_ptr, png_voidp user_chunk_ptr, png_user_chunk_ptr read_user_chunk_fn)
int png_check_fp_string(png_const_charp string, png_size_t size)
png_unknown_chunk FAR * png_unknown_chunkp
void PNGAPI png_set_sRGB(png_structp png_ptr, png_infop info_ptr, int srgb_intent)
void PNGAPI png_set_keep_unknown_chunks(png_structp png_ptr, int keep, png_const_bytep chunk_list, int num_chunks)
#define PNG_FLAG_KEEP_UNSAFE_CHUNKS
void PNGAPI png_set_pHYs(png_structp png_ptr, png_infop info_ptr, png_uint_32 res_x, png_uint_32 res_y, int unit_type)
void PNGAPI png_set_iCCP(png_structp png_ptr, png_infop info_ptr, png_const_charp name, int compression_type, png_const_bytep profile, png_uint_32 proflen)
void PNGAPI png_free(png_structp png_ptr, png_voidp ptr)
#define PNG_ROWBYTES(pixel_bits, width)
void PNGAPI png_set_pCAL(png_structp png_ptr, png_infop info_ptr, png_const_charp purpose, png_int_32 X0, png_int_32 X1, int type, int nparams, png_const_charp units, png_charpp params)
void PNGAPI png_set_chunk_cache_max(png_structp png_ptr, png_uint_32 user_chunk_cache_max)
PNG_CONST png_uint_16 FAR * png_const_uint_16p
void PNGAPI png_set_benign_errors(png_structp png_ptr, int allowed)
#define png_debug2(l, m, p1, p2)
png_color FAR * png_colorp