Loading [MathJax]/extensions/tex2jax.js
ProtoTracer  1.0
Real-time 3D rendering and animation engine
All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros Pages
Overflow.cpp
Go to the documentation of this file.
1#include "Overflow.h"
2
3Overflow::Overflow(uint8_t pixels) : pixels(pixels) {}
4
6 RGBColor* pixelColors = pixelGroup->GetColors();
7
8 for (unsigned int i = 0; i < pixelGroup->GetPixelCount(); i++) {
9 pixelColors[i].R = pixelColors[i].R != 0 ? pixelColors[i].R + 100 : 0;
10 pixelColors[i].G = pixelColors[i].G != 0 ? pixelColors[i].G + 100 : 0;
11 pixelColors[i].B = pixelColors[i].B != 0 ? pixelColors[i].B + 100 : 0;
12 }
13}
Defines the Overflow effect class for adding overflow distortion to pixel groups.
Interface for managing and interacting with a collection of pixels.
Definition IPixelGroup.h:25
virtual RGBColor * GetColors()=0
Retrieves the array of colors for the pixel group.
virtual uint16_t GetPixelCount()=0
Retrieves the total number of pixels in the group.
void ApplyEffect(IPixelGroup *pixelGroup) override
Applies the overflow distortion effect to the given pixel group.
Definition Overflow.cpp:5
Overflow(uint8_t pixels)
Constructs an Overflow effect with a specified number of affected pixels.
Definition Overflow.cpp:3
Represents an RGB color and provides methods for manipulation.
Definition RGBColor.h:23
uint8_t B
Blue component of the color (0-255).
Definition RGBColor.h:27
uint8_t G
Green component of the color (0-255).
Definition RGBColor.h:26
uint8_t R
Red component of the color (0-255).
Definition RGBColor.h:25