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

Comparing ray/src/util/depthcodec.c (file contents):
Revision 2.2 by greg, Thu Jul 18 22:33:34 2019 UTC vs.
Revision 2.3 by greg, Fri Jul 19 01:24:33 2019 UTC

# Line 15 | Line 15 | static const char RCSid[] = "$Id$";
15   #include "fvect.h"
16   #include "depthcodec.h"
17  
18 char            *progname = "depth_codec";
18  
20
19   #if 0                   /* defined as macro in depthcodec.h */
20   /* Encode depth as 16-bit signed integer */
21   int
# Line 63 | Line 61 | set_dc_defaults(DEPTHCODEC *dcp)
61          dcp->depth_unit[0] = '1';
62          dcp->vw = stdview;
63          dcp->res.rt = PIXSTANDARD;
64 +        if (!progname) progname = "depth_codec";
65   }
66  
67  
# Line 174 | Line 173 | check_decode_worldpos(DEPTHCODEC *dcp)
173                  return 0;
174          if ((dcp->res.xr <= 0) | (dcp->res.yr <= 0)) {
175                  fputs(progname, stderr);
176 <                fputs(": missing image resolution\n", stderr);
176 >                fputs(": missing map resolution\n", stderr);
177                  return 0;
178          }
179          if (!dcp->gotview) {
# Line 254 | Line 253 | seek_dc_pix(DEPTHCODEC *dcp, int x, int y)
253  
254          if ((dcp->res.xr <= 0) | (dcp->res.yr <= 0)) {
255                  fputs(progname, stderr);
256 <                fputs(": need image resolution to seek\n", stderr);
256 >                fputs(": need map resolution to seek\n", stderr);
257                  return -1;
258          }
259          if ((x < 0) | (y < 0) ||
260                          (x >= scanlen(&dcp->res)) | (y >= numscans(&dcp->res))) {
261                  fputs(dcp->inpname, stderr);
262 <                fputs(": warning - pixel index off image\n", stderr);
262 >                fputs(": warning - pixel index off map\n", stderr);
263                  return 0;
264          }
265          seekpos = dcp->dstart + 2*((long)y*scanlen(&dcp->res) + x);
266 +
267          if (seekpos != dcp->curpos &&
268                          fseek(dcp->finp, seekpos, SEEK_SET) == EOF) {
269                  fputs(dcp->inpname, stderr);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines