1 unstable release
0.1.0 | Dec 21, 2023 |
---|
#23 in #quad-tree
17KB
303 lines
Region Quadtree
This is a lightweight implementation of a Region Quadtree in Rust. It is a static structure to represent an image.
Usage
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");
Plot
Dependencies
~7–16MB
~171K SLoC