summaryrefslogtreecommitdiffstats
path: root/src/frontier/mean.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/frontier/mean.rs')
-rw-r--r--src/frontier/mean.rs15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/frontier/mean.rs b/src/frontier/mean.rs
index 3c441b8..e59e45c 100644
--- a/src/frontier/mean.rs
+++ b/src/frontier/mean.rs
@@ -17,7 +17,10 @@ enum MeanPixel<C> {
Filled(C),
}
-impl<C: ColorSpace> MeanPixel<C> {
+impl<C: ColorSpace> MeanPixel<C>
+where
+ C::Value: PartialOrd<C::Distance>,
+{
fn filled_color(&self) -> Option<C> {
match self {
Self::Filled(color) => Some(*color),
@@ -37,7 +40,10 @@ pub struct MeanFrontier<C> {
deleted: usize,
}
-impl<C: ColorSpace> MeanFrontier<C> {
+impl<C: ColorSpace> MeanFrontier<C>
+where
+ C::Value: PartialOrd<C::Distance>,
+{
/// Create a MeanFrontier with the given dimensions and initial pixel location.
pub fn new(width: u32, height: u32, x0: u32, y0: u32) -> Self {
let size = (width as usize) * (height as usize);
@@ -117,7 +123,10 @@ impl<C: ColorSpace> MeanFrontier<C> {
}
}
-impl<C: ColorSpace> Frontier for MeanFrontier<C> {
+impl<C: ColorSpace> Frontier for MeanFrontier<C>
+where
+ C::Value: PartialOrd<C::Distance>,
+{
fn width(&self) -> u32 {
self.width
}