Skip to content

Commit

Permalink
Initial rudimentary Lottie parsing code
Browse files Browse the repository at this point in the history
  • Loading branch information
pcwalton committed May 24, 2019
1 parent cd23d62 commit 8c4f05c
Show file tree
Hide file tree
Showing 6 changed files with 378 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Expand Up @@ -8,9 +8,11 @@ members = [
"examples/canvas_minimal",
"examples/canvas_moire",
"examples/canvas_text",
"examples/lottie_basic",
"geometry",
"gl",
"gpu",
"lottie",
"renderer",
"simd",
"svg",
Expand Down
10 changes: 10 additions & 0 deletions examples/lottie_basic/Cargo.toml
@@ -0,0 +1,10 @@
[package]
name = "lottie_basic"
version = "0.1.0"
authors = ["Patrick Walton <pcwalton@mimiga.net>"]
edition = "2018"

[dependencies]

[dependencies.pathfinder_lottie]
path = "../../lottie"
23 changes: 23 additions & 0 deletions examples/lottie_basic/src/main.rs
@@ -0,0 +1,23 @@
// pathfinder/examples/lottie_basic/src/main.rs
//
// Copyright © 2019 The Pathfinder Project Developers.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

//! Experimental example for reading Lottie animations. This is very incomplete.

use pathfinder_lottie::Lottie;
use std::env;
use std::fs::File;
use std::io::BufReader;

fn main() {
let path = env::args().skip(1).next().unwrap();
let file = BufReader::new(File::open(path).unwrap());
let lottie = Lottie::from_reader(file).unwrap();
println!("{:#?}", lottie);
}
12 changes: 12 additions & 0 deletions lottie/Cargo.toml
@@ -0,0 +1,12 @@
[package]
name = "pathfinder_lottie"
version = "0.1.0"
authors = ["Patrick Walton <pcwalton@mimiga.net>"]
edition = "2018"

[dependencies]
serde_json = "1.0"

[dependencies.serde]
version = "1.0"
features = ["derive"]

0 comments on commit 8c4f05c

Please sign in to comment.