8 |
|
*/ |
9 |
|
|
10 |
|
#include <stdio.h> |
11 |
+ |
#include <string.h> |
12 |
|
#include <time.h> |
13 |
|
#include <math.h> |
14 |
|
|
17 |
|
#include "resolu.h" |
18 |
|
|
19 |
|
double gamcor = 2.0; /* gamma correction */ |
19 |
– |
|
20 |
|
int bradj = 0; /* brightness adjustment */ |
21 |
– |
|
21 |
|
char *progname; |
23 |
– |
|
22 |
|
char errmsg[128]; |
25 |
– |
|
23 |
|
FILE *rafp, *bnfp[3]; |
27 |
– |
|
24 |
|
int xmax, ymax; |
25 |
|
|
26 |
+ |
static void quiterr(char *err); |
27 |
+ |
static int openbarney(char *fname, char *mode); |
28 |
+ |
static int getint(FILE *fp); |
29 |
+ |
static void putint(int val, FILE *fp); |
30 |
+ |
static void ra2bn(void); |
31 |
+ |
static void bn2ra(void); |
32 |
|
|
33 |
< |
main(argc, argv) |
34 |
< |
int argc; |
35 |
< |
char *argv[]; |
33 |
> |
|
34 |
> |
int |
35 |
> |
main( |
36 |
> |
int argc, |
37 |
> |
char *argv[] |
38 |
> |
) |
39 |
|
{ |
40 |
|
int reverse = 0; |
41 |
|
int i; |
119 |
|
} |
120 |
|
|
121 |
|
|
122 |
< |
quiterr(err) /* print message and exit */ |
123 |
< |
char *err; |
122 |
> |
static void |
123 |
> |
quiterr( /* print message and exit */ |
124 |
> |
char *err |
125 |
> |
) |
126 |
|
{ |
127 |
|
if (err != NULL) { |
128 |
|
fprintf(stderr, "%s: %s\n", progname, err); |
132 |
|
} |
133 |
|
|
134 |
|
|
135 |
< |
openbarney(fname, mode) /* open barneyscan files */ |
136 |
< |
char *fname; |
137 |
< |
char *mode; |
135 |
> |
static int |
136 |
> |
openbarney( /* open barneyscan files */ |
137 |
> |
char *fname, |
138 |
> |
char *mode |
139 |
> |
) |
140 |
|
{ |
141 |
|
static char suffix[3][4] = {"red", "grn", "blu"}; |
142 |
|
int i; |
163 |
|
} |
164 |
|
|
165 |
|
|
166 |
< |
int |
167 |
< |
getint(fp) /* get short int from barneyscan file */ |
168 |
< |
register FILE *fp; |
166 |
> |
static int |
167 |
> |
getint( /* get short int from barneyscan file */ |
168 |
> |
register FILE *fp |
169 |
> |
) |
170 |
|
{ |
171 |
|
register short val; |
172 |
|
|
177 |
|
} |
178 |
|
|
179 |
|
|
180 |
< |
putint(val, fp) /* put short int to barneyscan file */ |
181 |
< |
register int val; |
182 |
< |
register FILE *fp; |
180 |
> |
static void |
181 |
> |
putint( /* put short int to barneyscan file */ |
182 |
> |
register int val, |
183 |
> |
register FILE *fp |
184 |
> |
) |
185 |
|
{ |
186 |
|
putc(val&0xff, fp); |
187 |
|
putc((val >> 8)&0xff, fp); |
188 |
|
} |
189 |
|
|
190 |
|
|
191 |
< |
ra2bn() /* convert radiance to barneyscan */ |
191 |
> |
static void |
192 |
> |
ra2bn(void) /* convert radiance to barneyscan */ |
193 |
|
{ |
194 |
|
register int i; |
195 |
|
register COLR *inl; |
215 |
|
} |
216 |
|
|
217 |
|
|
218 |
< |
bn2ra() /* convert barneyscan to radiance */ |
218 |
> |
static void |
219 |
> |
bn2ra(void) /* convert barneyscan to radiance */ |
220 |
|
{ |
221 |
|
register int i; |
222 |
|
register COLR *outline; |