![]() |
ProtoTracer
1.0
Real-time 3D rendering and animation engine
|
Manages a collection of pixels with positions, colors, and spatial relationships. More...
#include <PixelGroup.h>
Public Member Functions | |
PixelGroup (Vector2D size, Vector2D position, uint16_t rowCount) | |
Constructs a rectangular PixelGroup. | |
PixelGroup (const Vector2D *pixelLocations, Direction direction=ZEROTOMAX) | |
Constructs a PixelGroup from arbitrary pixel locations. | |
~PixelGroup () | |
Destroys the PixelGroup object. | |
Vector2D | GetCenterCoordinate () override |
Retrieves the center coordinate of the pixel group. | |
Vector2D | GetSize () override |
Retrieves the size of the pixel group. | |
Vector2D | GetCoordinate (uint16_t count) override |
Retrieves the coordinate of a specific pixel. | |
int | GetPixelIndex (Vector2D location) override |
Retrieves the index of a pixel at a specific location. | |
RGBColor * | GetColor (uint16_t count) override |
Retrieves the color of a specific pixel. | |
RGBColor * | GetColors () override |
Retrieves the array of colors for the pixel group. | |
RGBColor * | GetColorBuffer () override |
Retrieves the color buffer for the pixel group. | |
uint16_t | GetPixelCount () override |
Retrieves the total number of pixels in the group. | |
bool | Overlaps (BoundingBox2D *box) override |
Checks if the pixel group overlaps with a bounding box. | |
bool | ContainsVector2D (Vector2D v) override |
Checks if the pixel group contains a specific vector. | |
bool | GetUpIndex (uint16_t count, uint16_t *upIndex) override |
Retrieves the index of the pixel above a given pixel. | |
bool | GetDownIndex (uint16_t count, uint16_t *downIndex) override |
Retrieves the index of the pixel below a given pixel. | |
bool | GetLeftIndex (uint16_t count, uint16_t *leftIndex) override |
Retrieves the index of the pixel to the left of a given pixel. | |
bool | GetRightIndex (uint16_t count, uint16_t *rightIndex) override |
Retrieves the index of the pixel to the right of a given pixel. | |
bool | GetAlternateXIndex (uint16_t count, uint16_t *index) override |
Retrieves an alternate X-axis index for a given pixel. | |
bool | GetAlternateYIndex (uint16_t count, uint16_t *index) override |
Retrieves an alternate Y-axis index for a given pixel. | |
bool | GetOffsetXIndex (uint16_t count, uint16_t *index, int x1) override |
Retrieves an offset X-axis index for a given pixel. | |
bool | GetOffsetYIndex (uint16_t count, uint16_t *index, int y1) override |
Retrieves an offset Y-axis index for a given pixel. | |
bool | GetOffsetXYIndex (uint16_t count, uint16_t *index, int x1, int y1) override |
Retrieves an offset XY-axis index for a given pixel. | |
bool | GetRadialIndex (uint16_t count, uint16_t *index, int pixels, float angle) override |
Retrieves a radial index for a given pixel based on distance and angle. | |
void | GridSort () override |
Sorts the pixels in a grid structure. | |
Private Attributes | |
const Vector2D * | pixelPositions |
Array of pixel positions. | |
Direction | direction |
Direction of pixel traversal. | |
BoundingBox2D | bounds |
Bounding box for the pixel group. | |
RGBColor | pixelColors [pixelCount] |
Array of pixel colors. | |
RGBColor | pixelBuffer [pixelCount] |
Array of color buffers for temporary use. | |
uint16_t | up [pixelCount] |
Indices of pixels above each pixel. | |
uint16_t | down [pixelCount] |
Indices of pixels below each pixel. | |
uint16_t | left [pixelCount] |
Indices of pixels to the left of each pixel. | |
uint16_t | right [pixelCount] |
Indices of pixels to the right of each pixel. | |
bool | isRectangular = false |
Indicates if the group forms a rectangular grid. | |
uint16_t | rowCount |
Number of rows in the grid. | |
uint16_t | colCount |
Number of columns in the grid. | |
Vector2D | size |
Size of the grid. | |
Vector2D | position |
Position of the grid. | |
Vector2D | tempLocation |
Temporary location for calculations. | |
Additional Inherited Members | |
![]() | |
enum | Direction { ZEROTOMAX , MAXTOZERO } |
Specifies traversal directions for pixels. More... | |
Manages a collection of pixels with positions, colors, and spatial relationships.
The PixelGroup class provides methods for retrieving and manipulating pixel data, including spatial relationships and color properties. Supports both rectangular and arbitrary pixel arrangements.
pixelCount | The total number of pixels in the group. |
Definition at line 27 of file PixelGroup.h.
PixelGroup | ( | Vector2D | size, |
Vector2D | position, | ||
uint16_t | rowCount | ||
) |
Constructs a rectangular PixelGroup.
size | Size of the rectangular grid. |
position | Position of the rectangular grid. |
rowCount | Number of rows in the grid. |
PixelGroup | ( | const Vector2D * | pixelLocations, |
Direction | direction = ZEROTOMAX |
||
) |
Constructs a PixelGroup from arbitrary pixel locations.
pixelLocations | Array of pixel locations. |
direction | Direction of pixel traversal (default: ZEROTOMAX). |
~PixelGroup | ( | ) |
Destroys the PixelGroup object.
Checks if the pixel group contains a specific vector.
v | The vector to check. |
Implements IPixelGroup.
|
overridevirtual |
Retrieves an alternate X-axis index for a given pixel.
count | The index of the current pixel. |
index | Pointer to store the alternate X index. |
Implements IPixelGroup.
|
overridevirtual |
Retrieves an alternate Y-axis index for a given pixel.
count | The index of the current pixel. |
index | Pointer to store the alternate Y index. |
Implements IPixelGroup.
Retrieves the center coordinate of the pixel group.
Implements IPixelGroup.
Retrieves the color of a specific pixel.
count | The index of the pixel. |
Implements IPixelGroup.
Referenced by BetaProtoController::Display(), ESP32DevKitV1::Display(), GammaControllerBack::Display(), GammaControllerFront::Display(), KaiborgV1Controller::Display(), KaiborgV1D1Controller::Display(), and ProtoDRController::Display().
Retrieves the color buffer for the pixel group.
Implements IPixelGroup.
Retrieves the array of colors for the pixel group.
Implements IPixelGroup.
Retrieves the coordinate of a specific pixel.
count | The index of the pixel. |
Implements IPixelGroup.
|
overridevirtual |
Retrieves the index of the pixel below a given pixel.
count | The index of the current pixel. |
downIndex | Pointer to store the index of the pixel below. |
Implements IPixelGroup.
|
overridevirtual |
Retrieves the index of the pixel to the left of a given pixel.
count | The index of the current pixel. |
leftIndex | Pointer to store the index of the pixel to the left. |
Implements IPixelGroup.
|
overridevirtual |
Retrieves an offset X-axis index for a given pixel.
count | The index of the current pixel. |
index | Pointer to store the offset X index. |
x1 | The X-axis offset value. |
Implements IPixelGroup.
|
overridevirtual |
Retrieves an offset XY-axis index for a given pixel.
count | The index of the current pixel. |
index | Pointer to store the offset XY index. |
x1 | The X-axis offset value. |
y1 | The Y-axis offset value. |
Implements IPixelGroup.
|
overridevirtual |
Retrieves an offset Y-axis index for a given pixel.
count | The index of the current pixel. |
index | Pointer to store the offset Y index. |
y1 | The Y-axis offset value. |
Implements IPixelGroup.
Retrieves the total number of pixels in the group.
Implements IPixelGroup.
Retrieves the index of a pixel at a specific location.
location | The location to search for a pixel. |
Implements IPixelGroup.
|
overridevirtual |
Retrieves a radial index for a given pixel based on distance and angle.
count | The index of the current pixel. |
index | Pointer to store the radial index. |
pixels | The radial distance in pixels. |
angle | The angle in degrees. |
Implements IPixelGroup.
|
overridevirtual |
Retrieves the index of the pixel to the right of a given pixel.
count | The index of the current pixel. |
rightIndex | Pointer to store the index of the pixel to the right. |
Implements IPixelGroup.
Retrieves the index of the pixel above a given pixel.
count | The index of the current pixel. |
upIndex | Pointer to store the index of the pixel above. |
Implements IPixelGroup.
Sorts the pixels in a grid structure.
Implements IPixelGroup.
|
overridevirtual |
Checks if the pixel group overlaps with a bounding box.
box | Pointer to the bounding box. |
Implements IPixelGroup.
|
private |
Bounding box for the pixel group.
Definition at line 31 of file PixelGroup.h.
Number of columns in the grid.
Definition at line 41 of file PixelGroup.h.
Direction of pixel traversal.
Definition at line 30 of file PixelGroup.h.
|
private |
Indices of pixels below each pixel.
Definition at line 35 of file PixelGroup.h.
Indicates if the group forms a rectangular grid.
Definition at line 39 of file PixelGroup.h.
|
private |
Indices of pixels to the left of each pixel.
Definition at line 36 of file PixelGroup.h.
|
private |
Array of color buffers for temporary use.
Definition at line 33 of file PixelGroup.h.
|
private |
Array of pixel colors.
Definition at line 32 of file PixelGroup.h.
Array of pixel positions.
Definition at line 29 of file PixelGroup.h.
Position of the grid.
Definition at line 43 of file PixelGroup.h.
|
private |
Indices of pixels to the right of each pixel.
Definition at line 37 of file PixelGroup.h.
Number of rows in the grid.
Definition at line 40 of file PixelGroup.h.
Size of the grid.
Definition at line 42 of file PixelGroup.h.
Temporary location for calculations.
Definition at line 44 of file PixelGroup.h.
|
private |
Indices of pixels above each pixel.
Definition at line 34 of file PixelGroup.h.