linuxfb

Crates.iolinuxfb
lib.rslinuxfb
version0.3.1
sourcesrc
created_at2020-05-10 12:33:56.347229
updated_at2023-09-21 09:23:47.551278
descriptionInterface to the Linux Framebuffer API
homepage
repositoryhttps://gitlab.com/nilclass/rust-linuxfb
max_upload_size
id239618
size35,854
Niklas Cathor (nilclass)

documentation

README

Rust interface to the Linux Framebuffer API

Crate version

Crate license

Build

Provides a safe, rusty wrapper around the Linux Framebuffer API (linux/fb.h).

Online Documentation

Features & Scope

  • Discover & open framebuffer devices
  • Read useful information from the device, such as:
    • Size of the display, in pixels and millimeters
    • Pixel-level layout (color channels, bytes per pixel)
    • Virtual display size, to use for panning, double-buffering, etc.
  • Modify virtual size, panning offset and bytes-per-pixel (for some drivers this allows switching between 32-bit and 16-bit mode)
  • Set blanking mode (turns the screen on and off)
  • Map the device into memory (provides you with a &mut [u8] slice to write to)
  • Optional wrapper providing a double-buffered surface, that can be "flipped"

This package does NOT deal with:

  • Drawing of any kind (you get a buffer, it's up to you to fill it)
  • Color representation and conversion

Getting started

First of all, make sure you have access to your framebuffer device. You can usually do that by running as root (definitely not recommended), or by adding yourself to the video group.

There are two examples provided in the documentation:

  1. Accessing, configuring and using the framebuffer in the linuxfb::Framebuffer documentation
  2. Using the optional double-buffering implementation in the linuxfb::double::Buffer documentation

Contributing

  • The upstream source can be found here
  • Pull requests are generally accepted, if they fit the scope of the package
Commit count: 29

cargo fmt