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

Comparing ray/src/util/depthcodec.h (file contents):
Revision 2.1 by greg, Thu Jul 18 18:51:56 2019 UTC vs.
Revision 2.2 by greg, Thu Jul 18 22:33:34 2019 UTC

# Line 43 | Line 43 | typedef struct {
43   } DEPTHCODEC;
44  
45   /* Encode depth as 16-bit signed integer */
46 < extern short    depth2code(double d, double dref);
46 > #define depth2code(d, dref) \
47 >                ( (d) > (dref) ? (int)(32768 - 32768*(dref)/(d))-1 : \
48 >                  (d) > .0 ? (int)(32767*(d)/(dref) - 32768) : -32768 )
49  
50   /* Decode depth from 16-bit signed integer */
51 < extern double   code2depth(short c, double dref);
51 > extern double   code2depth(int c, double dref);
52  
53   /* Set codec defaults */
54   extern void     set_dc_defaults(DEPTHCODEC *dcp);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines