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.3 by greg, Fri Jul 19 00:01:49 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);
# Line 57 | Line 59 | extern int     process_dc_header(DEPTHCODEC *dcp, int ac,
59   /* Check that we have what we need to decode depths */
60   extern int      check_decode_depths(DEPTHCODEC *dcp);
61  
62 < /* Decode next depth pixel */
62 > /* Decode next depth pixel from input */
63   extern double   decode_depth_next(DEPTHCODEC *dcp);
64  
65   /* Seek to the indicated pixel position */
# Line 69 | Line 71 | extern double  decode_depth_pix(DEPTHCODEC *dcp, int x,
71   /* Check that we have what we need to decode world positions */
72   extern int      check_decode_worldpos(DEPTHCODEC *dcp);
73  
74 < /* Compute world position from depth */
74 > /* Compute world position from pixel position and depth */
75   extern int      compute_worldpos(FVECT wpos, DEPTHCODEC *dcp,
76                                          int x, int y, double d);
77  
78 < /* Decode the next world position */
78 > /* Decode the next world position from input */
79   int             decode_worldpos_next(FVECT wpos, DEPTHCODEC *dcp);
80  
81 < /* Read and decode the world position at the given pixel */
81 > /* Decode depth and compute world position for the given pixel */
82   extern int      get_worldpos_pix(FVECT wpos, DEPTHCODEC *dcp, int x, int y);
83  
84   extern char     *progname;      /* global argv[0] (set by main) */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines