2#include "../../Utils/Math/Mathematics.h"
7 if (
ratio <= 0.001f)
return;
15 float sineR = sinf(coordX + mpiR * 8.0f);
23 uint16_t indexR = 0, indexG = 0, indexB = 0;
30 pixelColors[i].
R = pixelColors[indexR].
R;
35 pixelColors[i].
G = pixelColors[indexG].
G;
40 pixelColors[i].
B = pixelColors[indexB].
B;
Defines the PhaseOffsetY effect class for applying vertical phase offsets 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 Vector2D GetCoordinate(uint16_t count)=0
Retrieves the coordinate of a specific pixel.
virtual uint16_t GetPixelCount()=0
Retrieves the total number of pixels in the group.
virtual bool GetOffsetYIndex(uint16_t count, uint16_t *index, int y1)=0
Retrieves an offset Y-axis index for a given pixel.
static const float MPI
Mathematical constant (3.14159265358979323846...).
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.
PhaseOffsetY(uint8_t pixels)
Constructs a PhaseOffsetY effect instance.
void ApplyEffect(IPixelGroup *pixelGroup) override
Applies the vertical phase offset effect to the given pixel group.
FunctionGenerator fGenPhase
Function generator for vertical phase offsets.
const uint8_t pixels
Number of pixels to apply the effect to.
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).
float X
The X-component of the 2D vector.