--- ray/src/px/pcomb.c 1991/05/30 09:47:14 1.19 +++ ray/src/px/pcomb.c 1991/11/11 14:01:24 1.23 @@ -16,14 +16,14 @@ static char SCCSid[] = "$SunId$ LBL"; #include "color.h" +#include "resolu.h" + #include "calcomp.h" #define MAXINP 32 /* maximum number of input files */ #define WINSIZ 9 /* scanline window size */ #define MIDSCN 4 /* current scan position */ -#define BRT (-1) /* special index for brightness */ - struct { char *name; /* file or command name */ FILE *fp; /* stream pointer */ @@ -34,11 +34,11 @@ struct { int nfiles; /* number of input files */ -char *vcolin[3] = {"ri", "gi", "bi"}; -char *vcolout[3] = {"ro", "go", "bo"}; +char vcolin[3][4] = {"ri", "gi", "bi"}; +char vcolout[3][4] = {"ro", "go", "bo"}; char vbrtin[] = "li"; char vbrtout[] = "lo"; -char *vcolexp[3] = {"re", "ge", "be"}; +char vcolexp[3][4] = {"re", "ge", "be"}; char vbrtexp[] = "le"; char vnfiles[] = "nfiles"; @@ -68,7 +68,6 @@ main(argc, argv) int argc; char *argv[]; { - char buf[128]; int original; double f; int a, i; @@ -111,7 +110,7 @@ char *argv[]; break; case 'o': original++; - break; + continue; case 's': f = atof(argv[++a]); scalecolor(input[nfiles].coef, f); @@ -152,16 +151,10 @@ char *argv[]; if (argv[a][0] == '-') switch (argv[a][1]) { case 'x': - strcpy(buf, vxres); - strcat(buf, ":"); - strcat(buf, argv[++a]); - scompile(buf, NULL, 0); + varset(vxres, ':', eval(argv[++a])); continue; case 'y': - strcpy(buf, vyres); - strcat(buf, ":"); - strcat(buf, argv[++a]); - scompile(buf, NULL, 0); + varset(vyres, ':', eval(argv[++a])); continue; case 'w': continue; @@ -190,7 +183,7 @@ char *argv[]; printargs(argc, argv, stdout); fputformat(COLRFMT, stdout); putchar('\n'); - fputresolu(YMAJOR|YDECR, xres, yres, stdout); + fprtresolu(xres, yres, stdout); /* combine pictures */ combine(); quit(0); @@ -198,7 +191,7 @@ usage: eputs("Usage: "); eputs(argv[0]); eputs( -" [-w][-h][-x xr][-y yr][-e expr][-f file] [ [-s f][-c r g b] pic ..]\n"); +" [-w][-x xr][-y yr][-e expr][-f file] [ [-s f][-c r g b] pic ..]\n"); quit(1); } @@ -241,7 +234,7 @@ checkfile() /* ready a file */ eputs(": not in Radiance picture format\n"); quit(1); } - if (fgetresolu(&xinp, &yinp, input[nfiles].fp) != (YMAJOR|YDECR)) { + if (fgetresolu(&xinp, &yinp, input[nfiles].fp) < 0) { eputs(input[nfiles].name); eputs(": bad picture size\n"); quit(1);