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.22 by greg, Sun Nov 14 16:57:18 2004 UTC vs.
Revision 3.30 by greg, Mon Nov 11 21:19:41 2019 UTC

# Line 8 | Line 8 | static const char      RCSid[] = "$Id$";
8  
9   #include "platform.h"
10   #include "paths.h"
11 < #include "rtprocess.h"
11 > #include "paths.h"
12   #include "pcond.h"
13  
14  
# Line 60 | Line 60 | main(
60   {
61          static RGBPRIMS outprimS;
62          int     i;
63 < #define bool(flg)               switch (argv[i][2]) { \
63 > #define check_bool(flg)         switch (argv[i][2]) { \
64                                  case '\0': what2do ^= flg; break; \
65                                  case 'y': case 'Y': case 't': case 'T': \
66                                  case '+': case '1': what2do |= flg; break; \
# Line 73 | Line 73 | main(
73          for (i = 1; i < argc && argv[i][0] == '-'; i++)
74                  switch (argv[i][1]) {
75                  case 'h':
76 <                        bool(DO_HUMAN);
76 >                        check_bool(DO_HUMAN);
77                          break;
78                  case 'a':
79 <                        bool(DO_ACUITY);
79 >                        check_bool(DO_ACUITY);
80                          break;
81                  case 'v':
82 <                        bool(DO_VEIL);
82 >                        check_bool(DO_VEIL);
83                          break;
84                  case 's':
85 <                        bool(DO_HSENS);
85 >                        check_bool(DO_HSENS);
86                          break;
87                  case 'c':
88 <                        bool(DO_COLOR);
88 >                        check_bool(DO_COLOR);
89                          break;
90                  case 'w':
91 <                        bool(DO_CWEIGHT);
91 >                        check_bool(DO_CWEIGHT);
92                          break;
93                  case 'i':
94                          if (i+1 >= argc) goto userr;
# Line 97 | Line 97 | main(
97                          else what2do &= ~DO_FIXHIST;
98                          break;
99                  case 'I':
100 <                        bool(DO_PREHIST);
100 >                        check_bool(DO_PREHIST);
101                          break;
102                  case 'l':
103 <                        bool(DO_LINEAR);
103 >                        check_bool(DO_LINEAR);
104                          break;
105                  case 'p':
106                          if (i+8 >= argc) goto userr;
# Line 195 | Line 195 | userr:
195                          progname);
196          exit(1);
197          return 1; /* pro forma return */
198 < #undef bool
198 > #undef check_bool
199   }
200  
201  
202 < extern void
202 > void
203   syserror(                               /* report system error and exit */
204          char    *s
205   )
# Line 217 | Line 217 | headline(                              /* process header line */
217   )
218   {
219          static RGBPRIMS inprimS;
220 <        char    fmt[32];
220 >        char    fmt[MAXFMTLEN];
221  
222          if (formatval(fmt, s)) {        /* check if format string */
223                  if (!strcmp(fmt,COLRFMT)) lumf = rgblum;
# Line 225 | Line 225 | headline(                              /* process header line */
225                  else lumf = NULL;
226                  return(0);              /* don't echo */
227          }
228 <        if (isprims(s)) {               /* get input primaries */
229 <                primsval(inprimS, s);
230 <                inprims= inprimS;
228 >                                        /* get input primaries */
229 >        if (isprims(s) && primsval(inprimS, s)) {
230 >                inprims = inprimS;
231                  return(0);              /* don't echo */
232          }
233          if (isexpos(s)) {               /* picture exposure */
# Line 261 | Line 261 | getahead(void)                 /* load picture header */
261                  exit(1);
262          }
263          if (!gotview || ourview.type == VT_PAR ||
264 <                        ourview.horiz <= 3. | ourview.vert <= 3.) {
264 >                        (ourview.horiz <= 5.) | (ourview.vert <= 5.)) {
265                  ourview = stdview;
266                  ourview.type = VT_PER;
267                  if (pixaspect*inpres.yr < inpres.xr) {
# Line 344 | Line 344 | getfovimg(void)                        /* 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 364 | Line 365 | check2do(void)         /* check histogram to see what isn't w
365   {
366          double  sum;
367          double  b, l;
368 <        register int    i;
368 >        int     i;
369  
370                                          /* check for within display range */
371          if (bwmax - bwmin <= Bldmax - Bldmin)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines