2019-09-25 04:26:27 +00:00
|
|
|
#include "effect_blur2d.h"
|
|
|
|
|
|
|
|
boolean Blur2DEffect::can_be_shown_with_clock() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Blur2DEffect::loop() {
|
2019-09-25 18:05:18 +00:00
|
|
|
uint8_t blur_amount = dim8_raw(beatsin8(3, 128, 224));
|
2019-09-25 04:26:27 +00:00
|
|
|
window->blur(blur_amount);
|
2019-09-25 18:05:18 +00:00
|
|
|
|
|
|
|
uint8_t x1 = beatsin8(7, 0, window->width-1);
|
|
|
|
uint8_t y1 = beatsin8(11, 0, window->height-1);
|
|
|
|
|
|
|
|
uint8_t x2 = beatsin8(13, 0, window->width-1);
|
|
|
|
uint8_t y2 = beatsin8(8, 0, window->height-1);
|
|
|
|
|
|
|
|
uint8_t x3 = beatsin8(11, 0, window->width-1);
|
|
|
|
uint8_t y3 = beatsin8(13, 0, window->height-1);
|
|
|
|
|
2019-09-25 04:26:27 +00:00
|
|
|
uint16_t ms = millis();
|
|
|
|
CRGB c1 = CHSV(ms / 29, 200, 255);
|
|
|
|
CRGB c2 = CHSV(ms / 41, 200, 255);
|
|
|
|
CRGB c3 = CHSV(ms / 73, 200, 255);
|
|
|
|
window->addPixelColor(x1, y1, &c1);
|
|
|
|
window->addPixelColor(x2, y2, &c2);
|
|
|
|
window->addPixelColor(x3, y3, &c3);
|
|
|
|
}
|
|
|
|
|
|
|
|
Blur2DEffect::~Blur2DEffect() {
|
|
|
|
delete window;
|
|
|
|
}
|