--- ray/src/common/colrops.c 1990/10/19 21:31:54 1.2 +++ ray/src/common/colrops.c 1992/02/18 15:25:55 2.2 @@ -10,7 +10,7 @@ static char SCCSid[] = "$SunId$ LBL"; #include "color.h" -#define MAXGSHIFT 4 /* maximum shift for gamma table */ +#define MAXGSHIFT 15 /* maximum shift for gamma table */ static BYTE g_mant[256], g_nexp[256]; @@ -128,8 +128,17 @@ register COLR *scan; register int len; register int adjust; { + int minexp; + + if (adjust == 0) + return; + minexp = adjust < 0 ? -adjust : 0; while (len-- > 0) { - scan[0][EXP] += adjust; + if (scan[0][EXP] <= minexp) + scan[0][RED] = scan[0][GRN] = scan[0][BLU] = + scan[0][EXP] = 0; + else + scan[0][EXP] += adjust; scan++; } }