FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    PaintMotion

    struct · ferroui-livecharts · v0.5.0

    struct PaintMotion
    

    A paint's timeline is independent of geometries referring to its brush. Read it once per host frame and reuse its snapshot for all those geometries.

    Source names (Color, GradientStops, ColorPos, StartPoint, EndPoint, Center, Radius, StrokeThickness, StrokeMiter) are registered directly. ColorPos is Option<Vec<f64>>; None retains source evenly spaced stops.

    View source

    Members

    brush_space

    brush_space: super::BrushSpace
    

    Source

    DEFAULT_START_POINT

    const DEFAULT_START_POINT: Point
    

    Source

    DEFAULT_END_POINT

    const DEFAULT_END_POINT: Point
    

    Source

    solid

    fn solid(color: Color) -> Self
    

    Source

    solid_with_stroke

    fn solid_with_stroke(color: Color, stroke_width: f64) -> Result<Self, PaintError>
    

    Source

    linear

    fn linear(gradient_stops: Vec<Color>) -> Self
    

    Source

    linear_with_points

    fn linear_with_points(gradient_stops: Vec<Color>, start: Point, end: Point, color_positions: Option<Vec<f64>>) -> Self
    

    Source

    radial

    fn radial(gradient_stops: Vec<Color>) -> Self
    

    Source

    radial_with_center

    fn radial_with_center(gradient_stops: Vec<Color>, center: Point, radius: f64, color_positions: Option<Vec<f64>>) -> Self
    

    Source

    from_brush

    fn from_brush(brush: Rc<dyn IBrush>) -> Self
    

    Freezes the supplied native brush, preserving its coordinate units, transforms, opacity, spread and independent radial focal point/radii. Custom brush kinds remain a motionless Brush state property.

    Source

    kind

    fn kind(self: &Self) -> PaintKind
    

    Source

    animatable

    fn animatable(self: &Self) -> &Animatable
    

    Source

    animatable_mut

    fn animatable_mut(self: &mut Self) -> &mut Animatable
    

    Source

    is_valid

    fn is_valid(self: &Self) -> bool
    

    Source

    set_transition

    fn set_transition(self: &mut Self, animation: Option<Animation>, properties: &[&str]) -> Result<(), PropertyError>
    

    Source

    complete_transition

    fn complete_transition(self: &mut Self, properties: &[&str]) -> Result<(), PropertyError>
    

    Source

    remove_transition

    fn remove_transition(self: &mut Self, properties: &[&str]) -> Result<(), PropertyError>
    

    Source

    set

    fn set<T: 'static>(self: &mut Self, property: &str, value: T, now_ms: f64) -> Result<(), PropertyError>
    

    Source

    get

    fn get<T: Clone + 'static>(self: &mut Self, property: &str, now_ms: f64) -> Result<T, PropertyError>
    

    Source

    sample

    fn sample(self: &mut Self, now_ms: f64) -> Result<PaintSnapshot, PaintError>
    

    Samples each registered property once and reuses an unchanged immutable brush. Invalid paint parameters are reported before a renderer sees them.

    Source

    clone_snapshot

    fn clone_snapshot(self: &mut Self, now_ms: f64) -> Result<Self, PaintError>
    

    Creates an independent paint seeded from the current values. Registered motion defaults/from/to all start at those values; animations, state trackers and callbacks are intentionally instance-local.

    Source

    clear_cache

    fn clear_cache(self: &mut Self)
    

    Releases cached native brush handles; reference-counted render snapshots remain valid for frames already retained by the host.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ClassDefaults
    • ErasedDestructor
    • IntoEither
    • Debug
    • Default

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.