pub struct MaskData<'a> {
pub bpp: u8,
pub is_packed: bool,
pub data: &'a [u8],
}Expand description
A single channel alpha mask.
Fields§
§bpp: u8Number of bits-per-pixel. Always 1, 2, 4 or 8.
is_packed: boolTrue if each row of the data is bit-aligned. Otherwise, each row is padded to the next byte.
data: &'a [u8]Raw bitmap data.
Implementations§
Source§impl MaskData<'_>
impl MaskData<'_>
Sourcepub fn decode_to_slice(
&self,
width: u32,
height: u32,
dst: &mut [u8],
) -> Result<(), MaskDataDecodeError>
pub fn decode_to_slice( &self, width: u32, height: u32, dst: &mut [u8], ) -> Result<(), MaskDataDecodeError>
Decodes the raw packed bitmap data into 8-bit-per-pixel values, writing the result into the provided buffer.
The buffer must be at least width * height bytes long. Each pixel
value is scaled to the 0–255 range.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for MaskData<'a>
impl<'a> RefUnwindSafe for MaskData<'a>
impl<'a> Send for MaskData<'a>
impl<'a> Sync for MaskData<'a>
impl<'a> Unpin for MaskData<'a>
impl<'a> UnsafeUnpin for MaskData<'a>
impl<'a> UnwindSafe for MaskData<'a>
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