Lines Matching refs:png_ptr
24 write_unknown_chunks(png_structrp png_ptr, png_const_inforp info_ptr, in write_unknown_chunks() argument
42 int keep = png_handle_as_unknown(png_ptr, up->name); in write_unknown_chunks()
60 png_ptr->unknown_default == PNG_HANDLE_CHUNK_ALWAYS))) in write_unknown_chunks()
65 png_warning(png_ptr, "Writing zero-length unknown chunk"); in write_unknown_chunks()
67 png_write_chunk(png_ptr, up->name, up->data, up->size); in write_unknown_chunks()
84 png_write_info_before_PLTE(png_structrp png_ptr, png_const_inforp info_ptr) in png_write_info_before_PLTE() argument
88 if (png_ptr == NULL || info_ptr == NULL) in png_write_info_before_PLTE()
91 if ((png_ptr->mode & PNG_WROTE_INFO_BEFORE_PLTE) == 0) in png_write_info_before_PLTE()
94 png_write_sig(png_ptr); in png_write_info_before_PLTE()
97 if ((png_ptr->mode & PNG_HAVE_PNG_SIGNATURE) != 0 && \ in png_write_info_before_PLTE()
98 png_ptr->mng_features_permitted != 0) in png_write_info_before_PLTE()
100 png_warning(png_ptr, in png_write_info_before_PLTE()
102 png_ptr->mng_features_permitted = 0; in png_write_info_before_PLTE()
107 png_write_IHDR(png_ptr, info_ptr->width, info_ptr->height, in png_write_info_before_PLTE()
136 png_write_gAMA_fixed(png_ptr, info_ptr->colorspace.gamma); in png_write_info_before_PLTE()
150 png_app_warning(png_ptr, in png_write_info_before_PLTE()
154 png_write_iCCP(png_ptr, info_ptr->iccp_name, in png_write_info_before_PLTE()
165 png_write_sRGB(png_ptr, info_ptr->colorspace.rendering_intent); in png_write_info_before_PLTE()
171 png_write_sBIT(png_ptr, &(info_ptr->sig_bit), info_ptr->color_type); in png_write_info_before_PLTE()
179 png_write_cHRM_fixed(png_ptr, &info_ptr->colorspace.end_points_xy); in png_write_info_before_PLTE()
184 write_unknown_chunks(png_ptr, info_ptr, PNG_HAVE_IHDR); in png_write_info_before_PLTE()
187 png_ptr->mode |= PNG_WROTE_INFO_BEFORE_PLTE; in png_write_info_before_PLTE()
192 png_write_info(png_structrp png_ptr, png_const_inforp info_ptr) in png_write_info() argument
200 if (png_ptr == NULL || info_ptr == NULL) in png_write_info()
203 png_write_info_before_PLTE(png_ptr, info_ptr); in png_write_info()
206 png_write_PLTE(png_ptr, info_ptr->palette, in png_write_info()
210 png_error(png_ptr, "Valid palette required for paletted images"); in png_write_info()
217 if ((png_ptr->transformations & PNG_INVERT_ALPHA) != 0 && in png_write_info()
231 png_write_tRNS(png_ptr, info_ptr->trans_alpha, &(info_ptr->trans_color), in png_write_info()
237 png_write_bKGD(png_ptr, &(info_ptr->background), info_ptr->color_type); in png_write_info()
242 png_write_eXIf(png_ptr, info_ptr->exif, info_ptr->num_exif); in png_write_info()
247 png_write_hIST(png_ptr, info_ptr->hist, info_ptr->num_palette); in png_write_info()
252 png_write_oFFs(png_ptr, info_ptr->x_offset, info_ptr->y_offset, in png_write_info()
258 png_write_pCAL(png_ptr, info_ptr->pcal_purpose, info_ptr->pcal_X0, in png_write_info()
265 png_write_sCAL_s(png_ptr, (int)info_ptr->scal_unit, in png_write_info()
271 png_write_pHYs(png_ptr, info_ptr->x_pixels_per_unit, in png_write_info()
278 png_write_tIME(png_ptr, &(info_ptr->mod_time)); in png_write_info()
279 png_ptr->mode |= PNG_WROTE_tIME; in png_write_info()
286 png_write_sPLT(png_ptr, info_ptr->splt_palettes + i); in png_write_info()
300 png_write_iTXt(png_ptr, in png_write_info()
312 png_warning(png_ptr, "Unable to write international text"); in png_write_info()
321 png_write_zTXt(png_ptr, info_ptr->text[i].key, in png_write_info()
326 png_warning(png_ptr, "Unable to write compressed text"); in png_write_info()
334 png_write_tEXt(png_ptr, info_ptr->text[i].key, in png_write_info()
341 png_warning(png_ptr, "Unable to write uncompressed text"); in png_write_info()
348 write_unknown_chunks(png_ptr, info_ptr, PNG_HAVE_PLTE); in png_write_info()
358 png_write_end(png_structrp png_ptr, png_inforp info_ptr) in png_write_end() argument
362 if (png_ptr == NULL) in png_write_end()
365 if ((png_ptr->mode & PNG_HAVE_IDAT) == 0) in png_write_end()
366 png_error(png_ptr, "No IDATs written into file"); in png_write_end()
369 if (png_ptr->num_palette_max > png_ptr->num_palette) in png_write_end()
370 png_benign_error(png_ptr, "Wrote palette index exceeding num_palette"); in png_write_end()
382 (png_ptr->mode & PNG_WROTE_tIME) == 0) in png_write_end()
383 png_write_tIME(png_ptr, &(info_ptr->mod_time)); in png_write_end()
397 png_write_iTXt(png_ptr, in png_write_end()
409 png_warning(png_ptr, "Unable to write international text"); in png_write_end()
417 png_write_zTXt(png_ptr, info_ptr->text[i].key, in png_write_end()
422 png_warning(png_ptr, "Unable to write compressed text"); in png_write_end()
430 png_write_tEXt(png_ptr, info_ptr->text[i].key, in png_write_end()
435 png_warning(png_ptr, "Unable to write uncompressed text"); in png_write_end()
443 png_write_eXIf(png_ptr, info_ptr->exif, info_ptr->num_exif); in png_write_end()
447 write_unknown_chunks(png_ptr, info_ptr, PNG_AFTER_IDAT); in png_write_end()
451 png_ptr->mode |= PNG_AFTER_IDAT; in png_write_end()
454 png_write_IEND(png_ptr); in png_write_end()
465 png_flush(png_ptr); in png_write_end()
502 png_structrp png_ptr = png_create_png_struct(user_png_ver, error_ptr, variable
515 png_structrp png_ptr = png_create_png_struct(user_png_ver, error_ptr,
518 if (png_ptr != NULL)
523 png_ptr->zbuffer_size = PNG_ZBUF_SIZE;
529 png_ptr->zlib_strategy = PNG_Z_DEFAULT_STRATEGY;
530 png_ptr->zlib_level = PNG_Z_DEFAULT_COMPRESSION;
531 png_ptr->zlib_mem_level = 8;
532 png_ptr->zlib_window_bits = 15;
533 png_ptr->zlib_method = 8;
536 png_ptr->zlib_text_strategy = PNG_TEXT_Z_DEFAULT_STRATEGY;
537 png_ptr->zlib_text_level = PNG_TEXT_Z_DEFAULT_COMPRESSION;
538 png_ptr->zlib_text_mem_level = 8;
539 png_ptr->zlib_text_window_bits = 15;
540 png_ptr->zlib_text_method = 8;
552 png_ptr->flags |= PNG_FLAG_BENIGN_ERRORS_WARN;
559 png_ptr->flags |= PNG_FLAG_APP_WARNINGS_WARN;
566 png_set_write_fn(png_ptr, NULL, NULL, NULL);
569 return png_ptr;
579 png_write_rows(png_structrp png_ptr, png_bytepp row, in png_write_rows() argument
587 if (png_ptr == NULL) in png_write_rows()
593 png_write_row(png_ptr, *rp); in png_write_rows()
601 png_write_image(png_structrp png_ptr, png_bytepp image) in png_write_image() argument
607 if (png_ptr == NULL) in png_write_image()
616 num_pass = png_set_interlace_handling(png_ptr); in png_write_image()
624 for (i = 0, rp = image; i < png_ptr->height; i++, rp++) in png_write_image()
626 png_write_row(png_ptr, *rp); in png_write_image()
698 png_write_row(png_structrp png_ptr, png_const_bytep row) in png_write_row() argument
703 if (png_ptr == NULL) in png_write_row()
707 png_ptr->row_number, png_ptr->pass); in png_write_row()
710 if (png_ptr->row_number == 0 && png_ptr->pass == 0) in png_write_row()
713 if ((png_ptr->mode & PNG_WROTE_INFO_BEFORE_PLTE) == 0) in png_write_row()
714 png_error(png_ptr, in png_write_row()
719 if ((png_ptr->transformations & PNG_INVERT_MONO) != 0) in png_write_row()
720 png_warning(png_ptr, "PNG_WRITE_INVERT_SUPPORTED is not defined"); in png_write_row()
724 if ((png_ptr->transformations & PNG_FILLER) != 0) in png_write_row()
725 png_warning(png_ptr, "PNG_WRITE_FILLER_SUPPORTED is not defined"); in png_write_row()
729 if ((png_ptr->transformations & PNG_PACKSWAP) != 0) in png_write_row()
730 png_warning(png_ptr, in png_write_row()
735 if ((png_ptr->transformations & PNG_PACK) != 0) in png_write_row()
736 png_warning(png_ptr, "PNG_WRITE_PACK_SUPPORTED is not defined"); in png_write_row()
740 if ((png_ptr->transformations & PNG_SHIFT) != 0) in png_write_row()
741 png_warning(png_ptr, "PNG_WRITE_SHIFT_SUPPORTED is not defined"); in png_write_row()
745 if ((png_ptr->transformations & PNG_BGR) != 0) in png_write_row()
746 png_warning(png_ptr, "PNG_WRITE_BGR_SUPPORTED is not defined"); in png_write_row()
750 if ((png_ptr->transformations & PNG_SWAP_BYTES) != 0) in png_write_row()
751 png_warning(png_ptr, "PNG_WRITE_SWAP_SUPPORTED is not defined"); in png_write_row()
754 png_write_start_row(png_ptr); in png_write_row()
759 if (png_ptr->interlaced != 0 && in png_write_row()
760 (png_ptr->transformations & PNG_INTERLACE) != 0) in png_write_row()
762 switch (png_ptr->pass) in png_write_row()
765 if ((png_ptr->row_number & 0x07) != 0) in png_write_row()
767 png_write_finish_row(png_ptr); in png_write_row()
773 if ((png_ptr->row_number & 0x07) != 0 || png_ptr->width < 5) in png_write_row()
775 png_write_finish_row(png_ptr); in png_write_row()
781 if ((png_ptr->row_number & 0x07) != 4) in png_write_row()
783 png_write_finish_row(png_ptr); in png_write_row()
789 if ((png_ptr->row_number & 0x03) != 0 || png_ptr->width < 3) in png_write_row()
791 png_write_finish_row(png_ptr); in png_write_row()
797 if ((png_ptr->row_number & 0x03) != 2) in png_write_row()
799 png_write_finish_row(png_ptr); in png_write_row()
805 if ((png_ptr->row_number & 0x01) != 0 || png_ptr->width < 2) in png_write_row()
807 png_write_finish_row(png_ptr); in png_write_row()
813 if ((png_ptr->row_number & 0x01) == 0) in png_write_row()
815 png_write_finish_row(png_ptr); in png_write_row()
827 row_info.color_type = png_ptr->color_type; in png_write_row()
828 row_info.width = png_ptr->usr_width; in png_write_row()
829 row_info.channels = png_ptr->usr_channels; in png_write_row()
830 row_info.bit_depth = png_ptr->usr_bit_depth; in png_write_row()
842 memcpy(png_ptr->row_buf + 1, row, row_info.rowbytes); in png_write_row()
846 if (png_ptr->interlaced && png_ptr->pass < 6 && in png_write_row()
847 (png_ptr->transformations & PNG_INTERLACE) != 0) in png_write_row()
849 png_do_write_interlace(&row_info, png_ptr->row_buf + 1, png_ptr->pass); in png_write_row()
853 png_write_finish_row(png_ptr); in png_write_row()
861 if (png_ptr->transformations != 0) in png_write_row()
862 png_do_write_transformations(png_ptr, &row_info); in png_write_row()
868 if (row_info.pixel_depth != png_ptr->pixel_depth || in png_write_row()
869 row_info.pixel_depth != png_ptr->transformed_pixel_depth) in png_write_row()
870 png_error(png_ptr, "internal write transform logic error"); in png_write_row()
882 if ((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) != 0 && in png_write_row()
883 (png_ptr->filter_type == PNG_INTRAPIXEL_DIFFERENCING)) in png_write_row()
886 png_do_write_intrapixel(&row_info, png_ptr->row_buf + 1); in png_write_row()
894 png_ptr->num_palette_max >= 0) in png_write_row()
895 png_do_check_palette_indexes(png_ptr, &row_info); in png_write_row()
899 png_write_find_filter(png_ptr, &row_info); in png_write_row()
901 if (png_ptr->write_row_fn != NULL) in png_write_row()
902 (*(png_ptr->write_row_fn))(png_ptr, png_ptr->row_number, png_ptr->pass); in png_write_row()
908 png_set_flush(png_structrp png_ptr, int nrows) in png_set_flush() argument
912 if (png_ptr == NULL) in png_set_flush()
915 png_ptr->flush_dist = (nrows < 0 ? 0 : (png_uint_32)nrows); in png_set_flush()
920 png_write_flush(png_structrp png_ptr) in png_write_flush() argument
924 if (png_ptr == NULL) in png_write_flush()
928 if (png_ptr->row_number >= png_ptr->num_rows) in png_write_flush()
931 png_compress_IDAT(png_ptr, NULL, 0, Z_SYNC_FLUSH); in png_write_flush()
932 png_ptr->flush_rows = 0; in png_write_flush()
933 png_flush(png_ptr); in png_write_flush()
939 png_write_destroy(png_structrp png_ptr) in png_write_destroy() argument
944 if ((png_ptr->flags & PNG_FLAG_ZSTREAM_INITIALIZED) != 0) in png_write_destroy()
945 deflateEnd(&png_ptr->zstream); in png_write_destroy()
948 png_free_buffer_list(png_ptr, &png_ptr->zbuffer_list); in png_write_destroy()
949 png_free(png_ptr, png_ptr->row_buf); in png_write_destroy()
950 png_ptr->row_buf = NULL; in png_write_destroy()
952 png_free(png_ptr, png_ptr->prev_row); in png_write_destroy()
953 png_free(png_ptr, png_ptr->try_row); in png_write_destroy()
954 png_free(png_ptr, png_ptr->tst_row); in png_write_destroy()
955 png_ptr->prev_row = NULL; in png_write_destroy()
956 png_ptr->try_row = NULL; in png_write_destroy()
957 png_ptr->tst_row = NULL; in png_write_destroy()
961 png_free(png_ptr, png_ptr->chunk_list); in png_write_destroy()
962 png_ptr->chunk_list = NULL; in png_write_destroy()
985 png_structrp png_ptr = *png_ptr_ptr; in png_destroy_write_struct() local
987 if (png_ptr != NULL) /* added in libpng 1.6.0 */ in png_destroy_write_struct()
989 png_destroy_info_struct(png_ptr, info_ptr_ptr); in png_destroy_write_struct()
992 png_write_destroy(png_ptr); in png_destroy_write_struct()
993 png_destroy_png_struct(png_ptr); in png_destroy_write_struct()
1000 png_set_filter(png_structrp png_ptr, int method, int filters) in png_set_filter() argument
1004 if (png_ptr == NULL) in png_set_filter()
1008 if ((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) != 0 && in png_set_filter()
1020 case 7: png_app_error(png_ptr, "Unknown row filter for method 0"); in png_set_filter()
1024 png_ptr->do_filter = PNG_FILTER_NONE; break; in png_set_filter()
1028 png_ptr->do_filter = PNG_FILTER_SUB; break; in png_set_filter()
1031 png_ptr->do_filter = PNG_FILTER_UP; break; in png_set_filter()
1034 png_ptr->do_filter = PNG_FILTER_AVG; break; in png_set_filter()
1037 png_ptr->do_filter = PNG_FILTER_PAETH; break; in png_set_filter()
1040 png_ptr->do_filter = (png_byte)filters; break; in png_set_filter()
1043 png_app_error(png_ptr, "Unknown row filter for method 0"); in png_set_filter()
1061 if (png_ptr->row_buf != NULL) in png_set_filter()
1070 if (png_ptr->height == 1) in png_set_filter()
1073 if (png_ptr->width == 1) in png_set_filter()
1077 && png_ptr->prev_row == NULL) in png_set_filter()
1082 png_app_warning(png_ptr, in png_set_filter()
1104 buf_size = PNG_ROWBYTES(png_ptr->usr_channels * png_ptr->usr_bit_depth, in png_set_filter()
1105 png_ptr->width) + 1; in png_set_filter()
1107 if (png_ptr->try_row == NULL) in png_set_filter()
1108 png_ptr->try_row = png_voidcast(png_bytep, in png_set_filter()
1109 png_malloc(png_ptr, buf_size)); in png_set_filter()
1113 if (png_ptr->tst_row == NULL) in png_set_filter()
1114 png_ptr->tst_row = png_voidcast(png_bytep, in png_set_filter()
1115 png_malloc(png_ptr, buf_size)); in png_set_filter()
1118 png_ptr->do_filter = (png_byte)filters; in png_set_filter()
1122 png_error(png_ptr, "Unknown custom filter method"); in png_set_filter()
1129 png_set_filter_heuristics(png_structrp png_ptr, int heuristic_method, in png_set_filter_heuristics() argument
1133 PNG_UNUSED(png_ptr) in png_set_filter_heuristics()
1143 png_set_filter_heuristics_fixed(png_structrp png_ptr, int heuristic_method, in png_set_filter_heuristics_fixed() argument
1147 PNG_UNUSED(png_ptr) in png_set_filter_heuristics_fixed()
1158 png_set_compression_level(png_structrp png_ptr, int level) in png_set_compression_level() argument
1162 if (png_ptr == NULL) in png_set_compression_level()
1165 png_ptr->zlib_level = level; in png_set_compression_level()
1169 png_set_compression_mem_level(png_structrp png_ptr, int mem_level) in png_set_compression_mem_level() argument
1173 if (png_ptr == NULL) in png_set_compression_mem_level()
1176 png_ptr->zlib_mem_level = mem_level; in png_set_compression_mem_level()
1180 png_set_compression_strategy(png_structrp png_ptr, int strategy) in png_set_compression_strategy() argument
1184 if (png_ptr == NULL) in png_set_compression_strategy()
1189 png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_STRATEGY; in png_set_compression_strategy()
1190 png_ptr->zlib_strategy = strategy; in png_set_compression_strategy()
1197 png_set_compression_window_bits(png_structrp png_ptr, int window_bits) in png_set_compression_window_bits() argument
1199 if (png_ptr == NULL) in png_set_compression_window_bits()
1210 png_warning(png_ptr, "Only compression windows <= 32k supported by PNG"); in png_set_compression_window_bits()
1216 png_warning(png_ptr, "Only compression windows >= 256 supported by PNG"); in png_set_compression_window_bits()
1220 png_ptr->zlib_window_bits = window_bits; in png_set_compression_window_bits()
1224 png_set_compression_method(png_structrp png_ptr, int method) in png_set_compression_method() argument
1228 if (png_ptr == NULL) in png_set_compression_method()
1235 png_warning(png_ptr, "Only compression method 8 is supported by PNG"); in png_set_compression_method()
1237 png_ptr->zlib_method = method; in png_set_compression_method()
1244 png_set_text_compression_level(png_structrp png_ptr, int level) in png_set_text_compression_level() argument
1248 if (png_ptr == NULL) in png_set_text_compression_level()
1251 png_ptr->zlib_text_level = level; in png_set_text_compression_level()
1255 png_set_text_compression_mem_level(png_structrp png_ptr, int mem_level) in png_set_text_compression_mem_level() argument
1259 if (png_ptr == NULL) in png_set_text_compression_mem_level()
1262 png_ptr->zlib_text_mem_level = mem_level; in png_set_text_compression_mem_level()
1266 png_set_text_compression_strategy(png_structrp png_ptr, int strategy) in png_set_text_compression_strategy() argument
1270 if (png_ptr == NULL) in png_set_text_compression_strategy()
1273 png_ptr->zlib_text_strategy = strategy; in png_set_text_compression_strategy()
1280 png_set_text_compression_window_bits(png_structrp png_ptr, int window_bits) in png_set_text_compression_window_bits() argument
1282 if (png_ptr == NULL) in png_set_text_compression_window_bits()
1287 png_warning(png_ptr, "Only compression windows <= 32k supported by PNG"); in png_set_text_compression_window_bits()
1293 png_warning(png_ptr, "Only compression windows >= 256 supported by PNG"); in png_set_text_compression_window_bits()
1297 png_ptr->zlib_text_window_bits = window_bits; in png_set_text_compression_window_bits()
1301 png_set_text_compression_method(png_structrp png_ptr, int method) in png_set_text_compression_method() argument
1305 if (png_ptr == NULL) in png_set_text_compression_method()
1309 png_warning(png_ptr, "Only compression method 8 is supported by PNG"); in png_set_text_compression_method()
1311 png_ptr->zlib_text_method = method; in png_set_text_compression_method()
1317 png_set_write_status_fn(png_structrp png_ptr, png_write_status_ptr write_row_fn) in png_set_write_status_fn() argument
1319 if (png_ptr == NULL) in png_set_write_status_fn()
1322 png_ptr->write_row_fn = write_row_fn; in png_set_write_status_fn()
1327 png_set_write_user_transform_fn(png_structrp png_ptr, png_user_transform_ptr in png_set_write_user_transform_fn() argument
1332 if (png_ptr == NULL) in png_set_write_user_transform_fn()
1335 png_ptr->transformations |= PNG_USER_TRANSFORM; in png_set_write_user_transform_fn()
1336 png_ptr->write_user_transform_fn = write_user_transform_fn; in png_set_write_user_transform_fn()
1343 png_write_png(png_structrp png_ptr, png_inforp info_ptr, in png_write_png() argument
1346 if (png_ptr == NULL || info_ptr == NULL) in png_write_png()
1351 png_app_error(png_ptr, "no rows for png_write_image to write"); in png_write_png()
1356 png_write_info(png_ptr, info_ptr); in png_write_png()
1363 png_set_invert_mono(png_ptr); in png_write_png()
1365 png_app_error(png_ptr, "PNG_TRANSFORM_INVERT_MONO not supported"); in png_write_png()
1374 png_set_shift(png_ptr, &info_ptr->sig_bit); in png_write_png()
1376 png_app_error(png_ptr, "PNG_TRANSFORM_SHIFT not supported"); in png_write_png()
1382 png_set_packing(png_ptr); in png_write_png()
1384 png_app_error(png_ptr, "PNG_TRANSFORM_PACKING not supported"); in png_write_png()
1390 png_set_swap_alpha(png_ptr); in png_write_png()
1392 png_app_error(png_ptr, "PNG_TRANSFORM_SWAP_ALPHA not supported"); in png_write_png()
1406 png_app_error(png_ptr, in png_write_png()
1410 png_set_filler(png_ptr, 0, PNG_FILLER_AFTER); in png_write_png()
1414 png_set_filler(png_ptr, 0, PNG_FILLER_BEFORE); in png_write_png()
1416 png_app_error(png_ptr, "PNG_TRANSFORM_STRIP_FILLER not supported"); in png_write_png()
1423 png_set_bgr(png_ptr); in png_write_png()
1425 png_app_error(png_ptr, "PNG_TRANSFORM_BGR not supported"); in png_write_png()
1431 png_set_swap(png_ptr); in png_write_png()
1433 png_app_error(png_ptr, "PNG_TRANSFORM_SWAP_ENDIAN not supported"); in png_write_png()
1439 png_set_packswap(png_ptr); in png_write_png()
1441 png_app_error(png_ptr, "PNG_TRANSFORM_PACKSWAP not supported"); in png_write_png()
1447 png_set_invert_alpha(png_ptr); in png_write_png()
1449 png_app_error(png_ptr, "PNG_TRANSFORM_INVERT_ALPHA not supported"); in png_write_png()
1455 png_write_image(png_ptr, info_ptr->row_pointers); in png_write_png()
1458 png_write_end(png_ptr, info_ptr); in png_write_png()
1470 png_structp png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, image, in png_image_write_init() local
1473 if (png_ptr != NULL) in png_image_write_init()
1475 png_infop info_ptr = png_create_info_struct(png_ptr); in png_image_write_init()
1480 png_malloc_warn(png_ptr, (sizeof *control))); in png_image_write_init()
1486 control->png_ptr = png_ptr; in png_image_write_init()
1495 png_destroy_info_struct(png_ptr, &info_ptr); in png_image_write_init()
1498 png_destroy_write_struct(&png_ptr, NULL); in png_image_write_init()
1533 png_structrp png_ptr = image->opaque->png_ptr; in png_write_image_16bit() local
1561 png_error(png_ptr, "png_write_image: internal call error"); in png_write_image_16bit()
1624 png_write_row(png_ptr, png_voidcast(png_const_bytep, display->local_row)); in png_write_image_16bit()
1692 png_structrp png_ptr = image->opaque->png_ptr; in png_write_image_8bit() local
1749 png_write_row(png_ptr, png_voidcast(png_const_bytep, in png_write_image_8bit()
1775 png_write_row(png_ptr, output_row); in png_write_image_8bit()
1919 png_set_PLTE(image->opaque->png_ptr, image->opaque->info_ptr, palette, in png_image_set_PLTE()
1923 png_set_tRNS(image->opaque->png_ptr, image->opaque->info_ptr, tRNS, in png_image_set_PLTE()
1935 png_structrp png_ptr = image->opaque->png_ptr; in png_image_write_main() local
1947 png_set_benign_errors(png_ptr, 0/*error*/); in png_image_write_main()
1977 png_error(image->opaque->png_ptr, "memory image too large"); in png_image_write_main()
1981 png_error(image->opaque->png_ptr, "supplied row stride too small"); in png_image_write_main()
1985 png_error(image->opaque->png_ptr, "image row stride too large"); in png_image_write_main()
1995 png_set_IHDR(png_ptr, info_ptr, image->width, image->height, in png_image_write_main()
2004 png_error(image->opaque->png_ptr, in png_image_write_main()
2009 png_set_IHDR(png_ptr, info_ptr, image->width, image->height, in png_image_write_main()
2024 png_set_gAMA_fixed(png_ptr, info_ptr, PNG_GAMMA_LINEAR); in png_image_write_main()
2027 png_set_cHRM_fixed(png_ptr, info_ptr, in png_image_write_main()
2037 png_set_sRGB(png_ptr, info_ptr, PNG_sRGB_INTENT_PERCEPTUAL); in png_image_write_main()
2043 png_set_gAMA_fixed(png_ptr, info_ptr, PNG_GAMMA_sRGB_INVERSE); in png_image_write_main()
2046 png_write_info(png_ptr, info_ptr); in png_image_write_main()
2058 png_set_swap(png_ptr); in png_image_write_main()
2065 png_set_bgr(png_ptr); in png_image_write_main()
2074 png_set_swap_alpha(png_ptr); in png_image_write_main()
2083 png_set_packing(png_ptr); in png_image_write_main()
2088 png_error(png_ptr, "png_write_image: unsupported transformation"); in png_image_write_main()
2107 png_set_filter(png_ptr, PNG_FILTER_TYPE_BASE, PNG_NO_FILTERS); in png_image_write_main()
2114 png_set_compression_level(png_ptr, 3); in png_image_write_main()
2125 png_bytep row = png_voidcast(png_bytep, png_malloc(png_ptr, in png_image_write_main()
2126 png_get_rowbytes(png_ptr, info_ptr))); in png_image_write_main()
2136 png_free(png_ptr, row); in png_image_write_main()
2154 png_write_row(png_ptr, row); in png_image_write_main()
2159 png_write_end(png_ptr, info_ptr); in png_image_write_main()
2165 image_memory_write)(png_structp png_ptr, png_bytep/*const*/ data,
2169 png_ptr->io_ptr/*backdoor: png_get_io_ptr(png_ptr)*/);
2187 png_error(png_ptr, "png_image_write_to_memory: PNG too big");
2191 image_memory_flush)(png_structp png_ptr)
2193 PNG_UNUSED(png_ptr)
2206 png_set_write_fn(display->image->opaque->png_ptr, display/*io_ptr*/, in png_image_write_memory()
2297 image->opaque->png_ptr->io_ptr = file; in png_image_write_to_stdio()