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

Comparing src/util/dcglare.c (file contents):
Revision 2.5 by greg, Thu Mar 3 03:55:13 2022 UTC vs.
Revision 2.10 by greg, Sat Jun 7 05:09:46 2025 UTC

# Line 1 | Line 1
1 + #ifndef lint
2 + static const char RCSid[] = "$Id$";
3 + #endif
4   /*
5   * Compute time-step glare using imageless DGP calculation method.
6   *
# Line 33 | Line 36
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)
# Line 93 | Line 94 | sum_images(const char *fspec, const CMATRIX *cv, FILE
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);
# Line 184 | Line 185 | main(int argc, char *argv[])
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]) {
# Line 475 | Line 476 | main(int argc, char *argv[])
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);
# Line 508 | Line 509 | main(int argc, char *argv[])
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);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines