FastLED 3.10.8
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 124 of file primitives.h.

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

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

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

+ Here is the caller graph for this function: