pub struct LottieAnimation(/* private fields */);Expand description
A Lottie animation. Cloning is cheap, and it can be drawn at any moment.
use ravenrs_lottie::Animation;
let json = br#"{"v":"5.5.7","fr":30,"ip":0,"op":30,"w":100,"h":100,"layers":[]}"#;
let animation = Animation::from_json(json).expect("a Lottie");
assert_eq!(animation.duration(), 1.0);
assert!(animation.paths_at(0.5, 1.0).is_empty());Implementations§
Source§impl Animation
impl Animation
Sourcepub fn from_json(bytes: &[u8]) -> Result<Animation, LottieError>
pub fn from_json(bytes: &[u8]) -> Result<Animation, LottieError>
Reads the JSON of a Lottie file.
Sourcepub fn frame_rate(&self) -> f32
pub fn frame_rate(&self) -> f32
Its frames per second, which only says how it was authored: it can be drawn at any moment in between.
Sourcepub fn unsupported(&self) -> Vec<String>
pub fn unsupported(&self) -> Vec<String>
What the file asks for that is not drawn as asked, in words a person reads. Empty when nothing is missing.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Animation
impl RefUnwindSafe for Animation
impl Send for Animation
impl Sync for Animation
impl Unpin for Animation
impl UnsafeUnpin for Animation
impl UnwindSafe for Animation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more