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

Comparing ray/src/px/ra_ps.c (file contents):
Revision 2.32 by greg, Mon Jul 27 01:25:33 2020 UTC vs.
Revision 2.35 by greg, Sat Jun 7 05:09:46 2025 UTC

# Line 9 | Line 9 | static const char      RCSid[] = "$Id$";
9   #include  <ctype.h>
10  
11   #include  "platform.h"
12 #include  "paths.h"
12   #include  "rtio.h"
13   #include  "color.h"
14   #include  "resolu.h"
# Line 51 | Line 50 | int  docolor = 1;                      /* produce color image? */
50   int  bradj = 0;                         /* brightness adjustment */
51   int  ncopies = 1;                       /* number of copies */
52  
54 char  *progname;
53   int  xmax, ymax;                        /* input image dimensions */
54  
55   typedef void putprimf_t(COLR *scn, int pri);
# Line 81 | Line 79 | headline(              /* check header line */
79   {
80          char  fmt[MAXFMTLEN];
81  
82 <        if (isformat(s)) {
83 <                formatval(fmt, s);
84 <                wrongformat = strcmp(fmt, COLRFMT);
87 <        } else if (isaspect(s))
82 >        if (formatval(fmt, s))
83 >                wrongformat = strcmp(fmt, COLRFMT) && strcmp(fmt, SPECFMT);
84 >        else if (isaspect(s))
85                  pixaspect *= aspectval(s);
86 +        else if (isncomp(s))
87 +                NCSAMP = ncompval(s);
88 +        else if (iswlsplit(s))
89 +                wlsplitval(WLPART, s);
90          return(0);
91   }
92  
# Line 95 | Line 96 | main(int  argc, char  *argv[])
96          int  i;
97          double  d;
98          
99 <        progname = fixargv0(argv[0]);
99 >        fixargv0(argv[0]);              /* assigns progname */
100  
101          for (i = 1; i < argc; i++)
102                  if (argv[i][0] == '-')
# Line 473 | Line 474 | ra2ps(void)                            /* convert Radiance scanlines to 6-bit
474                  quiterr("out of memory in ra2ps");
475                                                  /* convert image */
476          for (y = ymax-1; y >= 0; y--) {
477 <                if (freadcolrs(scanin, xmax, stdin) < 0)
477 >                if (fread2colrs(scanin, xmax, stdin, NCSAMP, WLPART) < 0)
478                          quiterr("error reading Radiance picture");
479 <                if (putprim == Cputprim || devgam != 1.) {
479 >                if ((putprim == Cputprim) | (devgam != 1.)) {
480                          if (bradj)                      /* adjust exposure */
481                                  shiftcolrs(scanin, xmax, bradj);
482                          colrs_gambs(scanin, xmax);      /* gamma compression */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines