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.44 by greg, Wed Jan 24 17:22:24 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 308 | Line 307 | FVECT  p
307          }
308          ip[0] = DOT(disp,v->hvec)/v->hn2 + 0.5 - v->hoff;
309          ip[1] = DOT(disp,v->vvec)/v->vn2 + 0.5 - v->voff;
310 < gotall:                                 /* return negative if behind */
311 <        rval = 1 - 2*(ip[2] <= 0.0);
312 <        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;
310 > gotall:                                 /* compute return value */
311 >        return( (1 - 2*(ip[2] <= 0.0)) * (1 +
312 >        ((0.0 >= ip[0]) | (ip[0] >= 1.0) | (0.0 >= ip[1]) | (ip[1] >= 1.0))) );
313   }
314  
315  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines