From c404a0a02915e4f6d329d7667ed30b8519b8a964 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Tue, 5 Dec 2023 13:49:56 -0500 Subject: Move soft deletion into the forest implementation This allows us to filter out deleted items whenever we rebuild a tree. --- src/frontier/min.rs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/frontier/min.rs') diff --git a/src/frontier/min.rs b/src/frontier/min.rs index da08746..2a332e6 100644 --- a/src/frontier/min.rs +++ b/src/frontier/min.rs @@ -3,7 +3,7 @@ use super::{neighbors, Frontier, RcPixel, Target}; use crate::color::{ColorSpace, Rgb8}; -use crate::soft::SoftKdForest; +use crate::forest::KdForest; use acap::knn::NearestNeighbors; @@ -33,7 +33,7 @@ where pub struct MinFrontier { rng: R, pixels: Vec>, - forest: SoftKdForest>, + forest: KdForest>, width: u32, height: u32, x0: u32, @@ -57,7 +57,7 @@ where Self { rng, pixels, - forest: SoftKdForest::new(), + forest: KdForest::new(), width, height, x0, @@ -118,12 +118,6 @@ where } } - if 2 * self.deleted >= self.len { - self.forest.rebuild(); - self.len -= self.deleted; - self.deleted = 0; - } - Some((x, y)) } } -- cgit v1.2.3