| 1 |
+ |
#ifndef lint |
| 2 |
+ |
static const char RCSid[] = "$Id$"; |
| 3 |
+ |
#endif |
| 4 |
|
/* |
| 5 |
|
* Compute time-step glare using imageless DGP calculation method. |
| 6 |
|
* |
| 36 |
|
#include "resolu.h" |
| 37 |
|
#include "cmglare.h" |
| 38 |
|
|
| 36 |
– |
char *progname; /* global argv[0] */ |
| 37 |
– |
|
| 39 |
|
/* Sum together a set of images and write result to fout */ |
| 40 |
|
static int |
| 41 |
|
sum_images(const char *fspec, const CMATRIX *cv, FILE *fout) |
| 94 |
|
} |
| 95 |
|
/* flat file check */ |
| 96 |
|
if ((data_start = ftell(fp)) > 0 && fseek(fp, 0L, SEEK_END) == 0) { |
| 97 |
< |
flat_file = (ftell(fp) == data_start + sizeof(COLR)*xr*yr); |
| 97 |
> |
flat_file = (ftell(fp) >= data_start + sizeof(COLR)*xr*yr); |
| 98 |
|
if (fseek(fp, data_start, SEEK_SET) < 0) { |
| 99 |
|
sprintf(errmsg, "cannot seek on picture '%s'", fname); |
| 100 |
|
error(SYSTEM, errmsg); |
| 185 |
|
clock_t timer = clock(); |
| 186 |
|
#endif /* DC_GLARE */ |
| 187 |
|
|
| 188 |
< |
progname = argv[0]; |
| 188 |
> |
fixargv0(argv[0]); |
| 189 |
|
/* get options */ |
| 190 |
|
for (a = 1; a < argc && argv[a][0] == '-'; a++) |
| 191 |
|
switch (argv[a][1]) { |
| 476 |
|
fprintf(ofp, "FRAME=%d\n", i); |
| 477 |
|
fprintf(ofp, "NROWS=%d\n", rvec->nrows); |
| 478 |
|
fputs("NCOLS=1\nNCOMP=3\n", ofp); |
| 479 |
< |
if ((outfmt == 'f') | (outfmt == 'd')) |
| 479 |
> |
if ((outfmt == DTfloat) | (outfmt == DTdouble)) |
| 480 |
|
fputendian(ofp); |
| 481 |
|
fputformat(cm_fmt_id[outfmt], ofp); |
| 482 |
|
fputc('\n', ofp); |
| 509 |
|
fprintf(ofp, "NCOLS=%d\n", rmtx->ncols); |
| 510 |
|
fputs("NCOMP=3\n", ofp); |
| 511 |
|
#endif /* DC_GLARE */ |
| 512 |
< |
if ((outfmt == 'f') | (outfmt == 'd')) |
| 512 |
> |
if ((outfmt == DTfloat) | (outfmt == DTdouble)) |
| 513 |
|
fputendian(ofp); |
| 514 |
|
fputformat(cm_fmt_id[outfmt], ofp); |
| 515 |
|
fputc('\n', ofp); |