Skip to main content

Module screenshot

Module screenshot 

Source
Expand description

Headless offscreen screenshot capture for modde’s hottest GUI screens.

This module renders fully populated demo screens to RGBA pixels and PNG files without a GPU or display server, using iced 0.14’s dual-backend iced_test::renderer::Renderer, which falls back to the pure-CPU tiny-skia backend when no GPU is present. It powers the hidden modde dev screenshot CLI command used to generate Flathub / website assets and (in the future) CI automation.

The whole module is gated behind the non-default screenshot cargo feature so release binaries carry zero extra weight.

Screens are driven by constructing a demo Modde and setting its state fields directly — never by dispatching update() messages, which would fire async Tasks that need a database or network.

For determinism, run with ICED_BACKEND=tiny-skia in the environment so the software backend is always selected.

Structs§

ShotOptions
Rendering options for a screenshot capture.

Enums§

Screen
A capturable GUI screen.

Functions§

all_screens
Every screen, in priority/asset order. Used by the CLI --all flag.
capture
Render screen offscreen and return the RGBA pixel buffer as an image.
capture_to_png
Render screen and write it to out as a PNG.