Allows Numpy to be used to read and write pixel data to the framebuffer. This is faster than setting self._data directly and allows all features of Numpy to be used while not adding a dependency on Numpy.
Example:
import flaschen
import numpy as np
ft = flaschen.Flaschen(UDP_IP, UDP_PORT, 45, 35)
pixels = np.asarray(ft)
pixels[1, :] = (255, 0, 0) # Set 2nd row to red.
pixels[:, 1] = (0, 255, 0) # Set 2nd column to green.
pixels[(pixels == (0, 0, 0)).all(axis=-1)] = (1, 1, 1) # Change all (0, 0, 0) pixels to (1, 1, 1).
ft.send()
Allows Numpy to be used to read and write pixel data to the framebuffer. This is faster than setting
self._data
directly and allows all features of Numpy to be used while not adding a dependency on Numpy.Example: