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; |
172 |
|
|
173 |
|
if (tmTop == NULL) |
174 |
|
returnErr(TM_E_TMINVAL); |
175 |
< |
if (ls == NULL | scan == NULL | len < 0) |
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]; |
245 |
|
|
246 |
|
if (tmTop == NULL) |
247 |
|
returnErr(TM_E_TMINVAL); |
248 |
< |
if (ls == NULL | scan == NULL | len < 0) |
248 |
> |
if ((ls == NULL) | (scan == NULL) | (len < 0)) |
249 |
|
returnErr(TM_E_ILLEGAL); |
250 |
|
for (i = len; i--; ) |
251 |
|
if (scan[i] <= TM_NOLUM) { |
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 ); |
430 |
|
/* clamp histogram */ |
431 |
|
histo = (int *)malloc(histlen*sizeof(int)); |
432 |
|
cumf = (float *)malloc((histlen+2)*sizeof(float)); |
433 |
< |
if (histo == NULL | cumf == NULL) |
433 |
> |
if ((histo == NULL) | (cumf == NULL)) |
434 |
|
returnErr(TM_E_NOMEM); |
435 |
|
cumf[histlen+1] = 1.; /* guard for assignment code */ |
436 |
|
for (i = histlen; i--; ) /* make malleable copy */ |
498 |
|
|
499 |
|
if (tmTop == NULL || tmTop->lumap == NULL) |
500 |
|
returnErr(TM_E_TMINVAL); |
501 |
< |
if (ps == NULL | ls == NULL | len < 0) |
501 |
> |
if ((ps == NULL) | (ls == NULL) | (len < 0)) |
502 |
|
returnErr(TM_E_ILLEGAL); |
503 |
|
while (len--) { |
504 |
|
if ((li = *ls++) < tmTop->mbrmin) { |
540 |
|
{ |
541 |
|
register struct tmStruct *tms2; |
542 |
|
/* special cases first */ |
543 |
< |
if (tms == NULL | tmTop == NULL) |
543 |
> |
if ((tms == NULL) | (tmTop == NULL)) |
544 |
|
return(0); |
545 |
|
if (tms == tmTop) { |
546 |
|
tmTop = tms->tmprev; |