![]() |
ProtoTracer
1.0
Real-time 3D rendering and animation engine
|
Applies horizontal phase offsets to pixel groups. More...
#include <PhaseOffsetX.h>
Public Member Functions | |
PhaseOffsetX (uint8_t pixels) | |
Constructs a PhaseOffsetX effect instance. | |
void | ApplyEffect (IPixelGroup *pixelGroup) override |
Applies the horizontal 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 | fGenPhase = FunctionGenerator(FunctionGenerator::Sawtooth, 0.0f, 1.0f, 3.5f) |
Function generator for horizontal phase offsets. | |
Additional Inherited Members | |
![]() | |
float | ratio = 0.0f |
A scaling ratio used for dynamic effect adjustments. | |
Applies horizontal phase offsets to pixel groups.
The PhaseOffsetX
effect utilizes a function generator to create phase shifts along the horizontal axis for smooth and dynamic animations.
Definition at line 26 of file PhaseOffsetX.h.
PhaseOffsetX | ( | uint8_t | pixels | ) |
Constructs a PhaseOffsetX
effect instance.
pixels | The number of pixels to apply the effect to. |
Definition at line 4 of file PhaseOffsetX.cpp.
|
overridevirtual |
Applies the horizontal phase offset effect to the given pixel group.
This method modifies the pixel group by applying phase shifts along the horizontal axis.
pixelGroup | Pointer to the IPixelGroup to which the effect will be applied. |
Implements Effect.
Definition at line 6 of file PhaseOffsetX.cpp.
References RGBColor::B, Mathematics::Constrain(), fGenPhase, RGBColor::G, IPixelGroup::GetColorBuffer(), IPixelGroup::GetColors(), IPixelGroup::GetCoordinate(), IPixelGroup::GetOffsetXIndex(), IPixelGroup::GetPixelCount(), Mathematics::Map(), Mathematics::MPI, pixels, RGBColor::R, Effect::ratio, FunctionGenerator::Update(), and Vector2D::Y.
|
private |
Function generator for horizontal phase offsets.
Definition at line 31 of file PhaseOffsetX.h.
Referenced by ApplyEffect().
Number of pixels to apply the effect to.
Definition at line 28 of file PhaseOffsetX.h.
Referenced by ApplyEffect().