Lines Matching refs:rpng2_info

184 static mainprog_info rpng2_info;  variable
297 memset(&rpng2_info, 0, sizeof(mainprog_info)); in WinMain()
358 rpng2_info.display_exponent = atof(p); in WinMain()
360 rpng2_info.display_exponent = default_display_exponent; in WinMain()
395 rpng2_info.display_exponent = atof(*argv); in WinMain()
396 if (rpng2_info.display_exponent <= 0.0) in WinMain()
494 } else if ((rc = readpng2_init(&rpng2_info)) != 0) { in WinMain()
554 rpng2_info.bg_red = (uch)r; in WinMain()
555 rpng2_info.bg_green = (uch)g; in WinMain()
556 rpng2_info.bg_blue = (uch)b; in WinMain()
558 rpng2_info.need_bgcolor = TRUE; in WinMain()
560 rpng2_info.state = kPreInit; in WinMain()
561 rpng2_info.mainprog_init = rpng2_win_init; in WinMain()
562 rpng2_info.mainprog_display_row = rpng2_win_display_row; in WinMain()
563 rpng2_info.mainprog_finish_display = rpng2_win_finish_display; in WinMain()
577 if (readpng2_decode_data(&rpng2_info, inbuf, incount)) in WinMain()
581 if (error || incount != INBUFSIZE || rpng2_info.state == kDone) { in WinMain()
582 if (rpng2_info.state == kDone) { in WinMain()
609 readpng2_cleanup(&rpng2_info); in WinMain()
644 ulg rowbytes = rpng2_info.rowbytes; in rpng2_win_init()
647 Trace((stderr, " rowbytes = %d\n", rpng2_info.rowbytes)) in rpng2_win_init()
648 Trace((stderr, " width = %ld\n", rpng2_info.width)) in rpng2_win_init()
649 Trace((stderr, " height = %ld\n", rpng2_info.height)) in rpng2_win_init()
651 rpng2_info.image_data = (uch *)malloc(rowbytes * rpng2_info.height); in rpng2_win_init()
652 if (!rpng2_info.image_data) { in rpng2_win_init()
653 readpng2_cleanup(&rpng2_info); in rpng2_win_init()
657 rpng2_info.row_pointers = (uch **)malloc(rpng2_info.height * sizeof(uch *)); in rpng2_win_init()
658 if (!rpng2_info.row_pointers) { in rpng2_win_init()
659 free(rpng2_info.image_data); in rpng2_win_init()
660 rpng2_info.image_data = NULL; in rpng2_win_init()
661 readpng2_cleanup(&rpng2_info); in rpng2_win_init()
665 for (i = 0; i < rpng2_info.height; ++i) in rpng2_win_init()
666 rpng2_info.row_pointers[i] = rpng2_info.image_data + i*rowbytes; in rpng2_win_init()
674 readpng2_cleanup(&rpng2_info); in rpng2_win_init()
678 rpng2_info.state = kWindowInit; in rpng2_win_init()
687 uch bg_red = rpng2_info.bg_red; in rpng2_win_create_window()
688 uch bg_green = rpng2_info.bg_green; in rpng2_win_create_window()
689 uch bg_blue = rpng2_info.bg_blue; in rpng2_win_create_window()
702 wimage_rowbytes = ((3*rpng2_info.width + 3L) >> 2) << 2; in rpng2_win_create_window()
705 wimage_rowbytes*rpng2_info.height))) in rpng2_win_create_window()
720 bmih->biWidth = rpng2_info.width; in rpng2_win_create_window()
721 bmih->biHeight = -((long)rpng2_info.height); in rpng2_win_create_window()
734 memset(wimage_data, 0, wimage_rowbytes*rpng2_info.height); in rpng2_win_create_window()
736 for (j = 0; j < rpng2_info.height; ++j) { in rpng2_win_create_window()
738 for (i = rpng2_info.width; i > 0; --i) { in rpng2_win_create_window()
776 CW_USEDEFAULT, CW_USEDEFAULT, rpng2_info.width+extra_width, in rpng2_win_create_window()
777 rpng2_info.height+extra_height, NULL, NULL, global_hInst, NULL); in rpng2_win_create_window()
794 x = (rpng2_info.width - len*tm.tmAveCharWidth)/2; in rpng2_win_create_window()
795 y = (rpng2_info.height - tm.tmHeight)/2; in rpng2_win_create_window()
806 for (j = 0; j < rpng2_info.height; ++j) { in rpng2_win_create_window()
808 for (i = rpng2_info.width; i > 0; --i) { in rpng2_win_create_window()
818 rect.right = (LONG)rpng2_info.width; /* possibly off by one? */ in rpng2_win_create_window()
819 rect.bottom = (LONG)rpng2_info.height; /* possibly off by one? */ in rpng2_win_create_window()
848 bg_rowbytes = 3 * rpng2_info.width; in rpng2_win_load_bg_image()
849 bg_data = (uch *)malloc(bg_rowbytes * rpng2_info.height); in rpng2_win_load_bg_image()
876 for (row = 0; row < rpng2_info.height; ++row) { in rpng2_win_load_bg_image()
895 for (i = 0; i < rpng2_info.width; ++i) { in rpng2_win_load_bg_image()
943 for (row = 0; row < rpng2_info.height; ++row) { in rpng2_win_load_bg_image()
948 for (i = 0; i < rpng2_info.width; ++i) { in rpng2_win_load_bg_image()
976 hh = rpng2_info.height / 2; in rpng2_win_load_bg_image()
977 hw = rpng2_info.width / 2; in rpng2_win_load_bg_image()
995 for (row = 0; row < rpng2_info.height; ++row) { in rpng2_win_load_bg_image()
998 for (i = 0; i < rpng2_info.width; ++i) { in rpng2_win_load_bg_image()
1047 for (row = 0; row < rpng2_info.height; ++row) { in rpng2_win_load_bg_image()
1050 for (i = rpng2_info.width; i > 0; --i) { in rpng2_win_load_bg_image()
1070 uch bg_red = rpng2_info.bg_red; in rpng2_win_display_row()
1071 uch bg_green = rpng2_info.bg_green; in rpng2_win_display_row()
1072 uch bg_blue = rpng2_info.bg_blue; in rpng2_win_display_row()
1098 src = rpng2_info.image_data + row*rpng2_info.rowbytes; in rpng2_win_display_row()
1103 if (rpng2_info.channels == 3) { in rpng2_win_display_row()
1104 for (i = rpng2_info.width; i > 0; --i) { in rpng2_win_display_row()
1113 for (i = rpng2_info.width; i > 0; --i) { in rpng2_win_display_row()
1148 if ((rows & 0xf) == 0 || row == rpng2_info.height-1) { in rpng2_win_display_row()
1153 rect.right = (LONG)rpng2_info.width; /* possibly off by one? */ in rpng2_win_display_row()
1174 rpng2_info.state = kDone; in rpng2_win_finish_display()
1196 if (rpng2_info.image_data) { in rpng2_win_cleanup()
1197 free(rpng2_info.image_data); in rpng2_win_cleanup()
1198 rpng2_info.image_data = NULL; in rpng2_win_cleanup()
1201 if (rpng2_info.row_pointers) { in rpng2_win_cleanup()
1202 free(rpng2_info.row_pointers); in rpng2_win_cleanup()
1203 rpng2_info.row_pointers = NULL; in rpng2_win_cleanup()
1229 rc = StretchDIBits(hdc, 0, 0, rpng2_info.width, rpng2_info.height, in rpng2_win_wndproc()
1230 0, 0, rpng2_info.width, rpng2_info.height, in rpng2_win_wndproc()