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;
78 png_debug1(1,
"in %s storage function",
"cHRM XYZ fixed");
80 if (png_ptr ==
NULL || info_ptr ==
NULL)
89 XYZ.
blueX = int_blue_X;
90 XYZ.
blueY = int_blue_Y;
91 XYZ.
blueZ = int_blue_Z;
94 png_error(png_ptr,
"XYZ values out of representable range");
100 # ifdef PNG_FLOATING_POINT_SUPPORTED
103 double white_x,
double white_y,
double red_x,
double red_y,
104 double green_x,
double green_y,
double blue_x,
double blue_y)
107 png_fixed(png_ptr, white_x,
"cHRM White X"),
108 png_fixed(png_ptr, white_y,
"cHRM White Y"),
111 png_fixed(png_ptr, green_x,
"cHRM Green X"),
112 png_fixed(png_ptr, green_y,
"cHRM Green Y"),
113 png_fixed(png_ptr, blue_x,
"cHRM Blue X"),
114 png_fixed(png_ptr, blue_y,
"cHRM Blue Y"));
119 double red_Y,
double red_Z,
double green_X,
double green_Y,
double green_Z,
120 double blue_X,
double blue_Y,
double blue_Z)
126 png_fixed(png_ptr, green_X,
"cHRM Red X"),
127 png_fixed(png_ptr, green_Y,
"cHRM Red Y"),
128 png_fixed(png_ptr, green_Z,
"cHRM Red Z"),
129 png_fixed(png_ptr, blue_X,
"cHRM Red X"),
130 png_fixed(png_ptr, blue_Y,
"cHRM Red Y"),
131 png_fixed(png_ptr, blue_Z,
"cHRM Red Z"));
137 #ifdef PNG_gAMA_SUPPORTED
142 png_debug1(1,
"in %s storage function",
"gAMA");
144 if (png_ptr ==
NULL || info_ptr ==
NULL)
155 if (file_gamma < 16 || file_gamma > 625000000)
156 png_warning(png_ptr,
"Out of range gamma value ignored");
160 info_ptr->gamma = file_gamma;
165 # ifdef PNG_FLOATING_POINT_SUPPORTED
175 #ifdef PNG_hIST_SUPPORTED
181 png_debug1(1,
"in %s storage function",
"hIST");
183 if (png_ptr ==
NULL || info_ptr ==
NULL)
186 if (info_ptr->num_palette == 0 || info_ptr->num_palette
190 "Invalid palette size, hIST allocation skipped");
203 if (png_ptr->hist ==
NULL)
205 png_warning(png_ptr,
"Insufficient memory for hIST chunk data");
209 for (i = 0; i < info_ptr->num_palette; i++)
210 png_ptr->hist[i] = hist[i];
212 info_ptr->hist = png_ptr->hist;
224 png_debug1(1,
"in %s storage function",
"IHDR");
226 if (png_ptr ==
NULL || info_ptr ==
NULL)
229 info_ptr->width =
width;
230 info_ptr->height =
height;
231 info_ptr->bit_depth = (
png_byte)bit_depth;
232 info_ptr->color_type = (
png_byte)color_type;
233 info_ptr->compression_type = (
png_byte)compression_type;
234 info_ptr->filter_type = (
png_byte)filter_type;
235 info_ptr->interlace_type = (
png_byte)interlace_type;
238 info_ptr->bit_depth, info_ptr->color_type, info_ptr->interlace_type,
239 info_ptr->compression_type, info_ptr->filter_type);
242 info_ptr->channels = 1;
245 info_ptr->channels = 3;
248 info_ptr->channels = 1;
251 info_ptr->channels++;
253 info_ptr->pixel_depth = (
png_byte)(info_ptr->channels * info_ptr->bit_depth);
262 info_ptr->rowbytes = 0;
264 info_ptr->rowbytes =
PNG_ROWBYTES(info_ptr->pixel_depth, width);
267 #ifdef PNG_oFFs_SUPPORTED
272 png_debug1(1,
"in %s storage function",
"oFFs");
274 if (png_ptr ==
NULL || info_ptr ==
NULL)
277 info_ptr->x_offset = offset_x;
278 info_ptr->y_offset = offset_y;
279 info_ptr->offset_unit_type = (
png_byte)unit_type;
284 #ifdef PNG_pCAL_SUPPORTED
293 png_debug1(1,
"in %s storage function",
"pCAL");
295 if (png_ptr ==
NULL || info_ptr ==
NULL)
299 png_debug1(3,
"allocating purpose for info (%lu bytes)",
300 (
unsigned long)length);
306 png_error(png_ptr,
"Invalid pCAL equation type");
309 for (i=0; i<nparams; ++
i)
311 png_error(png_ptr,
"Invalid format for pCAL parameter");
313 info_ptr->pcal_purpose = (
png_charp)png_malloc_warn(png_ptr, length);
315 if (info_ptr->pcal_purpose ==
NULL)
317 png_warning(png_ptr,
"Insufficient memory for pCAL purpose");
321 png_memcpy(info_ptr->pcal_purpose, purpose, length);
323 png_debug(3,
"storing X0, X1, type, and nparams in info");
324 info_ptr->pcal_X0 = X0;
325 info_ptr->pcal_X1 = X1;
326 info_ptr->pcal_type = (
png_byte)type;
327 info_ptr->pcal_nparams = (
png_byte)nparams;
330 png_debug1(3,
"allocating units for info (%lu bytes)",
331 (
unsigned long)length);
333 info_ptr->pcal_units = (
png_charp)png_malloc_warn(png_ptr, length);
335 if (info_ptr->pcal_units ==
NULL)
337 png_warning(png_ptr,
"Insufficient memory for pCAL units");
341 png_memcpy(info_ptr->pcal_units, units, length);
343 info_ptr->pcal_params = (
png_charpp)png_malloc_warn(png_ptr,
346 if (info_ptr->pcal_params ==
NULL)
348 png_warning(png_ptr,
"Insufficient memory for pCAL params");
354 for (i = 0; i < nparams; i++)
357 png_debug2(3,
"allocating parameter %d for info (%lu bytes)", i,
358 (
unsigned long)length);
360 info_ptr->pcal_params[
i] = (
png_charp)png_malloc_warn(png_ptr, length);
362 if (info_ptr->pcal_params[i] ==
NULL)
364 png_warning(png_ptr,
"Insufficient memory for pCAL parameter");
368 png_memcpy(info_ptr->pcal_params[i], params[i], length);
376 #ifdef PNG_sCAL_SUPPORTED
383 png_debug1(1,
"in %s storage function",
"sCAL");
385 if (png_ptr ==
NULL || info_ptr ==
NULL)
391 if (unit != 1 && unit != 2)
396 png_error(png_ptr,
"Invalid sCAL width");
400 png_error(png_ptr,
"Invalid sCAL height");
402 info_ptr->scal_unit = (
png_byte)unit;
406 png_debug1(3,
"allocating unit for info (%u bytes)", (
unsigned int)lengthw);
408 info_ptr->scal_s_width = (
png_charp)png_malloc_warn(png_ptr, lengthw);
410 if (info_ptr->scal_s_width ==
NULL)
412 png_warning(png_ptr,
"Memory allocation failed while processing sCAL");
416 png_memcpy(info_ptr->scal_s_width, swidth, lengthw);
420 png_debug1(3,
"allocating unit for info (%u bytes)", (
unsigned int)lengthh);
422 info_ptr->scal_s_height = (
png_charp)png_malloc_warn(png_ptr, lengthh);
424 if (info_ptr->scal_s_height ==
NULL)
426 png_free (png_ptr, info_ptr->scal_s_width);
427 info_ptr->scal_s_width =
NULL;
429 png_warning(png_ptr,
"Memory allocation failed while processing sCAL");
433 png_memcpy(info_ptr->scal_s_height, sheight, lengthh);
439 # ifdef PNG_FLOATING_POINT_SUPPORTED
444 png_debug1(1,
"in %s storage function",
"sCAL");
448 png_warning(png_ptr,
"Invalid sCAL width ignored");
450 else if (height <= 0)
451 png_warning(png_ptr,
"Invalid sCAL height ignored");
469 # ifdef PNG_FIXED_POINT_SUPPORTED
474 png_debug1(1,
"in %s storage function",
"sCAL");
478 png_warning(png_ptr,
"Invalid sCAL width ignored");
480 else if (height <= 0)
481 png_warning(png_ptr,
"Invalid sCAL height ignored");
498 #ifdef PNG_pHYs_SUPPORTED
503 png_debug1(1,
"in %s storage function",
"pHYs");
505 if (png_ptr ==
NULL || info_ptr ==
NULL)
508 info_ptr->x_pixels_per_unit = res_x;
509 info_ptr->y_pixels_per_unit = res_y;
510 info_ptr->phys_unit_type = (
png_byte)unit_type;
520 png_debug1(1,
"in %s storage function",
"PLTE");
522 if (png_ptr ==
NULL || info_ptr ==
NULL)
528 png_error(png_ptr,
"Invalid palette length");
547 png_ptr->palette = (
png_colorp)png_calloc(png_ptr,
551 info_ptr->palette = png_ptr->palette;
552 info_ptr->num_palette = png_ptr->num_palette = (
png_uint_16)num_palette;
559 #ifdef PNG_sBIT_SUPPORTED
564 png_debug1(1,
"in %s storage function",
"sBIT");
566 if (png_ptr ==
NULL || info_ptr ==
NULL)
574 #ifdef PNG_sRGB_SUPPORTED
578 png_debug1(1,
"in %s storage function",
"sRGB");
580 if (png_ptr ==
NULL || info_ptr ==
NULL)
583 info_ptr->srgb_intent = (
png_byte)srgb_intent;
591 png_debug1(1,
"in %s storage function",
"sRGB_gAMA_and_cHRM");
593 if (png_ptr ==
NULL || info_ptr ==
NULL)
598 # ifdef PNG_gAMA_SUPPORTED
602 # ifdef PNG_cHRM_SUPPORTED
615 #ifdef PNG_iCCP_SUPPORTED
625 png_debug1(1,
"in %s storage function",
"iCCP");
631 new_iccp_name = (
png_charp)png_malloc_warn(png_ptr, length);
633 if (new_iccp_name ==
NULL)
635 png_warning(png_ptr,
"Insufficient memory to process iCCP chunk");
640 new_iccp_profile = (
png_bytep)png_malloc_warn(png_ptr, proflen);
642 if (new_iccp_profile ==
NULL)
646 "Insufficient memory to process iCCP profile");
654 info_ptr->iccp_proflen = proflen;
655 info_ptr->iccp_name = new_iccp_name;
656 info_ptr->iccp_profile = new_iccp_profile;
660 info_ptr->iccp_compression = (
png_byte)compression_type;
666 #ifdef PNG_TEXT_SUPPORTED
675 png_error(png_ptr,
"Insufficient memory to store text");
684 png_debug1(1,
"in %lx storage function", png_ptr ==
NULL ?
"unexpected" :
685 (
unsigned long)png_ptr->chunk_name);
687 if (png_ptr ==
NULL || info_ptr ==
NULL || num_text == 0)
693 if (info_ptr->num_text + num_text > info_ptr->max_text)
695 if (info_ptr->text !=
NULL)
700 old_max = info_ptr->max_text;
701 info_ptr->max_text = info_ptr->num_text + num_text + 8;
702 old_text = info_ptr->text;
703 info_ptr->text = (
png_textp)png_malloc_warn(png_ptr,
706 if (info_ptr->text ==
NULL)
719 info_ptr->max_text = num_text + 8;
720 info_ptr->num_text = 0;
721 info_ptr->text = (
png_textp)png_malloc_warn(png_ptr,
723 if (info_ptr->text ==
NULL)
728 png_debug1(3,
"allocated %d entries for info_ptr->text",
731 for (i = 0; i < num_text; i++)
735 png_textp textp = &(info_ptr->text[info_ptr->num_text]);
737 if (text_ptr[i].key ==
NULL)
743 png_warning(png_ptr,
"text compression mode is out of range");
749 if (text_ptr[i].compression <= 0)
756 # ifdef PNG_iTXt_SUPPORTED
760 if (text_ptr[i].lang !=
NULL)
766 if (text_ptr[i].lang_key !=
NULL)
767 lang_key_len =
png_strlen(text_ptr[i].lang_key);
779 if (text_ptr[i].text ==
NULL || text_ptr[i].text[0] ==
'\0')
782 # ifdef PNG_iTXt_SUPPORTED
783 if (text_ptr[i].compression > 0)
794 textp->compression = text_ptr[
i].compression;
797 textp->key = (
png_charp)png_malloc_warn(png_ptr,
799 (key_len + text_length + lang_len + lang_key_len + 4));
801 if (textp->key ==
NULL)
804 png_debug2(2,
"Allocated %lu bytes at %p in png_set_text",
806 (key_len + lang_len + lang_key_len + text_length + 4),
810 *(textp->key + key_len) =
'\0';
812 if (text_ptr[i].compression > 0)
814 textp->lang = textp->key + key_len + 1;
815 png_memcpy(textp->lang, text_ptr[i].lang, lang_len);
816 *(textp->lang + lang_len) =
'\0';
817 textp->lang_key = textp->lang + lang_len + 1;
818 png_memcpy(textp->lang_key, text_ptr[i].lang_key, lang_key_len);
819 *(textp->lang_key + lang_key_len) =
'\0';
820 textp->text = textp->lang_key + lang_key_len + 1;
826 textp->lang_key=
NULL;
827 textp->text = textp->key + key_len + 1;
834 *(textp->text + text_length) =
'\0';
836 # ifdef PNG_iTXt_SUPPORTED
837 if (textp->compression > 0)
839 textp->text_length = 0;
840 textp->itxt_length = text_length;
846 textp->text_length = text_length;
847 textp->itxt_length = 0;
850 info_ptr->num_text++;
851 png_debug1(3,
"transferred text chunk %d", info_ptr->num_text);
857 #ifdef PNG_tIME_SUPPORTED
861 png_debug1(1,
"in %s storage function",
"tIME");
863 if (png_ptr ==
NULL || info_ptr ==
NULL ||
867 if (mod_time->month == 0 || mod_time->month > 12 ||
868 mod_time->day == 0 || mod_time->day > 31 ||
869 mod_time->hour > 23 || mod_time->minute > 59 ||
870 mod_time->second > 60)
872 png_warning(png_ptr,
"Ignoring invalid time value");
881 #ifdef PNG_tRNS_SUPPORTED
886 png_debug1(1,
"in %s storage function",
"tRNS");
888 if (png_ptr ==
NULL || info_ptr ==
NULL)
891 if (trans_alpha !=
NULL)
901 png_ptr->trans_alpha = info_ptr->trans_alpha =
908 if (trans_color !=
NULL)
910 int sample_max = (1 << info_ptr->bit_depth);
913 (
int)trans_color->gray > sample_max) ||
915 ((
int)trans_color->red > sample_max ||
916 (
int)trans_color->green > sample_max ||
917 (
int)trans_color->blue > sample_max)))
919 "tRNS chunk has out-of-range samples for bit_depth");
921 png_memcpy(&(info_ptr->trans_color), trans_color,
938 #ifdef PNG_sPLT_SUPPORTED
954 if (png_ptr ==
NULL || info_ptr ==
NULL)
958 (info_ptr->splt_palettes_num + nentries) *
963 png_warning(png_ptr,
"No memory for sPLT palettes");
970 png_free(png_ptr, info_ptr->splt_palettes);
971 info_ptr->splt_palettes=
NULL;
980 to->name = (
png_charp)png_malloc_warn(png_ptr, length);
982 if (to->name ==
NULL)
985 "Out of memory while processing sPLT chunk");
993 if (to->entries ==
NULL)
996 "Out of memory while processing sPLT chunk");
1005 to->nentries = from->nentries;
1006 to->depth = from->depth;
1009 info_ptr->splt_palettes = np;
1010 info_ptr->splt_palettes_num +=
nentries;
1016 #ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED
1024 if (png_ptr ==
NULL || info_ptr ==
NULL || num_unknowns == 0)
1028 (
png_size_t)(info_ptr->unknown_chunks_num + num_unknowns) *
1034 "Out of memory while processing unknown chunk");
1042 png_free(png_ptr, info_ptr->unknown_chunks);
1043 info_ptr->unknown_chunks =
NULL;
1045 for (i = 0; i < num_unknowns; i++)
1052 to->size = from->size;
1055 to->location = (
png_byte)(png_ptr->mode & 0xff);
1057 if (from->size == 0)
1062 to->data = (
png_bytep)png_malloc_warn(png_ptr,
1065 if (to->data ==
NULL)
1068 "Out of memory while processing unknown chunk");
1073 png_memcpy(to->data, from->data, from->size);
1077 info_ptr->unknown_chunks = np;
1078 info_ptr->unknown_chunks_num += num_unknowns;
1086 if (png_ptr !=
NULL && info_ptr !=
NULL && chunk >= 0 && chunk <
1087 info_ptr->unknown_chunks_num)
1088 info_ptr->unknown_chunks[
chunk].location = (
png_byte)location;
1093 #ifdef PNG_MNG_FEATURES_SUPPORTED
1097 png_debug(1,
"in png_permit_mng_features");
1099 if (png_ptr ==
NULL)
1102 png_ptr->mng_features_permitted =
1105 return (
png_uint_32)png_ptr->mng_features_permitted;
1109 #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
1112 chunk_list,
int num_chunks)
1115 int i, old_num_chunks;
1116 if (png_ptr ==
NULL)
1119 if (num_chunks == 0)
1136 if (chunk_list ==
NULL)
1139 old_num_chunks = png_ptr->num_chunk_list;
1141 (
png_size_t)(5*(num_chunks + old_num_chunks)));
1143 if (png_ptr->chunk_list !=
NULL)
1147 png_free(png_ptr, png_ptr->chunk_list);
1148 png_ptr->chunk_list=
NULL;
1151 png_memcpy(new_list + 5*old_num_chunks, chunk_list,
1154 for (p = new_list + 5*old_num_chunks + 4, i = 0; i<num_chunks; i++, p += 5)
1157 png_ptr->num_chunk_list = old_num_chunks + num_chunks;
1158 png_ptr->chunk_list = new_list;
1163 #ifdef PNG_READ_USER_CHUNKS_SUPPORTED
1166 png_user_chunk_ptr read_user_chunk_fn)
1168 png_debug(1,
"in png_set_read_user_chunk_fn");
1170 if (png_ptr ==
NULL)
1173 png_ptr->read_user_chunk_fn = read_user_chunk_fn;
1174 png_ptr->user_chunk_ptr = user_chunk_ptr;
1178 #ifdef PNG_INFO_IMAGE_SUPPORTED
1182 png_debug1(1,
"in %s storage function",
"rows");
1184 if (png_ptr ==
NULL || info_ptr ==
NULL)
1187 if (info_ptr->row_pointers && (info_ptr->row_pointers != row_pointers))
1190 info_ptr->row_pointers = row_pointers;
1200 if (png_ptr ==
NULL)
1207 png_warning(png_ptr,
"Attempt to set buffer size beyond max ignored");
1213 png_ptr->zbuf_size = (
uInt)size;
1215 png_ptr->zbuf = (
png_bytep)png_malloc(png_ptr, size);
1220 png_ptr->zstream.next_out = png_ptr->zbuf;
1221 png_ptr->zstream.avail_out = 0;
1222 png_ptr->zstream.avail_in = 0;
1228 if (png_ptr && info_ptr)
1229 info_ptr->valid &= ~mask;
1234 #ifdef PNG_SET_USER_LIMITS_SUPPORTED
1244 if (png_ptr ==
NULL)
1247 png_ptr->user_width_max = user_width_max;
1248 png_ptr->user_height_max = user_height_max;
1257 png_ptr->user_chunk_cache_max = user_chunk_cache_max;
1266 png_ptr->user_chunk_malloc_max = user_chunk_malloc_max;
1271 #ifdef PNG_BENIGN_ERRORS_SUPPORTED
1275 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
else Out of place iCCP chunk
void PNGAPI png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask, int num)
GLint GLenum GLsizei GLsizei GLsizei GLint GLenum GLenum type
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)
png_error(png_ptr,"Missing IHDR before iCCP")
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)
EGLSurface EGLint EGLint EGLint EGLint height
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
EGLImageKHR EGLint * name
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_set_iCCP(png_ptr, info_ptr, png_ptr->chunkdata, compression_type,(png_bytep) png_ptr->chunkdata+prefix_length, profile_size)
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)
int png_xy_from_XYZ(png_xy *xy, png_XYZ XYZ)
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)
#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
png_set_sPLT(png_ptr, info_ptr,&new_palette, 1)
EGLSurface EGLint EGLint EGLint width
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_cHRM_XYZ(png_structp png_ptr, png_infop info_ptr, double red_X, double red_Y, double red_Z, double green_X, double green_Y, double green_Z, double blue_X, double blue_Y, double blue_Z)
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)
void PNGFAPI png_set_cHRM_XYZ_fixed(png_structp png_ptr, png_infop info_ptr, png_fixed_point int_red_X, png_fixed_point int_red_Y, png_fixed_point int_red_Z, png_fixed_point int_green_X, png_fixed_point int_green_Y, png_fixed_point int_green_Z, png_fixed_point int_blue_X, png_fixed_point int_blue_Y, png_fixed_point int_blue_Z)
png_sPLT_t FAR * png_sPLT_tp
GLint GLint GLint GLint GLint GLint GLint GLbitfield mask
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_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
#define PNG_GAMMA_sRGB_INVERSE
void PNGAPI png_set_benign_errors(png_structp png_ptr, int allowed)
#define png_debug2(l, m, p1, p2)
png_color FAR * png_colorp