ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/px/pcond.c
(Generate patch)

Comparing ray/src/px/pcond.c (file contents):
Revision 3.15 by schorsch, Thu Jun 5 19:29:34 2003 UTC vs.
Revision 3.20 by schorsch, Fri Jan 2 12:47:01 2004 UTC

# Line 7 | Line 7 | static const char      RCSid[] = "$Id$";
7   */
8  
9   #include "platform.h"
10 + #include "paths.h"
11 + #include "rtprocess.h"
12   #include "pcond.h"
13  
14  
# Line 42 | Line 44 | double bwavg;                          /* mean brightness */
44  
45   double  scalef = 0.;                    /* linear scaling factor */
46  
47 + static gethfunc headline;
48  
49 +
50   main(argc, argv)
51   int     argc;
52   char    *argv[];
# Line 106 | Line 110 | char   *argv[];
110                  case 'e':
111                          if (i+1 >= argc) goto userr;
112                          scalef = atof(argv[++i]);
113 <                        if (argv[i][0] == '+' | argv[i][0] == '-')
113 >                        if ((argv[i][0] == '+') | (argv[i][0] == '-'))
114                                  scalef = pow(2.0, scalef);
115                          what2do |= DO_LINEAR;
116                          break;
# Line 151 | Line 155 | char   *argv[];
155                                  progname);
156                  exit(1);
157          }
158 <        if (outprims == stdprims & inprims != stdprims)
158 >        if ((outprims == stdprims) & (inprims != stdprims))
159                  outprims = inprims;
160          Bldmin = Bl(ldmax/lddyn);
161          Bldmax = Bl(ldmax);
# Line 167 | Line 171 | char   *argv[];
171          SET_FILE_BINARY(stdout);
172          getahead();                     /* load input header */
173          printargs(argc, argv, stdout);  /* add to output header */
174 <        if (mbcalfile == NULL & outprims != stdprims)
174 >        if ((mbcalfile == NULL) & (outprims != stdprims))
175                  fputprims(outprims, stdout);
176          if ((what2do & (DO_PREHIST|DO_VEIL|DO_ACUITY)) != DO_PREHIST)
177                  getfovimg();            /* get foveal sample image? */
# Line 196 | Line 200 | char   *s;
200   }
201  
202  
203 < headline(s)                             /* process header line */
204 < char    *s;
203 > static int
204 > headline(                               /* process header line */
205 >        char    *s,
206 >        void    *p
207 > )
208   {
209          static RGBPRIMS inprimS;
210          char    fmt[32];
# Line 243 | Line 250 | getahead()                     /* load picture header */
250                  exit(1);
251          }
252          if (!gotview || ourview.type == VT_PAR) {
253 <                copystruct(&ourview, &stdview);
253 >                ourview = stdview;
254                  ourview.type = VT_PER;
255                  if (pixaspect*inpres.yr < inpres.xr) {
256                          ourview.horiz = 40.0;
# Line 305 | Line 312 | mapimage()                             /* map picture and send to stdout */
312  
313   getfovimg()                     /* load foveal sampled image */
314   {
315 <        extern FILE     *popen();
309 <        char    combuf[128];
315 >        char    combuf[PATH_MAX];
316          FILE    *fp;
317          int     x, y;
318                                                  /* compute image size */
# Line 321 | Line 327 | getfovimg()                    /* load foveal sampled image */
327          }
328          if ((fovimg = (COLOR *)malloc(fvxr*fvyr*sizeof(COLOR))) == NULL)
329                  syserror("malloc");
330 <        sprintf(combuf, "pfilt -1 -b -pa 0 -x %d -y %d %s", fvxr, fvyr, infn);
330 >        sprintf(combuf, "pfilt -1 -b -pa 0 -x %d -y %d \"%s\"", fvxr, fvyr, infn);
331          if ((fp = popen(combuf, "r")) == NULL)
332                  syserror("popen");
333          getheader(fp, NULL, NULL);      /* skip header */
334 <        if (fgetresolu(&x, &y, fp) < 0 || x != fvxr | y != fvyr)
334 >        if (fgetresolu(&x, &y, fp) < 0 || (x != fvxr) | (y != fvyr))
335                  goto readerr;
336          for (y = 0; y < fvyr; y++)
337                  if (freadscan(fovscan(y), fvxr, fp) < 0)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines