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 |
|
* ra_bn.c - program to convert between RADIANCE and barneyscan picture format. |
6 |
|
* |
13 |
|
#include <fcntl.h> |
14 |
|
#endif |
15 |
|
|
16 |
+ |
#include <time.h> |
17 |
+ |
|
18 |
+ |
#include <math.h> |
19 |
+ |
|
20 |
|
#include "color.h" |
21 |
|
|
22 |
|
#include "resolu.h" |
23 |
|
|
24 |
< |
extern double pow(); |
24 |
> |
double gamcor = 2.0; /* gamma correction */ |
25 |
|
|
25 |
– |
extern char *malloc(); |
26 |
– |
|
27 |
– |
double gamma = 2.0; /* gamma correction */ |
28 |
– |
|
26 |
|
int bradj = 0; /* brightness adjustment */ |
27 |
|
|
28 |
|
char *progname; |
52 |
|
if (argv[i][0] == '-') |
53 |
|
switch (argv[i][1]) { |
54 |
|
case 'g': |
55 |
< |
gamma = atof(argv[++i]); |
55 |
> |
gamcor = atof(argv[++i]); |
56 |
|
break; |
57 |
|
case 'r': |
58 |
|
reverse = !reverse; |
68 |
|
else |
69 |
|
break; |
70 |
|
/* set gamma correction */ |
71 |
< |
setcolrgam(gamma); |
71 |
> |
setcolrgam(gamcor); |
72 |
|
|
73 |
|
if (reverse) { |
74 |
|
if (i > argc-1 || i < argc-2) |
85 |
|
quiterr(errmsg); |
86 |
|
} |
87 |
|
/* put header */ |
88 |
+ |
newheader("RADIANCE", stdout); |
89 |
|
printargs(i, argv, rafp); |
90 |
|
fputformat(COLRFMT, rafp); |
91 |
|
putc('\n', rafp); |
207 |
|
if (ferror(bnfp[0]) || ferror(bnfp[1]) || ferror(bnfp[2])) |
208 |
|
quiterr("error writing Barney files"); |
209 |
|
} |
210 |
< |
free((char *)inl); |
210 |
> |
free((void *)inl); |
211 |
|
} |
212 |
|
|
213 |
|
|
233 |
|
if (fwritecolrs(outline, xmax, rafp) < 0) |
234 |
|
quiterr("error writing RADIANCE file"); |
235 |
|
} |
236 |
< |
free((char *)outline); |
236 |
> |
free((void *)outline); |
237 |
|
} |