![]() |
ProtoTracer
1.0
Real-time 3D rendering and animation engine
|
Applies rotational phase offsets to pixel groups. More...
#include <PhaseOffsetR.h>
Public Member Functions | |
PhaseOffsetR (uint8_t pixels) | |
Constructs a PhaseOffsetR effect instance. | |
void | ApplyEffect (IPixelGroup *pixelGroup) override |
Applies the rotational phase offset 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 apply the effect to. | |
FunctionGenerator | fGenPhase1 = FunctionGenerator(FunctionGenerator::Sawtooth, 0.0f, 1.0f, 4.5f) |
Function generator for the first phase offset. | |
FunctionGenerator | fGenPhase2 = FunctionGenerator(FunctionGenerator::Sawtooth, 0.0f, 1.0f, 3.2f) |
Function generator for the second phase offset. | |
FunctionGenerator | fGenRotation = FunctionGenerator(FunctionGenerator::Sawtooth, 0.0f, 360.0f, 3.7f) |
Function generator for rotation transformations. | |
Additional Inherited Members | |
![]() | |
float | ratio = 0.0f |
A scaling ratio used for dynamic effect adjustments. | |
Applies rotational phase offsets to pixel groups.
The PhaseOffsetR
effect uses function generators to create phase offsets and rotational transformations for dynamic and visually engaging effects.
Definition at line 26 of file PhaseOffsetR.h.
PhaseOffsetR | ( | uint8_t | pixels | ) |
Constructs a PhaseOffsetR
effect instance.
pixels | The number of pixels to apply the effect to. |
Definition at line 4 of file PhaseOffsetR.cpp.
|
overridevirtual |
Applies the rotational phase offset effect to the given pixel group.
This method modifies the pixel group using phase offsets and rotations.
pixelGroup | Pointer to the IPixelGroup to which the effect will be applied. |
Implements Effect.
Definition at line 6 of file PhaseOffsetR.cpp.
References RGBColor::B, Mathematics::Constrain(), fGenPhase1, fGenPhase2, fGenRotation, RGBColor::G, IPixelGroup::GetColorBuffer(), IPixelGroup::GetColors(), IPixelGroup::GetCoordinate(), IPixelGroup::GetPixelCount(), IPixelGroup::GetRadialIndex(), Mathematics::Map(), Mathematics::MPI, pixels, RGBColor::R, Effect::ratio, FunctionGenerator::Update(), Vector2D::X, and Vector2D::Y.
|
private |
Function generator for the first phase offset.
Definition at line 31 of file PhaseOffsetR.h.
Referenced by ApplyEffect().
|
private |
Function generator for the second phase offset.
Definition at line 34 of file PhaseOffsetR.h.
Referenced by ApplyEffect().
|
private |
Function generator for rotation transformations.
Definition at line 37 of file PhaseOffsetR.h.
Referenced by ApplyEffect().
Number of pixels to apply the effect to.
Definition at line 28 of file PhaseOffsetR.h.
Referenced by ApplyEffect().