| 4 |
|
set Ldmax=100 # maximum display luminance |
| 5 |
|
set nsteps=100 # number of steps in perceptual histogram |
| 6 |
|
set cvratio=0.08 # fraction of pixels to ignore in envelope clipping |
| 7 |
< |
set td=/usr/tmp |
| 7 |
> |
set td=/tmp |
| 8 |
|
set tf1=$td/hist$$ |
| 9 |
|
set tf1b=$td/hist$$.new |
| 10 |
|
set tf2=$td/cumt$$ |
| 57 |
|
set tst=1 |
| 58 |
|
while ( $totcount > 0 ) |
| 59 |
|
sed 's/^.*[ ]//' $tf1 | total -1 -r \ |
| 60 |
< |
| rcalc -e '$1=$1/'$totcount | lam $tf1 - \ |
| 60 |
> |
| rcalc -e '$1=$1/'$totcount | rlam $tf1 - \ |
| 61 |
|
| tabfunc -i 0 cf > $tf4 |
| 62 |
|
if ( $tst <= 0 ) break |
| 63 |
|
rcalc -f $tf4 -f $tf3 -e "T:$totcount*Stepsiz" \ |