add options to run.sh
This commit is contained in:
parent
0315cc9a9b
commit
88c75a6302
1 changed files with 31 additions and 9 deletions
40
run.sh
40
run.sh
|
@ -1,25 +1,47 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
start="1.0"
|
if [ $# -ne 8 ]; then
|
||||||
end="1.0e+30"
|
echo "usage: $0 startmag endmag frames method width height centerx centery"
|
||||||
frames="14400"
|
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
|
||||||
|
|
||||||
|
start="$1"
|
||||||
|
end="$2"
|
||||||
|
frames="$3"
|
||||||
|
method="$4"
|
||||||
|
width="$5"
|
||||||
|
height="$6"
|
||||||
|
centerx="$7"
|
||||||
|
centery="$8"
|
||||||
|
|
||||||
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)])"`
|
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)])"`
|
||||||
|
|
||||||
centerx="-0.743643887037158704752191506114774"
|
|
||||||
centery="0.131825904205311970493132056385139"
|
|
||||||
|
|
||||||
i=0
|
i=0
|
||||||
for mag in $magn; do
|
for mag in $magn; do
|
||||||
pngname=`printf "out_%05d_%s.png" $i $mag`
|
pngname=`printf "out_%05d.png" $i`
|
||||||
if [ -s "$pngname" ]; then
|
if [ -s "$pngname" ]; then
|
||||||
i=$((i+1))
|
i=$((i+1))
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
echo $i $mag
|
echo $i $mag
|
||||||
fname=`printf "out_%05d_%s.ppm" $i $mag`
|
fname=`printf "out_%05d.ppm" $i`
|
||||||
/usr/bin/time -f "%e s" ./mandel_dd 320 240 $centerx $centery $mag > "$fname"
|
/usr/bin/time -f "%e s" "./$method" $width $height $centerx $centery $mag > "$fname"
|
||||||
convert "$fname" -format png "$pngname"
|
convert "$fname" -format png "$pngname"
|
||||||
|
optipng -o4 -i0 "$pngname" > /dev/null 2>&1
|
||||||
|
advpng -z4 "$pngname" > /dev/null 2>&1
|
||||||
rm "$fname"
|
rm "$fname"
|
||||||
i=$((i+1))
|
i=$((i+1))
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in a new issue