ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/rpict.c
(Generate patch)

Comparing ray/src/rt/rpict.c (file contents):
Revision 1.25 by greg, Tue May 21 17:41:35 1991 UTC vs.
Revision 1.32 by greg, Thu Sep 19 13:55:53 1991 UTC

# Line 36 | Line 36 | double  pixaspect = 1.0;               /* pixel aspect ratio */
36   int  psample = 4;                       /* pixel sample size */
37   double  maxdiff = .05;                  /* max. difference for interpolation */
38   double  dstrpix = 0.67;                 /* square pixel distribution */
39 int  psuper = 2;                        /* pixel super-sampling rate */
39  
40   double  dstrsrc = 0.0;                  /* square source distribution */
41   double  shadthresh = .05;               /* shadow threshold */
42   double  shadcert = .5;                  /* shadow certainty */
43 + int  directrelay = 0;                   /* number of source relays */
44 + int  vspretest = 512;                   /* virtual source pretest density */
45 + int  directinvis = 0;                   /* sources invisible? */
46  
47   int  maxdepth = 6;                      /* maximum recursion depth */
48   double  minweight = 5e-3;               /* minimum ray weight */
# Line 65 | Line 67 | extern long  tstart;                   /* starting time */
67  
68   extern long  nrays;                     /* number of rays traced */
69  
70 < #define  MAXDIV         32              /* maximum sample size */
70 > #define  MAXDIV         15              /* maximum sample size */
71  
72   #define  pixjitter()    (.5+dstrpix*(.5-frandom()))
73  
# Line 127 | Line 129 | char  *zfile, *oldfile;
129                                          /* check sampling */
130          if (psample < 1)
131                  psample = 1;
132 <        else if (psample > MAXDIV)
132 >        else if (psample > MAXDIV) {
133 >                sprintf(errmsg, "pixel sampling reduced from %d to %d",
134 >                                psample, MAXDIV);
135 >                error(WARNING, errmsg);
136                  psample = MAXDIV;
137 +        }
138                                          /* allocate scanlines */
139          for (i = 0; i <= psample; i++) {
140                  scanbar[i] = (COLOR *)malloc(hresolu*sizeof(COLOR));
# Line 161 | Line 167 | char  *zfile, *oldfile;
167          pctdone = 100.0*i/vresolu;
168          if (ralrm > 0)                  /* report init stats */
169                  report();
170 + #ifndef  BSD
171 +        else
172 + #endif
173 +        signal(SIGALRM, report);
174          ypos = vresolu-1 - i;
175          fillscanline(scanbar[0], zbar[0], hresolu, ypos, psample);
176          ystep = psample;
# Line 182 | Line 192 | char  *zfile, *oldfile;
192                                                          /* fill bar */
193                  fillscanbar(scanbar, zbar, hresolu, ypos, ystep);
194                                                          /* write it out */
195 + #ifndef  BSD
196 +                signal(SIGALRM, SIG_IGN);       /* don't interrupt writes */
197 + #endif
198                  for (i = ystep; i > 0; i--) {
199                          if (zfd != -1 && write(zfd, (char *)zbar[i],
200                                          hresolu*sizeof(float))
# Line 196 | Line 209 | char  *zfile, *oldfile;
209                  pctdone = 100.0*(vresolu-1-ypos)/vresolu;
210                  if (ralrm > 0 && time((long *)0) >= tlastrept+ralrm)
211                          report();
212 + #ifndef  BSD
213 +                else
214 +                        signal(SIGALRM, report);
215 + #endif
216          }
217                                                  /* clean up */
218          if (zfd != -1) {
# Line 348 | Line 365 | int  x, y;                     /* pixel position */
365  
366          rayorigin(&thisray, NULL, PRIMARY, 1.0);
367  
368 <        samplendx = 3*y + x;                    /* set pixel index */
368 >        samplendx = pixnumber(x,y,hresolu,vresolu);     /* set pixel index */
369  
370          rayvalue(&thisray);                     /* trace ray */
371  
# Line 407 | Line 424 | char  *oldfile;
424          return(y);
425   writerr:
426          error(SYSTEM, "write error in salvage");
427 + }
428 +
429 +
430 + int
431 + pixnumber(x, y, xres, yres)             /* compute pixel index (brushed) */
432 + register int  x, y;
433 + int  xres, yres;
434 + {
435 +        x -= y;
436 +        while (x < 0)
437 +                x += xres;
438 +        return((((x>>2)*yres + y) << 2) + (x & 3));
439   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines