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 */ |
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'); |
139 |
|
quiterr("error writing Radiance picture"); |
140 |
|
} |
141 |
|
/* free scanline */ |
142 |
< |
free((char *)scanout); |
142 |
> |
free((void *)scanout); |
143 |
|
} |
144 |
|
|
145 |
|
|
169 |
|
quiterr("error writing AVS file"); |
170 |
|
} |
171 |
|
/* free scanline */ |
172 |
< |
free((char *)scanin); |
172 |
> |
free((void *)scanin); |
173 |
|
} |