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

Applies rotational phase offsets to pixel groups. More...

#include <PhaseOffsetR.h>

Inheritance diagram for PhaseOffsetR:
Collaboration diagram for PhaseOffsetR:

Public Member Functions

 PhaseOffsetR (uint8_t pixels)
 Constructs a PhaseOffsetR effect instance.
 
void ApplyEffect (IPixelGroup *pixelGroup) override
 Applies the rotational phase offset 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 fGenPhase1 = FunctionGenerator(FunctionGenerator::Sawtooth, 0.0f, 1.0f, 4.5f)
 Function generator for the first phase offset.
 
FunctionGenerator fGenPhase2 = FunctionGenerator(FunctionGenerator::Sawtooth, 0.0f, 1.0f, 3.2f)
 Function generator for the second phase offset.
 
FunctionGenerator fGenRotation = FunctionGenerator(FunctionGenerator::Sawtooth, 0.0f, 360.0f, 3.7f)
 Function generator for rotation transformations.
 

Additional Inherited Members

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

Detailed Description

Applies rotational phase offsets to pixel groups.

The PhaseOffsetR effect uses function generators to create phase offsets and rotational transformations for dynamic and visually engaging effects.

Definition at line 26 of file PhaseOffsetR.h.

Constructor & Destructor Documentation

◆ PhaseOffsetR()

PhaseOffsetR ( uint8_t  pixels)

Constructs a PhaseOffsetR effect instance.

Parameters
pixelsThe number of pixels to apply the effect to.

Definition at line 4 of file PhaseOffsetR.cpp.

Member Function Documentation

◆ ApplyEffect()

void ApplyEffect ( IPixelGroup pixelGroup)
overridevirtual

Applies the rotational phase offset effect to the given pixel group.

This method modifies the pixel group using phase offsets and rotations.

Parameters
pixelGroupPointer to the IPixelGroup to which the effect will be applied.

Implements Effect.

Definition at line 6 of file PhaseOffsetR.cpp.

References RGBColor::B, Mathematics::Constrain(), fGenPhase1, fGenPhase2, fGenRotation, RGBColor::G, IPixelGroup::GetColorBuffer(), IPixelGroup::GetColors(), IPixelGroup::GetCoordinate(), IPixelGroup::GetPixelCount(), IPixelGroup::GetRadialIndex(), Mathematics::Map(), Mathematics::MPI, pixels, RGBColor::R, Effect::ratio, FunctionGenerator::Update(), Vector2D::X, and Vector2D::Y.

Member Data Documentation

◆ fGenPhase1

FunctionGenerator fGenPhase1 = FunctionGenerator(FunctionGenerator::Sawtooth, 0.0f, 1.0f, 4.5f)
private

Function generator for the first phase offset.

Definition at line 31 of file PhaseOffsetR.h.

Referenced by ApplyEffect().

◆ fGenPhase2

FunctionGenerator fGenPhase2 = FunctionGenerator(FunctionGenerator::Sawtooth, 0.0f, 1.0f, 3.2f)
private

Function generator for the second phase offset.

Definition at line 34 of file PhaseOffsetR.h.

Referenced by ApplyEffect().

◆ fGenRotation

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

Function generator for rotation transformations.

Definition at line 37 of file PhaseOffsetR.h.

Referenced by ApplyEffect().

◆ pixels

const uint8_t pixels
private

Number of pixels to apply the effect to.

Definition at line 28 of file PhaseOffsetR.h.

Referenced by ApplyEffect().


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