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.8 by schorsch, Fri Jan 2 12:47:01 2004 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 33 | Line 29 | int  doflat = -1;                      /* produce flat file? */
29  
30   char  *progname;
31  
32 + static gethfunc headline;
33  
34 < int
35 < headline(s)                             /* process header line */
36 < char    *s;
34 >
35 > static int
36 > headline(                               /* process header line */
37 >        char    *s,
38 >        void    *p
39 > )
40   {
41          char    fmt[32];
42  
# Line 63 | Line 63 | int  argc;
63   char  *argv[];
64   {
65          int  i;
66 < #ifdef MSDOS
67 <        extern int  _fmode;
68 <        _fmode = O_BINARY;
69 <        setmode(fileno(stdin), O_BINARY);
70 <        setmode(fileno(stdout), O_BINARY);
71 < #endif
66 >        SET_DEFAULT_BINARY();
67 >        SET_FILE_BINARY(stdin);
68 >        SET_FILE_BINARY(stdout);
69          progname = argv[0];
70  
71          for (i = 1; i < argc; i++)
# Line 159 | Line 156 | convert()                              /* convert to XYZE or RGBE picture */
156                                                  /* compute transform */
157          if (rgbout) {
158                  if (rgbinp) {                   /* RGBE -> RGBE */
159 <                        comprgb2rgbmat(xfm, inprims, outprims);
159 >                        comprgb2rgbWBmat(xfm, inprims, outprims);
160                  } else {                        /* XYZE -> RGBE */
161 <                        compxyz2rgbmat(xfm, outprims);
161 >                        compxyz2rgbWBmat(xfm, outprims);
162                          ourexp *= WHTEFFICACY;
163                  }
164          } else {
165                  if (rgbinp) {                   /* RGBE -> XYZE */
166 <                        comprgb2xyzmat(xfm, inprims);
166 >                        comprgb2xyzWBmat(xfm, inprims);
167                          ourexp /= WHTEFFICACY;
168                  } else {                        /* XYZE -> XYZE */
169                          for (y = 0; y < 3; y++)
# Line 217 | Line 214 | convert()                              /* convert to XYZE or RGBE picture */
214                          quiterr("error writing output picture");
215          }
216                                                  /* free scanline */
217 <        free((char *)scanin);
217 >        free((void *)scanin);
218          if (scanout != NULL)
219 <                free((char *)scanout);
219 >                free((void *)scanout);
220   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines