pub struct BlendOps<S: SimdOps> { /* private fields */ }Expand description
Blending operations using SIMD.
Implementations§
Source§impl<S: SimdOps> BlendOps<S>
impl<S: SimdOps> BlendOps<S>
Sourcepub fn lerp_u8(&self, a: u8, b: u8, weight: u8) -> u8
pub fn lerp_u8(&self, a: u8, b: u8, weight: u8) -> u8
Linear interpolation between two values.
Returns: a + (b - a) * weight / 256
Weight is in range [0, 256] where:
- 0 = 100% a
- 256 = 100% b
- 128 = 50% each
Sourcepub fn lerp_i16x8(&self, a: I16x8, b: I16x8, weight: i16) -> I16x8
pub fn lerp_i16x8(&self, a: I16x8, b: I16x8, weight: i16) -> I16x8
Linear interpolation for i16x8 vectors.
Returns: a + (b - a) * weight / 256
Sourcepub fn weighted_avg_u8x16(&self, a: U8x16, b: U8x16, weight: u8) -> U8x16
pub fn weighted_avg_u8x16(&self, a: U8x16, b: U8x16, weight: u8) -> U8x16
Weighted average of two u8x16 vectors.
Returns: (a * (256 - weight) + b * weight + 128) / 256
Sourcepub fn bilinear_blend_u8(
&self,
tl: u8,
tr: u8,
bl: u8,
br: u8,
hweight: u8,
vweight: u8,
) -> u8
pub fn bilinear_blend_u8( &self, tl: u8, tr: u8, bl: u8, br: u8, hweight: u8, vweight: u8, ) -> u8
Bilinear blend for motion compensation.
Blends 4 samples using horizontal and vertical weights. Used for sub-pixel motion estimation.
Layout:
tl --- tr
| |
bl --- brReturns: blend of all 4 based on (hweight, vweight)
Trait Implementations§
Auto Trait Implementations§
impl<S> Freeze for BlendOps<S>where
S: Freeze,
impl<S> RefUnwindSafe for BlendOps<S>where
S: RefUnwindSafe,
impl<S> Send for BlendOps<S>
impl<S> Sync for BlendOps<S>
impl<S> Unpin for BlendOps<S>where
S: Unpin,
impl<S> UnsafeUnpin for BlendOps<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for BlendOps<S>where
S: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more