12 |
|
|
13 |
|
#include <stdio.h> |
14 |
|
|
15 |
+ |
#include <math.h> |
16 |
+ |
|
17 |
|
#include "color.h" |
18 |
|
|
19 |
|
|
29 |
|
int nfile; /* number of files */ |
30 |
|
|
31 |
|
|
32 |
+ |
int |
33 |
|
tabputs(s) /* print line preceded by a tab */ |
34 |
|
char *s; |
35 |
|
{ |
36 |
|
putc('\t', stdout); |
37 |
< |
fputs(s, stdout); |
37 |
> |
return(fputs(s, stdout)); |
38 |
|
} |
39 |
|
|
40 |
|
|
42 |
|
int argc; |
43 |
|
char *argv[]; |
44 |
|
{ |
45 |
< |
double d, atof(); |
45 |
> |
double d; |
46 |
|
int xres, yres; |
47 |
|
int an; |
48 |
|
|
99 |
|
fputs(":\n", stdout); |
100 |
|
getheader(fptr[nfile], tabputs); |
101 |
|
/* get picture size */ |
102 |
< |
if (fscanf(fptr[nfile], "-Y %d +X %d\n", &yres, &xres) != 2) { |
102 |
> |
if (fgetresolu(&xres, &yres, fptr[nfile]) != (YMAJOR|YDECR)) { |
103 |
|
fprintf(stderr, "%s: bad picture size\n", progname); |
104 |
|
quit(1); |
105 |
|
} else if (nfile == 0) { |
115 |
|
} |
116 |
|
/* add new header info. */ |
117 |
|
printargs(argc, argv, stdout); |
118 |
< |
printf("\n-Y %d +X %d\n", ysiz, xsiz); |
118 |
> |
putchar('\n'); |
119 |
> |
fputresolu(YMAJOR|YDECR, xsiz, ysiz, stdout); |
120 |
|
|
121 |
|
psum(); |
122 |
|
|