| 79 |
|
return(1); |
| 80 |
|
writerr: |
| 81 |
|
fputs(progname, stderr); |
| 82 |
< |
fputs(": error writing scanline\n", stderr); |
| 82 |
> |
fputs(": error writing picture\n", stderr); |
| 83 |
|
return(0); |
| 84 |
|
readerr: |
| 85 |
|
fputs(progname, stderr); |
| 86 |
< |
fputs(": error reading scanline\n", stderr); |
| 86 |
> |
fputs(": error reading picture\n", stderr); |
| 87 |
|
return(0); |
| 88 |
|
} |
| 89 |
|
|
| 91 |
|
static int |
| 92 |
|
binary_copyf(FILE *fp, int asize) |
| 93 |
|
{ |
| 94 |
< |
const int skip_thresh = 1024; |
| 94 |
> |
const int skip_thresh = 8192; |
| 95 |
|
const size_t elsiz = asize*ncomp; |
| 96 |
|
const int width = scanlen(&res); |
| 97 |
|
const long skip_len = (width-ncols)*elsiz; |
| 258 |
|
return(1); |
| 259 |
|
} |
| 260 |
|
printargs(argc, argv, stdout); |
| 261 |
< |
if (gotvw) { |
| 261 |
> |
if (gotvw) { /* adjust view? */ |
| 262 |
|
double p0[2], p1[2]; |
| 263 |
|
const char *err; |
| 264 |
|
if (res.rt & YMAJOR) { |
| 287 |
|
fputs(err, stderr); |
| 288 |
|
fputc('\n', stderr); |
| 289 |
|
return(1); |
| 290 |
+ |
} else { |
| 291 |
+ |
fputs(VIEWSTR, stdout); |
| 292 |
+ |
fprintview(&vw, stdout); |
| 293 |
+ |
fputc('\n', stdout); |
| 294 |
|
} |
| 291 |
– |
fputs(VIEWSTR, stdout); |
| 292 |
– |
fprintview(&vw, stdout); |
| 293 |
– |
fputc('\n', stdout); |
| 295 |
|
} |
| 296 |
|
if (gotdims) |
| 297 |
|
printf("NROWS=%d\nNCOLS=%d\n", nrows, ncols); |
| 316 |
|
asiz = sizeof(float); |
| 317 |
|
} else if (!strcmp(fmt, "double")) { |
| 318 |
|
asiz = sizeof(double); |
| 319 |
+ |
} else if (!strcmp(fmt, "32-bit_encoded_normal")) { |
| 320 |
+ |
asiz = 4; |
| 321 |
+ |
ncomp = 1; |
| 322 |
+ |
} else if (!strcmp(fmt, "16-bit_encoded_depth")) { |
| 323 |
+ |
asiz = 2; |
| 324 |
+ |
ncomp = 1; |
| 325 |
|
} else if (globmatch(PICFMT, fmt)) { |
| 326 |
|
asiz = -1; |
| 327 |
|
if (!ncomp) ncomp = 3; |
| 328 |
+ |
else ncomp *= (ncomp == 3); |
| 329 |
|
} else if (strcasecmp(fmt, "ascii")) { |
| 330 |
|
fputs(progname, stderr); |
| 331 |
|
fputs(": unsupported format - ", stderr); |
| 341 |
|
if (!(asiz < 0 ? colr_copyf(fp) : |
| 342 |
|
!asiz ? ascii_copyf(fp) : binary_copyf(fp, asiz))) |
| 343 |
|
return(1); |
| 344 |
+ |
/* need to consume the rest? */ |
| 345 |
+ |
if (fp == stdin && rmin+nrows < numscans(&res) && |
| 346 |
+ |
fseek(fp, 0L, SEEK_END) < 0) |
| 347 |
+ |
while (getc(fp) != EOF) |
| 348 |
+ |
; |
| 349 |
|
return(0); |
| 350 |
|
usage: |
| 351 |
|
fputs("Usage: ", stderr); |