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.15 by greg, Fri Feb 17 18:37:20 1995 UTC vs.
Revision 2.16 by greg, Mon Oct 16 12:04:33 1995 UTC

# Line 36 | Line 36 | struct {
36  
37   int     nfiles;                         /* number of input files */
38  
39 + char    ourfmt[LPICFMT+1] = PICFMT;     /* input picture format */
40 +
41   char    Command[] = "<Command>";
42   char    vcolin[3][4] = {"ri", "gi", "bi"};
43   char    vcolout[3][4] = {"ro", "go", "bo"};
# Line 203 | Line 205 | char   *argv[];
205          }
206                                                  /* complete header */
207          printargs(argc, argv, stdout);
208 <        fputformat(COLRFMT, stdout);
208 >        if (strcmp(ourfmt, PICFMT))
209 >                fputformat(ourfmt, stdout);     /* print format if known */
210          putchar('\n');
211          fprtresolu(xres, yres, stdout);
212                                                  /* combine pictures */
# Line 228 | Line 231 | char   *s;
231          if (isheadid(s))                        /* header id */
232                  return;         /* don't echo */
233          if (formatval(fmt, s)) {                /* check format */
234 <                wrongformat = strcmp(fmt, COLRFMT);
234 >                if (globmatch(ourfmt, fmt)) {
235 >                        wrongformat = 0;
236 >                        strcpy(ourfmt, fmt);
237 >                } else
238 >                        wrongformat = 1;
239                  return;         /* don't echo */
240          }
241          if (isexpos(s)) {                       /* exposure */
# Line 280 | Line 287 | checkfile()                    /* ready a file */
287   }
288  
289  
290 + double
291 + rgb_bright(clr)
292 + COLOR  clr;
293 + {
294 +        return(bright(clr));
295 + }
296 +
297 +
298 + double
299 + xyz_bright(clr)
300 + COLOR  clr;
301 + {
302 +        return(clr[CIEY]);
303 + }
304 +
305 +
306 + double  (*ourbright)() = rgb_bright;
307 +
308 +
309   init()                                  /* perform final setup */
310   {
311          double  l_colin(), l_expos(), l_ray();
# Line 297 | Line 323 | init()                                 /* perform final setup */
323          funset(vbrtin, 1, '=', l_colin);
324          for (i = 0; i < 6; i++)
325                  funset(vray[i], 1, '=', l_ray);
326 +                                                /* set brightness function */
327 +        if (!strcmp(ourfmt, CIEFMT))
328 +                ourbright = xyz_bright;
329   }
330  
331  
# Line 396 | Line 425 | register char  *nam;
425          if (fn < 0 || fn >= nfiles)
426                  return(1.0);
427          if (nam == vbrtexp)
428 <                return(bright(input[fn].expos));
428 >                return((*ourbright)(input[fn].expos));
429          n = 3;
430          while (n--)
431                  if (nam == vcolexp[n])
# Line 453 | Line 482 | register char  *nam;
482                  }
483          }
484          if (nam == vbrtin)
485 <                return(bright(input[fn].scan[MIDSCN+yoff][xscan+xoff]));
485 >                return((*ourbright)(input[fn].scan[MIDSCN+yoff][xscan+xoff]));
486          n = 3;
487          while (n--)
488              if (nam == vcolin[n])

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines