ProtoTracer  1.0
Real-time 3D rendering and animation engine
Loading...
Searching...
No Matches
RadialBlur Class Reference

Applies a radial blur effect to pixel groups. More...

#include <RadialBlur.h>

Inheritance diagram for RadialBlur:
Collaboration diagram for RadialBlur:

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.
 
- Public Member Functions inherited from Effect
 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

- Protected Attributes inherited from Effect
float ratio = 0.0f
 A scaling ratio used for dynamic effect adjustments.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ RadialBlur()

RadialBlur ( uint8_t  pixels)

Constructs a RadialBlur effect instance.

Parameters
pixelsThe number of pixels to apply the effect to.

Definition at line 4 of file RadialBlur.cpp.

Member Function Documentation

◆ ApplyEffect()

void ApplyEffect ( IPixelGroup pixelGroup)
overridevirtual

Applies the radial blur effect to the given pixel group.

This method modifies the pixel group by simulating a circular blur effect.

Parameters
pixelGroupPointer 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().

Member Data Documentation

◆ fGenRotation

FunctionGenerator fGenRotation = FunctionGenerator(FunctionGenerator::Sawtooth, 0.0f, 360.0f, 3.7f)
private

Function generator for controlling the rotational motion of the blur.

Definition at line 31 of file RadialBlur.h.

Referenced by ApplyEffect().

◆ pixels

const uint8_t pixels
private

Number of pixels to apply the effect to.

Definition at line 28 of file RadialBlur.h.

Referenced by ApplyEffect().


The documentation for this class was generated from the following files: