10 uint16_t indexLeft = i;
11 uint16_t indexRight = i;
12 uint16_t tIndexLeft = 0;
13 uint16_t tIndexRight = 0;
21 R = (uint16_t)pixelColors[i].R;
22 G = (uint16_t)pixelColors[i].G;
23 B = (uint16_t)pixelColors[i].B;
25 for (uint8_t j = 1; j < blurRange + 1; j++) {
26 validL = pixelGroup->
GetLeftIndex(indexLeft, &tIndexLeft);
29 indexLeft = tIndexLeft;
30 indexRight = tIndexRight;
32 if (validL && validR) {
33 R = R + (uint16_t)pixelColors[indexLeft].R + (uint16_t)pixelColors[indexRight].
R;
34 G = G + (uint16_t)pixelColors[indexLeft].G + (uint16_t)pixelColors[indexRight].
G;
35 B = B + (uint16_t)pixelColors[indexLeft].B + (uint16_t)pixelColors[indexRight].
B;
45 pixelColors[i].
R = colorBuffer[i].
R;
46 pixelColors[i].
G = colorBuffer[i].
G;
47 pixelColors[i].
B = colorBuffer[i].
B;
Defines the HorizontalBlur effect class for applying horizontal blur to pixel groups.
float ratio
A scaling ratio used for dynamic effect adjustments.
HorizontalBlur(uint8_t pixels)
Constructs a HorizontalBlur effect with a specified blur radius.
void ApplyEffect(IPixelGroup *pixelGroup) override
Applies the horizontal blur effect to the given pixel group.
const uint8_t pixels
The number of neighboring pixels to blend for the blur effect.
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 bool GetLeftIndex(uint16_t count, uint16_t *leftIndex)=0
Retrieves the index of the pixel to the left of a given pixel.
virtual bool GetRightIndex(uint16_t count, uint16_t *rightIndex)=0
Retrieves the index of the pixel to the right of a given pixel.
virtual uint16_t GetPixelCount()=0
Retrieves the total number of pixels in the group.
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).