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.
Members
brush_spaceDEFAULT_START_POINTDEFAULT_END_POINTsolidsolid_with_strokelinearlinear_with_pointsradialradial_with_centerfrom_brushkindanimatableanimatable_mutis_validset_transitioncomplete_transitionremove_transitionsetgetsampleclone_snapshotclear_cache
brush_space
brush_space: super::BrushSpace
DEFAULT_START_POINT
const DEFAULT_START_POINT: Point
DEFAULT_END_POINT
const DEFAULT_END_POINT: Point
solid
fn solid(color: Color) -> Self
solid_with_stroke
fn solid_with_stroke(color: Color, stroke_width: f64) -> Result<Self, PaintError>
linear
fn linear(gradient_stops: Vec<Color>) -> Self
linear_with_points
fn linear_with_points(gradient_stops: Vec<Color>, start: Point, end: Point, color_positions: Option<Vec<f64>>) -> Self
radial
fn radial(gradient_stops: Vec<Color>) -> Self
radial_with_center
fn radial_with_center(gradient_stops: Vec<Color>, center: Point, radius: f64, color_positions: Option<Vec<f64>>) -> Self
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.
kind
fn kind(self: &Self) -> PaintKind
animatable
fn animatable(self: &Self) -> &Animatable
animatable_mut
fn animatable_mut(self: &mut Self) -> &mut Animatable
is_valid
fn is_valid(self: &Self) -> bool
set_transition
fn set_transition(self: &mut Self, animation: Option<Animation>, properties: &[&str]) -> Result<(), PropertyError>
complete_transition
fn complete_transition(self: &mut Self, properties: &[&str]) -> Result<(), PropertyError>
remove_transition
fn remove_transition(self: &mut Self, properties: &[&str]) -> Result<(), PropertyError>
set
fn set<T: 'static>(self: &mut Self, property: &str, value: T, now_ms: f64) -> Result<(), PropertyError>
get
fn get<T: Clone + 'static>(self: &mut Self, property: &str, now_ms: f64) -> Result<T, PropertyError>
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.
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.
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.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyClassDefaultsErasedDestructorIntoEitherDebugDefault
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.