Giter Club home page Giter Club logo

libpyfb's Introduction

libpyfb

Python library for controling raw framebuffer. Written in pure Python.

What is this?

libpyfb is a low-level framebuffer control library written in Python. This work on all Linux devices, include x86, x86_64 and ARM.

Why made this?

Currently, there is no low-level Python module for direct writing to framebuffer. Pygame still require SDL and other C libraries. Their is also a gist in C about this and also a Go script here
So I made this small library for doing that. Have fun!

How this work?

Linux Framebuffer can be easily accessed in /dev/fb0. Like any other file, this can be read and write to (if the user in video group). So this library will open fb0, map it to memory and control the screen from that. Each pixel is 4 bytes (32 bit) or 2 bytes (16 bit). These bytes are B, G, R and one transparency bytes.

Todo

  • Add graphical drawing
  • Add mouse and keyboard support

License

Under MIT license.

And one last thing... Enjoy your 2021!

libpyfb's People

Contributors

raspiduino avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

libpyfb's Issues

This is an untested program, for sure.

Many lines have to be fixed.
Line 47 must be 5:9 to accept 1080
Lines 46 and 47: slicing must be replaced by split( ', ')
Lines 44 and 51: fb0 is constant the filename while the class constructor accept a devname different from fb0
Line 111: the result of %300 may exceed the capacity of a byte (0= N <=255)
Samething for %400 and %500

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.