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.