2#include "../../Utils/Math/Mathematics.h"
13 for (uint16_t i = 0; i < pixelCount; i++) {
14 uint16_t indexV = i, indexD = i;
15 uint16_t tIndexV = 0, tIndexD = 0;
16 bool validV =
true, validD =
true;
22 R = (uint16_t)pixelColors[i].R;
23 G = (uint16_t)pixelColors[i].G;
24 B = (uint16_t)pixelColors[i].B;
26 for (uint8_t j = 1; j < blurRange + 1; j++) {
28 validD = pixelGroup->
GetRadialIndex(i, &tIndexD, j, rotation + 180.0f);
34 R = R + (uint16_t)pixelColors[indexV].R;
35 G = G + (uint16_t)pixelColors[indexV].G;
36 B = B + (uint16_t)pixelColors[indexV].B;
40 R = R + (uint16_t)pixelColors[indexD].R;
41 G = G + (uint16_t)pixelColors[indexD].G;
42 B = B + (uint16_t)pixelColors[indexD].B;
51 for (uint16_t i = 0; i < pixelCount; i++) {
52 pixelColors[i].
R = colorBuffer[i].
R;
53 pixelColors[i].
G = colorBuffer[i].
G;
54 pixelColors[i].
B = colorBuffer[i].
B;
Defines the RadialBlur effect class for applying a radial blur to pixel groups.
float ratio
A scaling ratio used for dynamic effect adjustments.
float Update()
Updates and calculates the next value of the waveform.
Interface for managing and interacting with a collection of pixels.
virtual RGBColor * GetColors()=0
Retrieves the array of colors for the pixel group.
virtual RGBColor * GetColorBuffer()=0
Retrieves the color buffer for the pixel group.
virtual uint16_t GetPixelCount()=0
Retrieves the total number of pixels in the group.
virtual bool GetRadialIndex(uint16_t count, uint16_t *index, int pixels, float angle)=0
Retrieves a radial index for a given pixel based on distance and angle.
static T Map(T value, T inLow, T inMax, T outMin, T outMax)
Maps a value from one range to another.
static T Constrain(T value, T minimum, T maximum)
Constrains a value between minimum and maximum.
Represents an RGB color and provides methods for manipulation.
uint8_t B
Blue component of the color (0-255).
uint8_t G
Green component of the color (0-255).
uint8_t R
Red component of the color (0-255).
void ApplyEffect(IPixelGroup *pixelGroup) override
Applies the radial blur effect to the given pixel group.
FunctionGenerator fGenRotation
Function generator for controlling the rotational motion of the blur.
RadialBlur(uint8_t pixels)
Constructs a RadialBlur effect instance.
const uint8_t pixels
Number of pixels to apply the effect to.