Skip to main content

AlphaMaskU8

Struct AlphaMaskU8 

Source
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>

Source

pub fn new(rbuf: &'a RowAccessor, mask_function: MF) -> Self

Source

pub fn mask_function(&self) -> &MF

Trait Implementations§

Source§

impl<const STEP: usize, const OFFSET: usize, MF: MaskFunction> AlphaMask for AlphaMaskU8<'_, STEP, OFFSET, MF>

Source§

fn pixel(&self, x: i32, y: i32) -> u8

Source§

fn combine_pixel(&self, x: i32, y: i32, val: u8) -> u8

Source§

fn fill_hspan(&self, x: i32, y: i32, dst: &mut [u8])

Source§

fn combine_hspan(&self, x: i32, y: i32, dst: &mut [u8])

Source§

fn fill_vspan(&self, x: i32, y: i32, dst: &mut [u8])

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.