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