pub struct AlphaMaskU8<'a, const STEP: usize, const OFFSET: usize, MF: MaskFunction> { /* private fields */ }Expand description
Alpha mask with bounds-checked access to a rendering buffer.
STEP is the number of bytes per pixel, OFFSET is the byte offset
within each pixel to the mask component.
Port of C++ alpha_mask_u8<Step, Offset, MaskF>.
Implementations§
Source§impl<'a, const STEP: usize, const OFFSET: usize, MF: MaskFunction> AlphaMaskU8<'a, STEP, OFFSET, MF>
impl<'a, const STEP: usize, const OFFSET: usize, MF: MaskFunction> AlphaMaskU8<'a, STEP, OFFSET, MF>
pub fn new(rbuf: &'a RowAccessor, mask_function: MF) -> Self
pub fn mask_function(&self) -> &MF
Trait Implementations§
Source§impl<const STEP: usize, const OFFSET: usize, MF: MaskFunction> AlphaMask for AlphaMaskU8<'_, STEP, OFFSET, MF>
impl<const STEP: usize, const OFFSET: usize, MF: MaskFunction> AlphaMask for AlphaMaskU8<'_, STEP, OFFSET, MF>
fn pixel(&self, x: i32, y: i32) -> u8
fn combine_pixel(&self, x: i32, y: i32, val: u8) -> u8
fn fill_hspan(&self, x: i32, y: i32, dst: &mut [u8])
fn combine_hspan(&self, x: i32, y: i32, dst: &mut [u8])
fn fill_vspan(&self, x: i32, y: i32, dst: &mut [u8])
fn combine_vspan(&self, x: i32, y: i32, dst: &mut [u8])
Auto Trait Implementations§
impl<'a, const STEP: usize, const OFFSET: usize, MF> Freeze for AlphaMaskU8<'a, STEP, OFFSET, MF>where
MF: Freeze,
impl<'a, const STEP: usize, const OFFSET: usize, MF> RefUnwindSafe for AlphaMaskU8<'a, STEP, OFFSET, MF>where
MF: RefUnwindSafe,
impl<'a, const STEP: usize, const OFFSET: usize, MF> !Send for AlphaMaskU8<'a, STEP, OFFSET, MF>
impl<'a, const STEP: usize, const OFFSET: usize, MF> !Sync for AlphaMaskU8<'a, STEP, OFFSET, MF>
impl<'a, const STEP: usize, const OFFSET: usize, MF> Unpin for AlphaMaskU8<'a, STEP, OFFSET, MF>where
MF: Unpin,
impl<'a, const STEP: usize, const OFFSET: usize, MF> UnwindSafe for AlphaMaskU8<'a, STEP, OFFSET, MF>where
MF: 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