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

Comparing ray/src/px/pmblur2.c (file contents):
Revision 2.2 by greg, Fri Oct 5 02:07:10 2012 UTC vs.
Revision 2.3 by greg, Fri Oct 5 15:25:12 2012 UTC

# Line 111 | Line 111 | loadprev(int fno)
111          exprev = ih.ev;
112          if (!fgetsresolu(&rs, fp))
113                  goto readerr;
114 +        if (rs.rt != PIXSTANDARD) {
115 +                sprintf(errmsg, "unsupported orientation in picture \"%s\"", fname);
116 +                error(USER, errmsg);
117 +        }
118          if (!imres.xr) {                /* allocate buffers */
119                  imres = rs;
120                  imsum = (COLOR *)ecalloc(imres.xr*imres.yr, sizeof(COLOR));
# Line 146 | Line 150 | readerr:
150   /* Interpolate between two image pixels */
151   /* XXX skipping expensive ray vector calculations for now */
152   static void
153 < interp_pixel(COLOR con, const VIEW *vwn, int xn, int yn, double zn,
154 <                        double pos, int xp, int yp)
153 > interp_pixel(COLOR con, const VIEW *vwn, int xn, int yn, double zval,
154 >                        double pos, int xp, int yp, int interpOK)
155   {
156          const int       hres = scanlen(&imres);
157          RREAL           ipos;
158          FVECT           wprev, wcoor, rdir;
159          int             np, xd, yd, nd;
160          COLOR           cpr;
161 <        double          sf, zval;
161 >        double          sf;
162                                          /* check if off image */
163          if ((xp < 0) | (xp >= hres))
164                  return;
# Line 164 | Line 168 | interp_pixel(COLOR con, const VIEW *vwn, int xn, int y
168          xd = (1.-pos)*xp + pos*xn + .5;
169          yd = (1.-pos)*yp + pos*yn + .5;
170          nd = yd*hres + xd;
171 <                                        /* check interpolated depth */
172 <        zval = (1.-pos)*zprev[np] + pos*zn;
171 >                                        /* check depth */
172 >        if (interpOK)
173 >                zval = (1.-pos)*zprev[np] + pos*zval;
174          if (zval >= zbuf[nd])
175                  return;
176 <        copycolor(imbuf[nd], con);      /* assign interpolated color */
176 >        zbuf[nd] = zval;                /* assign new depth */
177 >        copycolor(imbuf[nd], con);      /* assign new color */
178 >        if (!interpOK)
179 >                return;
180          scalecolor(imbuf[nd], pos);
181          sf = (1.-pos)/exprev;
182          colr_color(cpr, imprev[np]);
183          scalecolor(cpr, sf);
184          addcolor(imbuf[nd], cpr);
177        zbuf[nd] = zval;                /* assign new depth */
185   }
186  
187  
# Line 258 | Line 265 | addframe(double fpos)
265                  error(USER, err);
266          if (!fgetsresolu(&rs, fpimg))
267                  goto readerr;
268 +        if (rs.rt != PIXSTANDARD) {
269 +                sprintf(errmsg, "unsupported orientation in picture \"%s\"", fname);
270 +                error(USER, errmsg);
271 +        }
272          if ((rs.xr != imres.xr) | (rs.yr != imres.yr)) {
273                  sprintf(errmsg, "resolution mismatch for picture \"%s\"", fname);
274                  error(USER, errmsg);
# Line 311 | Line 322 | addframe(double fpos)
322                          scalecolor(cval, sf);
323                          interp_pixel(cval, &fvw, h, n, zscan[h], fpos,
324                                          h + (int)mscan[3*h] - 32768,
325 <                                        n - (int)mscan[3*h+1] + 32768);
325 >                                        n - (int)mscan[3*h+1] + 32768,
326 >                                        mscan[3*h+2]);
327                  }
328          }
329                                          /* fill in missing pixels */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines