48 |
|
int argc; |
49 |
|
char *argv[]; |
50 |
|
{ |
51 |
+ |
int combine = 1; |
52 |
|
int gotview = 0; |
53 |
|
int rval, i; |
54 |
|
char *err; |
102 |
|
case 'p': |
103 |
|
picture = argv[++i]; |
104 |
|
break; |
105 |
+ |
case 'c': |
106 |
+ |
combine = !combine; |
107 |
+ |
break; |
108 |
|
case 'd': |
109 |
|
case 'l': |
110 |
|
rtargv[rtargc++] = argv[i]; |
183 |
|
if (threshold <= FTINY) |
184 |
|
comp_thresh(); /* compute glare threshold */ |
185 |
|
analyze(); /* analyze view */ |
186 |
+ |
if (combine) |
187 |
+ |
absorb_specks(); /* eliminate tiny sources */ |
188 |
|
cleanup(); /* tidy up */ |
189 |
|
/* print header */ |
190 |
|
printargs(argc, argv, stdout); |
281 |
|
cleanup() /* close files, wait for children */ |
282 |
|
{ |
283 |
|
if (verbose) |
284 |
< |
fprintf(stderr, "%s: cleaning up...\n", progname); |
284 |
> |
fprintf(stderr, "%s: cleaning up... \n", progname); |
285 |
|
if (picture != NULL) |
286 |
|
close_pict(); |
287 |
|
if (octree != NULL) |
292 |
|
} |
293 |
|
|
294 |
|
|
295 |
< |
compdir(vd, x, y) /* compute direction for x,y */ |
295 |
> |
compdir(vd, x, y, se) /* compute direction for x,y */ |
296 |
|
FVECT vd; |
297 |
|
int x, y; |
298 |
+ |
SPANERR *se; |
299 |
|
{ |
300 |
|
FVECT org; /* dummy variable */ |
301 |
|
|
307 |
|
return(viewray(org, vd, &rightview, |
308 |
|
(double)(x-hlim)/(2*sampdens)+.5, |
309 |
|
(double)y/(2*sampdens)+.5)); |
310 |
< |
/* central region */ |
310 |
> |
/* central region */ |
311 |
> |
if (se != NULL) { /* avoid over-counting of poles */ |
312 |
> |
se->err += se->prob; |
313 |
> |
if (se->err <= 0.5) |
314 |
> |
return(-1); |
315 |
> |
se->err -= 1.0; |
316 |
> |
} |
317 |
|
if (viewray(org, vd, &ourview, .5, (double)y/(2*sampdens)+.5) < 0) |
318 |
|
return(-1); |
319 |
|
spinvector(vd, vd, ourview.vup, h_theta(x)); |
320 |
|
return(0); |
321 |
+ |
} |
322 |
+ |
|
323 |
+ |
|
324 |
+ |
setspanerr(se, y) /* initialize span error at y */ |
325 |
+ |
register SPANERR *se; |
326 |
+ |
int y; |
327 |
+ |
{ |
328 |
+ |
se->err = 0.0; |
329 |
+ |
se->prob = sqrt(1.0 - (double)((long)y*y)/((long)vsize*vsize)); |
330 |
|
} |
331 |
|
|
332 |
|
|