Lines Matching refs:png_ptr
50 static void gdPngErrorHandler (png_structp png_ptr, png_const_charp msg) in gdPngErrorHandler() argument
66 jmpbuf_ptr = png_get_error_ptr (png_ptr); in gdPngErrorHandler()
75 static void gdPngReadData (png_structp png_ptr, png_bytep data, png_size_t length) in gdPngReadData() argument
78 check = gdGetBuf(data, length, (gdIOCtx *) png_get_io_ptr(png_ptr)); in gdPngReadData()
80 png_error(png_ptr, "Read Error: truncated data"); in gdPngReadData()
84 static void gdPngWriteData (png_structp png_ptr, png_bytep data, png_size_t length) in gdPngWriteData() argument
86 gdPutBuf (data, length, (gdIOCtx *) png_get_io_ptr(png_ptr)); in gdPngWriteData()
89 static void gdPngFlushData (png_structp png_ptr) in gdPngFlushData() argument
121 png_structp png_ptr; in gdImageCreateFromPngCtx() local
154 png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, &jbw, gdPngErrorHandler, NULL); in gdImageCreateFromPngCtx()
156 png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); in gdImageCreateFromPngCtx()
158 if (png_ptr == NULL) { in gdImageCreateFromPngCtx()
163 info_ptr = png_create_info_struct(png_ptr); in gdImageCreateFromPngCtx()
166 png_destroy_read_struct (&png_ptr, NULL, NULL); in gdImageCreateFromPngCtx()
182 png_destroy_read_struct(&png_ptr, &info_ptr, NULL); in gdImageCreateFromPngCtx()
188 png_set_sig_bytes(png_ptr, 8); /* we already read the 8 signature bytes */ in gdImageCreateFromPngCtx()
190 png_set_read_fn(png_ptr, (void *) infile, gdPngReadData); in gdImageCreateFromPngCtx()
191 png_read_info(png_ptr, info_ptr); /* read all PNG info up to image data */ in gdImageCreateFromPngCtx()
193 …png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, &interlace_type, NULL, N… in gdImageCreateFromPngCtx()
202 png_destroy_read_struct(&png_ptr, &info_ptr, NULL); in gdImageCreateFromPngCtx()
208 png_set_strip_16(png_ptr); in gdImageCreateFromPngCtx()
210 png_set_packing (png_ptr); /* expand to 1 byte per pixel */ in gdImageCreateFromPngCtx()
219 png_destroy_read_struct(&png_ptr, &info_ptr, NULL); in gdImageCreateFromPngCtx()
231 png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette); in gdImageCreateFromPngCtx()
235 if (png_get_valid (png_ptr, info_ptr, PNG_INFO_tRNS)) { in gdImageCreateFromPngCtx()
243 png_get_tRNS(png_ptr, info_ptr, &trans, &num_trans, NULL); in gdImageCreateFromPngCtx()
257 png_destroy_read_struct(&png_ptr, &info_ptr, NULL); in gdImageCreateFromPngCtx()
274 if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { in gdImageCreateFromPngCtx()
275 png_get_tRNS(png_ptr, info_ptr, NULL, NULL, &trans_gray_rgb); in gdImageCreateFromPngCtx()
296 png_set_gray_to_rgb(png_ptr); in gdImageCreateFromPngCtx()
304 if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { in gdImageCreateFromPngCtx()
305 png_get_tRNS(png_ptr, info_ptr, NULL, NULL, &trans_color_rgb); in gdImageCreateFromPngCtx()
319 png_read_update_info(png_ptr, info_ptr); in gdImageCreateFromPngCtx()
322 rowbytes = png_get_rowbytes(png_ptr, info_ptr); in gdImageCreateFromPngCtx()
332 png_read_image(png_ptr, row_pointers); /* read whole image... */ in gdImageCreateFromPngCtx()
333 png_read_end(png_ptr, NULL); /* ...done! */ in gdImageCreateFromPngCtx()
357 png_destroy_read_struct(&png_ptr, &info_ptr, NULL); in gdImageCreateFromPngCtx()
475 png_structp png_ptr; in gdImagePngCtxEx() local
482 png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, &jbw, gdPngErrorHandler, NULL); in gdImagePngCtxEx()
484 png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); in gdImagePngCtxEx()
486 if (png_ptr == NULL) { in gdImagePngCtxEx()
491 info_ptr = png_create_info_struct(png_ptr); in gdImagePngCtxEx()
494 png_destroy_write_struct (&png_ptr, (png_infopp) NULL); in gdImagePngCtxEx()
502 png_destroy_write_struct (&png_ptr, &info_ptr); in gdImagePngCtxEx()
508 png_set_write_fn(png_ptr, (void *) outfile, gdPngWriteData, gdPngFlushData); in gdImagePngCtxEx()
524 png_set_compression_level(png_ptr, level); in gdImagePngCtxEx()
526 png_set_filter(png_ptr, PNG_FILTER_TYPE_BASE, basefilter); in gdImagePngCtxEx()
574 png_set_IHDR(png_ptr, info_ptr, width, height, 8, PNG_COLOR_TYPE_RGB_ALPHA, interlace_type, in gdImagePngCtxEx()
577 png_set_IHDR(png_ptr, info_ptr, width, height, 8, PNG_COLOR_TYPE_RGB, interlace_type, in gdImagePngCtxEx()
581 png_set_IHDR(png_ptr, info_ptr, width, height, bit_depth, PNG_COLOR_TYPE_PALETTE, interlace_type, in gdImagePngCtxEx()
590 png_set_tRNS(png_ptr, info_ptr, 0, 0, &trans_rgb_value); in gdImagePngCtxEx()
614 png_set_tRNS (png_ptr, info_ptr, trans_values, 256, NULL); in gdImagePngCtxEx()
637 png_set_tRNS(png_ptr, info_ptr, trans_values, tc, NULL); in gdImagePngCtxEx()
660 png_set_PLTE(png_ptr, info_ptr, palette, colors); in gdImagePngCtxEx()
664 png_write_info(png_ptr, info_ptr); in gdImagePngCtxEx()
667 png_set_packing(png_ptr); in gdImagePngCtxEx()
720 png_write_image(png_ptr, row_pointers); in gdImagePngCtxEx()
721 png_write_end(png_ptr, info_ptr); in gdImagePngCtxEx()
739 png_write_image(png_ptr, row_pointers); in gdImagePngCtxEx()
740 png_write_end(png_ptr, info_ptr); in gdImagePngCtxEx()
748 png_write_image(png_ptr, im->pixels); in gdImagePngCtxEx()
749 png_write_end(png_ptr, info_ptr); in gdImagePngCtxEx()
754 png_destroy_write_struct(&png_ptr, &info_ptr); in gdImagePngCtxEx()