| Crates.io | celluloid-core |
| lib.rs | celluloid-core |
| version | 0.0.1 |
| created_at | 2025-12-16 19:53:15.780575+00 |
| updated_at | 2025-12-16 19:53:15.780575+00 |
| description | Data models for Celluloid grid-based animations |
| homepage | https://github.com/careyi3/celluloid |
| repository | https://github.com/careyi3/celluloid |
| max_upload_size | |
| id | 1988546 |
| size | 18,034 |
Data models for Celluloid grid-based animations.
This crate provides the core data structures for creating grid-based animations that can be visualized with the Celluloid viewer. Perfect for Advent of Code visualizations, cellular automata, pathfinding algorithms, and other grid-based simulations.
Add this to your Cargo.toml:
[dependencies]
celluloid-core = "0.1"
use celluloid_core::{AnimationData, Frame, CellState};
fn main() {
let mut animation = AnimationData::new("My Animation", 10, 10)
.with_frame_delay(100.0);
let mut grid = vec![vec![CellState::Empty as u8; 10]; 10];
grid[5][5] = CellState::Start as u8;
let frame = Frame::new(0, grid, "Initial state");
animation.add_frame(frame);
let json = serde_json::to_string_pretty(&animation).unwrap();
std::fs::write("animation.json", json).unwrap();
}
Empty (0) - Empty cellObstacle (1) - Blocked cellStart (2) - Starting positionEnd (3) - Goal positionVisited (4) - Visited during searchPath (5) - Part of final pathInstall the Celluloid viewer:
cargo install --git https://github.com/careyi3/celluloid --path server
Then run it in a directory with your animation JSON files:
celluloid
Licensed under MIT license.