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.32 by greg, Fri Oct 27 16:35:02 2023 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 "pcond.h"
12  
13  
14   #define LDMAX           100             /* default max. display luminance */
15 < #define LDDYN           32              /* default dynamic range */
15 > #define LDDYN           100             /* default dynamic range */
16  
17   int     what2do = 0;                    /* desired adjustments */
18  
# Line 60 | Line 59 | main(
59   {
60          static RGBPRIMS outprimS;
61          int     i;
62 < #define bool(flg)               switch (argv[i][2]) { \
62 > #define check_bool(flg)         switch (argv[i][2]) { \
63                                  case '\0': what2do ^= flg; break; \
64                                  case 'y': case 'Y': case 't': case 'T': \
65                                  case '+': case '1': what2do |= flg; break; \
# Line 73 | Line 72 | main(
72          for (i = 1; i < argc && argv[i][0] == '-'; i++)
73                  switch (argv[i][1]) {
74                  case 'h':
75 <                        bool(DO_HUMAN);
75 >                        check_bool(DO_HUMAN);
76                          break;
77                  case 'a':
78 <                        bool(DO_ACUITY);
78 >                        check_bool(DO_ACUITY);
79                          break;
80                  case 'v':
81 <                        bool(DO_VEIL);
81 >                        check_bool(DO_VEIL);
82                          break;
83                  case 's':
84 <                        bool(DO_HSENS);
84 >                        check_bool(DO_HSENS);
85                          break;
86                  case 'c':
87 <                        bool(DO_COLOR);
87 >                        check_bool(DO_COLOR);
88                          break;
89                  case 'w':
90 <                        bool(DO_CWEIGHT);
90 >                        check_bool(DO_CWEIGHT);
91                          break;
92                  case 'i':
93                          if (i+1 >= argc) goto userr;
# Line 97 | Line 96 | main(
96                          else what2do &= ~DO_FIXHIST;
97                          break;
98                  case 'I':
99 <                        bool(DO_PREHIST);
99 >                        check_bool(DO_PREHIST);
100                          break;
101                  case 'l':
102 <                        bool(DO_LINEAR);
102 >                        check_bool(DO_LINEAR);
103                          break;
104                  case 'p':
105                          if (i+8 >= argc) goto userr;
# Line 195 | Line 194 | userr:
194                          progname);
195          exit(1);
196          return 1; /* pro forma return */
197 < #undef bool
197 > #undef check_bool
198   }
199  
200  
201 < extern void
201 > void
202   syserror(                               /* report system error and exit */
203          char    *s
204   )
# Line 217 | Line 216 | headline(                              /* process header line */
216   )
217   {
218          static RGBPRIMS inprimS;
219 <        char    fmt[32];
219 >        char    fmt[MAXFMTLEN];
220  
221          if (formatval(fmt, s)) {        /* check if format string */
222                  if (!strcmp(fmt,COLRFMT)) lumf = rgblum;
# Line 225 | Line 224 | headline(                              /* process header line */
224                  else lumf = NULL;
225                  return(0);              /* don't echo */
226          }
227 <        if (isprims(s)) {               /* get input primaries */
228 <                primsval(inprimS, s);
229 <                inprims= inprimS;
227 >                                        /* get input primaries */
228 >        if (isprims(s) && primsval(inprimS, s)) {
229 >                inprims = inprimS;
230                  return(0);              /* don't echo */
231          }
232          if (isexpos(s)) {               /* picture exposure */
# Line 261 | Line 260 | getahead(void)                 /* load picture header */
260                  exit(1);
261          }
262          if (!gotview || ourview.type == VT_PAR ||
263 <                        ourview.horiz <= 3. | ourview.vert <= 3.) {
263 >                        (ourview.horiz <= 5.) | (ourview.vert <= 5.)) {
264                  ourview = stdview;
265                  ourview.type = VT_PER;
266                  if (pixaspect*inpres.yr < inpres.xr) {
# Line 344 | Line 343 | getfovimg(void)                        /* load foveal sampled image */
343          sprintf(combuf, "pfilt -1 -b -pa 0 -x %d -y %d \"%s\"", fvxr, fvyr, infn);
344          if ((fp = popen(combuf, "r")) == NULL)
345                  syserror("popen");
346 +        SET_FILE_BINARY(fp);
347          getheader(fp, NULL, NULL);      /* skip header */
348          if (fgetresolu(&x, &y, fp) < 0 || (x != fvxr) | (y != fvyr))
349                  goto readerr;
# Line 364 | Line 364 | check2do(void)         /* check histogram to see what isn't w
364   {
365          double  sum;
366          double  b, l;
367 <        register int    i;
367 >        int     i;
368  
369                                          /* check for within display range */
370          if (bwmax - bwmin <= Bldmax - Bldmin)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines