| 1 |
+ |
#ifndef lint |
| 2 |
+ |
static const char RCSid[] = "$Id$"; |
| 3 |
+ |
#endif |
| 4 |
|
/* |
| 5 |
|
* Compute time-step glare using imageless DGP calculation method. |
| 6 |
|
* |
| 70 |
|
error(SYSTEM, errmsg); |
| 71 |
|
} |
| 72 |
|
dt = DTfromHeader; |
| 73 |
< |
if ((err = cm_getheader(&dt, NULL, NULL, NULL, fp)) != NULL) |
| 73 |
> |
if ((err = cm_getheader(&dt, NULL, NULL, NULL, NULL, fp)) != NULL) |
| 74 |
|
error(USER, err); |
| 75 |
|
if ((dt != DTrgbe) & (dt != DTxyze) || |
| 76 |
|
!fscnresolu(&xr, &yr, fp)) { |
| 86 |
|
pmat = cm_alloc(myYR, myXR); |
| 87 |
|
memset(pmat->cmem, 0, sizeof(COLOR)*myXR*myYR); |
| 88 |
|
/* finish header */ |
| 89 |
< |
fputformat((char *)cm_fmt_id[myDT], fout); |
| 89 |
> |
fputformat(cm_fmt_id[myDT], fout); |
| 90 |
|
fputc('\n', fout); |
| 91 |
|
fflush(fout); |
| 92 |
|
} else if ((dt != myDT) | (xr != myXR) | (yr != myYR)) { |
| 96 |
|
} |
| 97 |
|
/* flat file check */ |
| 98 |
|
if ((data_start = ftell(fp)) > 0 && fseek(fp, 0L, SEEK_END) == 0) { |
| 99 |
< |
flat_file = (ftell(fp) == data_start + sizeof(COLR)*xr*yr); |
| 99 |
> |
flat_file = (ftell(fp) >= data_start + sizeof(COLR)*xr*yr); |
| 100 |
|
if (fseek(fp, data_start, SEEK_SET) < 0) { |
| 101 |
|
sprintf(errmsg, "cannot seek on picture '%s'", fname); |
| 102 |
|
error(SYSTEM, errmsg); |
| 303 |
|
if ((argc-a < 2) | (argc-a > 5)) |
| 304 |
|
goto userr; |
| 305 |
|
/* single bounce daylight coefficients file */ |
| 306 |
< |
direct_path = argv[++a]; |
| 306 |
> |
direct_path = argv[a++]; |
| 307 |
|
#else |
| 308 |
|
if ((argc-a < 1) | (argc-a > 4)) |
| 309 |
|
goto userr; |
| 478 |
|
fprintf(ofp, "FRAME=%d\n", i); |
| 479 |
|
fprintf(ofp, "NROWS=%d\n", rvec->nrows); |
| 480 |
|
fputs("NCOLS=1\nNCOMP=3\n", ofp); |
| 481 |
< |
if ((outfmt == 'f') | (outfmt == 'd')) |
| 481 |
> |
if ((outfmt == DTfloat) | (outfmt == DTdouble)) |
| 482 |
|
fputendian(ofp); |
| 483 |
< |
fputformat((char *)cm_fmt_id[outfmt], ofp); |
| 483 |
> |
fputformat(cm_fmt_id[outfmt], ofp); |
| 484 |
|
fputc('\n', ofp); |
| 485 |
|
} |
| 486 |
|
cm_write(rvec, outfmt, ofp); |
| 511 |
|
fprintf(ofp, "NCOLS=%d\n", rmtx->ncols); |
| 512 |
|
fputs("NCOMP=3\n", ofp); |
| 513 |
|
#endif /* DC_GLARE */ |
| 514 |
< |
if ((outfmt == 'f') | (outfmt == 'd')) |
| 514 |
> |
if ((outfmt == DTfloat) | (outfmt == DTdouble)) |
| 515 |
|
fputendian(ofp); |
| 516 |
< |
fputformat((char *)cm_fmt_id[outfmt], ofp); |
| 516 |
> |
fputformat(cm_fmt_id[outfmt], ofp); |
| 517 |
|
fputc('\n', ofp); |
| 518 |
|
} |
| 519 |
|
#ifdef DC_GLARE |