![]() |
ProtoTracer
1.0
Real-time 3D rendering and animation engine
|
Implements a glitch effect along the X-axis for pixel groups. More...
#include <GlitchX.h>
Public Member Functions | |
GlitchX (uint8_t pixels) | |
Constructs a GlitchX effect with a specified number of pixels. | |
void | ApplyEffect (IPixelGroup *pixelGroup) override |
Applies the glitch effect along the X-axis to the given pixel group. | |
![]() | |
Effect () | |
Default constructor for the Effect class. | |
void | SetRatio (float ratio) |
Sets the scaling ratio for the effect. | |
Private Attributes | |
const uint8_t | pixels |
The number of pixels to distort. | |
Additional Inherited Members | |
![]() | |
float | ratio = 0.0f |
A scaling ratio used for dynamic effect adjustments. | |
Implements a glitch effect along the X-axis for pixel groups.
The GlitchX
effect distorts the positions of pixels randomly along the X-axis, creating a glitch-like distortion.
Constructs a GlitchX
effect with a specified number of pixels.
pixels | The number of pixels to distort along the X-axis. |
Definition at line 3 of file GlitchX.cpp.
|
overridevirtual |
Applies the glitch effect along the X-axis to the given pixel group.
This method modifies the X-coordinates of the pixels in the group, shifting them randomly within a defined range.
pixelGroup | Pointer to the IPixelGroup to which the effect will be applied. |
Implements Effect.
Definition at line 5 of file GlitchX.cpp.
References RGBColor::B, RGBColor::G, IPixelGroup::GetColorBuffer(), IPixelGroup::GetColors(), IPixelGroup::GetOffsetXIndex(), IPixelGroup::GetPixelCount(), Mathematics::Map(), pixels, RGBColor::R, and Effect::ratio.
The number of pixels to distort.
Definition at line 28 of file GlitchX.h.
Referenced by ApplyEffect().