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 |
|
|
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); |
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); |
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++) |