Libraty providing a buffer interface to your Raspberry Pi's GPU layer. Usable with pygame, PIL and other graphics libraries.
Project description
DispmanX Bindings for Python
Documentation | Python Package Index
Usage
Install with pip,
pip install dispmanx
Then try out this sample program using pygame,
from random import randint
import pygame
from dispmanx import DispmanX
def random_color_with_alpha():
return tuple(randint(0, 0xFF) for _ in range(3)) + (randint(0x44, 0xFF),)
display = DispmanX(pixel_format="RGBA")
surface = pygame.image.frombuffer(display.buffer, display.size, display.pixel_format)
clock = pygame.time.Clock()
for _ in range(20):
surface.fill(random_color_with_alpha())
display.update()
clock.tick(2)
Next stop: the project's documentation.
License
This project is licensed under the MIT License — see the LICENSE file for details.
Final Note
...and remember kids, have fun!
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dispmanx-0.1.0.tar.gz.
File metadata
- Download URL: dispmanx-0.1.0.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.14 CPython/3.9.13 Linux/5.15.0-1014-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c606e326e303ba718eac93c7c9f7669c516147fa94f3ee989f02a48542392a3
|
|
| MD5 |
5be85d750df095292a1aa5ab33d9aabb
|
|
| BLAKE2b-256 |
c831d4c30a00226ccb8098af28896601f7d29cd320655bff6239bcd69f181da2
|
File details
Details for the file dispmanx-0.1.0-py3-none-any.whl.
File metadata
- Download URL: dispmanx-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.14 CPython/3.9.13 Linux/5.15.0-1014-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5394c3584ed9c46e64bd4430e4e4909646acbfc1bae5d45c7abc3372af270e7b
|
|
| MD5 |
28a4e7f61028803e4fa4b42ce5539814
|
|
| BLAKE2b-256 |
ef127b4d860e927f40e91d0c5224a90c6a4b68baad9848a26fffe3eda6d3e781
|