oxstack_gfx/lib.rs
1//! Graphics primitives for oxstack devices.
2//!
3//! The core type is [`Framebuffer`]: a full-screen RGB565 buffer that
4//! stores every pixel *already in the panel's wire format* (big-endian), and
5//! remembers which rows changed since the last flush. Flushing is then a
6//! single contiguous slice of the buffer, with no conversion pass and no
7//! copy, which DMA can stream directly to the display.
8//!
9//! It implements `embedded-graphics`' `DrawTarget`, so every font, shape
10//! and image crate in that ecosystem works unchanged. Renderers that write
11//! pixels one at a time, such as `oxstack-3d`, use
12//! [`Framebuffer::wire_rows_mut`] instead.
13//!
14//! [`TextBuf`] is the small formatting buffer every status line needs:
15//! `write!` into it, draw [`as_str`](TextBuf::as_str), nothing allocates.
16#![no_std]
17#![warn(missing_docs)]
18
19#[cfg(doctest)]
20#[doc = include_str!("../README.md")]
21struct ReadmeDoctests;
22
23mod framebuffer;
24mod text;
25
26pub use embedded_graphics_core::pixelcolor::Rgb565;
27pub use framebuffer::{DirtyRows, Framebuffer, wire_color};
28pub use text::TextBuf;