Public Access
Add four animated KonoSuba ESPHome pages
Megumin's daily explosion, the Adventurers' Guild quest board (agenda, weather, solar), Megumin's adventurer card and a party battle against a giant toad with a live-data battle log. Original 1-bit pixel art lives in tools/konosuba_sprites.py, which generates konosuba_sprites.h and can render a preview PNG. Home data and drawing helpers shared by the themed pages move to el512_pages.h; the display gains dither_mask() for a dissolve-in intro. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
50ee17b3f6
commit
e9b91c5628
11 files changed
+1655
-61
No files matched your search
@@ -148,6 +148,24 @@ void EL512Display::invert_rect(int x, int y, int width, int height) {
|
||||
this->panel_->setPixel(px, py, !this->panel_->getPixel(px, py));
|
||||
}
|
||||
|
||||
void EL512Display::dither_mask(int level) {
|
||||
if (this->panel_ == nullptr || level >= 16)
|
||||
return;
|
||||
static const uint8_t BAYER[4][4] = {{0, 8, 2, 10}, {12, 4, 14, 6}, {3, 11, 1, 9}, {15, 7, 13, 5}};
|
||||
uint8_t masks[4];
|
||||
for (int r = 0; r < 4; r++) {
|
||||
masks[r] = 0;
|
||||
for (int x = 0; x < 8; x++)
|
||||
if (BAYER[r][x & 3] < level)
|
||||
masks[r] |= 0x80 >> x;
|
||||
}
|
||||
uint8_t *fb = this->panel_->framebuffer();
|
||||
constexpr int ROW = EL512Panel::WIDTH / 8;
|
||||
for (int y = 0; y < EL512Panel::HEIGHT; y++)
|
||||
for (int i = 0; i < ROW; i++)
|
||||
fb[y * ROW + i] &= masks[y & 3];
|
||||
}
|
||||
|
||||
void EL512Display::update() {
|
||||
if (this->panel_ == nullptr || !this->panel_->running())
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user