aboutsummaryrefslogtreecommitdiff
path: root/evc/src/helpers/pixel.rs
diff options
context:
space:
mode:
Diffstat (limited to 'evc/src/helpers/pixel.rs')
-rw-r--r--evc/src/helpers/pixel.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/evc/src/helpers/pixel.rs b/evc/src/helpers/pixel.rs
index f7d6621..964040d 100644
--- a/evc/src/helpers/pixel.rs
+++ b/evc/src/helpers/pixel.rs
@@ -29,6 +29,7 @@ impl Pixel {
);
SQRT[rd + gd + bd]
}
+
#[inline]
pub fn average(a: Pixel, b: Pixel) -> Pixel {
//? this functions is broken
@@ -39,6 +40,8 @@ impl Pixel {
b: (a.b >> 1) + (b.b >> 1),
}
}
+
+ #[inline]
pub fn scale(&self, factor: f32) -> Pixel {
Pixel {
r: ((self.r as f32) * factor).clamp(0.0, 255.0) as u8,