ProtoTracer  1.0
Real-time 3D rendering and animation engine
Loading...
Searching...
No Matches
ShiftR.h
Go to the documentation of this file.
1/**
2 * @file ShiftR.h
3 * @brief Defines the `ShiftR` effect class for shifting color channels radially.
4 *
5 * The `ShiftR` effect applies a radial shift to the red, green, and blue channels
6 * of the pixels, creating a dynamic swirling color effect.
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 ShiftR
21 * @brief Radially shifts the red, green, and blue channels of the pixels.
22 *
23 * The `ShiftR` effect uses multiple function generators to apply rotations and phase shifts
24 * to the pixel colors, resulting in a swirling radial color transition.
25 */
26class ShiftR : public Effect {
27private:
28 const uint8_t pixels; ///< Number of pixels to consider for the radial effect.
29
30 /// Function generator for the red channel rotation phase.
32
33 /// Function generator for the green channel rotation phase.
35
36 /// Function generator for the overall rotation.
38
39public:
40 /**
41 * @brief Constructs a `ShiftR` effect instance.
42 *
43 * @param pixels The number of pixels to consider for the radial effect.
44 */
45 ShiftR(uint8_t pixels);
46
47 /**
48 * @brief Applies the radial shift effect to the given pixel group.
49 *
50 * This method shifts the red, green, and blue channels of the pixels radially
51 * based on the configured function generators.
52 *
53 * @param pixelGroup Pointer to the `IPixelGroup` to which the effect will be applied.
54 */
55 void ApplyEffect(IPixelGroup* pixelGroup) override;
56};
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
Radially shifts the red, green, and blue channels of the pixels.
Definition ShiftR.h:26
FunctionGenerator fGenPhase2
Function generator for the green channel rotation phase.
Definition ShiftR.h:34
void ApplyEffect(IPixelGroup *pixelGroup) override
Applies the radial shift effect to the given pixel group.
Definition ShiftR.cpp:6
FunctionGenerator fGenRotation
Function generator for the overall rotation.
Definition ShiftR.h:37
FunctionGenerator fGenPhase1
Function generator for the red channel rotation phase.
Definition ShiftR.h:31
const uint8_t pixels
Number of pixels to consider for the radial effect.
Definition ShiftR.h:28