--- ray/src/util/dctimestep.c 2019/10/23 17:00:14 2.43 +++ ray/src/util/dctimestep.c 2022/03/03 03:55:13 2.46 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: dctimestep.c,v 2.43 2019/10/23 17:00:14 greg Exp $"; +static const char RCSid[] = "$Id: dctimestep.c,v 2.46 2022/03/03 03:55:13 greg Exp $"; #endif /* * Compute time-step result using Daylight Coefficient method. @@ -48,7 +48,7 @@ sum_images(const char *fspec, const CMATRIX *cv, FILE error(SYSTEM, errmsg); } dt = DTfromHeader; - if ((err = cm_getheader(&dt, NULL, NULL, NULL, fp)) != NULL) + if ((err = cm_getheader(&dt, NULL, NULL, NULL, NULL, fp)) != NULL) error(USER, err); if ((dt != DTrgbe) & (dt != DTxyze) || !fscnresolu(&xr, &yr, fp)) { @@ -64,7 +64,7 @@ sum_images(const char *fspec, const CMATRIX *cv, FILE pmat = cm_alloc(myYR, myXR); memset(pmat->cmem, 0, sizeof(COLOR)*myXR*myYR); /* finish header */ - fputformat((char *)cm_fmt_id[myDT], fout); + fputformat(cm_fmt_id[myDT], fout); fputc('\n', fout); fflush(fout); } else if ((dt != myDT) | (xr != myXR) | (yr != myYR)) { @@ -240,6 +240,10 @@ main(int argc, char *argv[]) ofspec = NULL; /* only need to open once */ } if (hasNumberFormat(argv[a])) { /* generating image(s) */ + if (outfmt != DTrgbe) { + error(WARNING, "changing output type to -oc"); + outfmt = DTrgbe; + } if (ofspec == NULL) { SET_FILE_BINARY(ofp); newheader("RADIANCE", ofp); @@ -304,7 +308,7 @@ main(int argc, char *argv[]) fputs("NCOLS=1\nNCOMP=3\n", ofp); if ((outfmt == 'f') | (outfmt == 'd')) fputendian(ofp); - fputformat((char *)cm_fmt_id[outfmt], ofp); + fputformat(cm_fmt_id[outfmt], ofp); fputc('\n', ofp); } cm_write(rvec, outfmt, ofp); @@ -332,7 +336,7 @@ main(int argc, char *argv[]) fputs("NCOMP=3\n", ofp); if ((outfmt == 'f') | (outfmt == 'd')) fputendian(ofp); - fputformat((char *)cm_fmt_id[outfmt], ofp); + fputformat(cm_fmt_id[outfmt], ofp); fputc('\n', ofp); } cm_write(rmtx, outfmt, ofp); @@ -346,9 +350,9 @@ main(int argc, char *argv[]) cm_free(cmtx); return(0); userr: - fprintf(stderr, "Usage: %s [-n nsteps][-o ospec][-i{f|d|h}][-o{f|d}] DCspec [skyf]\n", + fprintf(stderr, "Usage: %s [-n nsteps][-o ospec][-i{f|d|h}][-o{f|d|c}] DCspec [skyf]\n", progname); - fprintf(stderr, " or: %s [-n nsteps][-o ospec][-i{f|d|h}][-o{f|d}] Vspec Tbsdf Dmat.dat [skyf]\n", + fprintf(stderr, " or: %s [-n nsteps][-o ospec][-i{f|d|h}][-o{f|d|c}] Vspec Tbsdf Dmat.dat [skyf]\n", progname); return(1); }