This Rust library is an implementation of the framebuffer approach for the embedded-graphics ecosystem. The goal is to perform bulk-write of all the screen pixels at once, instead of having multiple individual updates for separate primitives.
Graphic compositing in multiple operations with direct updates on a display can lead to flickering and clearing previous content on the screen is harder. A Framebuffer helps to deal with this by drawing on an in-memory display, so the final display image can be pushed all at once to your hardware display.
This technique is useful when you're updating large portions of screen or just simply don't want to deal with partial display updates but comes at the cost of higher RAM usage and more traffic to the displays. This crate also has DMA support, which can enhance the performance of larger display updates.
Make sure you have your rust
environment configurated
Add library to your Cargo.toml
toml
[dependencies]
embedded-graphics-framebuf = "0.3.0"
Use the library in you code ```rust use embeddedgraphicsframebuf::FrameBuf;
// ...
// Backend for the buffer let mut data = [BinaryColor::Off; 12 * 11]; let mut fbuf = FrameBuf::new(&mut data, 12, 11);
// You would use a "real" display here...
let mut display: MockDisplay
See the open issues for a full list of proposed features (and known issues).
Distributed under the MIT License. See LICENSE
for more information.
Bernard Kobos - @bkobos - bkobos@gmail.com
Jounathaen - jounathaen at mail dot de
Project Link: https://github.com/bernii/embedded-graphics-framebuf