orig/reinhard.csh
changeset 0 0aa115157c9c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/orig/reinhard.csh	Sat Apr 09 17:55:16 2011 +0100
@@ -0,0 +1,12 @@
+#!/bin/csh -f
+#
+# Apply Reinhard's simple tone operator
+#
+if ($#argv != 3) then
+	echo Usage: $0 key input.hdr output.tif
+	exit 1
+endif
+set lavg=`pvalue -h -H -b -d $argv[2]:q | total -p -m`
+set lmax=`pextrem $argv[2]:q | sed -n '2s/^[1-9][0-9]* [1-9][0-9]*	[^ ]* \([^ ]*\) .*$/\1/p'`
+pcomb -e "Lavg:$lavg;Lwht:$lmax;a:$argv[1]" -f reinhard.cal $argv[2]:q \
+	| ra_tiff - $argv[3]:q