| 26 | 
  | 
int  samplendx = 0;                     /* index for this sample */ | 
| 27 | 
  | 
 | 
| 28 | 
  | 
int  psample = 8;                       /* pixel sample size */ | 
| 29 | 
< | 
double  maxdiff = .15;                  /* max. sample difference */ | 
| 29 | 
> | 
double  maxdiff = .15;                  /* max. sample difference */ | 
| 30 | 
  | 
 | 
| 31 | 
< | 
double  exposure = 1.0;                 /* exposure for scene */ | 
| 31 | 
> | 
double  exposure = 1.0;                 /* exposure for scene */ | 
| 32 | 
  | 
 | 
| 33 | 
< | 
double  dstrsrc = 0.0;                  /* square source distribution */ | 
| 34 | 
< | 
double  shadthresh = .1;                /* shadow threshold */ | 
| 35 | 
< | 
double  shadcert = .25;                 /* shadow certainty */ | 
| 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 | 
< | 
double  srcsizerat = 0.;                /* maximum ratio source size/dist. */ | 
| 39 | 
> | 
double  srcsizerat = 0.;                /* maximum ratio source size/dist. */ | 
| 40 | 
  | 
 | 
| 41 | 
< | 
double  specthresh = .3;                /* specular sampling threshold */ | 
| 42 | 
< | 
double  specjitter = 1.;                /* specular sampling jitter */ | 
| 41 | 
> | 
double  specthresh = .3;                /* specular sampling threshold */ | 
| 42 | 
> | 
double  specjitter = 1.;                /* specular sampling jitter */ | 
| 43 | 
  | 
 | 
| 44 | 
  | 
int  maxdepth = 4;                      /* maximum recursion depth */ | 
| 45 | 
< | 
double  minweight = 1e-2;               /* minimum ray weight */ | 
| 45 | 
> | 
double  minweight = 1e-2;               /* minimum ray weight */ | 
| 46 | 
  | 
 | 
| 47 | 
  | 
COLOR  ambval = BLKCOLOR;               /* ambient value */ | 
| 48 | 
< | 
double  ambacc = 0.2;                   /* ambient accuracy */ | 
| 48 | 
> | 
double  ambacc = 0.2;                   /* ambient accuracy */ | 
| 49 | 
  | 
int  ambres = 8;                        /* ambient resolution */ | 
| 50 | 
  | 
int  ambdiv = 32;                       /* ambient divisions */ | 
| 51 | 
  | 
int  ambssamp = 0;                      /* ambient super-samples */ | 
| 68 | 
  | 
 | 
| 69 | 
  | 
#define RESERVE_AMT     32768           /* amount of memory to reserve */ | 
| 70 | 
  | 
 | 
| 71 | 
< | 
#define  CTRL(c)        ((c)-'@') | 
| 71 | 
> | 
#define  CTRL(c)        ((c)-'@') | 
| 72 | 
  | 
 | 
| 73 | 
  | 
 | 
| 74 | 
  | 
quit(code)                      /* quit program */ | 
| 95 | 
  | 
                                error(USER, errmsg); | 
| 96 | 
  | 
                        } else | 
| 97 | 
  | 
                                return; | 
| 98 | 
+ | 
#ifndef NIX                                                 | 
| 99 | 
  | 
                                                /* not there, try exec */ | 
| 100 | 
  | 
        if ((dev = comm_init(dname, id)) == NULL) { | 
| 101 | 
  | 
                sprintf(errmsg, "cannot start device \"%s\"", dname); | 
| 102 | 
  | 
                error(USER, errmsg); | 
| 103 | 
  | 
        } | 
| 104 | 
+ | 
#endif | 
| 105 | 
  | 
} | 
| 106 | 
  | 
 | 
| 107 | 
  | 
 | 
| 174 | 
  | 
command(prompt)                 /* get/execute command */ | 
| 175 | 
  | 
char  *prompt; | 
| 176 | 
  | 
{ | 
| 177 | 
< | 
#define  badcom(s)      strncmp(s, inpbuf, args-inpbuf-1) | 
| 177 | 
> | 
#define  badcom(s)      strncmp(s, inpbuf, args-inpbuf-1) | 
| 178 | 
  | 
        char  inpbuf[256]; | 
| 179 | 
  | 
        char  *args; | 
| 180 | 
  | 
again: | 
| 227 | 
  | 
                break; | 
| 228 | 
  | 
        case 'm':                               /* move camera */ | 
| 229 | 
  | 
                if (badcom("move")) | 
| 230 | 
< | 
#ifdef  MSTATS | 
| 230 | 
> | 
#ifdef  MSTATS | 
| 231 | 
  | 
                { | 
| 232 | 
  | 
                        if (badcom("memory")) | 
| 233 | 
  | 
                                goto commerr; | 
| 267 | 
  | 
                quit(0); | 
| 268 | 
  | 
        case CTRL('C'):                         /* interrupt */ | 
| 269 | 
  | 
                goto again; | 
| 270 | 
< | 
#ifdef  SIGTSTP | 
| 270 | 
> | 
#ifdef  SIGTSTP | 
| 271 | 
  | 
        case CTRL('Z'):                         /* stop */ | 
| 272 | 
  | 
                devclose(); | 
| 273 | 
  | 
                kill(0, SIGTSTP); | 
| 288 | 
  | 
                error(COMMAND, errmsg); | 
| 289 | 
  | 
                break; | 
| 290 | 
  | 
        } | 
| 291 | 
< | 
#undef  badcom | 
| 291 | 
> | 
#undef  badcom | 
| 292 | 
  | 
} | 
| 293 | 
  | 
 | 
| 294 | 
  | 
 | 
| 298 | 
  | 
        RECT  r; | 
| 299 | 
  | 
        PNODE  *p; | 
| 300 | 
  | 
        register RECT  *rl; | 
| 301 | 
< | 
        register PNODE  **pl; | 
| 301 | 
> | 
        register PNODE  **pl; | 
| 302 | 
  | 
        register int  x; | 
| 303 | 
  | 
        /* | 
| 304 | 
  | 
         *     We initialize the bottom row in the image at our current | 
| 305 | 
< | 
         * resolution.  During sampling, we check super-pixels to the | 
| 305 | 
> | 
         * resolution.  During sampling, we check super-pixels to the | 
| 306 | 
  | 
         * right and above by calling bigdiff().  If there is a significant | 
| 307 | 
  | 
         * difference, we subsample the super-pixels.  The testing process | 
| 308 | 
  | 
         * includes initialization of the next row. | 
| 382 | 
  | 
 | 
| 383 | 
  | 
int | 
| 384 | 
  | 
refine(p, xmin, ymin, xmax, ymax, pd)           /* refine a node */ | 
| 385 | 
< | 
register PNODE  *p; | 
| 385 | 
> | 
register PNODE  *p; | 
| 386 | 
  | 
int  xmin, ymin, xmax, ymax; | 
| 387 | 
  | 
int  pd; | 
| 388 | 
  | 
{ |