![]() |
ProtoTracer
1.0
Real-time 3D rendering and animation engine
|
Applies a radial blur effect to pixel groups. More...
#include <RadialBlur.h>
Public Member Functions | |
RadialBlur (uint8_t pixels) | |
Constructs a RadialBlur effect instance. | |
void | ApplyEffect (IPixelGroup *pixelGroup) override |
Applies the radial blur effect 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 |
Number of pixels to apply the effect to. | |
FunctionGenerator | fGenRotation = FunctionGenerator(FunctionGenerator::Sawtooth, 0.0f, 360.0f, 3.7f) |
Function generator for controlling the rotational motion of the blur. | |
Additional Inherited Members | |
![]() | |
float | ratio = 0.0f |
A scaling ratio used for dynamic effect adjustments. | |
Applies a radial blur effect to pixel groups.
The RadialBlur
effect uses a function generator to create rotational motion, resulting in a circular blur effect.
Definition at line 26 of file RadialBlur.h.
RadialBlur | ( | uint8_t | pixels | ) |
Constructs a RadialBlur
effect instance.
pixels | The number of pixels to apply the effect to. |
Definition at line 4 of file RadialBlur.cpp.
|
overridevirtual |
Applies the radial blur effect to the given pixel group.
This method modifies the pixel group by simulating a circular blur effect.
pixelGroup | Pointer to the IPixelGroup to which the effect will be applied. |
Implements Effect.
Definition at line 6 of file RadialBlur.cpp.
References RGBColor::B, Mathematics::Constrain(), fGenRotation, RGBColor::G, IPixelGroup::GetColorBuffer(), IPixelGroup::GetColors(), IPixelGroup::GetPixelCount(), IPixelGroup::GetRadialIndex(), Mathematics::Map(), pixels, RGBColor::R, Effect::ratio, and FunctionGenerator::Update().
|
private |
Function generator for controlling the rotational motion of the blur.
Definition at line 31 of file RadialBlur.h.
Referenced by ApplyEffect().
Number of pixels to apply the effect to.
Definition at line 28 of file RadialBlur.h.
Referenced by ApplyEffect().