_pixelbuf¶
A fast RGB(W) pixel buffer library for like NeoPixel and DotStar.
The _pixelbuf module provides the PixelBuf class to accelerate
RGB(W) strip/matrix manipulation, such as DotStar and Neopixel.
Byteorders are configured with strings, such as “RGB” or “RGBD”.
-
_pixelbuf.colorwheel(n: int) → Any¶ C implementation of the common wheel() function found in many examples. Returns the colorwheel RGB value as an integer value for n (usable in
PixelBuf, neopixel, and dotstar).
-
_pixelbuf.wheel(n: Any) → Any¶ Use of wheel() is deprecated. Please use colorwheel().
-
class
_pixelbuf.PixelBuf(size: int, *, byteorder: str = 'BGR', brightness: float = 0, auto_write: bool = False, header: bytes = b'', trailer: bytes = b'')¶ A fast RGB[W] pixel buffer for LED and similar devices.
-
bpp:Any¶ The number of bytes per pixel in the buffer (read-only)
-
brightness:Any¶ Float value between 0 and 1. Output brightness.
When brightness is less than 1.0, a second buffer will be used to store the color values before they are adjusted for brightness.
-
auto_write:Any¶ Whether to automatically write the pixels after each update.
-
byteorder:Any¶ byteorder string for the buffer (read-only)
-
show(self)¶ Transmits the color data to the pixels so that they are shown. This is done automatically when
auto_writeis True.
-
-
_pixelbuf.fill(color: Any) → Any¶ Fills the given pixelbuf with the given color.