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

Implements an overflow distortion effect for pixel groups. More...

#include <Overflow.h>

Inheritance diagram for Overflow:
Collaboration diagram for Overflow:

Public Member Functions

 Overflow (uint8_t pixels)
 Constructs an Overflow effect with a specified number of affected pixels.
 
void ApplyEffect (IPixelGroup *pixelGroup) override
 Applies the overflow distortion 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 affect in the group.
 

Additional Inherited Members

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

Detailed Description

Implements an overflow distortion effect for pixel groups.

The Overflow effect intentionally overflows 8-bit pixel values, creating dynamic wrap-around effects that result in unexpected color distortions.

Definition at line 24 of file Overflow.h.

Constructor & Destructor Documentation

◆ Overflow()

Overflow ( uint8_t  pixels)

Constructs an Overflow effect with a specified number of affected pixels.

Parameters
pixelsThe number of pixels to apply the overflow effect to.

Definition at line 3 of file Overflow.cpp.

Member Function Documentation

◆ ApplyEffect()

void ApplyEffect ( IPixelGroup pixelGroup)
overridevirtual

Applies the overflow distortion effect to the given pixel group.

This method modifies pixel color values, forcing them to exceed their 8-bit limits, and wraps them around using modulo arithmetic.

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

Implements Effect.

Definition at line 5 of file Overflow.cpp.

References RGBColor::B, RGBColor::G, IPixelGroup::GetColors(), IPixelGroup::GetPixelCount(), and RGBColor::R.

Member Data Documentation

◆ pixels

const uint8_t pixels
private

Number of pixels to affect in the group.

Definition at line 26 of file Overflow.h.


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