aboutsummaryrefslogtreecommitdiff
path: root/lvc/src/impls.rs
diff options
context:
space:
mode:
Diffstat (limited to 'lvc/src/impls.rs')
-rw-r--r--lvc/src/impls.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/lvc/src/impls.rs b/lvc/src/impls.rs
index 2a5a497..04699c6 100644
--- a/lvc/src/impls.rs
+++ b/lvc/src/impls.rs
@@ -50,6 +50,17 @@ impl Add for Pixel {
}
}
}
+impl Sub for Pixel {
+ type Output = Pixel;
+ #[inline]
+ fn sub(self, rhs: Self) -> Self::Output {
+ Self {
+ r: self.r - rhs.r,
+ g: self.g - rhs.g,
+ b: self.b - rhs.b,
+ }
+ }
+}
impl P2 {
pub const ZERO: P2 = P2 { x: 0, y: 0 };
pub const X: P2 = P2 { x: 1, y: 0 };