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.9 by greg, Thu Sep 23 18:00:54 2004 UTC vs.
Revision 2.14 by greg, Sun Apr 5 19:10:51 2020 UTC

# Line 5 | Line 5 | static const char RCSid[] = "$Id$";
5   *  program to convert between RADIANCE and Windows BMP file
6   */
7  
8 #include  <stdio.h>
8   #include  <math.h>
10 #include  <string.h>
9  
10 + #include  "rtio.h"
11   #include  "platform.h"
12   #include  "color.h"
13   #include  "tonemap.h"
# Line 160 | Line 159 | main(int argc, char *argv[])
159                  if (rgbp == NULL) {
160                          hdr = BMPmappedHeader(scanlen(&rs),
161                                                  numscans(&rs), 0, 256);
162 +                        /*
163                          if (outfile != NULL)
164                                  hdr->compr = BI_RLE8;
165 +                        */
166                  } else
167                          hdr = BMPtruecolorHeader(scanlen(&rs),
168                                                  numscans(&rs), 0);
# Line 209 | Line 210 | quiterr(const char *err)
210   static int
211   headline(char *s, void *p)
212   {
213 <        char    fmt[32];
213 >        char    fmt[MAXFMTLEN];
214  
215          if (formatval(fmt, s)) {        /* check if format string */
216                  if (!strcmp(fmt,COLRFMT))
# Line 248 | Line 249 | rad2bmp(FILE *rfp, BMPWriter *bwr, int inv, RGBPRIMP m
249          usexfm = (monpri != NULL ? rgbinp != monpri :
250                          rgbinp != TM_XYZPRIM && rgbinp != stdprims);
251          if (usexfm) {
252 <                double  expcomp = pow(2.0, (double)bradj);
252 >                RGBPRIMP        destpri = monpri != NULL ? monpri : stdprims;
253 >                double          expcomp = pow(2.0, (double)bradj);
254                  if (rgbinp == TM_XYZPRIM)
255 <                        compxyz2rgbWBmat(xfm, monpri);
255 >                        compxyz2rgbWBmat(xfm, destpri);
256                  else
257 <                        comprgb2rgbWBmat(xfm, rgbinp, monpri);
257 >                        comprgb2rgbWBmat(xfm, rgbinp, destpri);
258                  for (y = 0; y < 3; y++)
259                          for (x = 0; x < 3; x++)
260                                  xfm[y][x] *= expcomp;
# Line 350 | Line 352 | tmap2bmp(char *fnin, char *fnout, char *expec, RGBPRIM
352          BMPWriter       *wtr;
353          FILE            *fp;
354          int             xr, yr;
355 <        BYTE            *pa;
355 >        uby8            *pa;
356          int             i;
357                                          /* check tone-mapping spec */
358          i = strlen(expec);
# Line 395 | Line 397 | tmap2bmp(char *fnin, char *fnout, char *expec, RGBPRIM
397                  quiterr("cannot allocate writer structure");
398                                          /* write to BMP file */
399          while (wtr->yscan < yr) {
400 <                BYTE    *scn = pa + xr*((tmflags & TM_F_BW) ? 1 : 3)*
400 >                uby8    *scn = pa + xr*((tmflags & TM_F_BW) ? 1 : 3)*
401                                                  (yr-1 - wtr->yscan);
402                  if (tmflags & TM_F_BW)
403                          memcpy((void *)wtr->scanline, (void *)scn, xr);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines