Crates.io | region_quadtree |
lib.rs | region_quadtree |
version | 0.1.0 |
source | src |
created_at | 2023-12-21 20:32:43.357188 |
updated_at | 2023-12-21 20:32:43.357188 |
description | A lightweight Region Quadtree |
homepage | |
repository | https://github.com/juaquin456/Region-QuadTree.git |
max_upload_size | |
id | 1077492 |
size | 61,230 |
This is a lightweight implementation of a Region Quadtree in Rust. It is a static structure to represent an image.
use region_quadtree::region_qt::RegionQt;
fn main() {
let mut tree = RegionQt::new();
// build a region quadtree with dimensions and data given the image path
tree.build("img/GH.png");
// plot the original and draw each line that divide a quadrant
tree.plot();
// save to file a bincode encode of the tree struct
tree.write("GH_qt.bin");
}
You can use the from_file
method to read the bincode file
let mut tree = RegionQt::from_file("GH_qt.bin");