2#include "../../Utils/Math/Mathematics.h" 
   13    for (uint16_t i = 0; i < pixelCount; i++) {
 
   14        uint16_t indexR, indexG, indexB;
 
   15        bool validR, validG, validB;
 
   20        validG = pixelGroup->
GetRadialIndex(i, &indexG, range, rotation + 120.0f);
 
   21        validB = pixelGroup->
GetRadialIndex(i, &indexB, range, rotation + 240.0f);
 
   23        if (validR) colorBuffer[i].
R = pixelColors[indexR].
R;
 
   24        else colorBuffer[i].
R = 0;
 
   26        if (validG) colorBuffer[i].
G = pixelColors[indexG].
G;
 
   27        else colorBuffer[i].
G = 0;
 
   29        if (validB) colorBuffer[i].
B = pixelColors[indexB].
B;
 
   30        else colorBuffer[i].
B = 0;
 
   33    for (uint16_t i = 0; i < pixelCount; i++) {
 
   34        pixelColors[i].
R = colorBuffer[i].
R;
 
   35        pixelColors[i].
G = colorBuffer[i].
G;
 
   36        pixelColors[i].
B = colorBuffer[i].
B;
 
 
Defines the ShiftR effect class for shifting color channels radially.
 
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.
 
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).
 
ShiftR(uint8_t pixels)
Constructs a ShiftR effect instance.
 
void ApplyEffect(IPixelGroup *pixelGroup) override
Applies the radial shift effect to the given pixel group.
 
FunctionGenerator fGenRotation
Function generator for the overall rotation.
 
const uint8_t pixels
Number of pixels to consider for the radial effect.