39 |
|
exit(1); |
40 |
|
} |
41 |
|
/* discard header */ |
42 |
< |
getheader(input, NULL); |
42 |
> |
if (checkheader(input, COLRFMT, NULL) < 0) { |
43 |
> |
fprintf(stderr, "%s: not a Radiance picture\n", fname); |
44 |
> |
exit(1); |
45 |
> |
} |
46 |
|
/* get picture dimensions */ |
47 |
|
if (fgetresolu(&xres, &yres, input) != (YMAJOR|YDECR)) { |
48 |
|
fprintf(stderr, "%s: bad picture size\n", fname); |
66 |
|
fprintf(stderr, "%s: read error (y=%d)\n", fname, i); |
67 |
|
exit(1); |
68 |
|
} |
69 |
< |
normcolrs(scanline, xres); |
69 |
> |
normcolrs(scanline, xres, 0); |
70 |
|
for (j = 0; j < xres; j++) { |
71 |
|
winout[j] = 255L<<24; |
72 |
|
winout[j] |= (long)scanline[j][BLU]<<16; |