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

Comparing ray/src/px/ra_bmp.c (file contents):
Revision 2.14 by greg, Sun Apr 5 19:10:51 2020 UTC vs.
Revision 2.16 by greg, Fri Jun 6 19:11:21 2025 UTC

# Line 8 | Line 8 | static const char RCSid[] = "$Id$";
8   #include  <math.h>
9  
10   #include  "rtio.h"
11 + #include  "paths.h"
12   #include  "platform.h"
13   #include  "color.h"
14   #include  "tonemap.h"
# Line 18 | Line 19 | int            bradj = 0;              /* brightness adjustment */
19  
20   double          gamcor = 2.2;           /* gamma correction value */
21  
21 char            *progname;
22
22   static void quiterr(const char *err);
23   static void tmap2bmp(char *fnin, char *fnout, char *expec,
24                                  RGBPRIMP monpri, double gamval);
# Line 43 | Line 42 | main(int argc, char *argv[])
42          RESOLU          rs;
43          int             i;
44          
45 <        progname = argv[0];
45 >        fixargv0(argv[0]);              /* assigns progname */
46  
47          for (i = 1; i < argc; i++)
48                  if (argv[i][0] == '-' && argv[i][1])
# Line 219 | Line 218 | headline(char *s, void *p)
218                          rgbinp = TM_XYZPRIM;
219                          return(0);
220                  }
221 +                if (!strcmp(fmt,SPECFMT))
222 +                        return(0);
223                  return(-1);
224          }
225          if (isprims(s)) {               /* get input primaries */
# Line 226 | Line 227 | headline(char *s, void *p)
227                  rgbinp = myinprims;
228                  return(0);
229          }
230 +        if (isncomp(s)) {
231 +                NCSAMP = ncompval(s);
232 +                return(0);
233 +        }
234 +        if (iswlsplit(s)) {
235 +                wlsplitval(WLPART, s);
236 +                return(0);
237 +        }
238                                          /* should I grok colcorr also? */
239          return(0);
240   }
# Line 269 | Line 278 | rad2bmp(FILE *rfp, BMPWriter *bwr, int inv, RGBPRIMP m
278          }
279                                                  /* convert each scanline */
280          for ( ; y != yend; y += ystp) {
281 <                if (freadcolrs(scanin, bwr->hdr->width, rfp) < 0)
281 >                if (fread2colrs(scanin, bwr->hdr->width, rfp, NCSAMP, WLPART) < 0)
282                          quiterr("error reading Radiance picture");
283                  if (usexfm)
284                          for (x = bwr->hdr->width; x--; ) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines