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> 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