# Output is y4m.bz2 #size=200 size=576 #video_size=100 video_size=576 bg_filename=`basename "$1"` bg_filename=grx/crack/$bg_filename.png bg_pixname=$bg_filename.pix if [ ! -e $bg_filename ] then echo "$bg_filename background image not found" >&2 exit 1 fi png-pix $bg_filename > $bg_pixname if [ "$1" = "3d/hyperluma" ] then hyperluma_demo="D" step=0 azim=37 size=$video_size else hyperluma_demo="" step=1 azim=0 fi fixed_root=`echo "$1" | sed -e 's/\\//\\\\\\//g;s/\\./\\\\./g'` && gif_size=32 ctr=0 rm -f $1.pix while [ "$ctr" -lt 360 ] do if [ ! -e $1.pix.$ctr ] then rt -d1 -c "set gamma=2.2" -s$size -a$azim -e15 -o $1.pixd \ $1.g $2 2>&1 | fgrep View && utils/double_mask $bg_pixname < $1.pixd > $1.pix.tmp rm -f $1.pixd mv $1.pix.tmp $1.pix.$ctr fi azim=`expr "$azim" '+' "$step"` ctr=`expr "$ctr" '+' "1"` done && filenames_sorted=`ls $1.pix.* | sed -e 's/'"$fixed_root"'\.pix\.//g' \ | sort -n | sed -e 's/^/'"$fixed_root"'.pix./g'` && cat $filenames_sorted | utils/pix-y4m \ "$hyperluma_demo"1x${size}x${size}x50x0.454545454545x${video_size}x${video_size} \ | bzip2 -9 > $1.y4m.bz2 && if which gifsicle 2>&1 >/dev/null then cat $filenames_sorted \ | utils/pix-y4m \ P5x${size}x${size}x10x0.454545454545x${gif_size}x${gif_size} \ | convert -loop 0 -delay 10 - GIF:- | gifsicle --colors 256 -O2 > $1.gif else cat $filenames_sorted \ | utils/pix-y4m \ P5x${size}x${size}x10x0.454545454545x${gif_size}x${gif_size} \ | convert -loop 0 -delay 10 - $1.gif fi rm -f $1.pix $1.pix.* rm $bg_pixname