--- ray/src/px/ra_tiff.c 1991/08/15 15:47:35 1.5 +++ ray/src/px/ra_tiff.c 1994/02/27 10:17:27 2.6 @@ -10,19 +10,22 @@ static char SCCSid[] = "$SunId$ LBL"; #include +#include + #include "tiffio.h" #include "color.h" -extern double atof(); +#include "resolu.h" + extern char *malloc(), *realloc(); int lzcomp = 0; /* use Lempel-Ziv compression? */ int greyscale = 0; /* produce greyscale image? */ -double gamma = 2.2; /* gamma correction */ +double gamcor = 2.2; /* gamma correction */ int bradj = 0; /* brightness adjustment */ @@ -42,7 +45,7 @@ char *argv[]; if (argv[i][0] == '-') switch (argv[i][1]) { case 'g': - gamma = atof(argv[++i]); + gamcor = atof(argv[++i]); break; case 'z': lzcomp = !lzcomp; @@ -66,7 +69,7 @@ char *argv[]; else break; doneopts: - setcolrgam(gamma); + setcolrgam(gamcor); if (reverse) if (i != argc-2 && i != argc-1) @@ -136,13 +139,14 @@ char *inpf, *outf; if (outf != NULL && strcmp(outf, "-") && freopen(outf, "w", stdout) == NULL) quiterr("cannot open Radiance output file"); + newheader("RADIANCE", stdout); fputs(progname, stdout); if (bradj) printf(" -e %+d", bradj); fputs(" -r\n", stdout); fputformat(COLRFMT, stdout); putchar('\n'); - fputresolu(YDECR|YMAJOR, xmax, ymax, stdout); + fprtresolu((int)xmax, (int)ymax, stdout); /* convert image */ if (nsamps == 1) pconfig = 1; @@ -204,7 +208,7 @@ char *inpf, *outf; if (strcmp(inpf, "-") && freopen(inpf, "r", stdin) == NULL) quiterr("cannot open Radiance input file"); if (checkheader(stdin, COLRFMT, NULL) < 0 || - fgetresolu(&xmax, &ymax, stdin) != (YDECR|YMAJOR)) + fgetresolu(&xmax, &ymax, stdin) < 0) quiterr("bad Radiance picture"); /* open TIFF file */ if ((tif = TIFFOpen(outf, "w")) == NULL)