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.

The size type used by lottie Animation.

A surface has a fixed size and contains pixel data for it. You can render frames onto the surface.