wip large mode, slide pixlist into multiple fields
This commit is contained in:
parent
e01cb272cb
commit
ba5e40a603
2 changed files with 52 additions and 18 deletions
|
@ -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,
|
||||||
|
|
|
@ -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" ]
|
||||||
|
@ -331,6 +357,8 @@ loadLOL() {
|
||||||
LOL[$i]="$(echo "$LOL_org" | grep -v $ALPHACOLOR | shuf)"
|
LOL[$i]="$(echo "$LOL_org" | grep -v $ALPHACOLOR | shuf)"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -410,23 +438,29 @@ floot() {
|
||||||
esac
|
esac
|
||||||
|
|
||||||
message "starting $FLOOTFORKS workers"
|
message "starting $FLOOTFORKS workers"
|
||||||
while true
|
|
||||||
do
|
if [ $LARGE ]
|
||||||
for i in $(seq $FLOOTFORKS)
|
then
|
||||||
do
|
echo lol
|
||||||
#echo "check worker $i PID ${LOLPID[$i]} if running "
|
else
|
||||||
if [ -z ${LOLPID[$i]} ] || ! ps -p ${LOLPID[$i]} > /dev/null
|
while true
|
||||||
then
|
do
|
||||||
message "worker ${YELLOW}$i${ENDCOLOR} is not running, starting it"
|
for i in $(seq $FLOOTFORKS)
|
||||||
#if [ "$FLOOTSRUNNING" -le "$FLOOTFORKS" ]
|
do
|
||||||
#then
|
#echo "check worker $i PID ${LOLPID[$i]} if running "
|
||||||
flootworker $i &
|
if [ -z ${LOLPID[$i]} ] || ! ps -p ${LOLPID[$i]} > /dev/null
|
||||||
LOLPID[$i]=$!
|
then
|
||||||
#fi
|
message "worker ${YELLOW}$i${ENDCOLOR} is not running, starting it"
|
||||||
|
#if [ "$FLOOTSRUNNING" -le "$FLOOTFORKS" ]
|
||||||
fi
|
#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
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in a new issue