Expand description
strata_primitives: Zero-dependency mathematical, geometric, color, memory, and atom primitives for Project Strata.
§Examples
use strata_primitives::geom::Rect;
use strata_primitives::color::Rgba;
let rect = Rect::from_xywh(0.0, 0.0, 100.0, 50.0);
assert_eq!(rect.width(), 100.0);
let white = Rgba::WHITE;
assert_eq!(white.a, 255);Re-exports§
pub use arena::BumpArena;pub use arena::FrameArenaManager;pub use arena::ThreadLocalArena;pub use arena::DEFAULT_ARENA_CAPACITY;pub use atom::intern;pub use atom::resolve;pub use atom::AtomId;pub use atom::AtomTable;pub use color::Hsla;pub use color::Oklch;pub use color::Rgba;pub use entity::EntityId;pub use geom::EdgeInsets;pub use geom::FixedRect;pub use geom::LayoutUnit;pub use geom::Matrix4x4;pub use geom::Point;pub use geom::Rect;pub use geom::Size;pub use geom::Transform2D;pub use quantization::largest_remainder_quantization;pub use target::is_tui_target;pub use target::set_tui_target_active;
Modules§
- arena
- Fast contiguous bump memory arenas with bulk O(1) resets and SIMD sentry padding.
- atom
- Zero-dependency string interning atom table with pre-baked HTML/CSS static atoms.
- color
- Zero-dependency color science engine: sRGB, HSLA, Oklch, hex parsing, blending, and WCAG contrast.
- entity
- Entity identification primitive for cross-subsystem DOM and layout synchronization.
- geom
- Zero-dependency 2D geometry, subpixel snapping, and affine transformations.
- prelude
- quantization
- Largest Remainder Quantization (Hare-Niemeyer Algorithm) for Discrete Grids and Terminals.
- target
- Runtime Target State (e.g. GUI vs TUI).