43 |
|
return(NULL); |
44 |
|
|
45 |
|
tmnew->flags = flags & ~TM_F_UNIMPL; |
46 |
+ |
if (tmnew->flags & TM_F_BW) |
47 |
+ |
tmnew->flags &= ~TM_F_MESOPIC; |
48 |
|
/* set monitor transform */ |
49 |
|
if (monpri == NULL || monpri == stdprims || tmnew->flags & TM_F_BW) { |
50 |
|
tmnew->monpri = stdprims; |
175 |
|
if ((ls == NULL) | (scan == NULL) | (len < 0)) |
176 |
|
returnErr(TM_E_ILLEGAL); |
177 |
|
for (i = len; i--; ) { |
178 |
< |
if (tmNeedMatrix(tmTop)) /* get monitor RGB */ |
178 |
> |
if (tmNeedMatrix(tmTop)) { /* get monitor RGB */ |
179 |
|
colortrans(cmon, tmTop->cmat, scan[i]); |
180 |
< |
else { |
180 |
> |
} else { |
181 |
|
cmon[RED] = tmTop->inpsf*scan[i][RED]; |
182 |
|
cmon[GRN] = tmTop->inpsf*scan[i][GRN]; |
183 |
|
cmon[BLU] = tmTop->inpsf*scan[i][BLU]; |
417 |
|
histot += tmTop->histo[i]; |
418 |
|
sum += (j -= HISTEP) * tmTop->histo[i]; |
419 |
|
} |
420 |
< |
threshold = histot*.025 + .5; |
420 |
> |
threshold = histot*0.005 + .5; |
421 |
|
if (threshold < 4) |
422 |
|
returnErr(TM_E_TMFAIL); |
423 |
|
Lwavg = tmLuminance( (double)sum / histot ); |