FastLED 3.9.15
Loading...
Searching...
No Matches

◆ addPixelToBuffer()

template<typename PixelT, bool Overwrite>
void fl::gfx::addPixelToBuffer ( PixelT * pixels,
int width,
int height,
int x,
int y,
const PixelT & color )
inline

Internal helper: add or set pixel to rectangular buffer with bounds checking Direct row-major indexing: pixels[y * width + x] Templated on Overwrite for compile-time dispatch (no per-pixel branch).

Definition at line 122 of file primitives.h.

123 {
124 if (x >= 0 && x < width && y >= 0 && y < height) {
125 if (Overwrite)
126 pixels[y * width + x] = color;
127 else
128 pixels[y * width + x] += color;
129 }
130}
u8 u8 height
Definition blur.h:186
u8 width
Definition blur.h:186

References fl::height, fl::width, fl::x, and fl::y.

Referenced by fl::gfx::detail::drawLineCore().

+ Here is the caller graph for this function: