16 #define PNG_NO_PEDANTIC_WARNINGS 18 #ifdef PNG_WRITE_SUPPORTED 32 png_debug(1,
"in png_write_info_before_PLTE");
34 if (png_ptr ==
NULL || info_ptr ==
NULL)
36 if (!(png_ptr->mode & PNG_WROTE_INFO_BEFORE_PLTE))
40 #ifdef PNG_MNG_FEATURES_SUPPORTED 41 if ((png_ptr->mode&PNG_HAVE_PNG_SIGNATURE) && \
42 (png_ptr->mng_features_permitted))
44 png_warning(png_ptr,
"MNG features are not allowed in a PNG datastream");
45 png_ptr->mng_features_permitted = 0;
50 info_ptr->bit_depth, info_ptr->color_type, info_ptr->compression_type,
51 info_ptr->filter_type,
53 info_ptr->interlace_type);
60 #ifdef PNG_WRITE_gAMA_SUPPORTED 63 # ifdef PNG_FLOATING_POINT_SUPPORTED 66 #ifdef PNG_FIXED_POINT_SUPPORTED 72 #ifdef PNG_WRITE_sRGB_SUPPORTED 76 #ifdef PNG_WRITE_iCCP_SUPPORTED 79 info_ptr->iccp_profile, (
int)info_ptr->iccp_proflen);
81 #ifdef PNG_WRITE_sBIT_SUPPORTED 83 png_write_sBIT(png_ptr, &(info_ptr->sig_bit), info_ptr->color_type);
85 #ifdef PNG_WRITE_cHRM_SUPPORTED 88 #ifdef PNG_FLOATING_POINT_SUPPORTED 90 info_ptr->x_white, info_ptr->y_white,
91 info_ptr->x_red, info_ptr->y_red,
92 info_ptr->x_green, info_ptr->y_green,
93 info_ptr->x_blue, info_ptr->y_blue);
95 # ifdef PNG_FIXED_POINT_SUPPORTED 97 info_ptr->int_x_white, info_ptr->int_y_white,
98 info_ptr->int_x_red, info_ptr->int_y_red,
99 info_ptr->int_x_green, info_ptr->int_y_green,
100 info_ptr->int_x_blue, info_ptr->int_y_blue);
105 #ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED 106 if (info_ptr->unknown_chunks_num)
112 for (up = info_ptr->unknown_chunks;
113 up < info_ptr->unknown_chunks + info_ptr->unknown_chunks_num;
121 (png_ptr->flags & PNG_FLAG_KEEP_UNSAFE_CHUNKS)))
124 png_warning(png_ptr,
"Writing zero-length unknown chunk");
130 png_ptr->mode |= PNG_WROTE_INFO_BEFORE_PLTE;
137 #if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_sPLT_SUPPORTED) 143 if (png_ptr ==
NULL || info_ptr ==
NULL)
152 png_error(png_ptr,
"Valid palette required for paletted images");
154 #ifdef PNG_WRITE_tRNS_SUPPORTED 157 #ifdef PNG_WRITE_INVERT_ALPHA_SUPPORTED 159 if ((png_ptr->transformations & PNG_INVERT_ALPHA) &&
163 for (j = 0; j<(
int)info_ptr->num_trans; j++)
164 info_ptr->trans[j] = (
png_byte)(255 - info_ptr->trans[j]);
167 png_write_tRNS(png_ptr, info_ptr->trans, &(info_ptr->trans_values),
168 info_ptr->num_trans, info_ptr->color_type);
171 #ifdef PNG_WRITE_bKGD_SUPPORTED 173 png_write_bKGD(png_ptr, &(info_ptr->background), info_ptr->color_type);
175 #ifdef PNG_WRITE_hIST_SUPPORTED 179 #ifdef PNG_WRITE_oFFs_SUPPORTED 182 info_ptr->offset_unit_type);
184 #ifdef PNG_WRITE_pCAL_SUPPORTED 186 png_write_pCAL(png_ptr, info_ptr->pcal_purpose, info_ptr->pcal_X0,
187 info_ptr->pcal_X1, info_ptr->pcal_type, info_ptr->pcal_nparams,
188 info_ptr->pcal_units, info_ptr->pcal_params);
191 #ifdef PNG_sCAL_SUPPORTED 193 #ifdef PNG_WRITE_sCAL_SUPPORTED 194 #if defined(PNG_FLOATING_POINT_SUPPORTED) && defined(PNG_STDIO_SUPPORTED) 196 info_ptr->scal_pixel_width, info_ptr->scal_pixel_height);
198 #ifdef PNG_FIXED_POINT_SUPPORTED 199 png_write_sCAL_s(png_ptr, (
int)info_ptr->scal_unit,
200 info_ptr->scal_s_width, info_ptr->scal_s_height);
205 "png_write_sCAL not supported; sCAL chunk not written.");
209 #ifdef PNG_WRITE_pHYs_SUPPORTED 212 info_ptr->y_pixels_per_unit, info_ptr->phys_unit_type);
215 #ifdef PNG_WRITE_tIME_SUPPORTED 219 png_ptr->mode |= PNG_WROTE_tIME;
223 #ifdef PNG_WRITE_sPLT_SUPPORTED 225 for (i = 0; i < (
int)info_ptr->splt_palettes_num; i++)
229 #ifdef PNG_WRITE_TEXT_SUPPORTED 231 for (i = 0; i < info_ptr->num_text; i++)
233 png_debug2(2,
"Writing header text chunk %d, type %d", i,
234 info_ptr->text[i].compression);
236 if (info_ptr->text[i].compression > 0)
238 #ifdef PNG_WRITE_iTXt_SUPPORTED 240 png_write_iTXt(png_ptr,
241 info_ptr->text[i].compression,
242 info_ptr->text[i].key,
243 info_ptr->text[i].lang,
244 info_ptr->text[i].lang_key,
245 info_ptr->text[i].text);
247 png_warning(png_ptr,
"Unable to write international text");
255 #ifdef PNG_WRITE_zTXt_SUPPORTED 258 info_ptr->text[i].text, 0,
259 info_ptr->text[i].compression);
261 png_warning(png_ptr,
"Unable to write compressed text");
268 #ifdef PNG_WRITE_tEXt_SUPPORTED 271 info_ptr->text[i].text,
277 png_warning(png_ptr,
"Unable to write uncompressed text");
283 #ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED 284 if (info_ptr->unknown_chunks_num)
290 for (up = info_ptr->unknown_chunks;
291 up < info_ptr->unknown_chunks + info_ptr->unknown_chunks_num;
300 (png_ptr->flags & PNG_FLAG_KEEP_UNSAFE_CHUNKS)))
322 png_error(png_ptr,
"No IDATs written into file");
325 if (info_ptr !=
NULL)
327 #ifdef PNG_WRITE_TEXT_SUPPORTED 330 #ifdef PNG_WRITE_tIME_SUPPORTED 333 !(png_ptr->mode & PNG_WROTE_tIME))
336 #ifdef PNG_WRITE_TEXT_SUPPORTED 338 for (i = 0; i < info_ptr->num_text; i++)
340 png_debug2(2,
"Writing trailer text chunk %d, type %d", i,
341 info_ptr->text[i].compression);
343 if (info_ptr->text[i].compression > 0)
345 #ifdef PNG_WRITE_iTXt_SUPPORTED 347 png_write_iTXt(png_ptr,
348 info_ptr->text[i].compression,
349 info_ptr->text[i].key,
350 info_ptr->text[i].lang,
351 info_ptr->text[i].lang_key,
352 info_ptr->text[i].text);
354 png_warning(png_ptr,
"Unable to write international text");
361 #ifdef PNG_WRITE_zTXt_SUPPORTED 364 info_ptr->text[i].text, 0,
365 info_ptr->text[i].compression);
367 png_warning(png_ptr,
"Unable to write compressed text");
374 #ifdef PNG_WRITE_tEXt_SUPPORTED 377 info_ptr->text[i].text, 0);
379 png_warning(png_ptr,
"Unable to write uncompressed text");
387 #ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED 388 if (info_ptr->unknown_chunks_num)
394 for (up = info_ptr->unknown_chunks;
395 up < info_ptr->unknown_chunks + info_ptr->unknown_chunks_num;
402 (png_ptr->flags & PNG_FLAG_KEEP_UNSAFE_CHUNKS)))
422 #ifdef PNG_WRITE_FLUSH_SUPPORTED 423 # ifdef PNG_WRITE_FLUSH_AFTER_IEND_SUPPORTED 429 #ifdef PNG_CONVERT_tIME_SUPPORTED 434 png_debug(1,
"in png_convert_from_struct_tm");
436 ptime->year = (
png_uint_16)(1900 + ttime->tm_year);
437 ptime->month = (
png_byte)(ttime->tm_mon + 1);
438 ptime->day = (
png_byte)ttime->tm_mday;
439 ptime->hour = (
png_byte)ttime->tm_hour;
440 ptime->minute = (
png_byte)ttime->tm_min;
441 ptime->second = (
png_byte)ttime->tm_sec;
449 png_debug(1,
"in png_convert_from_time_t");
451 tbuf = gmtime(&ttime);
461 #ifdef PNG_USER_MEM_SUPPORTED 473 #ifdef PNG_SETJMP_SUPPORTED 477 #ifdef PNG_SETJMP_SUPPORTED 478 #ifdef USE_FAR_KEYWORD 484 png_debug(1,
"in png_create_write_struct");
486 #ifdef PNG_USER_MEM_SUPPORTED 496 #ifdef PNG_SET_USER_LIMITS_SUPPORTED 501 #ifdef PNG_SETJMP_SUPPORTED 502 #ifdef USE_FAR_KEYWORD 505 if (setjmp(png_ptr->jmpbuf))
509 png_ptr->zbuf =
NULL;
510 #ifdef PNG_USER_MEM_SUPPORTED 512 (png_free_ptr)free_fn, (
png_voidp)mem_ptr);
518 #ifdef USE_FAR_KEYWORD 523 #ifdef PNG_USER_MEM_SUPPORTED 528 if (user_png_ver !=
NULL)
537 png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH;
538 if (user_png_ver[i] ==
'.')
540 }
while (found_dots < 2 && user_png_ver[i] != 0 &&
544 png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH;
546 if (png_ptr->flags & PNG_FLAG_LIBRARY_MISMATCH)
554 (user_png_ver[0] ==
'1' && user_png_ver[2] !=
png_libpng_ver[2]) ||
555 (user_png_ver[0] ==
'0' && user_png_ver[2] <
'9'))
557 #if defined(PNG_STDIO_SUPPORTED) && !defined(_WIN32_WCE) 562 "Application was compiled with png.h from libpng-%.20s",
567 "Application is running with png.c from libpng-%.20s",
571 #ifdef PNG_ERROR_NUMBERS_SUPPORTED 575 "Incompatible libpng version in application and library");
587 #ifdef PNG_SETJMP_SUPPORTED 592 #ifdef USE_FAR_KEYWORD 597 if (setjmp(png_ptr->jmpbuf))
605 #if defined(PNG_1_0_X) || defined(PNG_1_2_X) 607 #undef png_write_init 620 if (png_ptr ==
NULL)
return;
621 #if defined(PNG_STDIO_SUPPORTED) && !defined(_WIN32_WCE) 626 png_ptr->warning_fn =
NULL;
630 "Application was compiled with png.h from libpng-%.20s",
635 "Application is running with png.c from libpng-%.20s",
642 png_ptr->error_fn =
NULL;
643 #ifdef PNG_ERROR_NUMBERS_SUPPORTED 647 "The png struct allocated by the application for writing is" 652 png_ptr->error_fn =
NULL;
653 #ifdef PNG_ERROR_NUMBERS_SUPPORTED 657 "The info struct allocated by the application for writing is" 670 #ifdef PNG_SETJMP_SUPPORTED 683 #ifdef PNG_LEGACY_SUPPORTED 684 png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH;
686 png_ptr->warning_fn =
NULL;
688 "Application uses deprecated png_write_init() and should be recompiled.");
696 #ifdef PNG_SETJMP_SUPPORTED 712 #ifdef PNG_SET_USER_LIMITS_SUPPORTED 717 #ifdef PNG_SETJMP_SUPPORTED 749 for (i = 0, rp = row; i <
num_rows; i++, rp++)
770 #ifdef PNG_WRITE_INTERLACING_SUPPORTED 779 for (pass = 0; pass < num_pass; pass++)
782 for (i = 0, rp = image; i < png_ptr->height; i++, rp++)
796 png_debug2(1,
"in png_write_row (row %ld, pass %d)",
797 png_ptr->row_number, png_ptr->pass);
800 if (png_ptr->row_number == 0 && png_ptr->pass == 0)
803 if (!(png_ptr->mode & PNG_WROTE_INFO_BEFORE_PLTE))
805 "png_write_info was never called before png_write_row.");
808 #if !defined(PNG_WRITE_INVERT_SUPPORTED) && defined(PNG_READ_INVERT_SUPPORTED) 809 if (png_ptr->transformations & PNG_INVERT_MONO)
811 "PNG_WRITE_INVERT_SUPPORTED is not defined.");
813 #if !defined(PNG_WRITE_FILLER_SUPPORTED) && defined(PNG_READ_FILLER_SUPPORTED) 814 if (png_ptr->transformations & PNG_FILLER)
816 "PNG_WRITE_FILLER_SUPPORTED is not defined.");
818 #if !defined(PNG_WRITE_PACKSWAP_SUPPORTED) && \ 819 defined(PNG_READ_PACKSWAP_SUPPORTED) 820 if (png_ptr->transformations & PNG_PACKSWAP)
822 "PNG_WRITE_PACKSWAP_SUPPORTED is not defined.");
824 #if !defined(PNG_WRITE_PACK_SUPPORTED) && defined(PNG_READ_PACK_SUPPORTED) 825 if (png_ptr->transformations & PNG_PACK)
826 png_warning(png_ptr,
"PNG_WRITE_PACK_SUPPORTED is not defined.");
828 #if !defined(PNG_WRITE_SHIFT_SUPPORTED) && defined(PNG_READ_SHIFT_SUPPORTED) 829 if (png_ptr->transformations & PNG_SHIFT)
830 png_warning(png_ptr,
"PNG_WRITE_SHIFT_SUPPORTED is not defined.");
832 #if !defined(PNG_WRITE_BGR_SUPPORTED) && defined(PNG_READ_BGR_SUPPORTED) 833 if (png_ptr->transformations & PNG_BGR)
834 png_warning(png_ptr,
"PNG_WRITE_BGR_SUPPORTED is not defined.");
836 #if !defined(PNG_WRITE_SWAP_SUPPORTED) && defined(PNG_READ_SWAP_SUPPORTED) 837 if (png_ptr->transformations & PNG_SWAP_BYTES)
838 png_warning(png_ptr,
"PNG_WRITE_SWAP_SUPPORTED is not defined.");
844 #ifdef PNG_WRITE_INTERLACING_SUPPORTED 846 if (png_ptr->interlaced && (png_ptr->transformations & PNG_INTERLACE))
848 switch (png_ptr->pass)
851 if (png_ptr->row_number & 0x07)
858 if ((png_ptr->row_number & 0x07) || png_ptr->width < 5)
865 if ((png_ptr->row_number & 0x07) != 4)
872 if ((png_ptr->row_number & 0x03) || png_ptr->width < 3)
879 if ((png_ptr->row_number & 0x03) != 2)
886 if ((png_ptr->row_number & 0x01) || png_ptr->width < 2)
893 if (!(png_ptr->row_number & 0x01))
904 png_ptr->row_info.color_type = png_ptr->color_type;
905 png_ptr->row_info.width = png_ptr->usr_width;
906 png_ptr->row_info.channels = png_ptr->usr_channels;
907 png_ptr->row_info.bit_depth = png_ptr->usr_bit_depth;
908 png_ptr->row_info.pixel_depth = (
png_byte)(png_ptr->row_info.bit_depth *
909 png_ptr->row_info.channels);
911 png_ptr->row_info.rowbytes = PNG_ROWBYTES(png_ptr->row_info.pixel_depth,
912 png_ptr->row_info.width);
914 png_debug1(3,
"row_info->color_type = %d", png_ptr->row_info.color_type);
915 png_debug1(3,
"row_info->width = %lu", png_ptr->row_info.width);
916 png_debug1(3,
"row_info->channels = %d", png_ptr->row_info.channels);
917 png_debug1(3,
"row_info->bit_depth = %d", png_ptr->row_info.bit_depth);
918 png_debug1(3,
"row_info->pixel_depth = %d", png_ptr->row_info.pixel_depth);
919 png_debug1(3,
"row_info->rowbytes = %lu", png_ptr->row_info.rowbytes);
923 png_ptr->row_info.rowbytes);
925 #ifdef PNG_WRITE_INTERLACING_SUPPORTED 927 if (png_ptr->interlaced && png_ptr->pass < 6 &&
928 (png_ptr->transformations & PNG_INTERLACE))
931 png_ptr->row_buf + 1, png_ptr->pass);
933 if (!(png_ptr->row_info.width))
942 if (png_ptr->transformations)
945 #ifdef PNG_MNG_FEATURES_SUPPORTED 966 if (png_ptr->write_row_fn !=
NULL)
967 (*(png_ptr->write_row_fn))(png_ptr, png_ptr->row_number, png_ptr->pass);
970 #ifdef PNG_WRITE_FLUSH_SUPPORTED 979 png_ptr->flush_dist = (nrows < 0 ? 0 :
nrows);
993 if (png_ptr->row_number >= png_ptr->num_rows)
1007 if (png_ptr->zstream.msg !=
NULL)
1008 png_error(png_ptr, png_ptr->zstream.msg);
1013 if (!(png_ptr->zstream.avail_out))
1017 png_ptr->zbuf_size);
1018 png_ptr->zstream.next_out = png_ptr->zbuf;
1019 png_ptr->zstream.avail_out = (
uInt)png_ptr->zbuf_size;
1022 }
while(wrote_IDAT == 1);
1025 if (png_ptr->zbuf_size != png_ptr->zstream.avail_out)
1029 png_ptr->zbuf_size - png_ptr->zstream.avail_out);
1030 png_ptr->zstream.next_out = png_ptr->zbuf;
1031 png_ptr->zstream.avail_out = (
uInt)png_ptr->zbuf_size;
1033 png_ptr->flush_rows = 0;
1044 #ifdef PNG_USER_MEM_SUPPORTED 1049 png_debug(1,
"in png_destroy_write_struct");
1051 if (png_ptr_ptr !=
NULL)
1053 png_ptr = *png_ptr_ptr;
1054 #ifdef PNG_USER_MEM_SUPPORTED 1055 free_fn = png_ptr->free_fn;
1056 mem_ptr = png_ptr->mem_ptr;
1060 #ifdef PNG_USER_MEM_SUPPORTED 1061 if (png_ptr !=
NULL)
1063 free_fn = png_ptr->free_fn;
1064 mem_ptr = png_ptr->mem_ptr;
1068 if (info_ptr_ptr !=
NULL)
1071 if (info_ptr !=
NULL)
1073 if (png_ptr !=
NULL)
1077 #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED 1078 if (png_ptr->num_chunk_list)
1080 png_free(png_ptr, png_ptr->chunk_list);
1081 png_ptr->chunk_list =
NULL;
1082 png_ptr->num_chunk_list = 0;
1087 #ifdef PNG_USER_MEM_SUPPORTED 1093 *info_ptr_ptr =
NULL;
1096 if (png_ptr !=
NULL)
1099 #ifdef PNG_USER_MEM_SUPPORTED 1105 *png_ptr_ptr =
NULL;
1114 #ifdef PNG_SETJMP_SUPPORTED 1120 #ifdef PNG_USER_MEM_SUPPORTED 1131 png_free(png_ptr, png_ptr->row_buf);
1132 #ifdef PNG_WRITE_FILTER_SUPPORTED 1133 png_free(png_ptr, png_ptr->prev_row);
1134 png_free(png_ptr, png_ptr->sub_row);
1135 png_free(png_ptr, png_ptr->up_row);
1136 png_free(png_ptr, png_ptr->avg_row);
1137 png_free(png_ptr, png_ptr->paeth_row);
1140 #ifdef PNG_TIME_RFC1123_SUPPORTED 1141 png_free(png_ptr, png_ptr->time_buffer);
1144 #ifdef PNG_SETJMP_SUPPORTED 1149 error_fn = png_ptr->error_fn;
1150 warning_fn = png_ptr->warning_fn;
1151 error_ptr = png_ptr->error_ptr;
1152 #ifdef PNG_USER_MEM_SUPPORTED 1153 free_fn = png_ptr->free_fn;
1161 #ifdef PNG_USER_MEM_SUPPORTED 1165 #ifdef PNG_SETJMP_SUPPORTED 1176 if (png_ptr ==
NULL)
1178 #ifdef PNG_MNG_FEATURES_SUPPORTED 1189 #ifdef PNG_WRITE_FILTER_SUPPORTED 1192 case 7:
png_warning(png_ptr,
"Unknown row filter for method 0");
1202 default: png_ptr->do_filter = (
png_byte)filters;
break;
1204 default:
png_warning(png_ptr,
"Unknown row filter for method 0");
1218 if (png_ptr->row_buf !=
NULL)
1220 #ifdef PNG_WRITE_FILTER_SUPPORTED 1224 (png_ptr->rowbytes + 1));
1230 if (png_ptr->prev_row ==
NULL)
1232 png_warning(png_ptr,
"Can't add Up filter after starting");
1238 (png_ptr->rowbytes + 1));
1245 if (png_ptr->prev_row ==
NULL)
1247 png_warning(png_ptr,
"Can't add Average filter after starting");
1253 (png_ptr->rowbytes + 1));
1259 png_ptr->paeth_row ==
NULL)
1261 if (png_ptr->prev_row ==
NULL)
1263 png_warning(png_ptr,
"Can't add Paeth filter after starting");
1269 (png_ptr->rowbytes + 1));
1280 png_error(png_ptr,
"Unknown custom filter method");
1290 #ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED 1307 png_debug(1,
"in png_set_compression_level");
1309 if (png_ptr ==
NULL)
1311 png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_LEVEL;
1312 png_ptr->zlib_level =
level;
1318 png_debug(1,
"in png_set_compression_mem_level");
1320 if (png_ptr ==
NULL)
1322 png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_MEM_LEVEL;
1329 png_debug(1,
"in png_set_compression_strategy");
1331 if (png_ptr ==
NULL)
1333 png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_STRATEGY;
1340 if (png_ptr ==
NULL)
1342 if (window_bits > 15)
1343 png_warning(png_ptr,
"Only compression windows <= 32k supported by PNG");
1344 else if (window_bits < 8)
1345 png_warning(png_ptr,
"Only compression windows >= 256 supported by PNG");
1348 if (window_bits == 8)
1350 png_warning(png_ptr,
"Compression window is being reset to 512");
1354 png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_WINDOW_BITS;
1361 png_debug(1,
"in png_set_compression_method");
1363 if (png_ptr ==
NULL)
1366 png_warning(png_ptr,
"Only compression method 8 is supported by PNG");
1367 png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_METHOD;
1368 png_ptr->zlib_method =
method;
1374 if (png_ptr ==
NULL)
1379 #ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED 1384 png_debug(1,
"in png_set_write_user_transform_fn");
1386 if (png_ptr ==
NULL)
1388 png_ptr->transformations |= PNG_USER_TRANSFORM;
1394 #ifdef PNG_INFO_IMAGE_SUPPORTED 1399 if (png_ptr ==
NULL || info_ptr ==
NULL)
1407 #ifdef PNG_WRITE_INVERT_SUPPORTED 1413 #ifdef PNG_WRITE_SHIFT_SUPPORTED 1422 #ifdef PNG_WRITE_PACK_SUPPORTED 1428 #ifdef PNG_WRITE_SWAP_ALPHA_SUPPORTED 1434 #ifdef PNG_WRITE_FILLER_SUPPORTED 1442 #ifdef PNG_WRITE_BGR_SUPPORTED 1448 #ifdef PNG_WRITE_SWAP_SUPPORTED 1454 #ifdef PNG_WRITE_PACKSWAP_SUPPORTED 1460 #ifdef PNG_WRITE_INVERT_ALPHA_SUPPORTED void png_write_sCAL(png_structp png_ptr, int unit, double width, double height)
void png_do_write_intrapixel(png_row_infop row_info, png_bytep row)
#define PNG_FILTER_VALUE_AVG
void PNGAPI png_write_chunk(png_structp png_ptr, png_bytep chunk_name, png_bytep data, png_size_t length)
void PNGAPI png_set_packing(png_structp png_ptr)
PNG_CONST char png_libpng_ver[18]
#define PNG_USER_WIDTH_MAX
void PNGAPI png_set_filter_heuristics(png_structp png_ptr, int heuristic_method, int num_weights, png_doublep filter_weights, png_doublep filter_costs)
#define PNG_TRANSFORM_SWAP_ENDIAN
void png_write_start_row(png_structp png_ptr)
png_voidp png_error_ptr png_error_ptr png_voidp png_malloc_ptr malloc_fn
void PNGAPI png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask, int num)
void PNGAPI png_write_image(png_structp png_ptr, png_bytepp image)
png_voidp png_create_struct(int type)
void PNGAPI png_write_png(png_structp png_ptr, png_infop info_ptr, int transforms, voidp params)
void png_write_hIST(png_structp png_ptr, png_uint_16p hist, int num_hist)
#define PNG_FILLER_BEFORE
void PNGAPI png_set_flush(png_structp png_ptr, int nrows)
void PNGAPI png_set_compression_level(png_structp png_ptr, int level)
int int png_doublep filter_weights
#define PNG_TRANSFORM_INVERT_MONO
png_voidp png_malloc_ptr png_free_ptr free_fn
png_user_transform_ptr write_user_transform_fn
void PNGAPI png_set_mem_fn(png_structp png_ptr, png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn)
#define png_malloc_ptr_NULL
void PNGAPI png_set_invert_alpha(png_structp png_ptr)
#define PNG_TRANSFORM_PACKSWAP
GLenum GLsizei GLenum GLenum const GLvoid * image
void png_write_gAMA_fixed(png_structp png_ptr, png_fixed_point file_gamma)
void PNGAPI png_write_rows(png_structp png_ptr, png_bytepp row, png_uint_32 num_rows)
#define PNG_COLOR_TYPE_PALETTE
void png_write_sig(png_structp png_ptr)
#define PNG_UNUSED(param)
#define PNG_FILTER_VALUE_PAETH
#define PNG_LIBPNG_VER_STRING
#define PNG_TRANSFORM_BGR
void png_write_sBIT(png_structp png_ptr, png_color_8p sbit, int color_type)
int PNGAPI png_handle_as_unknown(png_structp png_ptr, png_bytep chunk_name)
void png_do_write_transformations(png_structp png_ptr)
PNG_CONST char FAR * png_const_charp
void PNGAPI png_set_compression_strategy(png_structp png_ptr, int strategy)
int ZEXPORT deflateEnd(z_streamp strm)
void png_write_oFFs(png_structp png_ptr, png_int_32 x_offset, png_int_32 y_offset, int unit_type)
#define PNG_USER_HEIGHT_MAX
void png_write_IDAT(png_structp png_ptr, png_bytep data, png_size_t length)
#define PNG_TRANSFORM_STRIP_FILLER_AFTER
void PNGAPI png_set_write_fn(png_structp png_ptr, png_voidp io_ptr, png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn)
#define PNG_TEXT_COMPRESSION_NONE_WR
png_voidp png_error_ptr png_error_ptr warning_fn
void png_write_iCCP(png_structp png_ptr, png_charp name, int compression_type, png_charp profile, int profile_len)
png_struct FAR *FAR * png_structpp
#define PNG_WRITE_INTERLACING_SUPPORTED
void png_flush(png_structp png_ptr)
int int png_doublep png_doublep filter_costs
png_write_status_ptr write_row_fn
void png_write_tEXt(png_structp png_ptr, png_charp key, png_charp text, png_size_t text_len)
void png_write_pHYs(png_structp png_ptr, png_uint_32 x_pixels_per_unit, png_uint_32 y_pixels_per_unit, int unit_type)
GLenum GLenum GLvoid * row
void PNGAPI png_set_bgr(png_structp png_ptr)
png_byte FAR *FAR * png_bytepp
#define PNG_TEXT_COMPRESSION_zTXt
void PNGAPI png_set_write_user_transform_fn(png_structp png_ptr, png_user_transform_ptr write_user_transform_fn)
void png_write_sPLT(png_structp png_ptr, png_sPLT_tp spalette)
#define PNG_TEXT_COMPRESSION_NONE
png_struct FAR * png_structp
void PNGAPI png_write_info(png_structp png_ptr, png_infop info_ptr)
#define PNG_HANDLE_CHUNK_ALWAYS
#define png_error(s1, s2)
void PNGAPI png_set_filler(png_structp png_ptr, png_uint_32 filler, int filler_loc)
void png_write_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)
int JSAMPARRAY int int num_rows
void PNGAPI png_set_packswap(png_structp png_ptr)
#define PNG_TRANSFORM_STRIP_FILLER_BEFORE
void png_destroy_struct(png_voidp struct_ptr)
void PNGAPI png_set_swap(png_structp png_ptr)
void PNGAPI png_write_flush(png_structp png_ptr)
void png_write_find_filter(png_structp png_ptr, png_row_infop row_info)
png_voidp png_error_ptr error_fn
unsigned short png_uint_16
void PNGAPI png_set_compression_mem_level(png_structp png_ptr, int mem_level)
#define PNG_FILTER_VALUE_SUB
void png_write_IHDR(png_structp png_ptr, png_uint_32 width, png_uint_32 height, int bit_depth, int color_type, int compression_type, int filter_type, int interlace_type)
#define png_flush_ptr_NULL
void png_write_tRNS(png_structp png_ptr, png_bytep trans, png_color_16p tran, int num_trans, int color_type)
void PNGAPI png_write_init_2(png_structp png_ptr, png_const_charp user_png_ver, png_size_t png_struct_size, png_size_t png_info_size)
void PNGAPI png_warning(png_structp png_ptr, png_const_charp warning_message)
void PNGAPI png_set_write_status_fn(png_structp png_ptr, png_write_status_ptr write_row_fn)
void png_write_pCAL(png_structp png_ptr, png_charp purpose, png_int_32 X0, png_int_32 X1, int type, int nparams, png_charp units, png_charpp params)
void png_write_gAMA(png_structp png_ptr, double file_gamma)
void PNGAPI png_convert_from_struct_tm(png_timep ptime, struct tm FAR *ttime)
png_structp PNGAPI png_create_write_struct_2(png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn)
void PNGAPI png_write_end(png_structp png_ptr, png_infop info_ptr)
#define PNG_TRANSFORM_PACKING
#define PNG_TRANSFORM_INVERT_ALPHA
#define png_debug1(l, m, p1)
void PNGAPI png_set_compression_window_bits(png_structp png_ptr, int window_bits)
#define PNG_FILTER_VALUE_UP
int ZEXPORT deflate(z_streamp strm, int flush)
void PNGAPI png_set_invert_mono(png_structp png_ptr)
#define PNG_FLAG_MNG_FILTER_64
#define PNG_FILTER_TYPE_BASE
void png_write_destroy(png_structp png_ptr)
void png_write_tIME(png_structp png_ptr, png_timep mod_time)
#define PNG_TEXT_COMPRESSION_zTXt_WR
GLenum const GLfloat * params
png_voidp png_create_struct_2(int type, png_malloc_ptr malloc_fn, png_voidp mem_ptr)
#define png_free_ptr_NULL
void png_write_PLTE(png_structp png_ptr, png_colorp palette, png_uint_32 num_pal)
#define PNG_COMPRESSION_TYPE_BASE
void png_write_sRGB(png_structp png_ptr, int srgb_intent)
void PNGAPI png_write_info_before_PLTE(png_structp png_ptr, png_infop info_ptr)
png_voidp png_error_ptr png_error_ptr warn_fn
png_voidp PNGAPI png_memcpy_check(png_structp png_ptr, png_voidp s1, png_voidp s2, png_uint_32 length)
void PNGAPI png_convert_from_time_t(png_timep ptime, time_t ttime)
void PNGAPI png_destroy_write_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr)
int PNGAPI png_set_interlace_handling(png_structp png_ptr)
void png_write_IEND(png_structp png_ptr)
void PNGAPI png_write_row(png_structp png_ptr, png_bytep row)
void PNGAPI png_set_shift(png_structp png_ptr, png_color_8p true_bits)
#define PNG_TRANSFORM_SWAP_ALPHA
void png_write_bKGD(png_structp png_ptr, png_color_16p back, int color_type)
void png_destroy_struct_2(png_voidp struct_ptr, png_free_ptr free_fn, png_voidp mem_ptr)
png_structp PNGAPI png_create_write_struct(png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn)
png_byte name[PNG_CHUNK_NAME_LENGTH]
#define PNG_FILTER_VALUE_NONE
void PNGAPI png_write_init(png_structp png_ptr)
#define PNG_INTRAPIXEL_DIFFERENCING
void PNGAPI png_set_compression_method(png_structp png_ptr, int method)
void png_write_finish_row(png_structp png_ptr)
unsigned long png_uint_32
void png_write_zTXt(png_structp png_ptr, png_charp key, png_charp text, png_size_t text_len, int compression)
png_voidp png_error_ptr png_error_ptr png_voidp mem_ptr
png_info FAR *FAR * png_infopp
void PNGAPI png_free(png_structp png_ptr, png_voidp ptr)
#define png_debug2(l, m, p1, p2)
void PNGAPI png_set_swap_alpha(png_structp png_ptr)
#define PNG_TRANSFORM_SHIFT
void PNGAPI png_set_filter(png_structp png_ptr, int method, int filters)
void png_do_write_interlace(png_row_infop row_info, png_bytep row, int pass)
void PNGAPI png_set_error_fn(png_structp png_ptr, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warning_fn)
#define PNG_HANDLE_CHUNK_NEVER
png_voidp PNGAPI png_malloc(png_structp png_ptr, png_uint_32 size)
void png_write_cHRM(png_structp png_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_write_init_3(png_structpp ptr_ptr, png_const_charp user_png_ver, png_size_t png_struct_size)