Lines Matching refs:png_ptr
26 png_write_info_before_PLTE(png_structp png_ptr, png_infop info_ptr)
29 if (png_ptr == NULL || info_ptr == NULL)
31 if (!(png_ptr->mode & PNG_WROTE_INFO_BEFORE_PLTE))
33 png_write_sig(png_ptr); /* write PNG signature */
35 if((png_ptr->mode&PNG_HAVE_PNG_SIGNATURE)&&(png_ptr->mng_features_permitted))
37 png_warning(png_ptr,"MNG features are not allowed in a PNG datastream");
38 png_ptr->mng_features_permitted=0;
42 png_write_IHDR(png_ptr, info_ptr->width, info_ptr->height,
56 png_write_gAMA(png_ptr, info_ptr->gamma);
59 png_write_gAMA_fixed(png_ptr, info_ptr->int_gamma);
66 png_write_sRGB(png_ptr, (int)info_ptr->srgb_intent);
70 png_write_iCCP(png_ptr, info_ptr->iccp_name, PNG_COMPRESSION_TYPE_BASE,
75 png_write_sBIT(png_ptr, &(info_ptr->sig_bit), info_ptr->color_type);
81 png_write_cHRM(png_ptr,
88 png_write_cHRM_fixed(png_ptr,
108 int keep=png_handle_as_unknown(png_ptr, up->name);
113 (png_ptr->flags & PNG_FLAG_KEEP_UNSAFE_CHUNKS)))
115 png_write_chunk(png_ptr, up->name, up->data, up->size);
120 png_ptr->mode |= PNG_WROTE_INFO_BEFORE_PLTE;
125 png_write_info(png_structp png_ptr, png_infop info_ptr)
133 if (png_ptr == NULL || info_ptr == NULL)
136 png_write_info_before_PLTE(png_ptr, info_ptr);
139 png_write_PLTE(png_ptr, info_ptr->palette,
142 png_error(png_ptr, "Valid palette required for paletted images");
149 if ((png_ptr->transformations & PNG_INVERT_ALPHA) &&
157 png_write_tRNS(png_ptr, info_ptr->trans, &(info_ptr->trans_values),
163 png_write_bKGD(png_ptr, &(info_ptr->background), info_ptr->color_type);
167 png_write_hIST(png_ptr, info_ptr->hist, info_ptr->num_palette);
171 png_write_oFFs(png_ptr, info_ptr->x_offset, info_ptr->y_offset,
176 png_write_pCAL(png_ptr, info_ptr->pcal_purpose, info_ptr->pcal_X0,
183 png_write_sCAL(png_ptr, (int)info_ptr->scal_unit,
187 png_write_sCAL_s(png_ptr, (int)info_ptr->scal_unit,
190 png_warning(png_ptr,
197 png_write_pHYs(png_ptr, info_ptr->x_pixels_per_unit,
203 png_write_tIME(png_ptr, &(info_ptr->mod_time));
204 png_ptr->mode |= PNG_WROTE_tIME;
210 png_write_sPLT(png_ptr, info_ptr->splt_palettes + i);
223 png_write_iTXt(png_ptr,
230 png_warning(png_ptr, "Unable to write international text");
240 png_write_zTXt(png_ptr, info_ptr->text[i].key,
244 png_warning(png_ptr, "Unable to write compressed text");
253 png_write_tEXt(png_ptr, info_ptr->text[i].key,
257 png_warning(png_ptr, "Unable to write uncompressed text");
275 int keep=png_handle_as_unknown(png_ptr, up->name);
280 (png_ptr->flags & PNG_FLAG_KEEP_UNSAFE_CHUNKS)))
282 png_write_chunk(png_ptr, up->name, up->data, up->size);
295 png_write_end(png_structp png_ptr, png_infop info_ptr)
298 if (png_ptr == NULL)
300 if (!(png_ptr->mode & PNG_HAVE_IDAT))
301 png_error(png_ptr, "No IDATs written into file");
312 !(png_ptr->mode & PNG_WROTE_tIME))
313 png_write_tIME(png_ptr, &(info_ptr->mod_time));
326 png_write_iTXt(png_ptr,
333 png_warning(png_ptr, "Unable to write international text");
342 png_write_zTXt(png_ptr, info_ptr->text[i].key,
346 png_warning(png_ptr, "Unable to write compressed text");
355 png_write_tEXt(png_ptr, info_ptr->text[i].key,
358 png_warning(png_ptr, "Unable to write uncompressed text");
377 int keep=png_handle_as_unknown(png_ptr, up->name);
381 (png_ptr->flags & PNG_FLAG_KEEP_UNSAFE_CHUNKS)))
383 png_write_chunk(png_ptr, up->name, up->data, up->size);
390 png_ptr->mode |= PNG_AFTER_IDAT;
393 png_write_IEND(png_ptr);
423 /* Initialize png_ptr structure, and allocate any memory needed */
433 /* Alternate initialize png_ptr structure, and allocate any memory needed */
440 png_structp png_ptr;
449 png_ptr = (png_structp)png_create_struct_2(PNG_STRUCT_PNG,
452 png_ptr = (png_structp)png_create_struct(PNG_STRUCT_PNG);
454 if (png_ptr == NULL)
460 png_init_mmx_flags(png_ptr); /* 1.2.0 addition */
467 png_ptr->user_width_max=PNG_USER_WIDTH_MAX;
468 png_ptr->user_height_max=PNG_USER_HEIGHT_MAX;
475 if (setjmp(png_ptr->jmpbuf))
478 png_free(png_ptr, png_ptr->zbuf);
479 png_ptr->zbuf=NULL;
480 png_destroy_struct(png_ptr);
484 png_memcpy(png_ptr->jmpbuf,jmpbuf,png_sizeof(jmp_buf));
489 png_set_mem_fn(png_ptr, mem_ptr, malloc_fn, free_fn);
491 png_set_error_fn(png_ptr, error_ptr, error_fn, warn_fn);
497 png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH;
500 if (png_ptr->flags & PNG_FLAG_LIBRARY_MISMATCH)
518 png_warning(png_ptr, msg);
523 png_warning(png_ptr, msg);
526 png_ptr->flags=0;
528 png_error(png_ptr,
534 png_ptr->zbuf_size = PNG_ZBUF_SIZE;
535 png_ptr->zbuf = (png_bytep)png_malloc(png_ptr,
536 (png_uint_32)png_ptr->zbuf_size);
538 png_set_write_fn(png_ptr, png_voidp_NULL, png_rw_ptr_NULL,
542 png_set_filter_heuristics(png_ptr, PNG_FILTER_HEURISTIC_DEFAULT,
553 png_memcpy(png_ptr->jmpbuf,jmpbuf,png_sizeof(jmp_buf));
555 if (setjmp(png_ptr->jmpbuf))
559 return (png_ptr);
562 /* Initialize png_ptr structure, and allocate any memory needed */
567 png_write_init(png_structp png_ptr)
570 png_write_init_2(png_ptr, "1.0.6 or earlier", 0, 0);
574 png_write_init_2(png_structp png_ptr, png_const_charp user_png_ver,
578 if(png_ptr == NULL) return;
584 png_ptr->warning_fn=NULL;
590 png_warning(png_ptr, msg);
595 png_warning(png_ptr, msg);
600 png_ptr->error_fn=NULL;
602 png_ptr->flags=0;
604 png_error(png_ptr,
609 png_ptr->error_fn=NULL;
611 png_ptr->flags=0;
613 png_error(png_ptr,
616 png_write_init_3(&png_ptr, user_png_ver, png_struct_size);
625 png_structp png_ptr=*ptr_ptr;
632 if (png_ptr == NULL)
640 png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH;
642 png_ptr->warning_fn=NULL;
643 png_warning(png_ptr,
654 png_memcpy(tmp_jmp, png_ptr->jmpbuf, png_sizeof (jmp_buf));
659 png_destroy_struct(png_ptr);
660 png_ptr = (png_structp)png_create_struct(PNG_STRUCT_PNG);
661 *ptr_ptr = png_ptr;
665 png_memset(png_ptr, 0, png_sizeof (png_struct));
669 png_ptr->user_width_max=PNG_USER_WIDTH_MAX;
670 png_ptr->user_height_max=PNG_USER_HEIGHT_MAX;
676 png_init_mmx_flags(png_ptr); /* 1.2.0 addition */
683 png_memcpy(png_ptr->jmpbuf, tmp_jmp, png_sizeof (jmp_buf));
686 png_set_write_fn(png_ptr, png_voidp_NULL, png_rw_ptr_NULL,
690 png_ptr->zbuf_size = PNG_ZBUF_SIZE;
691 png_ptr->zbuf = (png_bytep)png_malloc(png_ptr,
692 (png_uint_32)png_ptr->zbuf_size);
695 png_set_filter_heuristics(png_ptr, PNG_FILTER_HEURISTIC_DEFAULT,
706 png_write_rows(png_structp png_ptr, png_bytepp row,
714 if (png_ptr == NULL)
720 png_write_row(png_ptr, *rp);
728 png_write_image(png_structp png_ptr, png_bytepp image)
734 if (png_ptr == NULL)
741 num_pass = png_set_interlace_handling(png_ptr);
749 for (i = 0, rp = image; i < png_ptr->height; i++, rp++)
751 png_write_row(png_ptr, *rp);
758 png_write_row(png_structp png_ptr, png_bytep row)
760 if (png_ptr == NULL)
763 png_ptr->row_number, png_ptr->pass);
766 if (png_ptr->row_number == 0 && png_ptr->pass == 0)
769 if (!(png_ptr->mode & PNG_WROTE_INFO_BEFORE_PLTE))
770 png_error(png_ptr,
775 if (png_ptr->transformations & PNG_INVERT_MONO)
776 png_warning(png_ptr, "PNG_WRITE_INVERT_SUPPORTED is not defined.");
779 if (png_ptr->transformations & PNG_FILLER)
780 png_warning(png_ptr, "PNG_WRITE_FILLER_SUPPORTED is not defined.");
783 if (png_ptr->transformations & PNG_PACKSWAP)
784 png_warning(png_ptr, "PNG_WRITE_PACKSWAP_SUPPORTED is not defined.");
787 if (png_ptr->transformations & PNG_PACK)
788 png_warning(png_ptr, "PNG_WRITE_PACK_SUPPORTED is not defined.");
791 if (png_ptr->transformations & PNG_SHIFT)
792 png_warning(png_ptr, "PNG_WRITE_SHIFT_SUPPORTED is not defined.");
795 if (png_ptr->transformations & PNG_BGR)
796 png_warning(png_ptr, "PNG_WRITE_BGR_SUPPORTED is not defined.");
799 if (png_ptr->transformations & PNG_SWAP_BYTES)
800 png_warning(png_ptr, "PNG_WRITE_SWAP_SUPPORTED is not defined.");
803 png_write_start_row(png_ptr);
808 if (png_ptr->interlaced && (png_ptr->transformations & PNG_INTERLACE))
810 switch (png_ptr->pass)
813 if (png_ptr->row_number & 0x07)
815 png_write_finish_row(png_ptr);
820 if ((png_ptr->row_number & 0x07) || png_ptr->width < 5)
822 png_write_finish_row(png_ptr);
827 if ((png_ptr->row_number & 0x07) != 4)
829 png_write_finish_row(png_ptr);
834 if ((png_ptr->row_number & 0x03) || png_ptr->width < 3)
836 png_write_finish_row(png_ptr);
841 if ((png_ptr->row_number & 0x03) != 2)
843 png_write_finish_row(png_ptr);
848 if ((png_ptr->row_number & 0x01) || png_ptr->width < 2)
850 png_write_finish_row(png_ptr);
855 if (!(png_ptr->row_number & 0x01))
857 png_write_finish_row(png_ptr);
866 png_ptr->row_info.color_type = png_ptr->color_type;
867 png_ptr->row_info.width = png_ptr->usr_width;
868 png_ptr->row_info.channels = png_ptr->usr_channels;
869 png_ptr->row_info.bit_depth = png_ptr->usr_bit_depth;
870 png_ptr->row_info.pixel_depth = (png_byte)(png_ptr->row_info.bit_depth *
871 png_ptr->row_info.channels);
873 png_ptr->row_info.rowbytes = PNG_ROWBYTES(png_ptr->row_info.pixel_depth,
874 png_ptr->row_info.width);
876 png_debug1(3, "row_info->color_type = %d\n", png_ptr->row_info.color_type);
877 png_debug1(3, "row_info->width = %lu\n", png_ptr->row_info.width);
878 png_debug1(3, "row_info->channels = %d\n", png_ptr->row_info.channels);
879 png_debug1(3, "row_info->bit_depth = %d\n", png_ptr->row_info.bit_depth);
880 png_debug1(3, "row_info->pixel_depth = %d\n", png_ptr->row_info.pixel_depth);
881 png_debug1(3, "row_info->rowbytes = %lu\n", png_ptr->row_info.rowbytes);
884 png_memcpy_check(png_ptr, png_ptr->row_buf + 1, row,
885 png_ptr->row_info.rowbytes);
889 if (png_ptr->interlaced && png_ptr->pass < 6 &&
890 (png_ptr->transformations & PNG_INTERLACE))
892 png_do_write_interlace(&(png_ptr->row_info),
893 png_ptr->row_buf + 1, png_ptr->pass);
895 if (!(png_ptr->row_info.width))
897 png_write_finish_row(png_ptr);
904 if (png_ptr->transformations)
905 png_do_write_transformations(png_ptr);
917 if((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) &&
918 (png_ptr->filter_type == PNG_INTRAPIXEL_DIFFERENCING))
921 png_do_write_intrapixel(&(png_ptr->row_info), png_ptr->row_buf + 1);
926 png_write_find_filter(png_ptr, &(png_ptr->row_info));
928 if (png_ptr->write_row_fn != NULL)
929 (*(png_ptr->write_row_fn))(png_ptr, png_ptr->row_number, png_ptr->pass);
935 png_set_flush(png_structp png_ptr, int nrows)
938 if (png_ptr == NULL)
940 png_ptr->flush_dist = (nrows < 0 ? 0 : nrows);
945 png_write_flush(png_structp png_ptr)
950 if (png_ptr == NULL)
953 if (png_ptr->row_number >= png_ptr->num_rows)
961 ret = deflate(&png_ptr->zstream, Z_SYNC_FLUSH);
967 if (png_ptr->zstream.msg != NULL)
968 png_error(png_ptr, png_ptr->zstream.msg);
970 png_error(png_ptr, "zlib error");
973 if (!(png_ptr->zstream.avail_out))
976 png_write_IDAT(png_ptr, png_ptr->zbuf,
977 png_ptr->zbuf_size);
978 png_ptr->zstream.next_out = png_ptr->zbuf;
979 png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
985 if (png_ptr->zbuf_size != png_ptr->zstream.avail_out)
988 png_write_IDAT(png_ptr, png_ptr->zbuf,
989 png_ptr->zbuf_size - png_ptr->zstream.avail_out);
990 png_ptr->zstream.next_out = png_ptr->zbuf;
991 png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
993 png_ptr->flush_rows = 0;
994 png_flush(png_ptr);
1002 png_structp png_ptr = NULL;
1012 png_ptr = *png_ptr_ptr;
1014 free_fn = png_ptr->free_fn;
1015 mem_ptr = png_ptr->mem_ptr;
1024 png_free_data(png_ptr, info_ptr, PNG_FREE_ALL, -1);
1027 if (png_ptr->num_chunk_list)
1029 png_free(png_ptr, png_ptr->chunk_list);
1030 png_ptr->chunk_list=NULL;
1031 png_ptr->num_chunk_list=0;
1044 if (png_ptr != NULL)
1046 png_write_destroy(png_ptr);
1048 png_destroy_struct_2((png_voidp)png_ptr, (png_free_ptr)free_fn,
1051 png_destroy_struct((png_voidp)png_ptr);
1058 /* Free any memory used in png_ptr struct (old method) */
1060 png_write_destroy(png_structp png_ptr)
1074 deflateEnd(&png_ptr->zstream);
1077 png_free(png_ptr, png_ptr->zbuf);
1078 png_free(png_ptr, png_ptr->row_buf);
1079 png_free(png_ptr, png_ptr->prev_row);
1080 png_free(png_ptr, png_ptr->sub_row);
1081 png_free(png_ptr, png_ptr->up_row);
1082 png_free(png_ptr, png_ptr->avg_row);
1083 png_free(png_ptr, png_ptr->paeth_row);
1086 png_free(png_ptr, png_ptr->time_buffer);
1090 png_free(png_ptr, png_ptr->prev_filters);
1091 png_free(png_ptr, png_ptr->filter_weights);
1092 png_free(png_ptr, png_ptr->inv_filter_weights);
1093 png_free(png_ptr, png_ptr->filter_costs);
1094 png_free(png_ptr, png_ptr->inv_filter_costs);
1099 png_memcpy(tmp_jmp, png_ptr->jmpbuf, png_sizeof (jmp_buf));
1102 error_fn = png_ptr->error_fn;
1103 warning_fn = png_ptr->warning_fn;
1104 error_ptr = png_ptr->error_ptr;
1106 free_fn = png_ptr->free_fn;
1109 png_memset(png_ptr, 0, png_sizeof (png_struct));
1111 png_ptr->error_fn = error_fn;
1112 png_ptr->warning_fn = warning_fn;
1113 png_ptr->error_ptr = error_ptr;
1115 png_ptr->free_fn = free_fn;
1119 png_memcpy(png_ptr->jmpbuf, tmp_jmp, png_sizeof (jmp_buf));
1125 png_set_filter(png_structp png_ptr, int method, int filters)
1128 if (png_ptr == NULL)
1131 if((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) &&
1142 case 7: png_warning(png_ptr, "Unknown row filter for method 0");
1145 png_ptr->do_filter=PNG_FILTER_NONE; break;
1148 png_ptr->do_filter=PNG_FILTER_SUB; break;
1150 png_ptr->do_filter=PNG_FILTER_UP; break;
1152 png_ptr->do_filter=PNG_FILTER_AVG; break;
1154 png_ptr->do_filter=PNG_FILTER_PAETH; break;
1155 default: png_ptr->do_filter = (png_byte)filters; break;
1157 default: png_warning(png_ptr, "Unknown row filter for method 0");
1170 if (png_ptr->row_buf != NULL)
1173 if ((png_ptr->do_filter & PNG_FILTER_SUB) && png_ptr->sub_row == NULL)
1175 png_ptr->sub_row = (png_bytep)png_malloc(png_ptr,
1176 (png_ptr->rowbytes + 1));
1177 png_ptr->sub_row[0] = PNG_FILTER_VALUE_SUB;
1180 if ((png_ptr->do_filter & PNG_FILTER_UP) && png_ptr->up_row == NULL)
1182 if (png_ptr->prev_row == NULL)
1184 png_warning(png_ptr, "Can't add Up filter after starting");
1185 png_ptr->do_filter &= ~PNG_FILTER_UP;
1189 png_ptr->up_row = (png_bytep)png_malloc(png_ptr,
1190 (png_ptr->rowbytes + 1));
1191 png_ptr->up_row[0] = PNG_FILTER_VALUE_UP;
1195 if ((png_ptr->do_filter & PNG_FILTER_AVG) && png_ptr->avg_row == NULL)
1197 if (png_ptr->prev_row == NULL)
1199 png_warning(png_ptr, "Can't add Average filter after starting");
1200 png_ptr->do_filter &= ~PNG_FILTER_AVG;
1204 png_ptr->avg_row = (png_bytep)png_malloc(png_ptr,
1205 (png_ptr->rowbytes + 1));
1206 png_ptr->avg_row[0] = PNG_FILTER_VALUE_AVG;
1210 if ((png_ptr->do_filter & PNG_FILTER_PAETH) &&
1211 png_ptr->paeth_row == NULL)
1213 if (png_ptr->prev_row == NULL)
1215 png_warning(png_ptr, "Can't add Paeth filter after starting");
1216 png_ptr->do_filter &= (png_byte)(~PNG_FILTER_PAETH);
1220 png_ptr->paeth_row = (png_bytep)png_malloc(png_ptr,
1221 (png_ptr->rowbytes + 1));
1222 png_ptr->paeth_row[0] = PNG_FILTER_VALUE_PAETH;
1226 if (png_ptr->do_filter == PNG_NO_FILTERS)
1228 png_ptr->do_filter = PNG_FILTER_NONE;
1232 png_error(png_ptr, "Unknown custom filter method");
1244 png_set_filter_heuristics(png_structp png_ptr, int heuristic_method,
1251 if (png_ptr == NULL)
1255 png_warning(png_ptr, "Unknown filter heuristic method");
1270 png_ptr->num_prev_filters = (png_byte)num_weights;
1271 png_ptr->heuristic_method = (png_byte)heuristic_method;
1275 if (png_ptr->prev_filters == NULL)
1277 png_ptr->prev_filters = (png_bytep)png_malloc(png_ptr,
1283 png_ptr->prev_filters[i] = 255;
1287 if (png_ptr->filter_weights == NULL)
1289 png_ptr->filter_weights = (png_uint_16p)png_malloc(png_ptr,
1292 png_ptr->inv_filter_weights = (png_uint_16p)png_malloc(png_ptr,
1296 png_ptr->inv_filter_weights[i] =
1297 png_ptr->filter_weights[i] = PNG_WEIGHT_FACTOR;
1305 png_ptr->inv_filter_weights[i] =
1306 png_ptr->filter_weights[i] = PNG_WEIGHT_FACTOR;
1310 png_ptr->inv_filter_weights[i] =
1312 png_ptr->filter_weights[i] =
1319 * need to be based on png_ptr->filter.
1321 if (png_ptr->filter_costs == NULL)
1323 png_ptr->filter_costs = (png_uint_16p)png_malloc(png_ptr,
1326 png_ptr->inv_filter_costs = (png_uint_16p)png_malloc(png_ptr,
1331 png_ptr->inv_filter_costs[i] =
1332 png_ptr->filter_costs[i] = PNG_COST_FACTOR;
1347 png_ptr->inv_filter_costs[i] =
1348 png_ptr->filter_costs[i] = PNG_COST_FACTOR;
1352 png_ptr->inv_filter_costs[i] =
1354 png_ptr->filter_costs[i] =
1362 png_set_compression_level(png_structp png_ptr, int level)
1365 if (png_ptr == NULL)
1367 png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_LEVEL;
1368 png_ptr->zlib_level = level;
1372 png_set_compression_mem_level(png_structp png_ptr, int mem_level)
1375 if (png_ptr == NULL)
1377 png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_MEM_LEVEL;
1378 png_ptr->zlib_mem_level = mem_level;
1382 png_set_compression_strategy(png_structp png_ptr, int strategy)
1385 if (png_ptr == NULL)
1387 png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_STRATEGY;
1388 png_ptr->zlib_strategy = strategy;
1392 png_set_compression_window_bits(png_structp png_ptr, int window_bits)
1394 if (png_ptr == NULL)
1397 png_warning(png_ptr, "Only compression windows <= 32k supported by PNG");
1399 png_warning(png_ptr, "Only compression windows >= 256 supported by PNG");
1404 png_warning(png_ptr, "Compression window is being reset to 512");
1408 png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_WINDOW_BITS;
1409 png_ptr->zlib_window_bits = window_bits;
1413 png_set_compression_method(png_structp png_ptr, int method)
1416 if (png_ptr == NULL)
1419 png_warning(png_ptr, "Only compression method 8 is supported by PNG");
1420 png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_METHOD;
1421 png_ptr->zlib_method = method;
1425 png_set_write_status_fn(png_structp png_ptr, png_write_status_ptr write_row_fn)
1427 if (png_ptr == NULL)
1429 png_ptr->write_row_fn = write_row_fn;
1434 png_set_write_user_transform_fn(png_structp png_ptr, png_user_transform_ptr
1438 if (png_ptr == NULL)
1440 png_ptr->transformations |= PNG_USER_TRANSFORM;
1441 png_ptr->write_user_transform_fn = write_user_transform_fn;
1448 png_write_png(png_structp png_ptr, png_infop info_ptr,
1451 if (png_ptr == NULL || info_ptr == NULL)
1456 png_set_invert_alpha(png_ptr);
1460 png_write_info(png_ptr, info_ptr);
1467 png_set_invert_mono(png_ptr);
1476 png_set_shift(png_ptr, &info_ptr->sig_bit);
1482 png_set_packing(png_ptr);
1488 png_set_swap_alpha(png_ptr);
1496 png_set_filler(png_ptr, 0, PNG_FILLER_BEFORE);
1502 png_set_bgr(png_ptr);
1508 png_set_swap(png_ptr);
1514 png_set_packswap(png_ptr);
1521 png_write_image(png_ptr, info_ptr->row_pointers);
1524 png_write_end(png_ptr, info_ptr);