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

Comparing ray/src/common/image.c (file contents):
Revision 2.36 by greg, Wed Mar 2 17:24:55 2011 UTC vs.
Revision 2.38 by greg, Fri Nov 16 00:14:19 2012 UTC

# Line 221 | Line 221 | double  y
221                  y *= sqrt(v->vn2);
222                  d = x*x + y*y;
223                  z = (1. - d)/(1. + d);
224 <                d = d <= FTINY*FTINY ? PI : sqrt((1.0 - z*z)/d);
225 <                x *= d;
226 <                y *= d;
224 >                x *= (1. + z);
225 >                y *= (1. + z);
226                  direc[0] = z*v->vdir[0] + x*v->hvec[0] + y*v->vvec[0];
227                  direc[1] = z*v->vdir[1] + x*v->hvec[1] + y*v->vvec[1];
228                  direc[2] = z*v->vdir[2] + x*v->hvec[2] + y*v->vvec[2];
# Line 308 | Line 307 | FVECT  p
307                          return;
308                  if (d <= -(1.0-FTINY))
309                          return;         /* really an error */
310 <                d = sqrt(1.0 - d*d) / (1.0 + d);
311 <                ip[0] += DOT(disp,v->hvec)*d/sqrt(v->hn2);
313 <                ip[1] += DOT(disp,v->vvec)*d/sqrt(v->vn2);
310 >                ip[0] += DOT(disp,v->hvec)/((1. + d)*sqrt(v->hn2));
311 >                ip[1] += DOT(disp,v->vvec)/((1. + d)*sqrt(v->vn2));
312                  return;
313          }
314          ip[0] = DOT(disp,v->hvec)/v->hn2 + 0.5 - v->hoff;
# Line 354 | Line 352 | double  ly
352   {
353          int  x, y;
354  
355 <        x = (lx >= 0.0) ? (int)(lx * rp->xr) : -(int)(-lx * rp->xr);
356 <        y = (ly >= 0.0) ? (int)(ly * rp->yr) : -(int)(-ly * rp->yr);
355 >        x = (int)(lx*rp->xr + .5 - (lx < 0.0));
356 >        y = (int)(ly*rp->yr + .5 - (ly < 0.0));
357 >
358          if (rp->rt & XDECR)
359                  x = rp->xr-1 - x;
360          if (rp->rt & YDECR)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines