Lines Matching refs:wpng_info

150 static mainprog_info wpng_info;   /* lone global */  variable
177 wpng_info.infile = NULL; in main()
178 wpng_info.outfile = NULL; in main()
179 wpng_info.image_data = NULL; in main()
180 wpng_info.row_pointers = NULL; in main()
181 wpng_info.filter = FALSE; in main()
182 wpng_info.interlaced = FALSE; in main()
183 wpng_info.have_bg = FALSE; in main()
184 wpng_info.have_time = FALSE; in main()
185 wpng_info.have_text = 0; in main()
186 wpng_info.gamma = 0.0; in main()
253 wpng_info.interlaced = TRUE; in main()
255 wpng_info.modtime = time(NULL); in main()
256 wpng_info.have_time = TRUE; in main()
263 wpng_info.gamma = atof(*argv); in main()
264 if (wpng_info.gamma <= 0.0) in main()
266 else if (wpng_info.gamma > 1.01) in main()
281 wpng_info.bg_red = (uch)r; in main()
282 wpng_info.bg_green = (uch)g; in main()
283 wpng_info.bg_blue = (uch)b; in main()
284 wpng_info.have_bg = TRUE; in main()
311 if ((wpng_info.infile = fdopen(fileno(stdin), "rb")) == NULL) { in main()
316 if ((wpng_info.outfile = fdopen(fileno(stdout), "wb")) == NULL) { in main()
319 fclose(wpng_info.infile); in main()
322 wpng_info.filter = TRUE; in main()
328 } else if (!(wpng_info.infile = fopen(inname, "rb"))) { in main()
334 fgets(pnmline, 256, wpng_info.infile); in main()
343 wpng_info.pnmtype = (int)(pnmchar - '0'); in main()
344 if (wpng_info.pnmtype != 8) in main()
345 wpng_info.have_bg = FALSE; /* no need for bg if opaque */ in main()
347 fgets(pnmline, 256, wpng_info.infile); /* lose any comments */ in main()
349 sscanf(pnmline, "%ld %ld", &wpng_info.width, &wpng_info.height); in main()
351 fgets(pnmline, 256, wpng_info.infile); /* more comment lines */ in main()
354 if (wpng_info.width <= 0L || wpng_info.height <= 0L || in main()
361 wpng_info.sample_depth = 8; /* <==> maxval 255 */ in main()
363 if (!wpng_info.filter) { in main()
376 if ((wpng_info.outfile = fopen(outname, "rb")) != NULL) { in main()
379 fclose(wpng_info.outfile); in main()
381 } else if (!(wpng_info.outfile = fopen(outname, "wb"))) { in main()
389 fclose(wpng_info.infile); in main()
390 wpng_info.infile = NULL; in main()
391 if (wpng_info.filter) { in main()
392 fclose(wpng_info.outfile); in main()
393 wpng_info.outfile = NULL; in main()
458 wpng_info.title = p; in main()
459 wpng_info.have_text |= TEXT_TITLE; in main()
468 wpng_info.have_text &= ~TEXT_TITLE; in main()
472 wpng_info.have_text &= ~TEXT_TITLE; in main()
488 wpng_info.author = p; in main()
489 wpng_info.have_text |= TEXT_AUTHOR; in main()
498 wpng_info.have_text &= ~TEXT_AUTHOR; in main()
502 wpng_info.have_text &= ~TEXT_AUTHOR; in main()
527 wpng_info.desc = textbuf + TEXT_DESC_OFFSET; in main()
528 wpng_info.have_text |= TEXT_DESC; in main()
538 wpng_info.have_text &= ~TEXT_DESC; in main()
542 wpng_info.have_text &= ~TEXT_DESC; in main()
558 wpng_info.copyright = p; in main()
559 wpng_info.have_text |= TEXT_COPY; in main()
568 wpng_info.have_text &= ~TEXT_COPY; in main()
572 wpng_info.have_text &= ~TEXT_COPY; in main()
588 wpng_info.email = p; in main()
589 wpng_info.have_text |= TEXT_EMAIL; in main()
598 wpng_info.have_text &= ~TEXT_EMAIL; in main()
602 wpng_info.have_text &= ~TEXT_EMAIL; in main()
618 wpng_info.url = p; in main()
619 wpng_info.have_text |= TEXT_URL; in main()
628 wpng_info.have_text &= ~TEXT_URL; in main()
632 wpng_info.have_text &= ~TEXT_URL; in main()
647 wpng_info.have_text = 0; in main()
653 if ((rc = writepng_init(&wpng_info)) != 0) { in main()
688 if (wpng_info.pnmtype == 5) in main()
689 rowbytes = wpng_info.width; in main()
690 else if (wpng_info.pnmtype == 6) in main()
691 rowbytes = wpng_info.width * 3; in main()
693 rowbytes = wpng_info.width * 4; in main()
702 if (wpng_info.interlaced) { in main()
705 ulg image_bytes = rowbytes * wpng_info.height; /* overflow? */ in main()
707 wpng_info.image_data = (uch *)malloc(image_bytes); in main()
708 wpng_info.row_pointers = (uch **)malloc(wpng_info.height*sizeof(uch *)); in main()
709 if (wpng_info.image_data == NULL || wpng_info.row_pointers == NULL) { in main()
711 writepng_cleanup(&wpng_info); in main()
715 for (i = 0; i < wpng_info.height; ++i) in main()
716 wpng_info.row_pointers[i] = wpng_info.image_data + i*rowbytes; in main()
717 bytes = fread(wpng_info.image_data, 1, image_bytes, wpng_info.infile); in main()
723 if (writepng_encode_image(&wpng_info) != 0) { in main()
726 writepng_cleanup(&wpng_info); in main()
735 wpng_info.image_data = (uch *)malloc(rowbytes); in main()
736 if (wpng_info.image_data == NULL) { in main()
738 writepng_cleanup(&wpng_info); in main()
743 for (j = wpng_info.height; j > 0L; --j) { in main()
744 bytes = fread(wpng_info.image_data, 1, rowbytes, wpng_info.infile); in main()
748 bytes, wpng_info.height-j); in main()
752 if (writepng_encode_row(&wpng_info) != 0) { in main()
755 wpng_info.height-j); in main()
761 writepng_cleanup(&wpng_info); in main()
765 if (writepng_encode_finish(&wpng_info) != 0) { in main()
767 writepng_cleanup(&wpng_info); in main()
779 writepng_cleanup(&wpng_info); in main()
809 if (wpng_info.outfile) { in wpng_cleanup()
810 fclose(wpng_info.outfile); in wpng_cleanup()
811 wpng_info.outfile = NULL; in wpng_cleanup()
814 if (wpng_info.infile) { in wpng_cleanup()
815 fclose(wpng_info.infile); in wpng_cleanup()
816 wpng_info.infile = NULL; in wpng_cleanup()
819 if (wpng_info.image_data) { in wpng_cleanup()
820 free(wpng_info.image_data); in wpng_cleanup()
821 wpng_info.image_data = NULL; in wpng_cleanup()
824 if (wpng_info.row_pointers) { in wpng_cleanup()
825 free(wpng_info.row_pointers); in wpng_cleanup()
826 wpng_info.row_pointers = NULL; in wpng_cleanup()