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

Comparing ray/src/rt/rview.c (file contents):
Revision 1.8 by greg, Fri Oct 27 11:48:25 1989 UTC vs.
Revision 1.9 by greg, Mon Jan 8 13:38:12 1990 UTC

# Line 20 | Line 20 | static char SCCSid[] = "$SunId$ LBL";
20  
21   #include  <ctype.h>
22  
23 < VIEW  ourview = STDVIEW(470);           /* viewing parameters */
23 > VIEW  ourview = STDVIEW;                /* viewing parameters */
24 > int  hresolu, vresolu;                  /* image resolution */
25  
26   int  psample = 8;                       /* pixel sample size */
27   double  maxdiff = .15;                  /* max. sample difference */
# Line 114 | Line 115 | rview()                                /* do a view */
115          newimage();                     /* set up image */
116  
117          for ( ; ; ) {                   /* quit in command() */
118 <                while (ourview.hresolu <= 1<<pdepth &&
119 <                                ourview.vresolu <= 1<<pdepth)
118 >                while (hresolu <= 1<<pdepth &&
119 >                                vresolu <= 1<<pdepth)
120                          command("done: ");
121  
122 <                if (ourview.hresolu <= psample<<pdepth &&
123 <                                ourview.vresolu <= psample<<pdepth) {
122 >                if (hresolu <= psample<<pdepth &&
123 >                                vresolu <= psample<<pdepth) {
124                          sprintf(buf, "%d sampling...\n", 1<<pdepth);
125                          (*dev->comout)(buf);
126                          rsample();
127                  } else {
128                          sprintf(buf, "%d refining...\n", 1<<pdepth);
129                          (*dev->comout)(buf);
130 <                        refine(&ptrunk, 0, 0, ourview.hresolu,
130 <                                        ourview.vresolu, pdepth+1);
130 >                        refine(&ptrunk, 0, 0, hresolu, vresolu, pdepth+1);
131                  }
132                  if (dev->inpready)
133                          command(": ");
# Line 266 | Line 266 | rsample()                      /* sample the image */
266           * difference, we subsample the super-pixels.  The testing process
267           * includes initialization of the next row.
268           */
269 <        xsiz = (((pframe.r-pframe.l)<<pdepth)+ourview.hresolu-1) /
270 <                        ourview.hresolu;
271 <        ysiz = (((pframe.u-pframe.d)<<pdepth)+ourview.vresolu-1) /
272 <                        ourview.vresolu;
269 >        xsiz = (((pframe.r-pframe.l)<<pdepth)+hresolu-1) / hresolu;
270 >        ysiz = (((pframe.u-pframe.d)<<pdepth)+vresolu-1) / vresolu;
271          rl = (RECT *)malloc(xsiz*sizeof(RECT));
272          pl = (PNODE **)malloc(xsiz*sizeof(PNODE *));
273          if (rl == NULL || pl == NULL)
# Line 278 | Line 276 | rsample()                      /* sample the image */
276           * Initialize the bottom row.
277           */
278          rl[0].l = rl[0].d = 0;
279 <        rl[0].r = ourview.hresolu; rl[0].u = ourview.vresolu;
279 >        rl[0].r = hresolu; rl[0].u = vresolu;
280          pl[0] = findrect(pframe.l, pframe.d, &ptrunk, rl, pdepth);
281          for (x = 1; x < xsiz; x++) {
282                  rl[x].l = rl[x].d = 0;
283 <                rl[x].r = ourview.hresolu; rl[x].u = ourview.vresolu;
284 <                pl[x] = findrect(pframe.l+((x*ourview.hresolu)>>pdepth),
283 >                rl[x].r = hresolu; rl[x].u = vresolu;
284 >                pl[x] = findrect(pframe.l+((x*hresolu)>>pdepth),
285                                  pframe.d, &ptrunk, rl+x, pdepth);
286          }
287                                                  /* sample the image */
# Line 311 | Line 309 | rsample()                      /* sample the image */
309                           * Find super-pixel at this position in next row.
310                           */
311                          r.l = r.d = 0;
312 <                        r.r = ourview.hresolu; r.u = ourview.vresolu;
313 <                        p = findrect(pframe.l+((x*ourview.hresolu)>>pdepth),
314 <                                pframe.d+(((y+1)*ourview.vresolu)>>pdepth),
312 >                        r.r = hresolu; r.u = vresolu;
313 >                        p = findrect(pframe.l+((x*hresolu)>>pdepth),
314 >                                pframe.d+(((y+1)*vresolu)>>pdepth),
315                                          &ptrunk, &r, pdepth);
316                          /*
317                           * Test super-pixel in next row.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines