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 2.57 by greg, Sat Dec 9 23:46:51 2023 UTC vs.
Revision 2.60 by greg, Thu Nov 7 20:07:08 2024 UTC

# Line 240 | Line 240 | main(
240                  fprintview(commvp, stdout);
241                  fputc('\n', stdout);
242          }
243 <        if (outfloat) {                         /* print format if known */
243 >        if (outfloat) {                         /* print output format */
244                  printf("NROWS=%d\nNCOLS=%d\n", yres, xres);
245                  fputncomp(outfloat, stdout);
246                  fputendian(stdout);
247                  fputformat("float", stdout);
248          } else if (strcmp(ourfmt, PICFMT))
249                  fputformat(ourfmt, stdout);
250 +        else
251 +                fputformat(COLRFMT, stdout);
252          fputc('\n', stdout);                    /* end header */
253          if (!outfloat)
254                  fprtresolu(xres, yres, stdout);
255  
256 +        doptimize(1);                           /* optimize definitions */
257          combine();                              /* combine pictures */
258          quit(0);
259   usage:
# Line 453 | Line 456 | static void
456   combine(void)                   /* combine pictures */
457   {
458          EPNODE  *coldef[3], *brtdef;
459 +        int     set_x, set_y;
460          COLOR   *scanout;
461          double  d;
462          int     i, j;
# Line 467 | Line 471 | combine(void)                  /* combine pictures */
471                  brtdef = eparse(vbrtout);
472          else
473                  brtdef = NULL;
474 +                                                /* what to set */
475 +        set_x = varlookup(vxpos) != NULL && !vardefined(vxpos);
476 +        set_y = varlookup(vypos) != NULL && !vardefined(vypos);
477                                                  /* allocate scanline */
478          scanout = (COLOR *)emalloc(xres*sizeof(COLOR));
479                                                  /* set input position */
# Line 474 | Line 481 | combine(void)                  /* combine pictures */
481                                                  /* combine files */
482          for (ypos = yres-1; ypos >= 0; ypos--) {
483              advance();
484 <            varset(vypos, '=', (double)ypos);
484 >            if (set_y) varset(vypos, '=', (double)ypos);
485              for (xpos = 0; xpos < xres; xpos++) {
486                  xscan = (xpos+.5)*xmax/xres;
487 <                varset(vxpos, '=', (double)xpos);
487 >                if (set_x) varset(vxpos, '=', (double)xpos);
488                  eclock++;
489                  if (brtdef != NULL) {
490                      d = evalue(brtdef);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines