summaryrefslogtreecommitdiffstats
path: root/src/frontier/min.rs
diff options
context:
space:
mode:
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
}