Lines Matching refs:png_ptr
51 static void gdPngErrorHandler (png_structp png_ptr, png_const_charp msg) in gdPngErrorHandler() argument
67 jmpbuf_ptr = png_get_error_ptr (png_ptr); in gdPngErrorHandler()
75 static void gdPngWarningHandler (png_structp png_ptr, png_const_charp msg) in gdPngWarningHandler() argument
81 static void gdPngReadData (png_structp png_ptr, png_bytep data, png_size_t length) in gdPngReadData() argument
84 check = gdGetBuf(data, length, (gdIOCtx *) png_get_io_ptr(png_ptr)); in gdPngReadData()
86 png_error(png_ptr, "Read Error: truncated data"); in gdPngReadData()
90 static void gdPngWriteData (png_structp png_ptr, png_bytep data, png_size_t length) in gdPngWriteData() argument
92 gdPutBuf (data, length, (gdIOCtx *) png_get_io_ptr(png_ptr)); in gdPngWriteData()
95 static void gdPngFlushData (png_structp png_ptr) in gdPngFlushData() argument
127 png_structp png_ptr; in gdImageCreateFromPngCtx() local
160 …png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, &jbw, gdPngErrorHandler, gdPngWarningHandl… in gdImageCreateFromPngCtx()
162 png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); in gdImageCreateFromPngCtx()
164 if (png_ptr == NULL) { in gdImageCreateFromPngCtx()
169 info_ptr = png_create_info_struct(png_ptr); in gdImageCreateFromPngCtx()
172 png_destroy_read_struct (&png_ptr, NULL, NULL); in gdImageCreateFromPngCtx()
188 png_destroy_read_struct(&png_ptr, &info_ptr, NULL); in gdImageCreateFromPngCtx()
194 png_set_sig_bytes(png_ptr, 8); /* we already read the 8 signature bytes */ in gdImageCreateFromPngCtx()
196 png_set_read_fn(png_ptr, (void *) infile, gdPngReadData); in gdImageCreateFromPngCtx()
197 png_read_info(png_ptr, info_ptr); /* read all PNG info up to image data */ in gdImageCreateFromPngCtx()
199 …png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, &interlace_type, NULL, N… in gdImageCreateFromPngCtx()
208 png_destroy_read_struct(&png_ptr, &info_ptr, NULL); in gdImageCreateFromPngCtx()
214 png_set_strip_16(png_ptr); in gdImageCreateFromPngCtx()
216 png_set_packing (png_ptr); /* expand to 1 byte per pixel */ in gdImageCreateFromPngCtx()
225 png_destroy_read_struct(&png_ptr, &info_ptr, NULL); in gdImageCreateFromPngCtx()
237 if (png_get_valid(png_ptr, info_ptr, PNG_INFO_pHYs)) { in gdImageCreateFromPngCtx()
238 if (png_get_pHYs(png_ptr, info_ptr, &res_x, &res_y, &unit_type)) { in gdImageCreateFromPngCtx()
251 png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette); in gdImageCreateFromPngCtx()
255 if (png_get_valid (png_ptr, info_ptr, PNG_INFO_tRNS)) { in gdImageCreateFromPngCtx()
263 png_get_tRNS(png_ptr, info_ptr, &trans, &num_trans, NULL); in gdImageCreateFromPngCtx()
277 png_destroy_read_struct(&png_ptr, &info_ptr, NULL); in gdImageCreateFromPngCtx()
294 if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { in gdImageCreateFromPngCtx()
295 png_get_tRNS(png_ptr, info_ptr, NULL, NULL, &trans_gray_rgb); in gdImageCreateFromPngCtx()
316 png_set_gray_to_rgb(png_ptr); in gdImageCreateFromPngCtx()
324 if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { in gdImageCreateFromPngCtx()
325 png_get_tRNS(png_ptr, info_ptr, NULL, NULL, &trans_color_rgb); in gdImageCreateFromPngCtx()
341 (void)png_set_interlace_handling(png_ptr); in gdImageCreateFromPngCtx()
344 png_read_update_info(png_ptr, info_ptr); in gdImageCreateFromPngCtx()
347 rowbytes = png_get_rowbytes(png_ptr, info_ptr); in gdImageCreateFromPngCtx()
357 png_read_image(png_ptr, row_pointers); /* read whole image... */ in gdImageCreateFromPngCtx()
358 png_read_end(png_ptr, NULL); /* ...done! */ in gdImageCreateFromPngCtx()
382 png_destroy_read_struct(&png_ptr, &info_ptr, NULL); in gdImageCreateFromPngCtx()
500 png_structp png_ptr; in gdImagePngCtxEx() local
507 …png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, &jbw, gdPngErrorHandler, gdPngWarningHand… in gdImagePngCtxEx()
509 png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); in gdImagePngCtxEx()
511 if (png_ptr == NULL) { in gdImagePngCtxEx()
516 info_ptr = png_create_info_struct(png_ptr); in gdImagePngCtxEx()
519 png_destroy_write_struct (&png_ptr, (png_infopp) NULL); in gdImagePngCtxEx()
527 png_destroy_write_struct (&png_ptr, &info_ptr); in gdImagePngCtxEx()
533 png_set_write_fn(png_ptr, (void *) outfile, gdPngWriteData, gdPngFlushData); in gdImagePngCtxEx()
549 png_set_compression_level(png_ptr, level); in gdImagePngCtxEx()
551 png_set_filter(png_ptr, PNG_FILTER_TYPE_BASE, basefilter); in gdImagePngCtxEx()
556 png_set_pHYs(png_ptr, info_ptr, DPI2DPM(im->res_x), DPI2DPM(im->res_y), in gdImagePngCtxEx()
605 png_set_IHDR(png_ptr, info_ptr, width, height, 8, PNG_COLOR_TYPE_RGB_ALPHA, interlace_type, in gdImagePngCtxEx()
608 png_set_IHDR(png_ptr, info_ptr, width, height, 8, PNG_COLOR_TYPE_RGB, interlace_type, in gdImagePngCtxEx()
612 png_set_IHDR(png_ptr, info_ptr, width, height, bit_depth, PNG_COLOR_TYPE_PALETTE, interlace_type, in gdImagePngCtxEx()
621 png_set_tRNS(png_ptr, info_ptr, 0, 0, &trans_rgb_value); in gdImagePngCtxEx()
645 png_set_tRNS (png_ptr, info_ptr, trans_values, 256, NULL); in gdImagePngCtxEx()
668 png_set_tRNS(png_ptr, info_ptr, trans_values, tc, NULL); in gdImagePngCtxEx()
691 png_set_PLTE(png_ptr, info_ptr, palette, colors); in gdImagePngCtxEx()
695 png_write_info(png_ptr, info_ptr); in gdImagePngCtxEx()
698 png_set_packing(png_ptr); in gdImagePngCtxEx()
746 png_write_image(png_ptr, row_pointers); in gdImagePngCtxEx()
747 png_write_end(png_ptr, info_ptr); in gdImagePngCtxEx()
765 png_write_image(png_ptr, row_pointers); in gdImagePngCtxEx()
766 png_write_end(png_ptr, info_ptr); in gdImagePngCtxEx()
774 png_write_image(png_ptr, im->pixels); in gdImagePngCtxEx()
775 png_write_end(png_ptr, info_ptr); in gdImagePngCtxEx()
780 png_destroy_write_struct(&png_ptr, &info_ptr); in gdImagePngCtxEx()