93 |
|
ls[i] = bi; |
94 |
|
if (cs == TM_NOCHROM) /* no color? */ |
95 |
|
continue; |
96 |
– |
if (tmTop->flags & TM_F_BW) |
97 |
– |
cmon[RED] = cmon[GRN] = cmon[BLU] = li; |
96 |
|
/* mesopic adj. */ |
97 |
|
if (tmTop->flags & TM_F_MESOPIC && bi < BMESUPPER) { |
98 |
|
register int pf, sli = normscot(cmon); |
99 |
|
if (bi < BMESLOWER) |
100 |
|
cmon[RED] = cmon[GRN] = cmon[BLU] = sli; |
101 |
|
else { |
102 |
+ |
if (tmTop->flags & TM_F_BW) |
103 |
+ |
cmon[RED] = cmon[GRN] = cmon[BLU] = li; |
104 |
|
pf = photofact[bi-BMESLOWER]; |
105 |
|
sli *= 256 - pf; |
106 |
|
cmon[RED] = ( sli + pf*cmon[RED] ) >> 8; |
107 |
|
cmon[GRN] = ( sli + pf*cmon[GRN] ) >> 8; |
108 |
|
cmon[BLU] = ( sli + pf*cmon[BLU] ) >> 8; |
109 |
|
} |
110 |
+ |
} else if (tmTop->flags & TM_F_BW) { |
111 |
+ |
cmon[RED] = cmon[GRN] = cmon[BLU] = li; |
112 |
|
} |
113 |
|
bi = ( (int4)GAMTSZ*cd->clfb[RED]*cmon[RED]/li ) >> 8; |
114 |
|
cs[3*i ] = bi>=GAMTSZ ? 255 : cd->gamb[bi]; |