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

Comparing ray/src/hd/rhpict.c (file contents):
Revision 3.3 by gwlarson, Mon Mar 8 14:09:11 1999 UTC vs.
Revision 3.4 by gwlarson, Tue Mar 9 10:55:24 1999 UTC

# Line 80 | Line 80 | char   *argv[];
80                          seqstart = atoi(argv[++i]);
81                          break;
82                  case 'v':                       /* view file */
83 <                        if (argv[i][1]!='f' || badarg(argc-i-1,argv+i+1,"s"))
83 >                        if (argv[i][2]!='f' || badarg(argc-i-1,argv+i+1,"s"))
84                                  goto userr;
85                          rval = viewfile(argv[++i], &myview, NULL);
86                          if (rval < 0) {
# Line 220 | Line 220 | int    fn;
220   int
221   endpicture()                    /* finish and write out pixels */
222   {
223 <        int     nunrend = 0;
224 <        int     v;
223 >        int     lastr = -1, nunrend = 0;
224 >        int4    lastp, lastrp;
225 >        register int4   p;
226          register double d;
226        register int    p;
227                                  /* compute final pixel values */
228          for (p = hres*vres; p--; ) {
229                  if (myweight[p] <= FTINY) {
230 +                        if (lastr >= 0)
231 +                                if (p/hres == lastp/hres)
232 +                                        copycolor(mypixel[p], mypixel[lastp]);
233 +                                else
234 +                                        copycolor(mypixel[p], mypixel[lastrp]);
235                          nunrend++;
236                          continue;
237                  }
238                  d = expval/myweight[p];
239                  scalecolor(mypixel[p], d);
240 +                if ((lastp=p)/hres != lastr)
241 +                        lastr = (lastrp=p)/hres;
242          }
243                                  /* write each scanline */
244 <        for (v = vres; v--; )
245 <                if (fwritescan(mypixel+v*hres, hres, stdout) < 0)
244 >        for (p = vres; p--; )
245 >                if (fwritescan(mypixel+p*hres, hres, stdout) < 0)
246                          return(-1);
247          if (fflush(stdout) == EOF)
248                  return(-1);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines