embedded-gui 0.2.1

no_std GUI and HUD primitives for embedded-graphics displays
Documentation
[package]
name = "embedded-gui"
version = "0.2.1"
edition = "2024"
rust-version = "1.87"
authors = ["Gerzain Mata <leftger@gmail.com>"]
license = "MIT OR Apache-2.0"
description = "no_std GUI and HUD primitives for embedded-graphics displays"
keywords = ["embedded-graphics", "gui", "hud", "embedded", "no_std"]
categories = ["embedded", "gui", "no-std"]
repository = "https://github.com/leftger/embedded-gui"
homepage = "https://github.com/leftger/embedded-gui"
documentation = "https://docs.rs/embedded-gui"
readme = "README.md"
exclude = [
    "docs/screenshots/*.gif",
    "docs/screenshots/*.png",
    "assets/",
]

[features]
default = ["std", "rich-widgets"]
std = ["embedded-dsp?/std"]
# The full widget-kind catalog (buttons, toggles, sliders, lists, tabs,
# dialogs, gauges, charts, keyboards, text areas, ...) beyond the small
# always-on set (Panel, Label, Button, Image, Border, Spacer, SweepingArc).
# Disabling this on a target that only builds a handful of widget kinds
# shrinks WidgetNode::render_at and friends considerably, since an unused
# match arm still gets compiled into that function even if its variant is
# never constructed at runtime -- only removing the variant does.
rich-widgets = []
image-decode = ["std"]
libm = ["dep:libm", "embedded-dsp?/libm"]
micromath = ["dep:micromath"]
# Optional interop adapters. These sit alongside the crate's own no_std
# layout.rs/text.rs/font.rs (which remain the default, dependency-light path)
# and add opt-in bridges to the wider embedded-graphics ecosystem.
embedded-text = ["dep:embedded-text", "dep:embedded-graphics"]
embedded-layout = ["dep:embedded-layout", "dep:embedded-graphics"]
embedded-graphics = ["dep:embedded-graphics"]
embedded-3dgfx = ["dep:embedded-3dgfx", "embedded-graphics", "dep:nalgebra"]
# Only pulls in the embedded-dsp modules visual_widgets.rs actually calls
# (biquad filtering + RMS/max statistics) instead of the whole crate
# (FFT, SVM, Bayes, quaternion, ...) — see embedded-dsp's per-module features.
embedded-dsp = ["dep:embedded-dsp", "embedded-dsp/filtering", "embedded-dsp/statistics"]
# Enable triple-buffered swapchain APIs.
triple-buffering = []
# Monotonic timing via embassy-time (no executor required).
embassy-time = ["dep:embassy-time"]
# Embassy-native DMA wake helpers and frame clock.
embassy = ["embassy-time", "dep:embassy-sync"]

[dependencies]
embedded-graphics-core = "0.4.1"
embedded-draw-target = { version = "0.1.1", path = "../embedded-draw-target" }
embedded-graphics-framebuf = "0.3"
critical-section = "1.1"
heapless = "0.9"
embassy-time = { version = "0.5", default-features = false, optional = true }
embassy-sync = { version = "0.8", default-features = false, optional = true }
libm = {version = "0.2", optional = true}
micromath = {version = "2.1", optional = true}
embedded-graphics = { version = "0.8", optional = true }
embedded-text = { version = "0.7.3", optional = true }
embedded-layout = { version = "0.4.2", optional = true }
embedded-dsp = { version = "0.2.0", optional = true, default-features = false }
embedded-3dgfx = { version = "0.5.3", path = "../embedded-3dgfx", optional = true }
nalgebra = { version = "0.35", default-features = false, features = ["libm"], optional = true }

[dev-dependencies]
critical-section = { version = "1.1", features = ["std"] }
criterion = { version = "0.5", features = ["html_reports"] }
embassy-time = { version = "0.5", features = ["std"] }
embassy-sync = { version = "0.8" }
embedded-3dgfx = { version = "0.5.3", path = "../embedded-3dgfx" }
embedded-graphics = "0.8"
embedded-graphics-framebuf = "0.3"
embedded-graphics-simulator = "0.8"
nalgebra = { version = "0.35", default-features = false, features = ["std"] }

[[bench]]
name = "gui_benchmarks"
harness = false

[[example]]
name = "interop_showcase"
path = "examples/integrations/interop_showcase.rs"
required-features = ["embedded-text", "embedded-layout"]

[[example]]
name = "completion_swapchain_sim"
path = "examples/integrations/completion_swapchain_sim.rs"
required-features = ["std"]

[[example]]
name = "embassy_gui_frame"
path = "examples/integrations/embassy_gui_frame.rs"
required-features = ["embassy", "std"]

[[example]]
name = "custom_font_showcase"
path = "examples/basics/custom_font_showcase.rs"
required-features = ["std"]

[[example]]
name = "embedded_3dgfx_overlay"
path = "examples/integrations/embedded_3dgfx_overlay.rs"
required-features = ["embedded-3dgfx", "std"]