![]() |
ProtoTracer
1.0
Real-time 3D rendering and animation engine
|
Radially shifts the red, green, and blue channels of the pixels. More...
#include <ShiftR.h>
Public Member Functions | |
ShiftR (uint8_t pixels) | |
Constructs a ShiftR effect instance. | |
void | ApplyEffect (IPixelGroup *pixelGroup) override |
Applies the radial shift effect to the given pixel group. | |
![]() | |
Effect () | |
Default constructor for the Effect class. | |
void | SetRatio (float ratio) |
Sets the scaling ratio for the effect. | |
Private Attributes | |
const uint8_t | pixels |
Number of pixels to consider for the radial effect. | |
FunctionGenerator | fGenPhase1 = FunctionGenerator(FunctionGenerator::Sawtooth, 0.0f, 1.0f, 4.5f) |
Function generator for the red channel rotation phase. | |
FunctionGenerator | fGenPhase2 = FunctionGenerator(FunctionGenerator::Sawtooth, 0.0f, 1.0f, 3.2f) |
Function generator for the green channel rotation phase. | |
FunctionGenerator | fGenRotation = FunctionGenerator(FunctionGenerator::Sawtooth, 0.0f, 360.0f, 3.7f) |
Function generator for the overall rotation. | |
Additional Inherited Members | |
![]() | |
float | ratio = 0.0f |
A scaling ratio used for dynamic effect adjustments. | |
Radially shifts the red, green, and blue channels of the pixels.
The ShiftR
effect uses multiple function generators to apply rotations and phase shifts to the pixel colors, resulting in a swirling radial color transition.
Constructs a ShiftR
effect instance.
pixels | The number of pixels to consider for the radial effect. |
Definition at line 4 of file ShiftR.cpp.
|
overridevirtual |
Applies the radial shift effect to the given pixel group.
This method shifts the red, green, and blue channels of the pixels radially based on the configured function generators.
pixelGroup | Pointer to the IPixelGroup to which the effect will be applied. |
Implements Effect.
Definition at line 6 of file ShiftR.cpp.
References RGBColor::B, fGenRotation, RGBColor::G, IPixelGroup::GetColorBuffer(), IPixelGroup::GetColors(), IPixelGroup::GetPixelCount(), IPixelGroup::GetRadialIndex(), Mathematics::Map(), pixels, RGBColor::R, Effect::ratio, and FunctionGenerator::Update().
|
private |
|
private |
|
private |
Function generator for the overall rotation.
Definition at line 37 of file ShiftR.h.
Referenced by ApplyEffect().
Number of pixels to consider for the radial effect.
Definition at line 28 of file ShiftR.h.
Referenced by ApplyEffect().