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

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

#include <PhaseOffsetX.h>

Inheritance diagram for PhaseOffsetX:
Collaboration diagram for PhaseOffsetX:

Public Member Functions

 PhaseOffsetX (uint8_t pixels)
 Constructs a PhaseOffsetX effect instance.
 
void ApplyEffect (IPixelGroup *pixelGroup) override
 Applies the horizontal 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 fGenPhase = FunctionGenerator(FunctionGenerator::Sawtooth, 0.0f, 1.0f, 3.5f)
 Function generator for horizontal phase offsets.
 

Additional Inherited Members

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

Detailed Description

Applies horizontal phase offsets to pixel groups.

The PhaseOffsetX effect utilizes a function generator to create phase shifts along the horizontal axis for smooth and dynamic animations.

Definition at line 26 of file PhaseOffsetX.h.

Constructor & Destructor Documentation

◆ PhaseOffsetX()

PhaseOffsetX ( uint8_t  pixels)

Constructs a PhaseOffsetX effect instance.

Parameters
pixelsThe number of pixels to apply the effect to.

Definition at line 4 of file PhaseOffsetX.cpp.

Member Function Documentation

◆ ApplyEffect()

void ApplyEffect ( IPixelGroup pixelGroup)
overridevirtual

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

This method modifies the pixel group by applying phase shifts along the horizontal axis.

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

Implements Effect.

Definition at line 6 of file PhaseOffsetX.cpp.

References RGBColor::B, Mathematics::Constrain(), fGenPhase, RGBColor::G, IPixelGroup::GetColorBuffer(), IPixelGroup::GetColors(), IPixelGroup::GetCoordinate(), IPixelGroup::GetOffsetXIndex(), IPixelGroup::GetPixelCount(), Mathematics::Map(), Mathematics::MPI, pixels, RGBColor::R, Effect::ratio, FunctionGenerator::Update(), and Vector2D::Y.

Member Data Documentation

◆ fGenPhase

FunctionGenerator fGenPhase = FunctionGenerator(FunctionGenerator::Sawtooth, 0.0f, 1.0f, 3.5f)
private

Function generator for horizontal phase offsets.

Definition at line 31 of file PhaseOffsetX.h.

Referenced by ApplyEffect().

◆ pixels

const uint8_t pixels
private

Number of pixels to apply the effect to.

Definition at line 28 of file PhaseOffsetX.h.

Referenced by ApplyEffect().


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