summaryrefslogtreecommitdiffstats
path: root/src/frontier/mean.rs
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2023-12-05 13:49:56 -0500
committerTavian Barnes <tavianator@tavianator.com>2023-12-05 14:09:17 -0500
commitc404a0a02915e4f6d329d7667ed30b8519b8a964 (patch)
tree8ca057be61563c0b7816331951bf28e270207e70 /src/frontier/mean.rs
parent932ff518e5f70c58e8dc687c00dab2bbdd4bec8d (diff)
downloadkd-forest-c404a0a02915e4f6d329d7667ed30b8519b8a964.tar.xz
Move soft deletion into the forest implementationmain
This allows us to filter out deleted items whenever we rebuild a tree.
Diffstat (limited to 'src/frontier/mean.rs')
-rw-r--r--src/frontier/mean.rs10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/frontier/mean.rs b/src/frontier/mean.rs
index 30443c9..9ccfe7e 100644
--- a/src/frontier/mean.rs
+++ b/src/frontier/mean.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
#[derive(Debug)]
pub struct MeanFrontier<C> {
pixels: Vec<MeanPixel<C>>,
- forest: SoftKdForest<RcPixel<C>>,
+ forest: KdForest<RcPixel<C>>,
width: u32,
height: u32,
len: usize,
@@ -114,12 +114,6 @@ where
self.len += pixels.len();
self.forest.extend(pixels);
-
- if 2 * self.deleted >= self.len {
- self.forest.rebuild();
- self.len -= self.deleted;
- self.deleted = 0;
- }
}
}