#! /bin/csh -f

# makes an icon for a pair of .ppm povray outputs

set fn = "$1"
set name = ${fn:t}
set dir = ${fn:h}
if ( "x${dir}" != "x${name}" ) then
  cd $dir
endif
set name = ${fn:r}

set bppm = ${name}-0.ppm
set wppm = ${name}-1.ppm
set gif = ${name}.gif
set icon = ${name}-icon.gif

rm -f ${icon} {p,q}.{gif,ppm} 
rm -f {p,q}-*.{gif,ppm} 
rm -f {p,q}.html-inc
linear-ppm-pair-to-gif ${bppm} ${wppm} > ${gif}
linear-ppm-pair-to-gif -ysize 050 ${bppm} ${wppm} > ${icon}
ln -s ${bppm} p-0.ppm
ln -s ${wppm} p-1.ppm
ln -s ${gif} p.gif
ln -s ${icon} p-icon.gif
