1 |
– |
/* Copyright (c) 1998 Silicon Graphics, Inc. */ |
2 |
– |
|
1 |
|
#ifndef lint |
2 |
< |
static char SCCSid[] = "$SunId$ SGI"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
6 |
– |
|
4 |
|
/* |
5 |
|
* Integer operations on COLR scanlines |
6 |
|
*/ |
7 |
|
|
8 |
+ |
#include "copyright.h" |
9 |
+ |
|
10 |
+ |
#include <math.h> |
11 |
|
#include "color.h" |
12 |
|
|
13 |
– |
#define NULL 0 |
14 |
– |
|
13 |
|
extern char *bmalloc(); |
14 |
|
|
15 |
|
#define MAXGSHIFT 31 /* maximum shift for gamma table */ |
18 |
|
|
19 |
|
static BYTE (*g_bval)[256] = NULL; |
20 |
|
|
23 |
– |
#ifndef pow |
24 |
– |
extern double pow(); |
25 |
– |
#endif |
21 |
|
|
22 |
< |
|
22 |
> |
int |
23 |
|
setcolrcor(f, a2) /* set brightness correction */ |
24 |
|
double (*f)(); |
25 |
|
double a2; |
41 |
|
} |
42 |
|
|
43 |
|
|
44 |
+ |
int |
45 |
|
setcolrinv(f, a2) /* set inverse brightness correction */ |
46 |
|
double (*f)(); |
47 |
|
double a2; |
67 |
|
} |
68 |
|
|
69 |
|
|
70 |
+ |
int |
71 |
|
setcolrgam(g) /* set gamma conversion */ |
72 |
|
double g; |
73 |
|
{ |
77 |
|
} |
78 |
|
|
79 |
|
|
80 |
+ |
int |
81 |
|
colrs_gambs(scan, len) /* convert scanline of colrs to gamma bytes */ |
82 |
|
register COLR *scan; |
83 |
|
int len; |
127 |
|
} |
128 |
|
|
129 |
|
|
130 |
+ |
int |
131 |
|
gambs_colrs(scan, len) /* convert gamma bytes to colr scanline */ |
132 |
|
register COLR *scan; |
133 |
|
int len; |
164 |
|
} |
165 |
|
|
166 |
|
|
167 |
+ |
void |
168 |
|
shiftcolrs(scan, len, adjust) /* shift a scanline of colors by 2^adjust */ |
169 |
|
register COLR *scan; |
170 |
|
register int len; |
186 |
|
} |
187 |
|
|
188 |
|
|
189 |
+ |
void |
190 |
|
normcolrs(scan, len, adjust) /* normalize a scanline of colrs */ |
191 |
|
register COLR *scan; |
192 |
|
int len; |