pub struct ImageViewMut<'a> { /* private fields */ }
Expand description
A borrowed mutable slice of image data.
Implementations§
Source§impl<'a> ImageViewMut<'a>
impl<'a> ImageViewMut<'a>
Sourcepub fn new(data: &'a mut [u8], size: Size, color: ColorFormat) -> Option<Self>
pub fn new(data: &'a mut [u8], size: Size, color: ColorFormat) -> Option<Self>
Creates a new image view from the given data, size, and color format.
The data must be the correct size for the given size and color format.
If data.len() != size.pixels() * color.bytes_per_pixel()
,
then None
is returned.
pub fn data(&mut self) -> &mut [u8] ⓘ
pub fn size(&self) -> Size
pub fn width(&self) -> u32
pub fn height(&self) -> u32
pub fn color(&self) -> ColorFormat
pub fn row_pitch(&self) -> usize
Auto Trait Implementations§
impl<'a> Freeze for ImageViewMut<'a>
impl<'a> RefUnwindSafe for ImageViewMut<'a>
impl<'a> Send for ImageViewMut<'a>
impl<'a> Sync for ImageViewMut<'a>
impl<'a> Unpin for ImageViewMut<'a>
impl<'a> !UnwindSafe for ImageViewMut<'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
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