Lines Matching refs:mainprog_ptr
105 int readpng2_init(mainprog_info *mainprog_ptr) in readpng2_init() argument
113 png_ptr = png_create_read_struct(png_get_libpng_ver(NULL), mainprog_ptr, in readpng2_init()
135 if (setjmp(mainprog_ptr->jmpbuf)) { in readpng2_init()
170 png_set_progressive_read_fn(png_ptr, mainprog_ptr, in readpng2_init()
176 mainprog_ptr->png_ptr = png_ptr; in readpng2_init()
177 mainprog_ptr->info_ptr = info_ptr; in readpng2_init()
190 int readpng2_decode_data(mainprog_info *mainprog_ptr, uch *rawbuf, ulg length) in readpng2_decode_data() argument
192 png_structp png_ptr = (png_structp)mainprog_ptr->png_ptr; in readpng2_decode_data()
193 png_infop info_ptr = (png_infop)mainprog_ptr->info_ptr; in readpng2_decode_data()
199 if (setjmp(mainprog_ptr->jmpbuf)) { in readpng2_decode_data()
201 mainprog_ptr->png_ptr = NULL; in readpng2_decode_data()
202 mainprog_ptr->info_ptr = NULL; in readpng2_decode_data()
219 mainprog_info *mainprog_ptr; in readpng2_info_callback() local
242 mainprog_ptr = png_get_progressive_ptr(png_ptr); in readpng2_info_callback()
244 if (mainprog_ptr == NULL) { /* we be hosed */ in readpng2_info_callback()
263 mainprog_ptr->width = (ulg)width; in readpng2_info_callback()
264 mainprog_ptr->height = (ulg)height; in readpng2_info_callback()
270 if (mainprog_ptr->need_bgcolor) in readpng2_info_callback()
284 mainprog_ptr->bg_red = pBackground->red >> 8; in readpng2_info_callback()
285 mainprog_ptr->bg_green = pBackground->green >> 8; in readpng2_info_callback()
286 mainprog_ptr->bg_blue = pBackground->blue >> 8; in readpng2_info_callback()
289 mainprog_ptr->bg_red = mainprog_ptr->bg_green = in readpng2_info_callback()
290 mainprog_ptr->bg_blue = pBackground->gray? 255 : 0; in readpng2_info_callback()
292 mainprog_ptr->bg_red = mainprog_ptr->bg_green = in readpng2_info_callback()
293 mainprog_ptr->bg_blue = (255/3) * pBackground->gray; in readpng2_info_callback()
295 mainprog_ptr->bg_red = mainprog_ptr->bg_green = in readpng2_info_callback()
296 mainprog_ptr->bg_blue = (255/15) * pBackground->gray; in readpng2_info_callback()
298 mainprog_ptr->bg_red = (uch)pBackground->red; in readpng2_info_callback()
299 mainprog_ptr->bg_green = (uch)pBackground->green; in readpng2_info_callback()
300 mainprog_ptr->bg_blue = (uch)pBackground->blue; in readpng2_info_callback()
347 png_set_gamma(png_ptr, mainprog_ptr->display_exponent, gamma); in readpng2_info_callback()
349 png_set_gamma(png_ptr, mainprog_ptr->display_exponent, 0.45455); in readpng2_info_callback()
353 (png_fixed_point)(100000*mainprog_ptr->display_exponent+.5), gamma); in readpng2_info_callback()
356 (png_fixed_point)(100000*mainprog_ptr->display_exponent+.5), 45455); in readpng2_info_callback()
361 mainprog_ptr->passes = png_set_interlace_handling(png_ptr); in readpng2_info_callback()
369 mainprog_ptr->rowbytes = (int)png_get_rowbytes(png_ptr, info_ptr); in readpng2_info_callback()
370 mainprog_ptr->channels = png_get_channels(png_ptr, info_ptr); in readpng2_info_callback()
378 (*mainprog_ptr->mainprog_init)(); in readpng2_info_callback()
393 mainprog_info *mainprog_ptr; in readpng2_row_callback() local
406 mainprog_ptr = png_get_progressive_ptr(png_ptr); in readpng2_row_callback()
411 mainprog_ptr->pass = pass; in readpng2_row_callback()
418 png_progressive_combine_row(png_ptr, mainprog_ptr->row_pointers[row_num], in readpng2_row_callback()
425 (*mainprog_ptr->mainprog_display_row)(row_num); in readpng2_row_callback()
439 mainprog_info *mainprog_ptr; in readpng2_end_callback() local
444 mainprog_ptr = png_get_progressive_ptr(png_ptr); in readpng2_end_callback()
454 (*mainprog_ptr->mainprog_finish_display)(); in readpng2_end_callback()
468 void readpng2_cleanup(mainprog_info *mainprog_ptr) in readpng2_cleanup() argument
470 png_structp png_ptr = (png_structp)mainprog_ptr->png_ptr; in readpng2_cleanup()
471 png_infop info_ptr = (png_infop)mainprog_ptr->info_ptr; in readpng2_cleanup()
476 mainprog_ptr->png_ptr = NULL; in readpng2_cleanup()
477 mainprog_ptr->info_ptr = NULL; in readpng2_cleanup()
491 mainprog_info *mainprog_ptr; in readpng2_error_handler() local
505 mainprog_ptr = png_get_error_ptr(png_ptr); in readpng2_error_handler()
506 if (mainprog_ptr == NULL) { /* we are completely hosed now */ in readpng2_error_handler()
520 longjmp(mainprog_ptr->jmpbuf, 1); in readpng2_error_handler()