Skip to main content

rlvgl_playit/
framebuffer.rs

1//! Framebuffer pixel inspection trait.
2
3/// Read-only access to the display front buffer for pixel inspection.
4///
5/// Platform backends implement this to expose the current visible framebuffer
6/// content to the playit executor for dump commands.
7pub trait FramebufferReader {
8    /// Read a single pixel at the given *landscape* coordinates.
9    ///
10    /// Returns an ARGB8888 packed value.  The implementor is responsible for
11    /// any coordinate transforms (e.g. portrait ↔ landscape).
12    fn read_pixel(&self, x: i32, y: i32) -> u32;
13
14    /// Read a horizontal run of pixels starting at `(x, y)` into `out`.
15    ///
16    /// Returns the number of pixels actually written (may be less than
17    /// `width` if the region extends past the framebuffer edge).
18    fn read_row(&self, x: i32, y: i32, width: u16, out: &mut [u32]) -> usize;
19
20    /// Current display present count, used to gate frame-synchronised dumps.
21    fn present_count(&self) -> u32;
22}