#!/bin/sh
# file: capt
# desc: Capture stills from node 0 & 1 of Vino video port, then
# process and save them for web use (keycam.html).
# 11/19/1997, rev. F (05/15/1998)

dir='/usr/people/robin/public_html/capture'
f=`date '+%H%M%S'`
d=`date '+%H'`

cp $dir/f $dir/f.old
#playaiff /usr/share/data/sounds/soundscheme/soundfiles/sk_lock.aifc
vidtomem -v 1 -z 1/2 -f $dir/$f-room >/dev/null 2>&1
#playaiff /usr/share/data/sounds/soundscheme/soundfiles/sk_lock.aifc
vidtomem -v 0 -z 1/2 -f $dir/$f-any >/dev/null 2>&1

if test $d -ge 16 -o $d -le 6
then
options='+contrast -gamma 1.5'
else
options='-gamma 1.45'
fi

/usr/local/bin/mogrify $options -qual 75 \
 -mattecolor 'light slate blue' -frame 4x4 \
 -format jpg $dir/$f-room-00000.rgb $dir/$f-any-00000.rgb

#date "Dave\'s Office: +%a %b %e %H:%M %Z %Y © KTI" > $dir/date.txt
/usr/local/bin/mogrify -display spyder:0 -pen '#FFFFFF' \
 -font '-*-helvetica-medium-r-*-*-12-*-*-*-*-*-iso8859-*' \
 -draw 'text 7,230 "@/dsk2/www/html/capture/date.txt"' \
 $dir/$f-room-00000.jpg $dir/$f-any-00000.jpg

#date "+Another View: %a %b %e %H:%M %Z %Y © KTI" > $dir/date.txt
/usr/local/bin/mogrify -display spyder:0 -pen '#FFFFFF' \
 -font '-*-helvetica-medium-r-*-*-12-*-*-*-*-*-iso8859-*' \
 -draw 'text 7,230 "@/dsk2/www/html/capture/date.txt"' \
 $dir/$f-any-00000.jpg

date '+%A, %B %e, %r %Z' > $dir/date.txt
echo $f > $dir/f
rm $dir/$f*.rgb
mv $dir/`cat $dir/archive/f.old`*.jpg

mv $dir/$f-room-00000.jpg $dir/$f-room.jpg
mv $dir/$f-any-00000.jpg $dir/$f-any.jpg

