HexaCone/tools/linkfarmer.sh
2025-01-07 14:33:26 +01:00

123 lines
2.0 KiB
Bash
Executable File

#!/bin/bash
set -e ; set -u
IDX=0
SPOOL="frames/Spool"
SEQNAME="none"
TMP="WS/tmp.png"
FONTE="Palatino-Bold"
source tools/fonctions.sh
# -------------------------------------------------------
# /!\ this function just copy the
# file to the spool dir, so
# you can use it for tmp pics.
#
addfile ()
{
src="$1"
dstname=$(printf "%s/%05d.png" $SPOOL $IDX)
# echo "$src -> $dstname"
# ln --force --symbolic $src $dstname
cp -f $src $dstname
IDX=$(( IDX + 1 ))
}
# -------------------------------------------------------
linkfarm ()
{
SRC="frames/$1"
echo "linkfarm $SRC" | tee -a WS/log
local NBRE=30
for foo in $(seq 0 $NBRE)
do
addfile "$SRC/00000.png"
done
for src in "$SRC"/*
do
addfile $src
done
for foo in $(seq 0 $NBRE)
do
addfile "$SRC/00359.png"
done
}
# -------------------------------------------------------
faire_le_titre ()
{
echo "faire le titre"
local NBRE=190
for foo in $(seq 0 $NBRE)
do
Ypos=$(( 210 - ( foo / 2 ) ))
convert "WS/negatif.png" \
-gravity north \
-font $FONTE \
-pointsize 172 \
-fill black \
-strokewidth 2 -stroke gray90 \
-annotate +0+${Ypos} "HexaCone" \
${TMP}
# identify ${TMP}
addfile ${TMP}
done
}
# -------------------------------------------------------
faire_la_fin ()
{
local NBRE=120
datetime=$(LANG=fr date -u)
echo $datetime | tee -a WS/log
for foo in $(seq 0 $NBRE)
do
Ypos=$(( foo + 100 ))
convert "WS/negatif.png" \
-gravity north \
-font $FONTE \
-pointsize 86 \
-fill Black \
-strokewidth 2 -stroke gray90 \
-annotate +0+${Ypos} "tTh des Bourtoulots" \
-pointsize 48 \
-strokewidth 1 \
-gravity south \
-annotate +0+170 "${datetime}" \
${TMP}
# identify ${TMP}
addfile ${TMP}
done
}
# -------------------------------------------------------
figlet "Link farmer"
rm frames/Spool/*.png
tools/plot-timing.sh
faire_le_titre
linkfarm hexabenz
linkfarm escadrille
linkfarm topview
linkfarm passage
linkfarm scene
linkfarm orbite
# linkfarm essai
tools/plot-timing.sh
faire_la_fin
ff_encodage Spool full.mp4