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.8 by greg, Thu Apr 18 08:05:57 1991 UTC vs.
Revision 1.9 by greg, Thu Apr 18 10:19:48 1991 UTC

# Line 42 | Line 42 | char   *vcolout[3] = {"ro", "go", "bo"};
42  
43   int     nowarn = 0;                     /* no warning messages? */
44  
45 + int     original = 0;                   /* origninal values? */
46 +
47   int     xres=0, yres=0;                 /* picture resolution */
48  
49   int     xpos, ypos;                     /* picture position */
# Line 50 | Line 52 | int    xpos, ypos;                     /* picture position */
52   tputs(s)                        /* put out string preceded by a tab */
53   char    *s;
54   {
55 +        double  d;
56 +        COLOR   ctmp;
57 +                                /* echo header line */
58          putchar('\t');
59          fputs(s, stdout);
60 +        if (!original)
61 +                return;
62 +                                /* check for exposure */
63 +        if (isexpos(s)) {
64 +                d = 1.0/exposval(s);
65 +                scalecolor(input[nfiles].coef, d);
66 +        } else if (iscolcor(s)) {
67 +                colcorval(ctmp, s);
68 +                colval(input[nfiles].coef,RED) /= colval(ctmp,RED);
69 +                colval(input[nfiles].coef,GRN) /= colval(ctmp,GRN);
70 +                colval(input[nfiles].coef,BLU) /= colval(ctmp,BLU);
71 +        }
72   }
73  
74  
# Line 84 | Line 101 | char   *argv[];
101                          case 'w':
102                                  nowarn = !nowarn;
103                                  break;
104 +                        case 'o':
105 +                                original = !original;
106 +                                break;
107                          case 'f':
108                                  fcompile(argv[++a]);
109                                  break;
# Line 159 | Line 179 | getfiles:
179   usage:
180          eputs("Usage: ");
181          eputs(argv[0]);
182 < eputs(" [-w][-x xr][-y yr][-e expr][-f file] [ [-s f][-c r g b] picture ..]\n");
182 >        eputs(
183 > " [-w][-h][-x xr][-y yr][-e expr][-f file] [ [-s f][-c r g b] pic ..]\n");
184          quit(1);
185   }
186  
# Line 197 | Line 218 | combine()                      /* combine pictures */
218                      }
219              varset(vypos, (double)ypos);
220              for (xpos = 0; xpos < xres; xpos++) {
221 +                for (i = 0; i < nfiles; i++)
222 +                        multcolor(input[i].scan[xpos],input[i].coef);
223                  varset(vxpos, (double)xpos);
224                  eclock++;
225                  if (brtdef != NULL) {
# Line 212 | Line 235 | combine()                      /* combine pictures */
235                              colval(scanout[xpos],j) = 0.0;
236                              for (i = 0; i < nfiles; i++)
237                                  colval(scanout[xpos],j) +=
215                                        colval(input[i].coef,j) *
238                                          colval(input[i].scan[xpos],j);
239                          }
240                          if (colval(scanout[xpos],j) < 0.0)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines