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

Comparing ray/src/util/rcode_depth.c (file contents):
Revision 2.11 by greg, Mon Jul 20 15:53:30 2020 UTC vs.
Revision 2.13 by greg, Tue Jun 3 21:31:51 2025 UTC

# Line 15 | Line 15 | static const char RCSid[] = "$Id$";
15   #include "fvect.h"
16   #include "depthcodec.h"
17  
18 char            *progname;              /* set in main() */
19
18   enum {CV_FWD, CV_REV, CV_PTS};
19  
20  
# Line 162 | Line 160 | pixel_depths(DEPTHCODEC *dcp, int unbuf)
160                  return 0;
161  
162          while (scanf("%d %d", &xy[0], &xy[1]) == 2) {
163 <
164 <                loc2pix(xy, &dcp->res,
167 <                        (xy[0]+.5)/dcp->res.xr, (xy[1]+.5)/dcp->res.yr);
168 <
163 >                loc2pix(xy, &dcp->res, xy[0]/(double)dcp->res.xr,
164 >                                xy[1]/(double)dcp->res.yr);
165                  d = decode_depth_pix(dcp, xy[0], xy[1]);
166                  if (d < -FTINY)
167                          return 0;
172
168                  output_depth(dcp, d);
174
169                  if (unbuf && fflush(stdout) == EOF) {
170                          fputs(progname, stderr);
171                          fputs(": write error on output\n", stderr);
# Line 260 | Line 254 | pixel_points(DEPTHCODEC *dcp, int unbuf)
254                  return 0;
255  
256          while (scanf("%d %d", &xy[0], &xy[1]) == 2) {
257 <                loc2pix(xy, &dcp->res,
258 <                        (xy[0]+.5)/dcp->res.xr, (xy[1]+.5)/dcp->res.yr);
257 >                loc2pix(xy, &dcp->res, xy[0]/(double)dcp->res.xr,
258 >                                xy[1]/(double)dcp->res.yr);
259                  if (get_worldpos_pix(wpos, dcp, xy[0], xy[1]) < 0)
260                          return 0;
261                  output_worldpos(dcp, wpos);
# Line 289 | Line 283 | main(int argc, char *argv[])
283          int             unbuffered = 0;
284          DEPTHCODEC      dc;
285          int             a;
286 <
287 <        progname = argv[0];
286 >                                        /* set global progname */
287 >        fixargv0(argv[0]);
288          set_dc_defaults(&dc);
289          dc.hdrflags = HF_ALL;
290          for (a = 1; a < argc && argv[a][0] == '-'; a++)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines