103 |
|
if (read(fileno(stdin), inpbuf, 2) != 2 || inpbuf[0] != 'P') |
104 |
|
quiterr("input not a Poskanzer Pixmap"); |
105 |
|
ptype = inpbuf[1]; |
106 |
< |
#ifdef _WIN32 |
106 |
> |
#if defined(_WIN32) || defined(_WIN64) |
107 |
|
if (ptype > 4) |
108 |
|
SET_FILE_BINARY(stdin); |
109 |
|
SET_FILE_BINARY(stdout); |
153 |
|
quiterr("unsupported Pixmap type"); |
154 |
|
} |
155 |
|
} else { |
156 |
< |
#ifdef _WIN32 |
156 |
> |
#if defined(_WIN32) || defined(_WIN64) |
157 |
|
SET_FILE_BINARY(stdin); |
158 |
|
if (binflag) |
159 |
|
SET_FILE_BINARY(stdout); |
220 |
|
|
221 |
|
|
222 |
|
static void |
223 |
< |
ra2ppm( /* convert Radiance picture to Pixmap */ |
223 |
> |
ra2ppm( /* convert Radiance picture to 1-byte/sample Pixmap */ |
224 |
|
int binary, |
225 |
|
int grey |
226 |
|
) |
585 |
|
{ |
586 |
|
register int lowerb, upperb; |
587 |
|
|
588 |
– |
lowerb = getc(fp); |
588 |
|
upperb = getc(fp); |
589 |
< |
if (upperb == EOF) |
589 |
> |
lowerb = getc(fp); |
590 |
> |
if (lowerb == EOF) |
591 |
|
return(EOF); |
592 |
|
return(upperb<<8 | lowerb); |
593 |
|
} |
599 |
|
register FILE *fp |
600 |
|
) |
601 |
|
{ |
602 |
– |
putc(w & 0xff, fp); |
602 |
|
putc(w>>8 & 0xff, fp); |
603 |
+ |
putc(w & 0xff, fp); |
604 |
|
if (ferror(fp)) { |
605 |
|
fprintf(stderr, "%s: write error on PPM output\n", progname); |
606 |
|
exit(1); |