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.47 by greg, Fri Jan 12 00:50:17 2018 UTC vs.
Revision 2.50 by greg, Fri May 4 23:56:49 2018 UTC

# Line 31 | Line 31 | struct {
31  
32   int     nfiles;                         /* number of input files */
33  
34 + VIEW    commvw;                         /* common view parameters */
35 +
36   char    ourfmt[LPICFMT+1] = PICFMT;     /* input picture format */
37  
38   char    StandardInput[] = "<stdin>";
# Line 191 | Line 193 | main(
193          init();                         /* set constants */
194                                          /* go back and get expressions */
195          for (a = 1; a < argc; a++) {
196 +                char    *fpath;
197                  if (argv[a][0] == '-')
198                          switch (argv[a][1]) {
199                          case 'x':
# Line 204 | Line 207 | main(
207                          case 'h':
208                                  continue;
209                          case 'f':
210 <                                fcompile(argv[++a]);
210 >                                fpath = getpath(argv[++a], getrlibpath(), 0);
211 >                                if (fpath == NULL) {
212 >                                        eputs(argv[0]);
213 >                                        eputs(": cannot find file '");
214 >                                        eputs(argv[a]);
215 >                                        eputs("'\n");
216 >                                        quit(1);
217 >                                }
218 >                                fcompile(fpath);
219                                  continue;
220                          case 'e':
221                                  scompile(argv[++a], NULL, 0);
# Line 212 | Line 223 | main(
223                          }
224                  break;
225          }
226 <                                                /* set/get output resolution */
216 <        if (!vardefined(vxres))
217 <                varset(vxres, ':', (double)xmax);
218 <        if (!vardefined(vyres))
219 <                varset(vyres, ':', (double)ymax);
226 >                                                /* get output resolution */
227          xres = varvalue(vxres) + .5;
228          yres = varvalue(vyres) + .5;
229          if (xres <= 0 || yres <= 0) {
# Line 226 | Line 233 | main(
233          }
234                                                  /* complete header */
235          printargs(argc, argv, stdout);
236 +        if (commvw.type) {
237 +                fputs(VIEWSTR, stdout);
238 +                fprintview(&commvw, stdout);
239 +                fputc('\n', stdout);
240 +        }
241          if (strcmp(ourfmt, PICFMT))
242                  fputformat(ourfmt, stdout);     /* print format if known */
243          putchar('\n');
# Line 304 | Line 316 | checkfile(void)                        /* ready a file */
316          }
317          if (!gotview || setview(&input[nfiles].vw) != NULL)
318                  input[nfiles].vw.type = 0;
319 +        else if (!commvw.type)
320 +                commvw = input[nfiles].vw;
321          if (!fgetsresolu(&input[nfiles].rs, input[nfiles].fp)) {
322                  eputs(input[nfiles].name);
323                  eputs(": bad picture size\n");
# Line 371 | Line 385 | init(void)                                     /* perform final setup */
385                  ourbright = xyz_bright;
386          } else
387                  varset(vwhteff, ':', WHTEFFICACY);
388 +                                                /* these may be overridden */
389 +        varset(vxres, ':', (double)xmax);
390 +        varset(vyres, ':', (double)ymax);
391   }
392  
393  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines