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.38 by greg, Wed May 25 04:44:25 2005 UTC vs.
Revision 2.39 by greg, Fri Sep 8 21:38:25 2006 UTC

# 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");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines