use now a tmp file for images do generate LOL array. should work in a Var too but im too dumb now

This commit is contained in:
Marcus 2024-01-02 02:19:05 +01:00
parent fafa95f69c
commit 325af279d4

View file

@ -9,10 +9,10 @@ FNAME="$(echo $2 | sed -e 's/\..*$//' -e 's/^images\///')"
IMGFILE="$2" IMGFILE="$2"
PPMFILE="$FNAME.ppm" PPMFILE="$FNAME.ppm"
HEXPPM="images/$FNAME.hexppm" HEXPPM="images/$FNAME.hexppm"
PIXLIST="pixlists/$FNAME.pixlist" PIXLIST="/tmp/$FNAME.pixlist"
SHUFMODE="$3" SHUFMODE="$3"
test -z "$FLOOTFORKS" && FLOOTFORKS="3" test -z "$FLOOTFORKS" && FLOOTFORKS="2"
declare -a PIXMAP declare -a PIXMAP
declare -a LOL declare -a LOL
@ -226,9 +226,9 @@ floot() {
if [ "$FNAME" == "winketuxS" ] if [ "$FNAME" == "winketuxS" ]
then then
echo "drawing winketuxS animation" echo "drawing winketuxS animation"
LOL[1]="$(cat ${FNAME}1.pixlist | shuf)" LOL[1]="$(cat pixlists/${FNAME}1.pixlist | shuf)"
LOL[2]="$(cat ${FNAME}2.pixlist | shuf )" LOL[2]="$(cat pixlists/${FNAME}2.pixlist | shuf )"
LOL[3]="$(cat ${FNAME}2.pixlist | shuf )" LOL[3]="$(cat pixlists/${FNAME}2.pixlist | shuf )"
#LOL[3]="$(cat $FNAME-mc.pixlist.2 | shuf)" #LOL[3]="$(cat $FNAME-mc.pixlist.2 | shuf)"
elif [ "$FNAME" == "fill" ] elif [ "$FNAME" == "fill" ]
then then
@ -239,7 +239,10 @@ floot() {
LOL[$i]="$LOL_org" LOL[$i]="$LOL_org"
done done
else else
#LOL_org="$(convertimg)" # generate a tmp file, as i have trouble atm to figure out
# why free space get lost when i generate the pixlist directly
# in ram
convertimg > $PIXLIST
echo "convert and shuffle pixels for $FLOOTFORKS workers" echo "convert and shuffle pixels for $FLOOTFORKS workers"
for i in $(seq 1 $FLOOTFORKS) for i in $(seq 1 $FLOOTFORKS)
do do
@ -252,10 +255,11 @@ floot() {
if [ -z "$ALPHACOLOR" ] if [ -z "$ALPHACOLOR" ]
then then
#LOL[$i]="$(cat $PIXLIST | shuf)" LOL[$i]="$(cat $PIXLIST | shuf)"
LOL[$i]="$(convertimg | shuf)" #LOL[$i]="$(convertimg | shuf)"
else else
LOL[$i]="$(convertimg | grep -v $ALPHACOLOR | shuf)" LOL[$i]="$(grep -v $ALPHACOLOR $PIXLIST | shuf)"
#LOL[$i]="$(convertimg | grep -v $ALPHACOLOR | shuf)"
fi fi
echo " DONE!" echo " DONE!"
done done
@ -291,6 +295,7 @@ case $1 in
##draw_pixmap ##draw_pixmap
convertimg > $PIXLIST convertimg > $PIXLIST
echo "file $PIXLIST" generated
;; ;;
floot) if [ "$SHUFMODE" == "static" ] && ([ -z "$W" ] && [ -z "$H" ]) floot) if [ "$SHUFMODE" == "static" ] && ([ -z "$W" ] && [ -z "$H" ])