262 |
|
) |
263 |
|
{ |
264 |
|
static const char funcName[] = "tmCvColors"; |
265 |
– |
static COLOR csmall = {.5*MINLUM, .5*MINLUM, .5*MINLUM}; |
265 |
|
static BYTE gamtab[1024]; |
266 |
|
static double curgam = .0; |
267 |
|
COLOR cmon; |
300 |
|
lum = tms->clf[RED]*cmon[RED] + |
301 |
|
tms->clf[GRN]*cmon[GRN] + |
302 |
|
tms->clf[BLU]*cmon[BLU] ; |
303 |
< |
if (lum <= TM_NOLUM) /* convert brightness */ |
303 |
> |
if (lum <= TM_NOLUM) { /* convert brightness */ |
304 |
> |
lum = cmon[RED] = cmon[GRN] = cmon[BLU] = TM_NOLUM; |
305 |
|
ls[i] = TM_NOBRT; |
306 |
< |
else |
306 |
> |
} else |
307 |
|
ls[i] = tmCvLumLUfp(&lum); |
308 |
|
if (cs == TM_NOCHROM) /* no color? */ |
309 |
|
continue; |
310 |
|
if (tms->flags & TM_F_MESOPIC && lum < LMESUPPER) { |
311 |
|
slum = scotlum(cmon); /* mesopic adj. */ |
312 |
< |
if (lum < LMESLOWER) |
312 |
> |
if (lum < LMESLOWER) { |
313 |
|
cmon[RED] = cmon[GRN] = cmon[BLU] = slum; |
314 |
< |
else { |
314 |
> |
} else { |
315 |
|
d = (lum - LMESLOWER)/(LMESUPPER - LMESLOWER); |
316 |
|
if (tms->flags & TM_F_BW) |
317 |
|
cmon[RED] = cmon[GRN] = |