switched exec-cycle to a live >=2fps ascii preview loop and added txt2printr stub
replaced the guvcview+keypress capture flow with a continuous capture/convert/display loop so the terminal shows a live ascii preview; pressing c saves the frame and triggers the new txt2printr.sh hook (currently a blank template).master
parent
494fa5dc64
commit
7030454075
|
|
@ -1,14 +1,23 @@
|
|||
#/bin/bash
|
||||
|
||||
trap 'stty sane; clear; exit 0' SIGINT SIGTERM
|
||||
|
||||
while true; do
|
||||
clear
|
||||
echo "Press any key to capture image"
|
||||
guvcview &> /dev/null &
|
||||
read -n 1
|
||||
killall guvcview
|
||||
|
||||
./webcam2ascii.sh
|
||||
read -n 1
|
||||
echo
|
||||
echo "[c] capture [Ctrl+C] quit"
|
||||
|
||||
if read -n 1 -t 0.05 -s key && [[ "$key" == "c" || "$key" == "C" ]]; then
|
||||
timestamp=$(date +%Y%m%d-%H%M%S)
|
||||
cp web-cam-shot.jpg "photo-$timestamp.jpg"
|
||||
cp ascii-img.txt "ascii-img-$timestamp.txt"
|
||||
clear
|
||||
cat "ascii-img-$timestamp.txt"
|
||||
echo
|
||||
echo "Saved photo-$timestamp.jpg and ascii-img-$timestamp.txt"
|
||||
./txt2printr.sh "ascii-img-$timestamp.txt"
|
||||
read -n 1 -s -p "Press any key to resume live preview, Ctrl+C to quit..."
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
#/bin/bash
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
#/bin/bash
|
||||
|
||||
fswebcam -r 640x480 --jpeg 85 -D 1 web-cam-shot.jpg &> /dev/null
|
||||
fswebcam -q --no-banner -r 640x480 --jpeg 85 web-cam-shot.jpg &> /dev/null
|
||||
ascii-image-converter web-cam-shot.jpg | tee ascii-img.txt
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue