orig/reinhard.csh
changeset 0 0aa115157c9c
equal deleted inserted replaced
-1:000000000000 0:0aa115157c9c
       
     1 #!/bin/csh -f
       
     2 #
       
     3 # Apply Reinhard's simple tone operator
       
     4 #
       
     5 if ($#argv != 3) then
       
     6 	echo Usage: $0 key input.hdr output.tif
       
     7 	exit 1
       
     8 endif
       
     9 set lavg=`pvalue -h -H -b -d $argv[2]:q | total -p -m`
       
    10 set lmax=`pextrem $argv[2]:q | sed -n '2s/^[1-9][0-9]* [1-9][0-9]*	[^ ]* \([^ ]*\) .*$/\1/p'`
       
    11 pcomb -e "Lavg:$lavg;Lwht:$lmax;a:$argv[1]" -f reinhard.cal $argv[2]:q \
       
    12 	| ra_tiff - $argv[3]:q