21 |
|
static float gamtab[1<<GAMTABBITS]; |
22 |
|
static float gammul[16]; |
23 |
|
static double cur_gam = 0.; |
24 |
< |
static BYTE mongamtab[MONGAMTSZ]; |
24 |
> |
static uby8 mongamtab[MONGAMTSZ]; |
25 |
|
static double cur_mongam = 0.; |
26 |
|
|
27 |
|
#define imultpow2(i,s) ((s)>=0 ? (i)<<(s) : (i)>>-(s)) |
170 |
|
|
171 |
|
/* Convert a 48-bit RGB scanline to encoded luminance/chrominance */ |
172 |
|
int |
173 |
< |
tmCvRGB48(TMstruct *tms, TMbright *ls, BYTE *cs, |
173 |
> |
tmCvRGB48(TMstruct *tms, TMbright *ls, uby8 *cs, |
174 |
|
uint16 (*scan)[3], int len, double gv) |
175 |
|
{ |
176 |
|
static const char funcName[] = "tmCvRGB48"; |
257 |
|
cmon[BLU] = slum + pf*cmon[BLU]; |
258 |
|
} |
259 |
|
} else if (tms->flags & TM_F_BW) { |
260 |
< |
cmon[RED] = cmon[GRN] = cmon[BLU] = lum; |
260 |
> |
int j = 3; |
261 |
> |
while (j--) cs[3*i+j] = tms->cdiv[j]/(TM_BRES>>8); |
262 |
> |
continue; |
263 |
|
} |
264 |
|
bi = (double)MONGAMTSZ*tms->clf[RED]*cmon[RED]/lum; |
265 |
|
cs[3*i ] = bi>=MONGAMTSZ ? 255 : mongamtab[bi]; |