--- ray/src/px/pcond.c 1996/10/03 16:52:46 3.1 +++ ray/src/px/pcond.c 1996/10/10 17:09:24 3.4 @@ -278,8 +278,7 @@ mapimage() /* map picture and send to stdout */ fprintf(stderr, "%s: linear scaling factor = %f\n", progname, scalef); #endif - if (scalef < 0.99 | scalef > 1.01) - fputexpos(scalef, stdout); /* write in header */ + fputexpos(inpexp*scalef, stdout); /* record exposure */ if (lumf == cielum) scalef /= WHTEFFICACY; } putchar('\n'); /* complete header */ @@ -378,10 +377,14 @@ check2do() /* check histogram to see what isn't worth register int i; /* check for within display range */ - if (!(what2do&DO_LINEAR) && Lb(bwmax)/Lb(bwmin) <= ldmax/ldmin) + l = Lb(bwmax)/Lb(bwmin); + if (l <= ldmax/ldmin) what2do |= DO_LINEAR; + /* determine if veiling significant */ + if (l < 100.) /* heuristic */ + what2do &= ~DO_VEIL; - if (!(what2do & (DO_ACUITY|DO_COLOR|DO_VEIL))) + if (!(what2do & (DO_ACUITY|DO_COLOR))) return; /* find 5th percentile */ sum = histot*0.05 + .5; @@ -390,25 +393,12 @@ check2do() /* check histogram to see what isn't worth break; b = (i+.5)*(bwmax-bwmin)/HISTRES + bwmin; l = Lb(b); -#if 0 /* determine if acuity adj. useful */ if (what2do&DO_ACUITY && hacuity(l) >= (inpres.xr/sqrt(ourview.hn2) + inpres.yr/sqrt(ourview.vn2))/(2.*180./PI*2.)) what2do &= ~DO_ACUITY; -#endif /* color sensitivity loss? */ if (l >= 6.0) what2do &= ~DO_COLOR; - if (!(what2do&DO_VEIL)) - return; - /* find 50th percentile (median) */ - sum = histot*0.50 + .5; - for (i = 0; i < HISTRES; i++) - if ((sum -= bwhist[i]) <= 0) - break; - /* determine if veiling significant */ - b = (i+.5)*(bwmax-bwmin)/HISTRES + bwmin; - if ((b-bwmin)/(bwmax-bwmin) >= 0.70) /* heuristic */ - what2do &= ~DO_VEIL; }