Expand description
Device-class projection profiles.
VIEW_4 promotes the web from “the view surface” to one surface among many.
The capability presets (watch/glasses/phone/desktop, plus
cli/tui/webui) live in crate::surface; the projection that fits a
Scene to a surface lives in crate::codec::reduce_for_caps. This module
ties them together and proves, via fixtures, that one semantic Scene projects
DIFFERENTLY and DETERMINISTICALLY for each device class – a glance watch sees
a one-line summary where a dense desktop sees the whole tree, from the same
input.
§Example
use sim_lib_view::profiles::project_for_preset;
let scene = sim_lib_scene::build::stack(
"column",
vec![
sim_lib_scene::build::text_node("a"),
sim_lib_scene::build::text_node("b"),
sim_lib_scene::build::text_node("c"),
],
);
// The same Scene reduces hard for a glance watch, not at all for a desktop.
let watch = project_for_preset(&scene, "watch").unwrap();
let desktop = project_for_preset(&scene, "desktop").unwrap();
assert!(sim_lib_scene::validate_scene(&watch).is_ok());
assert_ne!(watch, desktop);Constants§
- DEVICE_
PRESETS - The device-class presets this profile set covers, beyond
cli/tui/webui.
Functions§
- project_
for_ preset - Projects
scenetoward the named surface preset’s capabilities.