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

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

#include <PhaseOffsetY.h>

Inheritance diagram for PhaseOffsetY:
Collaboration diagram for PhaseOffsetY:

Public Member Functions

 PhaseOffsetY (uint8_t pixels)
 Constructs a PhaseOffsetY effect instance.
 
void ApplyEffect (IPixelGroup *pixelGroup) override
 Applies the vertical 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 vertical 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 vertical phase offsets to pixel groups.

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

Definition at line 26 of file PhaseOffsetY.h.

Constructor & Destructor Documentation

◆ PhaseOffsetY()

PhaseOffsetY ( uint8_t  pixels)

Constructs a PhaseOffsetY effect instance.

Parameters
pixelsThe number of pixels to apply the effect to.

Definition at line 4 of file PhaseOffsetY.cpp.

Member Function Documentation

◆ ApplyEffect()

void ApplyEffect ( IPixelGroup pixelGroup)
overridevirtual

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

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

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

Implements Effect.

Definition at line 6 of file PhaseOffsetY.cpp.

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

Member Data Documentation

◆ fGenPhase

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

Function generator for vertical phase offsets.

Definition at line 31 of file PhaseOffsetY.h.

Referenced by ApplyEffect().

◆ pixels

const uint8_t pixels
private

Number of pixels to apply the effect to.

Definition at line 28 of file PhaseOffsetY.h.

Referenced by ApplyEffect().


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