wip large mode, slide pixlist into multiple fields

This commit is contained in:
Marcus 2024-01-05 03:56:53 +01:00
parent e01cb272cb
commit ba5e40a603
2 changed files with 52 additions and 18 deletions

View file

@ -48,7 +48,7 @@ available env vars to configure:
IPFLOOT(string), FLOOTPORT(int), USECACHE(bool), FLOOTFORKS(int) IPFLOOT(string), FLOOTPORT(int), USECACHE(bool), FLOOTFORKS(int)
SIZE(int), TEXT(string), FONTSIZE(int), BGCOLOR(hex), COLOR(hex) SIZE(int), TEXT(string), FONTSIZE(int), BGCOLOR(hex), COLOR(hex)
BORDERCOLOR(hex), X(int), Y(int), X_MAX(int), Y_MAX(int), H(int), W(int) BORDERCOLOR(hex), X(int), Y(int), X_MAX(int), Y_MAX(int), H(int), W(int)
RESIZE(int), ALPHACOLOR(hex), BOUNCESTEP(int) RESIZE(int), ALPHACOLOR(hex), BOUNCESTEP(int), LARGE(bool)
``` ```
Running on my Ryzen 4700G with [wellenbrecher](https://github.com/bits0rcerer/wellenbrecher) 1280x720 and three workers, Running on my Ryzen 4700G with [wellenbrecher](https://github.com/bits0rcerer/wellenbrecher) 1280x720 and three workers,

View file

@ -320,6 +320,32 @@ checkfile() {
loadLOL() { loadLOL() {
# when LARGE true, then we slize the large pixlist into smaller pieces
# max 64k each one
if [ $LARGE ]
then
FIELDSIZE=64000
# line counter
L=1
LINES="$(echo "$LOL_org" | wc -l )"
FIELDS="$(( ( $LINES / $FIELDSIZE ) ))"
message "LARGE mode: slicing ${YELLOW}${IMGFILE}${ENDCOLOR} - ${YELLOW}${LINES}${ENDCOLOR} into ${YELLOW}${FIELDS}${ENDCOLOR} fields"
i=0
while [ $i -le $FIELDS ]
do
LN=$(($L+$FIELDSIZE+1))
message "field ${YELLOW}${i}${ENDCOLOR}, lines ${YELLOW}${L}${ENDCOLOR} - ${YELLOW}${LN}${ENDCOLOR}"
LOL[$i]="$(echo "$LOL_org" | sed -n "${L},$(($LN-1))p;${LN}q" )"
L=$LN
i=$(($i+1))
done
echo STOP
read
else
for i in $(seq 1 $FLOOTFORKS) for i in $(seq 1 $FLOOTFORKS)
do do
if [ -z "$ALPHACOLOR" ] if [ -z "$ALPHACOLOR" ]
@ -332,6 +358,8 @@ loadLOL() {
fi fi
done done
fi
} }
floot() { floot() {
@ -410,23 +438,29 @@ floot() {
esac esac
message "starting $FLOOTFORKS workers" message "starting $FLOOTFORKS workers"
while true
do
for i in $(seq $FLOOTFORKS)
do
#echo "check worker $i PID ${LOLPID[$i]} if running "
if [ -z ${LOLPID[$i]} ] || ! ps -p ${LOLPID[$i]} > /dev/null
then
message "worker ${YELLOW}$i${ENDCOLOR} is not running, starting it"
#if [ "$FLOOTSRUNNING" -le "$FLOOTFORKS" ]
#then
flootworker $i &
LOLPID[$i]=$!
#fi
fi if [ $LARGE ]
then
echo lol
else
while true
do
for i in $(seq $FLOOTFORKS)
do
#echo "check worker $i PID ${LOLPID[$i]} if running "
if [ -z ${LOLPID[$i]} ] || ! ps -p ${LOLPID[$i]} > /dev/null
then
message "worker ${YELLOW}$i${ENDCOLOR} is not running, starting it"
#if [ "$FLOOTSRUNNING" -le "$FLOOTFORKS" ]
#then
flootworker $i &
LOLPID[$i]=$!
#fi
fi
done
done done
done fi
} }
case $1 in case $1 in
@ -511,7 +545,7 @@ case $1 in
echo "IPFLOOT(string), FLOOTPORT(int), USECACHE(bool), FLOOTFORKS(int)" echo "IPFLOOT(string), FLOOTPORT(int), USECACHE(bool), FLOOTFORKS(int)"
echo "SIZE(int), TEXT(string), FONTSIZE(int), BGCOLOR(hex), COLOR(hex)" echo "SIZE(int), TEXT(string), FONTSIZE(int), BGCOLOR(hex), COLOR(hex)"
echo "BORDERCOLOR(hex), X(int), Y(int), X_MAX(int), Y_MAX(int), H(int), W(int)" echo "BORDERCOLOR(hex), X(int), Y(int), X_MAX(int), Y_MAX(int), H(int), W(int)"
echo "RESIZE(int), ALPHACOLOR(hex), BOUNCESTEP(int)" echo "RESIZE(int), ALPHACOLOR(hex), BOUNCESTEP(int), LARGE(bool)"
exit 1 exit 1
;; ;;