summaryrefslogtreecommitdiffstats
path: root/src/frontier/min.rs
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2020-07-06 23:04:10 -0400
committerTavian Barnes <tavianator@tavianator.com>2020-08-24 11:10:13 -0400
commit6ba084db4ba375eacaa1677fd75de318c12170c7 (patch)
tree9122e889fcc47d8f6ebd71717a8cb35a98ebafdb /src/frontier/min.rs
parent39c0348c9f98b4dd29bd112a0a2a42faa67c92d4 (diff)
downloadkd-forest-6ba084db4ba375eacaa1677fd75de318c12170c7.tar.xz
Bump acap to 0.2.0
This requires adapting to the new k-d trees, which are significantly faster.
Diffstat (limited to 'src/frontier/min.rs')
-rw-r--r--src/frontier/min.rs15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/frontier/min.rs b/src/frontier/min.rs
index 95b3321..5c298e7 100644
--- a/src/frontier/min.rs
+++ b/src/frontier/min.rs
@@ -16,7 +16,10 @@ struct MinPixel<C> {
filled: bool,
}
-impl<C: ColorSpace> MinPixel<C> {
+impl<C: ColorSpace> MinPixel<C>
+where
+ C::Value: PartialOrd<C::Distance>,
+{
fn new() -> Self {
Self {
pixel: None,
@@ -39,7 +42,10 @@ pub struct MinFrontier<C, R> {
deleted: usize,
}
-impl<C: ColorSpace, R: Rng> MinFrontier<C, R> {
+impl<C: ColorSpace, R: Rng> MinFrontier<C, R>
+where
+ C::Value: PartialOrd<C::Distance>,
+{
/// Create a MinFrontier with the given dimensions and initial pixel location.
pub fn new(rng: R, width: u32, height: u32, x0: u32, y0: u32) -> Self {
let size = (width as usize) * (height as usize);
@@ -122,7 +128,10 @@ impl<C: ColorSpace, R: Rng> MinFrontier<C, R> {
}
}
-impl<C: ColorSpace, R: Rng> Frontier for MinFrontier<C, R> {
+impl<C: ColorSpace, R: Rng> Frontier for MinFrontier<C, R>
+where
+ C::Value: PartialOrd<C::Distance>,
+{
fn width(&self) -> u32 {
self.width
}