Fortraneries/Fraktalism/mkjuliagif.sh

62 lines
1.1 KiB
Bash
Raw Permalink Normal View History

2022-02-13 09:27:59 +11:00
#!/bin/bash
2022-02-15 23:32:07 +11:00
#
# build the prog
#
2023-01-02 00:28:52 +11:00
make mkjulia
2022-02-15 23:32:07 +11:00
if [ $? -ne 0 ] ; then
echo
echo "Make error " $?
exit 1
fi
2024-03-10 16:56:29 +11:00
cxa=" -1.5432 " ; cya=" -0.8999 "
cxb=" 1.0975 " ; cyb=" 1.5091 "
nbi=" 2000 "
tmpimg="/dev/shm/juliatmp.pnm"
rm frames/julia/*
2024-02-11 07:55:04 +11:00
2022-02-15 23:32:07 +11:00
#
# run the prog
#
2023-01-03 11:22:40 +11:00
workdir="frames/julia/"
2024-02-11 07:55:04 +11:00
for foo in $( seq 0 $(( nbi - 1)) )
2022-02-13 09:27:59 +11:00
do
2024-02-11 07:55:04 +11:00
Ka=$( echo "$foo / $nbi" | bc -l)
Kb=$( echo "1.0 - $Ka" | bc -l)
# echo $Ka $Kb
cx=$(echo "($cxa*$Ka) + ($cxb*$Kb)" | bc -l)
cy=$(echo "$cya*$Ka + $cyb*$Kb" | bc -l)
2022-02-13 09:27:59 +11:00
2024-03-10 16:56:29 +11:00
# make mkjulia
2024-02-11 07:55:04 +11:00
printf "%5d %4.6f %4.6f %4.6f %4.6f\n" \
$foo $Ka $Kb $cx $cy
2024-03-10 16:56:29 +11:00
./mkjulia $tmpimg $cx $cy
echo
2023-05-07 19:35:48 +11:00
2024-03-10 16:56:29 +11:00
img=$(printf "%s/%05d.png" $workdir $foo)
tcx=$(printf "%8.6f" $cx)
tcy=$(printf "%8.6f" $cy)
convert $tmpimg \
-gravity North-East \
-font Courier-Bold \
-pointsize 20 \
-fill Yellow \
-annotate +15+34 $tcx \
-annotate +15+58 $tcy \
-gravity South-East \
-font Courier \
-pointsize 14 \
-fill Yellow \
-annotate +10+6 "Konrad+tTh 2024" \
$img
2022-02-13 09:27:59 +11:00
2024-03-10 16:56:29 +11:00
done
2023-01-03 11:22:40 +11:00
2022-02-13 09:27:59 +11:00
echo ; echo "Encoding, please wait..."
2024-03-10 16:56:29 +11:00
./encode.sh frames/julia/ foo.mp4