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.35 by greg, Fri Dec 12 22:05:38 2008 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 326 | Line 324 | int  px,
324   int  py
325   )
326   {
327 <        register int  x, y;
327 >        int  x, y;
328  
329          if (rp->rt & YMAJOR) {
330                  x = px;
# Line 352 | Line 350 | double  lx,
350   double  ly
351   )
352   {
353 <        register int  x, y;
353 >        int  x, y;
354  
355 <        x = lx * rp->xr;
356 <        y = 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)
# Line 498 | Line 497 | VIEW  *vp
497   )
498   {
499          static char  vwstr[128];
500 <        register char  *cp = vwstr;
500 >        char  *cp = vwstr;
501  
502          *cp = '\0';
503          if (vp->type != stdview.type) {
# Line 557 | Line 556 | char  *s
556   {
557          static char  *altname[]={NULL,VIEWSTR,"rpict","rview","rvu","rpiece","pinterp",NULL};
558          extern char  *progname;
559 <        register char  *cp;
560 <        register char  **an;
559 >        char  *cp;
560 >        char  **an;
561                                          /* add program name to list */
562          if (altname[0] == NULL) {
563                  for (cp = progname; *cp; cp++)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines