16 |
|
#define VEQ(v1,v2) (FEQ((v1)[0],(v2)[0])&&FEQ((v1)[1],(v2)[1]) \ |
17 |
|
&&FEQ((v1)[2],(v2)[2])) |
18 |
|
|
19 |
< |
char *rtargv[32] = {"rtrace", "-h-", "-ov", "-fff"}; |
20 |
< |
int rtargc = 4; |
19 |
> |
char *rtargv[64] = {"rtrace", "-h-", "-ov", "-fff", "-ld-", "-i-", "-I-"}; |
20 |
> |
int rtargc = 7; |
21 |
|
|
22 |
|
VIEW ourview = STDVIEW; /* our view */ |
23 |
|
VIEW pictview = STDVIEW; /* picture view */ |
55 |
|
progname = argv[0]; |
56 |
|
/* process options */ |
57 |
|
for (i = 1; i < argc && argv[i][0] == '-'; i++) { |
58 |
+ |
/* expand arguments */ |
59 |
+ |
while (rval = expandarg(&argc, &argv, i)) |
60 |
+ |
if (rval < 0) { |
61 |
+ |
fprintf(stderr, "%s: cannot expand '%s'", |
62 |
+ |
argv[0], argv[i]); |
63 |
+ |
exit(1); |
64 |
+ |
} |
65 |
|
rval = getviewopt(&ourview, argc-i, argv+i); |
66 |
|
if (rval >= 0) { |
67 |
|
i += rval; |
82 |
|
} |
83 |
|
if (argv[i][2] != 'f') |
84 |
|
goto userr; |
85 |
< |
rval = viewfile(argv[++i], &ourview, 0, 0); |
85 |
> |
rval = viewfile(argv[++i], &ourview, NULL); |
86 |
|
if (rval < 0) { |
87 |
|
fprintf(stderr, |
88 |
|
"%s: cannot open view file \"%s\"\n", |
112 |
|
combine = !combine; |
113 |
|
break; |
114 |
|
case 'd': |
115 |
+ |
rtargv[rtargc++] = argv[i]; |
116 |
+ |
if (argv[i][2] != 'v') |
117 |
+ |
rtargv[rtargc++] = argv[++i]; |
118 |
+ |
break; |
119 |
|
case 'l': |
120 |
+ |
if (argv[i][2] == 'd') |
121 |
+ |
break; |
122 |
+ |
/* FALL THROUGH */ |
123 |
+ |
case 's': |
124 |
+ |
case 'P': |
125 |
|
rtargv[rtargc++] = argv[i]; |
126 |
|
rtargv[rtargc++] = argv[++i]; |
127 |
|
break; |
128 |
+ |
case 'w': |
129 |
+ |
rtargv[rtargc++] = argv[i]; |
130 |
+ |
break; |
131 |
|
case 'a': |
132 |
|
rtargv[rtargc++] = argv[i]; |
133 |
|
if (argv[i][2] == 'v') { |
149 |
|
} |
150 |
|
/* get view */ |
151 |
|
if (picture != NULL) { |
152 |
< |
rval = viewfile(picture, &pictview, 0, 0); |
152 |
> |
rval = viewfile(picture, &pictview, NULL); |
153 |
|
if (rval < 0) { |
154 |
|
fprintf(stderr, "%s: cannot open picture file \"%s\"\n", |
155 |
|
progname, picture); |
205 |
|
absorb_specks(); /* eliminate tiny sources */ |
206 |
|
cleanup(); /* tidy up */ |
207 |
|
/* print header */ |
208 |
+ |
newheader("RADIANCE", stdout); |
209 |
|
printargs(argc, argv, stdout); |
210 |
|
fputs(VIEWSTR, stdout); |
211 |
|
fprintview(&ourview, stdout); |
325 |
|
if (octree != NULL) |
326 |
|
done_rtrace(); |
327 |
|
if (npixinvw < 100*npixmiss) |
328 |
< |
fprintf(stderr, "%s: warning -- missing %ld%% of samples\n", |
329 |
< |
progname, 100L*npixmiss/npixinvw); |
328 |
> |
fprintf(stderr, "%s: warning -- missing %d%% of samples\n", |
329 |
> |
progname, (int)(100L*npixmiss/npixinvw)); |
330 |
|
} |
331 |
|
|
332 |
|
|
374 |
|
xo = x-hl; |
375 |
|
else |
376 |
|
xo = 0; |
377 |
< |
disc = 1. - (double)(xo*xo + y*y)/(sampdens*sampdens); |
378 |
< |
if (disc <= FTINY) |
377 |
> |
disc = 1. - (double)((long)xo*xo + (long)y*y)/((long)sampdens*sampdens); |
378 |
> |
if (disc <= FTINY*FTINY) |
379 |
|
return(0.); |
380 |
|
return(1./(sampdens*sampdens*sqrt(disc))); |
381 |
|
} |