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.43 by greg, Wed Jan 24 04:39:52 2018 UTC vs.
Revision 2.45 by greg, Tue Feb 6 02:08:12 2018 UTC

# Line 231 | Line 231 | viewloc(                       /* find image location for point */
231   FVECT  ip,
232   VIEW  *v,
233   FVECT  p
234 < )
234 > )       /* returns: Good=1, Bad=0, Behind=-1, OutOfFrame=2, Behind+OOF=-2 */
235   {
236        int     rval;
236          double  d, d2;
237          FVECT  disp;
238  
# Line 305 | Line 304 | FVECT  p
304                  ip[0] += DOT(disp,v->hvec)/((1. + d)*sqrt(v->hn2));
305                  ip[1] += DOT(disp,v->vvec)/((1. + d)*sqrt(v->vn2));
306                  goto gotall;
307 +        default:
308 +                return(0);
309          }
310          ip[0] = DOT(disp,v->hvec)/v->hn2 + 0.5 - v->hoff;
311          ip[1] = DOT(disp,v->vvec)/v->vn2 + 0.5 - v->voff;
312 < gotall:                                 /* return negative if behind */
313 <        rval = 1 - 2*(ip[2] <= 0.0);
314 <        if ((0.0 > ip[0]) | (ip[0] > 1.0) || (0.0 > ip[1]) | (ip[1] > 1.0))
314 <                return 2*rval;          /* +/-2 if outside frame */
315 <        return rval;
312 > gotall:                                 /* compute return value */
313 >        return( (1 - 2*(ip[2] <= 0.0)) * (1 +
314 >        ((0.0 >= ip[0]) | (ip[0] >= 1.0) | (0.0 >= ip[1]) | (ip[1] >= 1.0))) );
315   }
316  
317  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines