ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/px/pcomb.c
(Generate patch)

Comparing ray/src/px/pcomb.c (file contents):
Revision 1.3 by greg, Tue Jul 11 17:13:44 1989 UTC vs.
Revision 1.5 by greg, Tue Sep 12 13:04:22 1989 UTC

# Line 129 | Line 129 | getfiles:
129                  fputs(input[nfiles].name, stdout);
130                  fputs(":\n", stdout);
131                  getheader(input[nfiles].fp, tputs);
132 <                if (fscanf(input[nfiles].fp, "-Y %d +X %d\n", &ypos, &xpos) != 2) {
132 >                if (fgetresolu(&xpos, &ypos, input[nfiles].fp) !=
133 >                                (YMAJOR|YDECR)) {
134                          eputs(input[nfiles].name);
135                          eputs(": bad picture size\n");
136                          quit(1);
# Line 147 | Line 148 | getfiles:
148          }
149          printargs(argc, argv, stdout);
150          putchar('\n');
151 <        printf("-Y %d +X %d\n", yres, xres);
151 >        fputresolu(YMAJOR|YDECR, xres, yres, stdout);
152          combine();
153          quit(0);
154   usage:
# Line 160 | Line 161 | eputs(" [-w][-x xr][-y yr][-e expr][-f file] [ [-s f][
161  
162   combine()                       /* combine pictures */
163   {
164 <        int     coldef[3];
164 >        EPNODE  *coldef[3];
165          COLOR   *scanout;
166          register int    i, j;
167                                                  /* check defined variables */
168 <        for (j = 0; j < 3; j++)
169 <                coldef[j] = vardefined(vcolout[j]);
168 >        for (j = 0; j < 3; j++) {
169 >                if (vardefined(vcolout[j]))
170 >                        coldef[j] = eparse(vcolout[j]);
171 >                else
172 >                        coldef[j] = NULL;
173 >        }
174                                                  /* allocate scanline */
175          scanout = (COLOR *)emalloc(xres*sizeof(COLOR));
176                                                  /* combine files */
# Line 180 | Line 185 | combine()                      /* combine pictures */
185                  for (xpos = 0; xpos < xres; xpos++) {
186                          varset(vxpos, (double)xpos);
187                          eclock++;
188 <                        for (j = 0; j < 3; j++)
189 <                                if (coldef[j]) {
188 >                        for (j = 0; j < 3; j++) {
189 >                                if (coldef[j] != NULL) {
190                                          colval(scanout[xpos],j) =
191 <                                                varvalue(vcolout[j]);
187 <                                        if (colval(scanout[xpos],j) < 0.0)
188 <                                                colval(scanout[xpos],j) = 0.0;
191 >                                                evalue(coldef[j]);
192                                  } else {
193                                          colval(scanout[xpos],j) = 0.0;
194                                          for (i = 0; i < nfiles; i++)
# Line 193 | Line 196 | combine()                      /* combine pictures */
196                                                  colval(input[i].coef,j) *
197                                                  colval(input[i].scan[xpos],j);
198                                  }
199 +                                if (colval(scanout[xpos],j) < 0.0)
200 +                                        colval(scanout[xpos],j) = 0.0;
201 +                        }
202                  }
203                  if (fwritescan(scanout, xres, stdout) < 0) {
204                          eputs("write error\n");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines