pub struct SnapshotFrame {
pub width: u32,
pub height: u32,
pub pixels: Vec<u8>,
pub geometry: Vec<SnapshotIconGeometry>,
}Expand description
Off-screen render output from
DesktopBackend::render_overlay_snapshot.
Pixel buffer is tightly-packed premultiplied BGRA — stride = width * 4 (no row padding). Callers can hand it directly to any
image library that accepts BGRA with a known stride (e.g. PIL’s
Image.frombuffer("RGBA", (w, h), buf, "raw", "BGRA", 0, 1)).
geometry is the authoritative per-icon paint answer, populated
from D2D’s per-icon DrawBitmap rect and DirectWrite’s
IDWriteTextLayout::GetMetrics. Callers doing pixel-level
diagnostics should prefer these rects to any CV-based
segmentation of pixels.
Backends that can’t compute geometry (e.g. the platform stub)
return an empty geometry vector.
Fields§
§width: u32§height: u32§pixels: Vec<u8>Row-major premultiplied BGRA pixel data.
geometry: Vec<SnapshotIconGeometry>One entry per icon that was actually drawn into the frame,
in the same order as the caller’s positions slice. Skips
icons whose id was not present in the backend’s cache.
Trait Implementations§
Source§impl Clone for SnapshotFrame
impl Clone for SnapshotFrame
Source§fn clone(&self) -> SnapshotFrame
fn clone(&self) -> SnapshotFrame
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SnapshotFrame
impl Debug for SnapshotFrame
impl Eq for SnapshotFrame
Source§impl PartialEq for SnapshotFrame
impl PartialEq for SnapshotFrame
Source§fn eq(&self, other: &SnapshotFrame) -> bool
fn eq(&self, other: &SnapshotFrame) -> bool
self and other values to be equal, and is used by ==.