| 9 |
|
|
| 10 |
|
#include <stdio.h> |
| 11 |
|
#include <math.h> |
| 12 |
+ |
|
| 13 |
+ |
#include "rtmisc.h" |
| 14 |
|
#include "color.h" |
| 15 |
|
|
| 14 |
– |
extern char *bmalloc(); |
| 16 |
|
|
| 17 |
|
#define MAXGSHIFT 31 /* maximum shift for gamma table */ |
| 18 |
|
|
| 19 |
< |
static BYTE *g_mant = NULL, *g_nexp = NULL; |
| 19 |
> |
static uby8 *g_mant = NULL, *g_nexp = NULL; |
| 20 |
|
|
| 21 |
< |
static BYTE (*g_bval)[256] = NULL; |
| 21 |
> |
static uby8 (*g_bval)[256] = NULL; |
| 22 |
|
|
| 23 |
|
|
| 24 |
|
int |
| 25 |
|
setcolrcor(f, a2) /* set brightness correction */ |
| 26 |
< |
double (*f)(); |
| 26 |
> |
double (*f)(double,double); |
| 27 |
|
double a2; |
| 28 |
|
{ |
| 29 |
|
double mult; |
| 30 |
|
register int i, j; |
| 31 |
|
/* allocate tables */ |
| 32 |
|
if (g_bval == NULL && (g_bval = |
| 33 |
< |
(BYTE (*)[256])bmalloc((MAXGSHIFT+1)*256)) == NULL) |
| 33 |
> |
(uby8 (*)[256])bmalloc((MAXGSHIFT+1)*256)) == NULL) |
| 34 |
|
return(-1); |
| 35 |
|
/* compute colr -> gamb mapping */ |
| 36 |
|
mult = 1.0/256.0; |
| 45 |
|
|
| 46 |
|
int |
| 47 |
|
setcolrinv(f, a2) /* set inverse brightness correction */ |
| 48 |
< |
double (*f)(); |
| 48 |
> |
double (*f)(double,double); |
| 49 |
|
double a2; |
| 50 |
|
{ |
| 51 |
|
double mult; |
| 52 |
|
register int i, j; |
| 53 |
|
/* allocate tables */ |
| 54 |
< |
if (g_mant == NULL && (g_mant = (BYTE *)bmalloc(256)) == NULL) |
| 54 |
> |
if (g_mant == NULL && (g_mant = (uby8 *)bmalloc(256)) == NULL) |
| 55 |
|
return(-1); |
| 56 |
< |
if (g_nexp == NULL && (g_nexp = (BYTE *)bmalloc(256)) == NULL) |
| 56 |
> |
if (g_nexp == NULL && (g_nexp = (uby8 *)bmalloc(256)) == NULL) |
| 57 |
|
return(-1); |
| 58 |
|
/* compute gamb -> colr mapping */ |
| 59 |
|
i = 0; |