pub struct Image2d<T, Storage: AsRef<[T]> = Vec<T>> { /* private fields */ }
Implementations§
Source§impl<T, Storage: AsRef<[T]>> Image2d<T, Storage>
impl<T, Storage: AsRef<[T]>> Image2d<T, Storage>
pub fn new(width: usize, height: usize) -> Selfwhere
T: Default,
Storage: FromIterator<T>,
pub fn from_fn(
width: usize,
height: usize,
f: impl FnMut(usize, usize) -> T,
) -> Selfwhere
Storage: FromIterator<T>,
pub fn from_storage(width: usize, height: usize, storage: Storage) -> Self
pub fn width(&self) -> usize
pub fn height(&self) -> usize
pub fn reborrow(&self) -> Image2d<T, &[T]>
pub fn reborrow_mut(&mut self) -> Image2d<T, &mut [T]>
pub fn cursor_at(&mut self, x: usize, y: usize) -> Image2dCursor<'_, T>
Trait Implementations§
impl<T: Copy, Storage: Copy + AsRef<[T]>> Copy for Image2d<T, Storage>
Auto Trait Implementations§
impl<T, Storage> Freeze for Image2d<T, Storage>where
Storage: Freeze,
impl<T, Storage> RefUnwindSafe for Image2d<T, Storage>where
Storage: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, Storage> Send for Image2d<T, Storage>
impl<T, Storage> Sync for Image2d<T, Storage>
impl<T, Storage> Unpin for Image2d<T, Storage>
impl<T, Storage> UnwindSafe for Image2d<T, Storage>where
Storage: UnwindSafe,
T: UnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.