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

Comparing ray/src/px/ra_xyze.c (file contents):
Revision 2.5 by gwlarson, Tue Oct 27 09:08:27 1998 UTC vs.
Revision 2.7 by schorsch, Thu Jun 5 19:29:34 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1997 Silicon Graphics, Inc. */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ SGI";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   *  Program to convert between RADIANCE RGBE and XYZE formats
6 + *  Added white-balance adjustment 10/01 (GW).
7   */
8  
9   #include  <stdio.h>
10 + #include  <string.h>
11   #include  <math.h>
12 + #include  <time.h>
13 +
14 + #include  "platform.h"
15   #include  "color.h"
16   #include  "resolu.h"
17  
16 #ifdef MSDOS
17 #include  <fcntl.h>
18 #endif
19
20 extern char  *malloc(), *strcpy();
21
18   int  rgbinp = -1;                       /* input is RGBE? */
19  
20   int  rgbout = 0;                        /* output should be RGBE? */
# Line 63 | Line 59 | int  argc;
59   char  *argv[];
60   {
61          int  i;
62 < #ifdef MSDOS
63 <        extern int  _fmode;
64 <        _fmode = O_BINARY;
69 <        setmode(fileno(stdin), O_BINARY);
70 <        setmode(fileno(stdout), O_BINARY);
71 < #endif
62 >        SET_DEFAULT_BINARY();
63 >        SET_FILE_BINARY(stdin);
64 >        SET_FILE_BINARY(stdout);
65          progname = argv[0];
66  
67          for (i = 1; i < argc; i++)
# Line 159 | Line 152 | convert()                              /* convert to XYZE or RGBE picture */
152                                                  /* compute transform */
153          if (rgbout) {
154                  if (rgbinp) {                   /* RGBE -> RGBE */
155 <                        comprgb2rgbmat(xfm, inprims, outprims);
155 >                        comprgb2rgbWBmat(xfm, inprims, outprims);
156                  } else {                        /* XYZE -> RGBE */
157 <                        compxyz2rgbmat(xfm, outprims);
157 >                        compxyz2rgbWBmat(xfm, outprims);
158                          ourexp *= WHTEFFICACY;
159                  }
160          } else {
161                  if (rgbinp) {                   /* RGBE -> XYZE */
162 <                        comprgb2xyzmat(xfm, inprims);
162 >                        comprgb2xyzWBmat(xfm, inprims);
163                          ourexp /= WHTEFFICACY;
164                  } else {                        /* XYZE -> XYZE */
165                          for (y = 0; y < 3; y++)
# Line 217 | Line 210 | convert()                              /* convert to XYZE or RGBE picture */
210                          quiterr("error writing output picture");
211          }
212                                                  /* free scanline */
213 <        free((char *)scanin);
213 >        free((void *)scanin);
214          if (scanout != NULL)
215 <                free((char *)scanout);
215 >                free((void *)scanout);
216   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines