ProtoTracer  1.0
Real-time 3D rendering and animation engine
Loading...
Searching...
No Matches
GlitchX.h
Go to the documentation of this file.
1/**
2 * @file GlitchX.h
3 * @brief Defines the `GlitchX` effect class for applying glitch effects along the X-axis to pixel groups.
4 *
5 * The `GlitchX` effect randomly distorts pixel positions along the X-axis,
6 * creating a glitch-like appearance.
7 *
8 * @date 22/12/2024
9 * @version 1.0
10 * @author Coela Can't
11 */
12
13#pragma once
14
15#include <Arduino.h>
16#include "Effect.h"
17#include "../../Utils/Math/Mathematics.h"
18
19/**
20 * @class GlitchX
21 * @brief Implements a glitch effect along the X-axis for pixel groups.
22 *
23 * The `GlitchX` effect distorts the positions of pixels randomly along the X-axis,
24 * creating a glitch-like distortion.
25 */
26class GlitchX : public Effect {
27private:
28 const uint8_t pixels; ///< The number of pixels to distort.
29
30public:
31 /**
32 * @brief Constructs a `GlitchX` effect with a specified number of pixels.
33 *
34 * @param pixels The number of pixels to distort along the X-axis.
35 */
36 GlitchX(uint8_t pixels);
37
38 /**
39 * @brief Applies the glitch effect along the X-axis to the given pixel group.
40 *
41 * This method modifies the X-coordinates of the pixels in the group,
42 * shifting them randomly within a defined range.
43 *
44 * @param pixelGroup Pointer to the `IPixelGroup` to which the effect will be applied.
45 */
46 void ApplyEffect(IPixelGroup* pixelGroup) override;
47};
48
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
Implements a glitch effect along the X-axis for pixel groups.
Definition GlitchX.h:26
void ApplyEffect(IPixelGroup *pixelGroup) override
Applies the glitch effect along the X-axis to the given pixel group.
Definition GlitchX.cpp:5
const uint8_t pixels
The number of pixels to distort.
Definition GlitchX.h:28
Interface for managing and interacting with a collection of pixels.
Definition IPixelGroup.h:25