1 |
< |
/* Copyright (c) 1991 Regents of the University of California */ |
1 |
> |
/* Copyright (c) 1992 Regents of the University of California */ |
2 |
|
|
3 |
|
#ifndef lint |
4 |
|
static char SCCSid[] = "$SunId$ LBL"; |
20 |
|
|
21 |
|
|
22 |
|
extern char *fgetword(); |
23 |
– |
extern double atof(); |
23 |
|
|
24 |
|
extern char *libpath; /* library search path */ |
25 |
|
|
26 |
< |
static DATARRAY *dlist = NULL; /* data array list */ |
26 |
> |
static DATARRAY *dlist = NULL; /* data array list */ |
27 |
|
|
28 |
< |
static DATARRAY *plist = NULL; /* picture list */ |
28 |
> |
static DATARRAY *plist = NULL; /* picture list */ |
29 |
|
|
30 |
|
|
31 |
|
DATARRAY * |
139 |
|
} |
140 |
|
|
141 |
|
|
143 |
– |
static double inpaspect; /* aspect ratio of input picture */ |
144 |
– |
|
142 |
|
static |
143 |
< |
headaspect(s) /* check string for aspect ratio */ |
143 |
> |
headaspect(s, iap) /* check string for aspect ratio */ |
144 |
|
char *s; |
145 |
+ |
double *iap; |
146 |
|
{ |
147 |
|
if (isaspect(s)) |
148 |
< |
inpaspect *= aspectval(s); |
148 |
> |
*iap *= aspectval(s); |
149 |
|
} |
150 |
|
|
151 |
|
|
154 |
|
char *pname; |
155 |
|
{ |
156 |
|
extern char *libpath; |
157 |
+ |
double inpaspect; |
158 |
|
char *pfname; |
159 |
|
FILE *fp; |
160 |
|
COLOR *scanin; |
161 |
|
int sl, ns; |
162 |
< |
RESOLU inpres; |
162 |
> |
RESOLU inpres; |
163 |
|
FLOAT loc[2]; |
164 |
|
int y; |
165 |
|
register int x, i; |
184 |
|
sprintf(errmsg, "cannot open picture file \"%s\"", pfname); |
185 |
|
error(SYSTEM, errmsg); |
186 |
|
} |
187 |
+ |
#ifdef MSDOS |
188 |
+ |
setmode(fileno(fp), O_BINARY); |
189 |
+ |
#endif |
190 |
|
/* get dimensions */ |
191 |
|
inpaspect = 1.0; |
192 |
< |
getheader(fp, headaspect); |
192 |
> |
getheader(fp, headaspect, &inpaspect); |
193 |
|
if (!fgetsresolu(&inpres, fp)) |
194 |
|
goto readerr; |
195 |
|
for (i = 0; i < 3; i++) { |
292 |
|
double |
293 |
|
datavalue(dp, pt) /* interpolate data value at a point */ |
294 |
|
register DATARRAY *dp; |
295 |
< |
double *pt; |
295 |
> |
double *pt; |
296 |
|
{ |
297 |
|
DATARRAY sd; |
298 |
|
int asize; |
299 |
|
int lower, upper; |
300 |
|
register int i; |
301 |
< |
double x, y, y0, y1; |
301 |
> |
double x, y, y0, y1; |
302 |
|
/* set up dimensions for recursion */ |
303 |
|
sd.nd = dp->nd - 1; |
304 |
|
asize = 1; |