10 |
|
* 3/24/87 |
11 |
|
*/ |
12 |
|
|
13 |
< |
#include "standard.h" |
13 |
> |
#include "ray.h" |
14 |
|
|
15 |
– |
#include "color.h" |
16 |
– |
|
15 |
|
#include "rpaint.h" |
16 |
|
|
17 |
|
#include <signal.h> |
21 |
|
VIEW ourview = STDVIEW; /* viewing parameters */ |
22 |
|
int hresolu, vresolu; /* image resolution */ |
23 |
|
|
24 |
+ |
int dimlist[MAXDIM]; /* sampling dimensions */ |
25 |
+ |
int ndims = 0; /* number of sampling dimensions */ |
26 |
+ |
int samplendx = 0; /* index for this sample */ |
27 |
+ |
|
28 |
|
int psample = 8; /* pixel sample size */ |
29 |
|
double maxdiff = .15; /* max. sample difference */ |
30 |
|
|
33 |
|
double dstrsrc = 0.0; /* square source distribution */ |
34 |
|
double shadthresh = .1; /* shadow threshold */ |
35 |
|
double shadcert = .25; /* shadow certainty */ |
36 |
+ |
int directrelay = 0; /* number of source relays */ |
37 |
+ |
int vspretest = 128; /* virtual source pretest density */ |
38 |
+ |
int directinvis = 0; /* sources invisible? */ |
39 |
|
|
40 |
|
int maxdepth = 4; /* maximum recursion depth */ |
41 |
|
double minweight = 1e-2; /* minimum ray weight */ |
62 |
|
|
63 |
|
static char *reserve_mem = NULL; /* pre-allocated reserve memory */ |
64 |
|
|
65 |
< |
#define RESERVE_AMT 8192 /* amount of memory to reserve */ |
65 |
> |
#define RESERVE_AMT 32768 /* amount of memory to reserve */ |
66 |
|
|
67 |
|
#define CTRL(c) ('c'-'@') |
68 |
|
|
316 |
|
/* sample the image */ |
317 |
|
for (y = 0; /* y < ysiz */ ; y++) { |
318 |
|
for (x = 0; x < xsiz-1; x++) { |
319 |
< |
if (dev->inpready) |
319 |
> |
if (dev->inpready || errno == ENOMEM) |
320 |
|
goto escape; |
321 |
|
/* |
322 |
|
* Test super-pixel to the right. |
332 |
|
if (y >= ysiz-1) |
333 |
|
break; |
334 |
|
for (x = 0; x < xsiz; x++) { |
335 |
< |
if (dev->inpready) |
335 |
> |
if (dev->inpready || errno == ENOMEM) |
336 |
|
goto escape; |
337 |
|
/* |
338 |
|
* Find super-pixel at this position in next row. |
387 |
|
if (p->kid == NULL) { /* subdivide */ |
388 |
|
|
389 |
|
if ((p->kid = newptree()) == NULL) |
390 |
< |
return(growth); |
390 |
> |
return(0); |
391 |
|
/* |
392 |
|
* The following paint order can leave a black pixel |
393 |
|
* when redraw() is called in (*dev->paintr)(). |