HexaCone/tools/linkfarmer.sh
2025-06-19 14:33:30 +02:00

171 lines
2.9 KiB
Bash
Executable File

#!/bin/bash
set -e ; set -u
source tools/config.sh
IDX=0
SPOOL="frames/Spool"
SEQNAME="none"
TMP="WS/tmp.png"
FONTE="Helvetica-Bold"
source tools/fonctions.sh
# -------------------------------------------------------
# /!\ this function just copy the
# file to the spool dir, so
# you can use it for tmp pics.
#
copy_a_file ()
{
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 INTER="/dev/shm/tmp-intertitre.png"
tools/plot-timing.sh $1
local NBRE=33
convert "WS/negatif.png" \
-gravity north \
-font $FONTE \
-pointsize 96 \
-kerning 10 \
-fill $TEXTCOL \
-strokewidth 2 -stroke $STROKOL \
-annotate +0+530 "$1" \
${INTER}
for foo in $(seq 0 $NBRE)
do
copy_a_file $INTER
# :
done
for foo in $(seq 0 $NBRE)
do
copy_a_file "$SRC/00000.png"
done
for src in "$SRC"/*
do
copy_a_file $src
done
for foo in $(seq 0 $NBRE)
do
copy_a_file "$SRC/00359.png"
done
}
# -------------------------------------------------------
faire_le_titre ()
{
echo "faire le titre"
local NBRE=320
local SRC="frames/passage/00099.png"
local GRAY="/dev/shm/tmp-titre.png"
convert -colorspace gray -colors 27 $SRC $GRAY
for foo in $(seq 0 $NBRE)
do
Ypos=$(( -175 + foo ))
convert ${GRAY} \
-gravity north \
-font $FONTE \
-pointsize 140 \
-kerning 6 \
-fill $TEXTCOL \
-strokewidth 3 -stroke $STROKOL \
-annotate +0+${Ypos} "La famille\nHexaCone" \
${TMP}
# identify ${TMP}
copy_a_file ${TMP}
printf "."
done
echo
}
# -------------------------------------------------------
faire_la_fin ()
{
local NBRE=160
datetime=$(LANG=fr date -u +"%Y/%m/%d")
echo $datetime | tee -a WS/log
local SRC="frames/escadrille/00299.png"
local GRAY="/dev/shm/tmp-titre.png"
convert -colorspace gray -colors 27 $SRC $GRAY
for foo in $(seq 0 $NBRE)
do
Ypos=$(( foo + 20 ))
convert ${GRAY} \
-gravity north \
-font $FONTE \
-pointsize 86 \
-kerning 6 \
-fill $TEXTCOL \
-strokewidth 2 -stroke $STROKOL \
-annotate +0+${Ypos} \
"un film de\ntTh des Bourtoulots" \
-pointsize 52 \
-strokewidth 2 \
-gravity south \
-annotate +0+110 "${datetime}" \
${TMP}
# identify ${TMP}
copy_a_file ${TMP}
printf "."
done
echo
}
# -------------------------------------------------------
figlet "Link farmer"
rm -f frames/Spool/*.png
faire_le_titre
linkfarm hexabenz
linkfarm hexawood
linkfarm escadrille
linkfarm survol
linkfarm cutoff
linkfarm topview
linkfarm passage
linkfarm scene
linkfarm carto
linkfarm circular
linkfarm bubblecut
linkfarm orbite
linkfarm hexacone
linkfarm remote
linkfarm essai
tools/plot-timing.sh
faire_la_fin
ff_encodage Spool full.mp4
nb=$(( $IDX - 1 ))
echo "linkfarmed $nb files" | tee -a WS/log