add blur option

This commit is contained in:
Frank
2025-11-09 17:33:04 +01:00
parent 4659939547
commit 6581dd6ff9
2 changed files with 11 additions and 2 deletions

View File

@@ -4509,7 +4509,7 @@ uint16_t mode_image(void) {
// Serial.println(status);
// }
}
static const char _data_FX_MODE_IMAGE[] PROGMEM = "Image@!,;;;12;sx=128";
static const char _data_FX_MODE_IMAGE[] PROGMEM = "Image@!,Blur,;;;12;sx=128,ix=0";
/*
Blends random colors across palette

View File

@@ -56,7 +56,16 @@ void screenClearCallback(void) {
activeSeg->fill(0);
}
void updateScreenCallback(void) {}
// this callback runs when the decoder has finished painting all pixels
void updateScreenCallback(void) {
// perfect time for adding blur
if (activeSeg->intensity > 1) {
uint8_t blurAmount = activeSeg->intensity >> 2;
if ((blurAmount < 24) && (activeSeg->is2D())) activeSeg->blurRows(activeSeg->intensity >> 1); // some blur - fast
else activeSeg->blur(blurAmount); // more blur - slower
}
lastCoordinate = -1; // invalidate last position
}
// note: GifDecoder drawing is done top right to bottom left, line by line