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

Comparing ray/src/px/ra_avs.c (file contents):
Revision 2.5 by greg, Wed Oct 27 09:37:37 1993 UTC vs.
Revision 2.10 by schorsch, Thu Jun 5 19:29:34 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1993 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   *  Convert Radiance file to/from AVS file.
6   */
7  
8   #include  <stdio.h>
9   #include  <math.h>
10 < #ifdef MSDOS
11 < #include  <fcntl.h>
12 < #endif
10 > #include  <time.h>
11 >
12 > #include  "platform.h"
13   #include  "color.h"
14   #include  "resolu.h"
15  
19 extern char  *malloc();
20
16   double  gamcor = 2.2;                   /* gamma correction */
17  
18   int  bradj = 0;                         /* brightness adjustment */
# Line 65 | Line 60 | char  *argv[];
60                  exit(1);
61          }
62          if (i == argc-2 && freopen(argv[i+1], "w", stdout) == NULL) {
63 <                fprintf(stderr, "can't open output \"%s\"\n",
63 >                fprintf(stderr, "%s: can't open output \"%s\"\n",
64                                  progname, argv[i+1]);
65                  exit(1);
66          }
67 < #ifdef MSDOS
68 <        setmode(fileno(stdin), O_BINARY);
74 <        setmode(fileno(stdout), O_BINARY);
75 < #endif
67 >        SET_FILE_BINARY(stdin);
68 >        SET_FILE_BINARY(stdout);
69          setcolrgam(gamcor);             /* set up gamma correction */
70          if (reverse) {
71                                          /* get their image resolution */
72                  xmax = getint(4, stdin);
73                  ymax = getint(4, stdin);
74 +                if (feof(stdin))
75 +                        quiterr("empty input file");
76                                          /* put our header */
77 +                newheader("RADIANCE", stdout);
78                  printargs(i, argv, stdout);
79                  fputformat(COLRFMT, stdout);
80                  putchar('\n');
# Line 143 | Line 139 | avs2ra()               /* convert 24-bit scanlines to Radiance pict
139                          quiterr("error writing Radiance picture");
140          }
141                                                  /* free scanline */
142 <        free((char *)scanout);
142 >        free((void *)scanout);
143   }
144  
145  
# Line 173 | Line 169 | ra2avs()               /* convert Radiance scanlines to 24-bit */
169                          quiterr("error writing AVS file");
170          }
171                                                  /* free scanline */
172 <        free((char *)scanin);
172 >        free((void *)scanin);
173   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines