_pixelmap
– A fast pixel mapping library
The _pixelmap
module provides the PixelMap
class to accelerate
RGB(W) strip/matrix manipulation, such as DotStar and Neopixel.
Available on these boards
- _pixelmap.PixelReturnType
- _pixelmap.PixelReturnSequence
- _pixelmap.PixelType
- _pixelmap.PixelSequence
- class _pixelmap.PixelMap(pixelbuf: adafruit_pixelbuf.PixelBuf, indices: Tuple[int | Tuple[int]])
Construct a PixelMap object that uses the given indices of the underlying pixelbuf
- fill(color: adafruit_pixelbuf.PixelType) None
Fill all the pixels in the map with the given color
- __getitem__(index: slice) PixelReturnSequence
- __getitem__(index: int) adafruit_pixelbuf.PixelReturnType
Retrieve the value of one of the underlying pixels at ‘index’.
- __setitem__(index: slice, value: adafruit_pixelbuf.PixelSequence) None
- __setitem__(index: int, value: adafruit_pixelbuf.PixelType) None
Sets the pixel value at the given index. Value can either be a tuple or integer. Tuples are The individual (Red, Green, Blue[, White]) values between 0 and 255. If given an integer, the red, green and blue values are packed into the lower three bytes (0xRRGGBB). For RGBW byteorders, if given only RGB values either as an int or as a tuple, the white value is used instead when the red, green, and blue values are the same.
- show() None
Transmits the color data to the pixels so that they are shown. This is done automatically when
auto_write
is True.