12 |
|
|
13 |
|
#include "standard.h" |
14 |
|
|
15 |
– |
#include <fcntl.h> |
16 |
– |
|
15 |
|
#include <ctype.h> |
16 |
|
|
17 |
|
#include "view.h" |
32 |
|
|
33 |
|
#define PACKSIZ 256 /* max. calculation packet size */ |
34 |
|
|
35 |
< |
#define RTCOM "rtrace -h- -ovl -fff" |
35 |
> |
#define RTCOM "rtrace -h- -ovl -fff " |
36 |
|
|
37 |
|
#define ABS(x) ((x)>0?(x):-(x)) |
38 |
|
|
159 |
|
vresolu = atoi(argv[++i]); |
160 |
|
break; |
161 |
|
case 'p': /* pixel aspect */ |
162 |
< |
check(2,"f"); |
162 |
> |
if (argv[i][2] != 'a') |
163 |
> |
goto badopt; |
164 |
> |
check(3,"f"); |
165 |
|
pixaspect = atof(argv[++i]); |
166 |
|
break; |
167 |
|
case 'v': /* view file */ |
197 |
|
} |
198 |
|
normaspect(viewaspect(&ourview), &pixaspect, &hresolu, &vresolu); |
199 |
|
/* allocate frame */ |
200 |
< |
ourpict = (COLR *)malloc(hresolu*vresolu*sizeof(COLR)); |
201 |
< |
ourzbuf = (float *)calloc(hresolu*vresolu,sizeof(float)); |
200 |
> |
ourpict = (COLR *)bmalloc(hresolu*vresolu*sizeof(COLR)); |
201 |
> |
ourzbuf = (float *)bmalloc(hresolu*vresolu*sizeof(float)); |
202 |
|
if (ourpict == NULL || ourzbuf == NULL) |
203 |
|
syserror(); |
204 |
+ |
bzero((char *)ourzbuf, hresolu*vresolu*sizeof(float)); |
205 |
|
/* get input */ |
206 |
|
for ( ; i < argc; i += 2) |
207 |
|
addpicture(argv[i], argv[i+1]); |
244 |
|
headline(s) /* process header string */ |
245 |
|
char *s; |
246 |
|
{ |
246 |
– |
static char *altname[] = {VIEWSTR,"rpict","rview","pinterp",NULL}; |
247 |
– |
register char **an; |
247 |
|
char fmt[32]; |
248 |
|
|
249 |
|
if (isformat(s)) { |
258 |
|
theirexp *= exposval(s); |
259 |
|
return; |
260 |
|
} |
261 |
< |
for (an = altname; *an != NULL; an++) |
262 |
< |
if (!strncmp(*an, s, strlen(*an))) { |
264 |
< |
if (sscanview(&theirview, s+strlen(*an)) > 0) |
265 |
< |
gotview++; |
266 |
< |
break; |
267 |
< |
} |
261 |
> |
if (isview(s) && sscanview(&theirview, s) > 0) |
262 |
> |
gotview++; |
263 |
|
} |
264 |
|
|
265 |
|
|
386 |
|
float *zline; |
387 |
|
struct position *lasty; /* input/output */ |
388 |
|
{ |
394 |
– |
extern double sqrt(); |
389 |
|
FVECT pos; |
390 |
|
struct position lastx, newpos; |
391 |
|
register int x; |
633 |
|
writedistance(fname) /* write out z file */ |
634 |
|
char *fname; |
635 |
|
{ |
642 |
– |
extern double sqrt(); |
636 |
|
int donorm = normdist && ourview.type == VT_PER; |
637 |
|
int fd; |
638 |
|
int y; |