| 1 |
< |
/* Copyright (c) 1992 Regents of the University of California */ |
| 1 |
> |
/* Copyright (c) 1998 Silicon Graphics, Inc. */ |
| 2 |
|
|
| 3 |
|
#ifndef lint |
| 4 |
< |
static char SCCSid[] = "$SunId$ LBL"; |
| 4 |
> |
static char SCCSid[] = "$SunId$ SGI"; |
| 5 |
|
#endif |
| 6 |
|
|
| 7 |
|
/* |
| 20 |
|
|
| 21 |
|
static BYTE (*g_bval)[256] = NULL; |
| 22 |
|
|
| 23 |
+ |
#ifndef pow |
| 24 |
|
extern double pow(); |
| 25 |
+ |
#endif |
| 26 |
|
|
| 27 |
|
|
| 28 |
|
setcolrcor(f, a2) /* set brightness correction */ |
| 60 |
|
/* compute gamb -> colr mapping */ |
| 61 |
|
i = 0; |
| 62 |
|
mult = 256.0; |
| 63 |
< |
for (j = 255; j > 0; j--) { |
| 64 |
< |
while ((g_mant[j] = mult * (*f)(j/256.0, a2)) < 128) { |
| 63 |
> |
for (j = 256; j--; ) { |
| 64 |
> |
while ((g_mant[j] = mult * (*f)((j+.5)/256.0, a2)) < 128) { |
| 65 |
|
i++; |
| 66 |
|
mult *= 2.0; |
| 67 |
|
} |
| 68 |
|
g_nexp[j] = i; |
| 69 |
|
} |
| 68 |
– |
g_mant[0] = 0; |
| 69 |
– |
g_nexp[0] = COLXS; |
| 70 |
|
return(0); |
| 71 |
|
} |
| 72 |
|
|