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

Comparing ray/src/common/depthcodec.h (file contents):
Revision 2.5 by greg, Thu Nov 7 23:20:28 2019 UTC vs.
Revision 2.7 by greg, Sat Jan 25 05:35:34 2020 UTC

# Line 50 | Line 50 | typedef struct {
50   #if 1
51   #define depth2code(d, dref) \
52                  ( (d) > (dref) ? (int)(32768.001 - 32768.*(dref)/(d))-1 : \
53 <                  (d) > .0 ? (int)(32767.*(d)/(dref) - 32768.) : -32768 )
53 >                  (d) > .0 ? (int)(32767.*(d)/(dref) - 32768.999) : -32768 )
54   #else
55   extern int      depth2code(double d, double dref);
56   #endif
# Line 59 | Line 59 | extern int     depth2code(double d, double dref);
59   #if 1
60   #define code2depth(c, dref) \
61                  ( (c) <= -32768 ? .0 : (c) >= 32767 ? FHUGE : \
62 <                  (c) < 0 ? (dref)*(32767.5 + (c))*(1./32767.) : \
62 >                  (c) < -1 ? (dref)*(32768.5 + (c))*(1./32767.) : \
63                                  (dref)*32768./(32766.5 - (c)) )
64   #else
65   extern double   code2depth(int c, double dref);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines