mandelbrot/run
Yann Esposito (Yogsototh) 1944a7caef Merge branch 'master' of github.com:yogsototh/mandelbrot
Conflicts:
	run
2013-03-06 21:17:44 +01:00

44 lines
1,008 B
Bash
Executable file

#!/usr/bin/env zsh
# arguments are:
# width nb pixels
# height nb pixels
# nb of iterations
# x position
# y position
# with of the window
# \rm -f mandel.png && ./mandelbrot 500 200 256 -1.351 0.06 0.0005 mandel.png
dir=stillimages
[[ ! -e $dir ]] && mkdir $dir
old=( $dir/*(.N) )
(( $#old > 0 )) && {
print -- "cleaning..."
\rm -f $dir/*(.)
}
liste=()
i=1
width=4.0
imgheight=500
imgwidth=$((imgheight*16/10))
while ((width>0.000005)); do
fic=$(printf "$dir/m-%04d.png" $i)
\rm -f $fic
PREPARAMS="$imgwidth $imgheight 1000 -1.2535555 0.3845245 $width $fic"
print ./mandelbrot $PREPARAMS
eval ./mandelbrot $PREPARAMS
(($?>0)) && exit 0
liste=( $liste $fic )
(( width *= 0.97 ))
((i++))
done
cmd=avconv
which $cmd >/dev/null || cmd=ffmpeg
framerate=24
quality=8
\rm -f animandel.mpeg && \
$cmd -f image2 -i "$dir/m-%04d.png" -r $framerate -qscale $quality -s ${imgwidth}x${imgheight} animandel.mp4
# convert -delay 10 -loop 0 $liste animandel.gif