--- ray/src/px/ra_gif.c 1994/06/10 12:51:27 2.4 +++ ray/src/px/ra_gif.c 2003/02/22 02:07:27 2.7 @@ -1,9 +1,6 @@ -/* Copyright (c) 1994 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: ra_gif.c,v 2.7 2003/02/22 02:07:27 greg Exp $"; #endif - /* * Convert from Radiance picture file to Compuserve GIF. * Currently, we don't know how to get back. @@ -11,6 +8,8 @@ static char SCCSid[] = "$SunId$ LBL"; #include +#include + #include "color.h" #include "resolu.h" @@ -52,6 +51,8 @@ int dither = 1; /* dither colors? */ int bradj = 0; /* brightness adjustment */ +int ncolors = 0; /* number of colors requested */ + char *progname; @@ -59,7 +60,6 @@ main(argc, argv) int argc; char *argv[]; { - int ncolors = 0; int bitsperpix; int i; #ifdef MSDOS @@ -142,7 +142,7 @@ char *argv[]; exit(0); userr: fprintf(stderr, - "Usage: %s [-b][-c ncolors][-g gamv][-e +/-stops] input [output]\n", + "Usage: %s [-b][-d][-n samp][-c ncolors][-g gamv][-e +/-stops] input [output]\n", progname); exit(1); } @@ -228,7 +228,7 @@ int x, y; getrow(y); if (greyscale) - return(normbright(scanln[x])); + return((normbright(scanln[x])*ncolors)>>8); if (pixscan != NULL) return(pixscan[x]); return(samplefac ? neu_map_pixel(scanln[x]) : map_pixel(scanln[x]));