FastLED 3.10.10
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 129 of file primitives.h.

130 {
131 if (x >= 0 && x < width && y >= 0 && y < height) {
132 if (Overwrite)
133 pixels[y * width + x] = color;
134 else
135 pixels[y * width + x] += color;
136 }
137}
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: