9 |
|
*/ |
10 |
|
|
11 |
|
#include <stdio.h> |
12 |
+ |
#include <math.h> |
13 |
|
#ifdef MSDOS |
14 |
|
#include <fcntl.h> |
15 |
|
#endif |
31 |
|
int argc; |
32 |
|
char *argv[]; |
33 |
|
{ |
34 |
+ |
extern long getint(); |
35 |
|
int reverse = 0; |
36 |
|
int i; |
37 |
|
|
76 |
|
setcolrgam(gamma); /* set up gamma correction */ |
77 |
|
if (reverse) { |
78 |
|
/* get their image resolution */ |
79 |
< |
fread((char *)&xmax, sizeof(int), 1, stdin); |
80 |
< |
fread((char *)&ymax, sizeof(int), 1, stdin); |
79 |
> |
xmax = getint(4, stdin); |
80 |
> |
ymax = getint(4, stdin); |
81 |
|
/* put our header */ |
82 |
|
printargs(i, argv, stdout); |
83 |
|
fputformat(COLRFMT, stdout); |
91 |
|
fgetresolu(&xmax, &ymax, stdin) < 0) |
92 |
|
quiterr("bad picture format"); |
93 |
|
/* write their header */ |
94 |
< |
fwrite((char *)&xmax, sizeof(int), 1, stdout); |
95 |
< |
fwrite((char *)&ymax, sizeof(int), 1, stdout); |
94 |
> |
putint((long)xmax, 4, stdout); |
95 |
> |
putint((long)ymax, 4, stdout); |
96 |
|
/* convert file */ |
97 |
|
ra2avs(); |
98 |
|
} |