pub struct ImageStoreMut<'a, T, const N: usize>{
pub buffer: BufferStore<'a, T>,
pub channels: usize,
pub width: usize,
pub height: usize,
pub stride: usize,
pub bit_depth: usize,
}
Expand description
Fields§
§buffer: BufferStore<'a, T>
§channels: usize
Channels in the image
width: usize
Image width
height: usize
Image height
stride: usize
Image stride, if stride is zero then it considered to be width * N
bit_depth: usize
Required for u16
images
Implementations§
Source§impl<'a, T, const N: usize> ImageStoreMut<'a, T, N>
impl<'a, T, const N: usize> ImageStoreMut<'a, T, N>
Sourcepub fn new(
slice_ref: Vec<T>,
width: usize,
height: usize,
) -> Result<ImageStoreMut<'a, T, N>, PicScaleError>
pub fn new( slice_ref: Vec<T>, width: usize, height: usize, ) -> Result<ImageStoreMut<'a, T, N>, PicScaleError>
Creates new mutable storage from vector
Always sets bit-depth to 0
Sourcepub fn borrow(
slice_ref: &'a mut [T],
width: usize,
height: usize,
) -> Result<ImageStoreMut<'a, T, N>, PicScaleError>
pub fn borrow( slice_ref: &'a mut [T], width: usize, height: usize, ) -> Result<ImageStoreMut<'a, T, N>, PicScaleError>
Creates new mutable storage from slice
Always sets bit-depth to 0
Sourcepub fn alloc(width: usize, height: usize) -> ImageStoreMut<'a, T, N>
pub fn alloc(width: usize, height: usize) -> ImageStoreMut<'a, T, N>
Allocates new mutable image storage
Always sets bit depth to 0
Sourcepub fn alloc_with_depth(
width: usize,
height: usize,
bit_depth: usize,
) -> ImageStoreMut<'a, T, N>
pub fn alloc_with_depth( width: usize, height: usize, bit_depth: usize, ) -> ImageStoreMut<'a, T, N>
Allocates new mutable image storage with required bit-depth
Source§impl<T, const N: usize> ImageStoreMut<'_, T, N>
impl<T, const N: usize> ImageStoreMut<'_, T, N>
Source§impl<'a, T, const N: usize> ImageStoreMut<'a, T, N>
impl<'a, T, const N: usize> ImageStoreMut<'a, T, N>
Sourcepub fn from_slice(
slice_ref: &'a mut [T],
width: usize,
height: usize,
) -> Result<ImageStoreMut<'a, T, N>, PicScaleError>
pub fn from_slice( slice_ref: &'a mut [T], width: usize, height: usize, ) -> Result<ImageStoreMut<'a, T, N>, PicScaleError>
Borrows mutable slice as new image store
Sourcepub fn copied<'b>(&self) -> ImageStoreMut<'b, T, N>
pub fn copied<'b>(&self) -> ImageStoreMut<'b, T, N>
Performs deep copy into a new mutable image
Sourcepub fn to_immutable(&self) -> ImageStore<'_, T, N>
pub fn to_immutable(&self) -> ImageStore<'_, T, N>
Performs deep copy into a new immutable image
Trait Implementations§
Auto Trait Implementations§
impl<'a, T, const N: usize> Freeze for ImageStoreMut<'a, T, N>
impl<'a, T, const N: usize> RefUnwindSafe for ImageStoreMut<'a, T, N>where
T: RefUnwindSafe,
impl<'a, T, const N: usize> Send for ImageStoreMut<'a, T, N>where
T: Send,
impl<'a, T, const N: usize> Sync for ImageStoreMut<'a, T, N>where
T: Sync,
impl<'a, T, const N: usize> Unpin for ImageStoreMut<'a, T, N>where
T: Unpin,
impl<'a, T, const N: usize> !UnwindSafe for ImageStoreMut<'a, T, N>
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