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.30 by greg, Mon Nov 11 21:19:41 2019 UTC vs.
Revision 3.35 by greg, Sat Jun 7 05:09:46 2025 UTC

# Line 7 | Line 7 | static const char      RCSid[] = "$Id$";
7   */
8  
9   #include "platform.h"
10 #include "paths.h"
11 #include "paths.h"
10   #include "pcond.h"
11  
12  
13   #define LDMAX           100             /* default max. display luminance */
14 < #define LDDYN           32              /* default dynamic range */
14 > #define LDDYN           100             /* default dynamic range */
15  
16   int     what2do = 0;                    /* desired adjustments */
17  
# Line 21 | Line 19 | double ldmax = LDMAX;                  /* maximum output luminance */
19   double  lddyn = LDDYN;                  /* display dynamic range */
20   double  Bldmin, Bldmax;                 /* Bl(ldmax/lddyn) and Bl(ldmax) */
21  
24 char    *progname;                      /* global argv[0] */
25
22   char    *infn;                          /* input file name */
23   FILE    *infp;                          /* input stream */
24   FILE    *mapfp = NULL;                  /* tone-mapping function stream */
# Line 68 | Line 64 | main(
64                                  case '-': case '0': what2do &= ~(flg); break; \
65                                  default: goto userr; }
66  
67 <        progname = argv[0];
67 >        fixargv0(argv[0]);              /* sets global progname */
68  
69          for (i = 1; i < argc && argv[i][0] == '-'; i++)
70                  switch (argv[i][1]) {
# Line 220 | Line 216 | headline(                              /* process header line */
216          char    fmt[MAXFMTLEN];
217  
218          if (formatval(fmt, s)) {        /* check if format string */
219 <                if (!strcmp(fmt,COLRFMT)) lumf = rgblum;
220 <                else if (!strcmp(fmt,CIEFMT)) lumf = cielum;
221 <                else lumf = NULL;
219 >                if (!strcmp(fmt,COLRFMT) || !strcmp(fmt,SPECFMT))
220 >                        lumf = rgblum;
221 >                else if (!strcmp(fmt,CIEFMT))
222 >                        lumf = cielum;
223 >                else
224 >                        lumf = NULL;
225                  return(0);              /* don't echo */
226          }
227 +        if (isncomp(s)) {
228 +                NCSAMP = ncompval(s);
229 +                return(0);
230 +        }
231 +        if (iswlsplit(s)) {
232 +                wlsplitval(WLPART, s);
233 +                return(0);
234 +        }
235                                          /* get input primaries */
236          if (isprims(s) && primsval(inprimS, s)) {
237                  inprims = inprimS;
# Line 349 | Line 356 | getfovimg(void)                        /* load foveal sampled image */
356          if (fgetresolu(&x, &y, fp) < 0 || (x != fvxr) | (y != fvyr))
357                  goto readerr;
358          for (y = 0; y < fvyr; y++)
359 <                if (freadscan(fovscan(y), fvxr, fp) < 0)
359 >                if (fread2scan(fovscan(y), fvxr, fp, NCSAMP, WLPART) < 0)
360                          goto readerr;
361          pclose(fp);
362          return;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines