pub struct Mask { /* private fields */ }Expand description
A per-pixel coverage mask: width x height 8-bit samples with stride
bytes per row (0 = not covered, 255 = fully covered). Its own grid, not
the frame’s, so it stays valid when the frame is scaled.
Implementations§
Source§impl Mask
impl Mask
Sourcepub fn new(width: u32, height: u32, stride: u32, data: Vec<u8>) -> Option<Self>
pub fn new(width: u32, height: u32, stride: u32, data: Vec<u8>) -> Option<Self>
Build a mask over data, or None if the geometry does not fit it.
Dimensions reach this from a model output or a wire peer, so they are
checked here once and the accessors can then index without guessing.
pub fn width(&self) -> u32
pub fn height(&self) -> u32
pub fn stride(&self) -> u32
pub fn data(&self) -> &[u8] ⓘ
Trait Implementations§
impl Eq for Mask
impl StructuralPartialEq for Mask
Auto Trait Implementations§
impl Freeze for Mask
impl RefUnwindSafe for Mask
impl Send for Mask
impl Sync for Mask
impl Unpin for Mask
impl UnsafeUnpin for Mask
impl UnwindSafe for Mask
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