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

Comparing ray/src/px/ra_pict.c (file contents):
Revision 2.5 by greg, Fri Oct 30 09:14:04 1992 UTC vs.
Revision 2.8 by greg, Sat Feb 22 02:07:27 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   /*              Convert an Radiance image to APPLE pict format.
5   *
6   *                      Orginally Iris to PICT by       Paul Haeberli - 1990
# Line 20 | Line 17 | static char SCCSid[] = "$SunId$ LBL";
17   */
18  
19   #include <stdio.h>
20 + #include <math.h>
21   #ifdef MSDOS
22   #include <fcntl.h>
23   #endif
24 + #include  <time.h>
25  
26   #include "pict.h"
27   #include "color.h"
28   #include "resolu.h"
29  
31 extern char     *malloc();
32
30   int     outbytes;                   /* This had better be 32 bits! */
31   char    *progname;
32   int     verbose = 0;
33 < float   gamma = 2.0;
33 > float   gamcor = 2.0;
34   int     bradj = 0;
35  
36          /* First some utility routines */
# Line 111 | Line 108 | char **argv;
108      for (i = 1; i < argc ; i++)
109          if (argv[i][0] ==  '-')
110              switch (argv[i][1]) {
111 <                case 'g':       gamma = atof(argv[++i]);
111 >                case 'g':       gamcor = atof(argv[++i]);
112                                  break;
113  
114                  case 'e':       if (argv[i+1][0] != '+' && argv[i+1][0] != '-')
# Line 157 | Line 154 | outofparse:
154   #ifdef DEBUG
155          fprintf(stderr, "Input file: %s\n", i <= argc - 1 ? argv[i] : "stdin");
156          fprintf(stderr, "Outut file: %s\n", i <= argc - 2 ? argv[i+1] : "stdout" );
157 <        fprintf(stderr, "Gamma: %f\n", gamma);
157 >        fprintf(stderr, "Gamma: %f\n", gamcor);
158          fprintf(stderr, "Brightness adjust: %d\n", bradj);
159          fprintf(stderr, "Verbose: %s\n", verbose ? "on" : "off");
160   #endif
# Line 172 | Line 169 | outofparse:
169  
170              /* Set the gamma correction */
171  
172 <    setcolrgam(gamma);
172 >    setcolrgam(gamcor);
173  
174      for(i=0; i<HEADER_SIZE; i++)
175          putbyte(0);
# Line 195 | Line 192 | outofparse:
192  
193      if (verbose)
194          fprintf(stderr, "%s: The picture is %d by %d, with a gamma of %f\n",
195 <            progname, xsize, ysize, gamma);
195 >            progname, xsize, ysize, gamcor);
196  
197  
198      putpict(xsize, ysize);      /* Here is where all the work is done */
# Line 223 | Line 220 | int ysize;
220      int     nbytes, rowbytes;
221      char    *cbuf, *pbuf;
222  
223 <    cbuf = malloc(4 * xsize);
223 >    cbuf = (char *)malloc(4 * xsize);
224  
225      if (cbuf == NULL) {
226          fprintf(stderr, "%s: not enough memory\n", progname);
227          exit(1);
228          }
229  
230 <    pbuf = malloc(4 * xsize);
230 >    pbuf = (char *)malloc(4 * xsize);
231  
232      if (pbuf == NULL) {
233          fprintf(stderr, "%s: not enough memory\n", progname);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines