ProtoTracer  1.0
Real-time 3D rendering and animation engine
Loading...
Searching...
No Matches
Overflow.h
Go to the documentation of this file.
1/**
2 * @file Overflow.h
3 * @brief Defines the `Overflow` effect class for adding overflow distortion to pixel groups.
4 *
5 * The `Overflow` effect manipulates pixel values to exceed their 8-bit boundaries,
6 * creating visual artifacts by wrapping values that exceed 255 back to 0.
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
17/**
18 * @class Overflow
19 * @brief Implements an overflow distortion effect for pixel groups.
20 *
21 * The `Overflow` effect intentionally overflows 8-bit pixel values, creating dynamic
22 * wrap-around effects that result in unexpected color distortions.
23 */
24class Overflow : public Effect {
25private:
26 const uint8_t pixels; ///< Number of pixels to affect in the group.
27
28public:
29 /**
30 * @brief Constructs an `Overflow` effect with a specified number of affected pixels.
31 *
32 * @param pixels The number of pixels to apply the overflow effect to.
33 */
34 Overflow(uint8_t pixels);
35
36 /**
37 * @brief Applies the overflow distortion effect to the given pixel group.
38 *
39 * This method modifies pixel color values, forcing them to exceed their 8-bit limits,
40 * and wraps them around using modulo arithmetic.
41 *
42 * @param pixelGroup Pointer to the `IPixelGroup` to which the effect will be applied.
43 */
44 void ApplyEffect(IPixelGroup* pixelGroup) override;
45};
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
Interface for managing and interacting with a collection of pixels.
Definition IPixelGroup.h:25
Implements an overflow distortion effect for pixel groups.
Definition Overflow.h:24
void ApplyEffect(IPixelGroup *pixelGroup) override
Applies the overflow distortion effect to the given pixel group.
Definition Overflow.cpp:5
const uint8_t pixels
Number of pixels to affect in the group.
Definition Overflow.h:26