Expand description
Safe Rust bindings to rlottie.
Example
ⓘ
use rlottie::{Animation, Surface};
let mut animation = Animation::from_file(path_to_lottie_json)?;
let size = animation.size();
let mut surface = Surface::new(size);
for frame in 0 .. animation.totalframe() {
animation.render(frame, &mut surface);
for (x, y, color) in surface.pixels() {
println!("frame {frame} at ({x}, {y}): {color:?}");
}
}
Structs
A lottie animation.
A surface has a fixed size and contains pixel data for it. You can render frames onto the surface.