ProtoTracer  1.0
Real-time 3D rendering and animation engine
Loading...
Searching...
No Matches
PhaseOffsetY.h
Go to the documentation of this file.
1/**
2 * @file PhaseOffsetY.h
3 * @brief Defines the `PhaseOffsetY` effect class for applying vertical phase offsets to pixel groups.
4 *
5 * The `PhaseOffsetY` effect dynamically alters pixel groups by introducing phase shifts
6 * along the vertical axis for visually engaging animations.
7 *
8 * @date 22/12/2024
9 * @version 1.0
10 * @author Coela Can't
11 */
12
13#pragma once
14
15#include "Effect.h"
16#include "../../Utils/Signals/FunctionGenerator.h"
17#include "../../Utils/Math/Mathematics.h"
18
19/**
20 * @class PhaseOffsetY
21 * @brief Applies vertical phase offsets to pixel groups.
22 *
23 * The `PhaseOffsetY` effect utilizes a function generator to create phase shifts
24 * along the vertical axis for smooth and dynamic animations.
25 */
26class PhaseOffsetY : public Effect {
27private:
28 const uint8_t pixels; ///< Number of pixels to apply the effect to.
29
30 /// Function generator for vertical phase offsets.
32
33public:
34 /**
35 * @brief Constructs a `PhaseOffsetY` effect instance.
36 *
37 * @param pixels The number of pixels to apply the effect to.
38 */
39 PhaseOffsetY(uint8_t pixels);
40
41 /**
42 * @brief Applies the vertical phase offset effect to the given pixel group.
43 *
44 * This method modifies the pixel group by applying phase shifts along the vertical axis.
45 *
46 * @param pixelGroup Pointer to the `IPixelGroup` to which the effect will be applied.
47 */
48 void ApplyEffect(IPixelGroup* pixelGroup) override;
49};
Defines the base Effect class for applying transformations or effects to pixel groups.
Abstract base class for applying visual effects to pixel groups.
Definition Effect.h:26
A class to generate various waveform functions with customizable parameters.
@ Sawtooth
Sawtooth waveform.
Interface for managing and interacting with a collection of pixels.
Definition IPixelGroup.h:25
Applies vertical phase offsets to pixel groups.
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.