![]() |
ProtoTracer
1.0
Real-time 3D rendering and animation engine
|
Represents a pixel in a 2D grid with positional, color, and neighbor information. More...
#include <Pixel.h>
Public Member Functions | |
Pixel () | |
Default constructor. | |
Pixel (const Vector2D *position) | |
Constructs a Pixel object with a specified position. | |
const Vector2D | GetPosition () |
Retrieves the pixel's position. | |
void | SetUpPixel (Pixel *pixel) |
Sets the pixel above this pixel. | |
void | SetDownPixel (Pixel *pixel) |
Sets the pixel below this pixel. | |
void | SetLeftPixel (Pixel *pixel) |
Sets the pixel to the left of this pixel. | |
void | SetRightPixel (Pixel *pixel) |
Sets the pixel to the right of this pixel. | |
bool | HasUpPixel () |
Checks if a pixel exists above this pixel. | |
bool | HasDownPixel () |
Checks if a pixel exists below this pixel. | |
bool | HasLeftPixel () |
Checks if a pixel exists to the left of this pixel. | |
bool | HasRightPixel () |
Checks if a pixel exists to the right of this pixel. | |
Pixel * | GetUpPixel () |
Retrieves the pixel above this pixel. | |
Pixel * | GetDownPixel () |
Retrieves the pixel below this pixel. | |
Pixel * | GetLeftPixel () |
Retrieves the pixel to the left of this pixel. | |
Pixel * | GetRightPixel () |
Retrieves the pixel to the right of this pixel. | |
Public Attributes | |
RGBColor * | Color |
Pointer to the RGB color of the pixel. | |
Private Attributes | |
const Vector2D * | position |
Pointer to the pixel's position in 2D space. | |
bool | sorted = false |
Indicates whether the pixel has been processed in sorting algorithms. | |
bool | upExists = false |
Indicates if a pixel exists above this pixel. | |
bool | downExists = false |
Indicates if a pixel exists below this pixel. | |
bool | leftExists = false |
Indicates if a pixel exists to the left of this pixel. | |
bool | rightExists = false |
Indicates if a pixel exists to the right of this pixel. | |
Pixel * | up = nullptr |
Pointer to the pixel above this pixel. | |
Pixel * | down = nullptr |
Pointer to the pixel below this pixel. | |
Pixel * | left = nullptr |
Pointer to the pixel to the left of this pixel. | |
Pixel * | right = nullptr |
Pointer to the pixel to the right of this pixel. | |
Represents a pixel in a 2D grid with positional, color, and neighbor information.
The Pixel class stores data for a single pixel, including its position, color, and connections to neighboring pixels (up, down, left, right). It provides methods for managing these relationships and accessing pixel properties.
Pixel | ( | ) |
Pixel * GetDownPixel | ( | ) |
Pixel * GetLeftPixel | ( | ) |
Pixel * GetRightPixel | ( | ) |
Pixel * GetUpPixel | ( | ) |
bool HasDownPixel | ( | ) |
Checks if a pixel exists below this pixel.
Definition at line 39 of file Pixel.cpp.
References downExists.
bool HasLeftPixel | ( | ) |
Checks if a pixel exists to the left of this pixel.
Definition at line 43 of file Pixel.cpp.
References leftExists.
bool HasRightPixel | ( | ) |
Checks if a pixel exists to the right of this pixel.
Definition at line 47 of file Pixel.cpp.
References rightExists.
bool HasUpPixel | ( | ) |
Sets the pixel below this pixel.
pixel | Pointer to the pixel below this pixel. |
Definition at line 20 of file Pixel.cpp.
References down, and downExists.
Sets the pixel to the left of this pixel.
pixel | Pointer to the pixel to the left of this pixel. |
Definition at line 25 of file Pixel.cpp.
References left, and leftExists.
Sets the pixel to the right of this pixel.
pixel | Pointer to the pixel to the right of this pixel. |
Definition at line 30 of file Pixel.cpp.
References right, and rightExists.
Pointer to the pixel below this pixel.
Definition at line 35 of file Pixel.h.
Referenced by GetDownPixel(), and SetDownPixel().
Indicates if a pixel exists below this pixel.
Definition at line 30 of file Pixel.h.
Referenced by HasDownPixel(), and SetDownPixel().
Pointer to the pixel to the left of this pixel.
Definition at line 36 of file Pixel.h.
Referenced by GetLeftPixel(), and SetLeftPixel().
Indicates if a pixel exists to the left of this pixel.
Definition at line 31 of file Pixel.h.
Referenced by HasLeftPixel(), and SetLeftPixel().
Pointer to the pixel's position in 2D space.
Definition at line 27 of file Pixel.h.
Referenced by GetPosition(), and Pixel().
Pointer to the pixel to the right of this pixel.
Definition at line 37 of file Pixel.h.
Referenced by GetRightPixel(), and SetRightPixel().
Indicates if a pixel exists to the right of this pixel.
Definition at line 32 of file Pixel.h.
Referenced by HasRightPixel(), and SetRightPixel().
Pointer to the pixel above this pixel.
Definition at line 34 of file Pixel.h.
Referenced by GetUpPixel(), and SetUpPixel().
Indicates if a pixel exists above this pixel.
Definition at line 29 of file Pixel.h.
Referenced by HasUpPixel(), and SetUpPixel().