Expand description
Shape system for WaterUI with HDR support.
This module provides a trait-based system for defining shapes that can be used for clipping views and as filled views.
Filled shapes are emitted as native ResolvedShape raw views so each backend
renders paths with its own 2D engine. Morphing shapes stay GPU-backed.
§Example
ⓘ
use waterui::prelude::*;
use waterui::shape::*;
// Clip to a circle
image("avatar.jpg").clip(Circle);
// Fill a shape with HDR color
Circle.fill(Color::red().with_headroom(0.5))Structs§
- Capsule
- A capsule (pill) shape.
- Circle
- A circle inscribed in the view bounds.
- Clip
Shape - Metadata for clipping a view to a shape.
- Ellipse
- An ellipse that fills the view bounds.
- Filled
Shape - A shape filled with a color, resolved to
ResolvedShape. - Fixed
Rounded Rectangle - A rectangle with a uniform corner radius in logical points.
- Fixed
Uneven Rounded Rectangle - A rectangle with independent corner radii in logical points.
- Morph
Animation - Configuration for shape morph animations.
- Morph
Shape - A morphing filled shape view.
- Path
- A custom path defined by explicit commands.
- Rectangle
- A simple rectangle with sharp corners.
- Resolved
Morph Shape - Resolved morphing shape payload rendered directly by capable backends.
- Resolved
Shape - Resolved shape payload rendered directly by native backends.
- Rounded
Rectangle - A rectangle with uniform corner radius.
- Uneven
Rounded Rectangle - A rectangle with independent corner radii.
Enums§
- Path
Command - A single path command for drawing shapes.
- Shape
Kind - The kind of shape for backend rendering optimization.