9 |
|
|
10 |
|
#include "copyright.h" |
11 |
|
|
12 |
< |
#include "standard.h" |
13 |
< |
|
12 |
> |
#include "rtio.h" |
13 |
> |
#include "rtmath.h" |
14 |
> |
#include "paths.h" |
15 |
|
#include "view.h" |
16 |
|
|
16 |
– |
#include "paths.h" |
17 |
|
|
18 |
|
#define FEQ(x,y) (fabs((x)-(y)) <= FTINY) |
19 |
|
#define VEQ(v,w) (FEQ((v)[0],(w)[0]) && FEQ((v)[1],(w)[1]) \ |
21 |
|
|
22 |
|
VIEW stdview = STDVIEW; /* default view parameters */ |
23 |
|
|
24 |
+ |
static gethfunc gethview; |
25 |
|
|
26 |
+ |
|
27 |
|
char * |
28 |
|
setview(v) /* set hvec and vvec, return message on error */ |
29 |
|
register VIEW *v; |
273 |
|
|
274 |
|
void |
275 |
|
pix2loc(loc, rp, px, py) /* compute image location from pixel pos. */ |
276 |
< |
FLOAT loc[2]; |
276 |
> |
RREAL loc[2]; |
277 |
|
register RESOLU *rp; |
278 |
|
int px, py; |
279 |
|
{ |
396 |
|
int na; |
397 |
|
int nvopts = 0; |
398 |
|
|
399 |
+ |
while (*s == ' ') |
400 |
+ |
s++; |
401 |
|
if (*s != '-') |
402 |
|
s = sskip2(s,1); |
403 |
|
while (*s) { |
404 |
|
ac = 0; |
405 |
|
do { |
406 |
< |
av[ac++] = s; |
406 |
> |
if (ac || *s == '-') |
407 |
> |
av[ac++] = s; |
408 |
|
while (*s && *s != ' ') |
409 |
|
s++; |
410 |
|
while (*s == ' ') |
494 |
|
isview(s) /* is this a view string? */ |
495 |
|
char *s; |
496 |
|
{ |
497 |
< |
static char *altname[]={NULL,VIEWSTR,"rpict","rview","pinterp",NULL}; |
497 |
> |
static char *altname[]={NULL,VIEWSTR,"rpict","rview","rvu","rpiece","pinterp",NULL}; |
498 |
|
extern char *progname; |
499 |
|
register char *cp; |
500 |
|
register char **an; |
526 |
|
|
527 |
|
|
528 |
|
static int |
529 |
< |
gethview(s, v) /* get view from header */ |
530 |
< |
char *s; |
531 |
< |
register struct myview *v; |
529 |
> |
gethview( /* get view from header */ |
530 |
> |
char *s, |
531 |
> |
void *v |
532 |
> |
) |
533 |
|
{ |
534 |
< |
if (isview(s) && sscanview(v->hv, s) > 0) |
535 |
< |
v->ok++; |
534 |
> |
if (isview(s) && sscanview(((struct myview*)v)->hv, s) > 0) |
535 |
> |
((struct myview*)v)->ok++; |
536 |
|
return(0); |
537 |
|
} |
538 |
|
|
554 |
|
mvs.hv = vp; |
555 |
|
mvs.ok = 0; |
556 |
|
|
557 |
< |
getheader(fp, (int (*)(char *, char *))&gethview, (char *)&mvs); |
557 |
> |
getheader(fp, gethview, &mvs); |
558 |
|
|
559 |
|
if (rp != NULL && !fgetsresolu(rp, fp)) |
560 |
|
mvs.ok = 0; |