--- ray/src/px/psquish.csh 1996/09/20 16:44:00 3.1 +++ ray/src/px/psquish.csh 2008/11/10 19:08:19 3.5 @@ -1,11 +1,11 @@ #!/bin/csh -f -# SCCSid "$SunId$ LBL" +# RCSid: $Id: psquish.csh,v 3.5 2008/11/10 19:08:19 greg Exp $ set Lmin=.0001 # minimum visible world luminance set Ldmin=1 # minimum display luminance set Ldmax=100 # maximum display luminance set nsteps=100 # number of steps in perceptual histogram set cvratio=0.05 # fraction of pixels to ignore in envelope clipping -set td=/usr/tmp +set td=/tmp set tf0=$td/tf$$ set tf1=$td/hist$$ set tf1b=$td/hist$$.diff @@ -18,12 +18,12 @@ if ( "$argv[1]" == "-a" ) then shift argv endif if ( $#argv != 1 ) then - echo "Usage: $0 [-a] input.pic > output.pic" + echo "Usage: $0 [-a] input.hdr > output.hdr" exit 1 endif set ifile=$1 set ibase=$ifile:t -if ( "$ibase" =~ *.pic ) set ibase=$ibase:r +if ( "$ibase" =~ *.hdr ) set ibase=$ibase:r set ibase=$ibase:t onintr quit pextrem -o $ifile > $tf0 @@ -100,7 +100,7 @@ set margin=`ev "floor($totcount*$cvratio+.5)"` while ( 1 ) # Compute mapping function sed 's/^.*[ ]//' $tf1 | total -1 -r \ - | rcalc -e '$1=$1/'$totcount | lam $tf1 - \ + | rcalc -e '$1=$1/'$totcount | rlam $tf1 - \ | tabfunc -i 0 cf > $tf4 # Compute difference with visible envelope rcalc -f $tf4 -f $tf3 -e "T:$totcount*Stepsiz" \ @@ -149,7 +149,7 @@ while ( 1 ) endif end # Mung histogram - echo $diffs | tr ' ' '\012' | lam $tf1 - \ + echo $diffs | tr ' ' '\012' | rlam $tf1 - \ | rcalc -f $tf4 -f $tf3 -e "T:$totcount*Stepsiz" \ -e 'clfq=floor(T*clamp(Lb($1))+.5)' \ -e '$1=$1;$2=$3+clfq' > $tf1b