#!/bin/csh -f
# Change location for conversion utility to /data2/opt/netpbm/bin 
# and leave tmp directory as is.  7/23/1998 rcg
# Added call to ppmquant to reduce number of colors rcg 8/6/1998
# Add title and page heading.  Allow multiply image files. 
#	using suffices of nothing, 1, 2, 3, ... 9.  rcg 8/7/1998
# Change location of utilities to /usr/bin. Change /tmp directory
#	to string $USETEMPDIR so can be set during execution.
#	9/7/2001 rcg

echo "Content-type: text/html"
echo ""

echo \<title\>Image output via Matlab\</title\>
echo \<h2 align=center\>Image output via Matlab\</h2\>
setenv TMP `date '+%H%M%S'`

set suffix=(0 1 2 3 4 5 6 7 8 9)

foreach i ( $suffix )
   if ( -e temp${i}.ppm ) then
	/usr/bin/ppmquant 256 < temp${i}.ppm > temptemp.ppm
	/usr/bin/ppmtogif < temptemp.ppm > temp${i}${TMP}.gif
	echo \<p\>\<img src=\"$USETEMPDIR/temp${i}${TMP}.gif\"\>\<p\>
	\rm temptemp.ppm
   endif
end

echo \<h4\>Matlab source generating image\</h4\>
echo \<pre\>
cat doit.m
echo \</pre\>
