diff --git a/run.sh b/run.sh index 450eea1..c39e2a6 100755 --- a/run.sh +++ b/run.sh @@ -1,25 +1,47 @@ #!/bin/sh -start="1.0" -end="1.0e+30" -frames="14400" +if [ $# -ne 8 ]; then + echo "usage: $0 startmag endmag frames method width height centerx centery" + echo "" + echo " startmag start magnification" + echo " endmag end magnification" + echo " frames number of frames to generate over the magnification range" + echo " method name of executable to use for mandelbrot generation" + echo " width width of the images" + echo " height height of the images" + echo " centerx x zoom coordinate" + echo " centery y zoom coordinate" + echo "" + echo "example:" + echo "" + echo " $0 1.0 1.0e+30 14400 mandel_dd_aa 1920 1080 -0.743643887037158704752191506114774 0.131825904205311970493132056385139" + exit +fi -magn=`python -c "from math import pow; fac = pow($end / $start, 1.0 / ($frames - 1)); print \"\\n\".join([ str($start * pow(fac, i-1)) for i in range(1, $frames + 1)])"` +start="$1" +end="$2" +frames="$3" +method="$4" +width="$5" +height="$6" +centerx="$7" +centery="$8" -centerx="-0.743643887037158704752191506114774" -centery="0.131825904205311970493132056385139" +magn=`python -c "from math import pow; fac = pow($end / $start, 1.0 / ($frames - 1)); print \"\\n\".join([ str($start * pow(fac, i-1)) for i in range(1, $frames + 1)])"` i=0 for mag in $magn; do - pngname=`printf "out_%05d_%s.png" $i $mag` + pngname=`printf "out_%05d.png" $i` if [ -s "$pngname" ]; then i=$((i+1)) continue fi echo $i $mag - fname=`printf "out_%05d_%s.ppm" $i $mag` - /usr/bin/time -f "%e s" ./mandel_dd 320 240 $centerx $centery $mag > "$fname" + fname=`printf "out_%05d.ppm" $i` + /usr/bin/time -f "%e s" "./$method" $width $height $centerx $centery $mag > "$fname" convert "$fname" -format png "$pngname" + optipng -o4 -i0 "$pngname" > /dev/null 2>&1 + advpng -z4 "$pngname" > /dev/null 2>&1 rm "$fname" i=$((i+1)) done