![]() |
ProtoTracer
1.0
Real-time 3D rendering and animation engine
|
Applies vertical phase offsets to pixel groups. More...
#include <PhaseOffsetY.h>


Public Member Functions | |
| 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. | |
Public Member Functions inherited from Effect | |
| 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 vertical phase offsets. | |
Additional Inherited Members | |
Protected Attributes inherited from Effect | |
| float | ratio = 0.0f |
| A scaling ratio used for dynamic effect adjustments. | |
Applies vertical phase offsets to pixel groups.
The PhaseOffsetY effect utilizes a function generator to create phase shifts along the vertical axis for smooth and dynamic animations.
Definition at line 26 of file PhaseOffsetY.h.
| PhaseOffsetY | ( | uint8_t | pixels | ) |
Constructs a PhaseOffsetY effect instance.
| pixels | The number of pixels to apply the effect to. |
Definition at line 4 of file PhaseOffsetY.cpp.
|
overridevirtual |
Applies the vertical phase offset effect to the given pixel group.
This method modifies the pixel group by applying phase shifts along the vertical axis.
| pixelGroup | Pointer to the IPixelGroup to which the effect will be applied. |
Implements Effect.
Definition at line 6 of file PhaseOffsetY.cpp.
References RGBColor::B, Mathematics::Constrain(), fGenPhase, RGBColor::G, IPixelGroup::GetColors(), IPixelGroup::GetCoordinate(), IPixelGroup::GetOffsetYIndex(), IPixelGroup::GetPixelCount(), Mathematics::Map(), Mathematics::MPI, pixels, RGBColor::R, Effect::ratio, FunctionGenerator::Update(), and Vector2D::X.
|
private |
Function generator for vertical phase offsets.
Definition at line 31 of file PhaseOffsetY.h.
Referenced by ApplyEffect().
Number of pixels to apply the effect to.
Definition at line 28 of file PhaseOffsetY.h.
Referenced by ApplyEffect().