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.20 by schorsch, Fri Jan 2 12:47:01 2004 UTC vs.
Revision 3.25 by greg, Mon Oct 20 13:42:13 2014 UTC

# Line 45 | Line 45 | double bwavg;                          /* mean brightness */
45   double  scalef = 0.;                    /* linear scaling factor */
46  
47   static gethfunc headline;
48 + static void getahead(void);
49 + static void mapimage(void);
50 + static void getfovimg(void);
51 + static void check2do(void);
52  
53  
54 < main(argc, argv)
55 < int     argc;
56 < char    *argv[];
54 >
55 > int
56 > main(
57 >        int     argc,
58 >        char    *argv[]
59 > )
60   {
61          static RGBPRIMS outprimS;
62          int     i;
# Line 187 | Line 194 | userr:
194          fprintf(stderr, "Usage: %s [-{h|a|v|s|c|l|w}[+-]][-I|-i ffrac][-e ev][-p xr yr xg yg xb yb xw yw|-f mbf.cal|-m rgb.cwp][-u Ldmax][-d Lddyn][-x mapfile] inpic [outpic]\n",
195                          progname);
196          exit(1);
197 +        return 1; /* pro forma return */
198   #undef bool
199   }
200  
201  
202 < syserror(s)                             /* report system error and exit */
203 < char    *s;
202 > extern void
203 > syserror(                               /* report system error and exit */
204 >        char    *s
205 > )
206   {
207          fprintf(stderr, "%s: ", progname);
208          perror(s);
# Line 232 | Line 242 | headline(                              /* process header line */
242   }
243  
244  
245 < getahead()                      /* load picture header */
245 > static void
246 > getahead(void)                  /* load picture header */
247   {
248          char    *err;
249  
# Line 249 | Line 260 | getahead()                     /* load picture header */
260                                  progname);
261                  exit(1);
262          }
263 <        if (!gotview || ourview.type == VT_PAR) {
263 >        if (!gotview || ourview.type == VT_PAR ||
264 >                        (ourview.horiz <= 5.) | (ourview.vert <= 5.)) {
265                  ourview = stdview;
266                  ourview.type = VT_PER;
267                  if (pixaspect*inpres.yr < inpres.xr) {
# Line 270 | Line 282 | getahead()                     /* load picture header */
282   }
283  
284  
285 < mapimage()                              /* map picture and send to stdout */
285 > static void
286 > mapimage(void)                          /* map picture and send to stdout */
287   {
288          COLOR   *scan;
289  
# Line 310 | Line 323 | mapimage()                             /* map picture and send to stdout */
323   }
324  
325  
326 < getfovimg()                     /* load foveal sampled image */
326 > static void
327 > getfovimg(void)                 /* load foveal sampled image */
328   {
329          char    combuf[PATH_MAX];
330          FILE    *fp;
# Line 330 | Line 344 | getfovimg()                    /* load foveal sampled image */
344          sprintf(combuf, "pfilt -1 -b -pa 0 -x %d -y %d \"%s\"", fvxr, fvyr, infn);
345          if ((fp = popen(combuf, "r")) == NULL)
346                  syserror("popen");
347 +        SET_FILE_BINARY(fp);
348          getheader(fp, NULL, NULL);      /* skip header */
349          if (fgetresolu(&x, &y, fp) < 0 || (x != fvxr) | (y != fvyr))
350                  goto readerr;
# Line 345 | Line 360 | readerr:
360   }
361  
362  
363 < check2do()              /* check histogram to see what isn't worth doing */
363 > static void
364 > check2do(void)          /* check histogram to see what isn't worth doing */
365   {
366          double  sum;
367          double  b, l;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines