summaryrefslogtreecommitdiff
path: root/src/app/bad-apple-atmega2560-ssd1306/convert
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-02-11 10:54:47 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2024-02-11 10:54:47 +0100
commitb6206e83d10eb7e350b6ea17ab9f649a09332f52 (patch)
tree3599c4345fa56a4a0129fc1dcb7a0369a086492c /src/app/bad-apple-atmega2560-ssd1306/convert
parent0d6dfd6e47cbeff1e10f0c536824e5f7259b21e8 (diff)
Add Bad Apple on ATMega2560 (not working very well)
Looks like these devices can only use the lower 64 kB as PROGMEM, so the whole exercise is kinda pointless. Also inflate() is slow af.
Diffstat (limited to 'src/app/bad-apple-atmega2560-ssd1306/convert')
-rwxr-xr-xsrc/app/bad-apple-atmega2560-ssd1306/convert17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/app/bad-apple-atmega2560-ssd1306/convert b/src/app/bad-apple-atmega2560-ssd1306/convert
new file mode 100755
index 0000000..964c7a4
--- /dev/null
+++ b/src/app/bad-apple-atmega2560-ssd1306/convert
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# [size=WxH] ./convert.sh <file> -r <frame rate> [additional ffmpeg args]
+
+set -eu
+
+mkdir -p tmp
+
+ffmpeg -i "$@" tmp/frame%4d.png
+
+parallel mogrify -resize "${size:-128x32}" -threshold 50% -- tmp/*.png
+
+echo "#include <avr/pgmspace.h>" > frames.cc
+echo "const unsigned char frame_rate = $3;" >> frames.cc
+./frames-to-cc tmp/*.png >> frames.cc
+
+rm -rf tmp