16 |
|
|
17 |
|
#include "color.h" |
18 |
|
|
19 |
+ |
#include "resolu.h" |
20 |
|
|
21 |
+ |
|
22 |
|
main(argc, argv) /* print a picture */ |
23 |
|
int argc; |
24 |
|
char *argv[]; |
41 |
|
exit(1); |
42 |
|
} |
43 |
|
/* discard header */ |
44 |
< |
getheader(input, NULL); |
44 |
> |
if (checkheader(input, COLRFMT, NULL) < 0) { |
45 |
> |
fprintf(stderr, "%s: not a Radiance picture\n", fname); |
46 |
> |
exit(1); |
47 |
> |
} |
48 |
|
/* get picture dimensions */ |
49 |
< |
if (fgetresolu(&xres, &yres, input) != (YMAJOR|YDECR)) { |
49 |
> |
if (fgetresolu(&xres, &yres, input) < 0) { |
50 |
|
fprintf(stderr, "%s: bad picture size\n", fname); |
51 |
|
exit(1); |
52 |
|
} |
68 |
|
fprintf(stderr, "%s: read error (y=%d)\n", fname, i); |
69 |
|
exit(1); |
70 |
|
} |
71 |
< |
normcolrs(scanline, xres); |
71 |
> |
normcolrs(scanline, xres, 0); |
72 |
|
for (j = 0; j < xres; j++) { |
73 |
|
winout[j] = 255L<<24; |
74 |
|
winout[j] |= (long)scanline[j][BLU]<<16; |