fast image operations
Diffstat (limited to 'src/pixels/blending.rs')
| -rw-r--r-- | src/pixels/blending.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/pixels/blending.rs b/src/pixels/blending.rs index 17ce141..a65861e 100644 --- a/src/pixels/blending.rs +++ b/src/pixels/blending.rs @@ -1,5 +1,5 @@ //! module for pixel blending ops -use super::{unfloat, Floatify, PMap, Trunc, Unfloatify}; +use super::{convert::PFrom, unfloat, Floatify, PMap, Trunc, Unfloatify}; use umath::FF32; /// Trait for blending pixels together. @@ -41,6 +41,14 @@ impl Blend<3> for [u8; 3] { } } +impl Blend<4> for [u8; 3] { + fn blend(&mut self, with: [u8; 4]) { + let mut us: [u8; 4] = PFrom::pfrom(*self); + us.blend(with); + *self = PFrom::pfrom(us); + } +} + impl Blend<2> for [u8; 2] { fn blend(&mut self, with: [u8; 2]) { let bg = self.float(); |