From 155674e74bbcbf1e8473948276068a418a0a19b4 Mon Sep 17 00:00:00 2001 From: tth Date: Wed, 19 Feb 2020 22:39:09 +0100 Subject: [PATCH] first commit --- scripts/echomix.sh | 56 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 scripts/echomix.sh diff --git a/scripts/echomix.sh b/scripts/echomix.sh new file mode 100644 index 00000000..58a665c5 --- /dev/null +++ b/scripts/echomix.sh @@ -0,0 +1,56 @@ +#!/bin/bash + + ############################### + # ECHOMIX # + ############################### + +SRCDIR="Fist" +DSTDIR="Pong" +FTMP="/dev/shm/tmp.fimg" +FDST="/dev/shm/foo.fimg" + +# ------------------------------------------------------------ + +# count the nomber of picz in the source directory +# +NBRE=$(ls -1 ${SRCDIR}/*.fimg | wc -l) + +# compute the echo picz offset +# +OFFS=$(( NBRE / 4 )) + +# ------------------------------------------------------------ +# MAIN LOOP + +for idx in $(seq 0 $NBRE) +do + # build the two input filenames ... + # + imgA=$(printf "$SRCDIR/%04d.fimg" $idx) + vb=$(( $(( idx + OFFS )) % NBRE)) + imgB=$(printf "$SRCDIR/%04d.fimg" $vb) + + # ... ant the output filename + # + dst=$(printf "%s/%05d.png" ${DSTDIR} $idx) + + printf " %20s %20s %8df %20s\n" $imgA $imgB $vb $dst + + # trying to autocompute the mixing coefficient + # + compute=" s(${idx} / 16) " + K=$(echo $compute | bc -l) + printf " %25s => %8.3f\n" "$compute" $K + + # do the hard floating computation + # + fimgfx -v cos010 ${imgB} ${FTMP} + fimgops -k ${K} ${FTMP} ${imgA} mix ${FDST} + + # write the output as PNG for video encoding + # + fimg2png ${FDST} ${dst} + +done + +# ------------------------------------------------------------