ProtoTracer  1.0
Real-time 3D rendering and animation engine
Loading...
Searching...
No Matches
Effect.h
Go to the documentation of this file.
1/**
2 * @file Effect.h
3 * @brief Defines the base `Effect` class for applying transformations or effects to pixel groups.
4 *
5 * The `Effect` class serves as an abstract base for implementing various visual effects
6 * on pixel groups, leveraging mathematical transformations and ratios for dynamic adjustments.
7 *
8 * @date 22/12/2024
9 * @version 1.0
10 * @author Coela Can't
11 */
12
13#pragma once
14
15#include "../../Camera/Pixels/IPixelGroup.h"
16#include "../../Utils/Math/Mathematics.h"
17
18/**
19 * @class Effect
20 * @brief Abstract base class for applying visual effects to pixel groups.
21 *
22 * The `Effect` class provides a framework for applying transformations or effects
23 * to `IPixelGroup` objects. Subclasses should implement the `ApplyEffect` method
24 * to define specific effect behavior.
25 */
26class Effect {
27protected:
28 float ratio = 0.0f; ///< A scaling ratio used for dynamic effect adjustments.
29
30public:
31 /**
32 * @brief Default constructor for the `Effect` class.
33 */
34 Effect();
35
36 /**
37 * @brief Sets the scaling ratio for the effect.
38 *
39 * The ratio is typically used for time-based or intensity-based transformations.
40 *
41 * @param ratio The scaling ratio to be applied.
42 */
43 void SetRatio(float ratio);
44
45 /**
46 * @brief Pure virtual method for applying the effect to a pixel group.
47 *
48 * Subclasses must override this method to implement the effect's behavior.
49 *
50 * @param pixelGroup Pointer to the `IPixelGroup` to which the effect will be applied.
51 */
52 virtual void ApplyEffect(IPixelGroup* pixelGroup) = 0;
53};
54
Abstract base class for applying visual effects to pixel groups.
Definition Effect.h:26
float ratio
A scaling ratio used for dynamic effect adjustments.
Definition Effect.h:28
virtual void ApplyEffect(IPixelGroup *pixelGroup)=0
Pure virtual method for applying the effect to a pixel group.
void SetRatio(float ratio)
Sets the scaling ratio for the effect.
Definition Effect.cpp:5
Effect()
Default constructor for the Effect class.
Definition Effect.cpp:3
Interface for managing and interacting with a collection of pixels.
Definition IPixelGroup.h:25