--- ray/src/px/ra_pr.c 1991/11/12 16:05:09 2.1 +++ ray/src/px/ra_pr.c 1994/02/27 10:17:12 2.5 @@ -13,6 +13,8 @@ static char SCCSid[] = "$SunId$ LBL"; #include +#include + #include "rasterfile.h" #include "color.h" @@ -39,10 +41,8 @@ extern char *ecalloc(), *emalloc(); extern long ftell(); -extern double atof(), pow(); +double gamcor = 2.2; /* gamma correction */ -double gamma = 2.2; /* gamma correction */ - int bradj = 0; /* brightness adjustment */ pic *inpic, *outpic; @@ -77,7 +77,7 @@ char *argv[]; dither = !dither; break; case 'g': - gamma = atof(argv[++i]); + gamcor = atof(argv[++i]); break; case 'b': greyscale = !greyscale; @@ -122,6 +122,7 @@ char *argv[]; head.ras_depth != 8) quiterr("incompatible format"); /* put header */ + newheader("RADIANCE", stdout); printargs(i, argv, stdout); fputformat(COLRFMT, stdout); putchar('\n'); @@ -258,9 +259,9 @@ struct rasterfile *h; /* convert table */ for (i = 0; i < h->ras_maplength/3; i++) setcolr(ctab[i], - pow((cmap[0][i]+.5)/256.,gamma), - pow((cmap[1][i]+.5)/256.,gamma), - pow((cmap[2][i]+.5)/256.,gamma)); + pow((cmap[0][i]+.5)/256.,gamcor), + pow((cmap[1][i]+.5)/256.,gamcor), + pow((cmap[2][i]+.5)/256.,gamcor)); if (bradj) shiftcolrs(ctab, 256, bradj); /* convert file */ @@ -361,7 +362,7 @@ colormap map; register int i, val; for (i = 0; i < 256; i++) { - val = pow((i+0.5)/256.0, 1.0/gamma) * 256.0; + val = pow((i+0.5)/256.0, 1.0/gamcor) * 256.0; map[0][i] = map[1][i] = map[2][i] = val; } }