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.35 by greg, Mon Jan 24 19:29:39 2005 UTC vs.
Revision 2.39 by greg, Fri Sep 8 21:38:25 2006 UTC

# Line 14 | Line 14 | static const char      RCSid[] = "$Id$";
14   #include "calcomp.h"
15   #include "view.h"
16  
17 < #define MAXINP          32              /* maximum number of input files */
17 > #define MAXINP          512             /* maximum number of input files */
18   #define WINSIZ          64              /* scanline window size */
19   #define MIDSCN          ((WINSIZ-1)/2+1)
20  
# Line 68 | Line 68 | int    xpos, ypos;                     /* output position */
68  
69   char    *progname;                      /* global argv[0] */
70  
71 + int     echoheader = 1;
72   int     wrongformat = 0;
73   int     gotview;
74  
75  
76 < static gethfunc tabputs;
76 > static gethfunc headline;
77   static void checkfile(void);
78   static double rgb_bright(COLOR  clr);
79   static double xyz_bright(COLOR  clr);
# Line 110 | Line 111 | main(
111                          case 'w':
112                                  nowarn = !nowarn;
113                                  continue;
114 +                        case 'h':
115 +                                echoheader = !echoheader;
116 +                                continue;
117                          case 'f':
118                          case 'e':
119                                  a++;
# Line 228 | Line 232 | usage:
232          eputs("Usage: ");
233          eputs(argv[0]);
234          eputs(
235 < " [-w][-x xr][-y yr][-e expr][-f file] [ [-o][-s f][-c r g b] pic ..]\n");
235 > " [-w][-h][-x xr][-y yr][-e expr][-f file] [ [-o][-s f][-c r g b] pic ..]\n");
236          quit(1);
237          return 1; /* pro forma return */
238   }
239  
240  
241   static int
242 < tabputs(                        /* put out string preceded by a tab */
242 > headline(                       /* check header line & echo if requested */
243          char    *s,
244          void    *p
245   )
# Line 264 | Line 268 | tabputs(                       /* put out string preceded by a tab */
268                  input[nfiles].pa *= aspectval(s);
269          else if (isview(s) && sscanview(&input[nfiles].vw, s) > 0)
270                  gotview++;
271 <                                                /* echo line */
272 <        putchar('\t');
273 <        return(fputs(s, stdout));
271 >
272 >        if (echoheader) {                       /* echo line */
273 >                putchar('\t');
274 >                return(fputs(s, stdout));
275 >        }
276 >        return(0);
277   }
278  
279  
# Line 276 | Line 283 | checkfile(void)                        /* ready a file */
283          register int    i;
284                                          /* process header */
285          gotview = 0;
286 <        fputs(input[nfiles].name, stdout);
287 <        fputs(":\n", stdout);
288 <        getheader(input[nfiles].fp, tabputs, NULL);
286 >        if (echoheader) {
287 >                fputs(input[nfiles].name, stdout);
288 >                fputs(":\n", stdout);
289 >        }
290 >        getheader(input[nfiles].fp, headline, NULL);
291          if (wrongformat < 0) {
292                  eputs(input[nfiles].name);
293                  eputs(": not a Radiance picture\n");
# Line 439 | Line 448 | advance(void)                  /* read in data for next scanline */
448                                  eputs(": read error\n");
449                                  quit(1);
450                          }
451 <                        if (fabs(colval(input[i].coef,RED)-1.0) > 1e-3 ||
452 <                                fabs(colval(input[i].coef,GRN)-1.0) > 1e-3 ||
444 <                                fabs(colval(input[i].coef,BLU)-1.0) > 1e-3)
445 <                                for (j = 0; j < xmax; j++)  /* adjust color */
446 <                                        multcolor(st[j], input[i].coef);
451 >                        for (j = 0; j < xmax; j++)      /* adjust color */
452 >                                multcolor(st[j], input[i].coef);
453                  }
454   }
455  
# Line 601 | Line 607 | l_psize(char *nm)              /* compute pixel size in steradians
607                  if (input[fn].vw.type == 0)
608                          errno = EDOM;
609                  else if (input[fn].vw.type != VT_PAR &&
610 <                                funvalue(vray[6], 1, &d) > FTINY) {
610 >                                funvalue(vray[6], 1, &d) >= -FTINY) {
611                          for (i = 0; i < 3; i++)
612                                  dir0[i] = funvalue(vray[3+i], 1, &d);
613                          pix2loc(locx, &input[fn].rs, xscan+1, ymax-1-yscan);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines