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

Comparing ray/src/px/ra_pr24.c (file contents):
Revision 2.4 by greg, Wed Sep 23 09:17:53 1992 UTC vs.
Revision 2.9 by greg, Sat Feb 22 02:07:28 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1992 Regents of the University of California */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ LBL";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   *  program to convert between RADIANCE and 24-bit rasterfiles.
6   */
# Line 14 | Line 11 | static char SCCSid[] = "$SunId$ LBL";
11   #include  <fcntl.h>
12   #endif
13  
14 + #include  <time.h>
15 +
16 + #include  <math.h>
17 +
18   #include  "rasterfile.h"
19  
20   #include  "color.h"
21  
22   #include  "resolu.h"
23  
24 < extern double  pow();
24 > double  gamcor = 2.2;                   /* gamma correction */
25  
25 extern char  *malloc();
26
27 double  gamma = 2.2;                    /* gamma correction */
28
26   int  bradj = 0;                         /* brightness adjustment */
27  
28   char  *progname;
# Line 53 | Line 50 | char  *argv[];
50                  if (argv[i][0] == '-')
51                          switch (argv[i][1]) {
52                          case 'g':
53 <                                gamma = atof(argv[++i]);
53 >                                gamcor = atof(argv[++i]);
54                                  break;
55                          case 'e':
56                                  if (argv[i+1][0] != '+' && argv[i+1][0] != '-')
# Line 80 | Line 77 | char  *argv[];
77                  exit(1);
78          }
79          if (i == argc-2 && freopen(argv[i+1], "w", stdout) == NULL) {
80 <                fprintf(stderr, "can't open output \"%s\"\n",
80 >                fprintf(stderr, "%s: can't open output \"%s\"\n",
81                                  progname, argv[i+1]);
82                  exit(1);
83          }
84 <        setcolrgam(gamma);
84 >        setcolrgam(gamcor);
85          if (reverse) {
86                                          /* get header */
87                  if (fread((char *)&head, sizeof(head), 1, stdin) != 1)
# Line 99 | Line 96 | char  *argv[];
96                                  || head.ras_depth != 24)
97                          quiterr("incompatible format");
98                                          /* put header */
99 +                newheader("RADIANCE", stdout);
100                  printargs(i, argv, stdout);
101                  fputformat(COLRFMT, stdout);
102                  putchar('\n');
# Line 176 | Line 174 | int    pad;
174                          quiterr("error writing Radiance picture");
175          }
176                                                  /* free scanline */
177 <        free((char *)scanout);
177 >        free((void *)scanout);
178   }
179  
180  
# Line 222 | Line 220 | int    pad;
220                          quiterr("error writing rasterfile");
221          }
222                                                  /* free scanline */
223 <        free((char *)scanin);
223 >        free((void *)scanin);
224   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines