Struct oxygengine_procedural::Grid2d
source · pub struct Grid2d<T> { /* private fields */ }
Implementations§
source§impl<T> Grid2d<T>where
T: Clone + Send + Sync,
impl<T> Grid2d<T>where T: Clone + Send + Sync,
pub fn new(cols: usize, rows: usize, fill: T) -> Grid2d<T>
pub fn with_cells(cols: usize, cells: Vec<T, Global>) -> Grid2d<T>
pub fn resize(&mut self, cols: usize, rows: usize, default: T)
pub fn cols(&self) -> usize
pub fn rows(&self) -> usize
pub fn size(&self) -> (usize, usize)
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn cells(&self) -> &[T]
pub fn cells_mut(&mut self) -> &mut [T]
pub fn cell(&self, col: usize, row: usize) -> Option<&T>
pub fn cell_mut(&mut self, col: usize, row: usize) -> Option<&mut T>
pub fn get(&self, col: usize, row: usize) -> Option<T>
pub fn set(&mut self, col: usize, row: usize, value: T)
pub fn get_col_cells(&self, index: usize) -> Option<Vec<T, Global>>
pub fn get_row_cells(&self, index: usize) -> Option<Vec<T, Global>>
pub fn copy_part(&self, range: Range<(usize, usize)>, result: &mut Grid2d<T>)where T: Default,
pub fn get_part(&self, range: Range<(usize, usize)>) -> Grid2d<T>
pub fn get_part_seamless(&self, range: Range<(usize, usize)>) -> Grid2d<T>
pub fn get_view(&self, range: Range<(usize, usize)>) -> Grid2d<&T>
pub fn get_view_seamless(&self, range: Range<(usize, usize)>) -> Grid2d<&T>
pub fn copy_sample( &self, _: (usize, usize), margin: usize, result: &mut Grid2d<T> )where T: Default,
pub fn sample(&self, _: (usize, usize), margin: usize) -> Grid2d<T>
pub fn sample_seamless(&self, _: (usize, usize), margin: usize) -> Grid2d<T>
pub fn view_sample(&self, _: (usize, usize), margin: usize) -> Grid2d<&T>
pub fn view_sample_seamless( &self, _: (usize, usize), margin: usize ) -> Grid2d<&T>
pub fn map<F, R>(&self, f: F) -> Grid2d<R>where F: FnMut(usize, usize, &T) -> R, R: Clone + Send + Sync,
pub fn with<F>(&mut self, f: F)where F: FnMut(usize, usize, &T) -> T,
pub fn iter(&self) -> impl DoubleEndedIterator
pub fn iter_mut(&mut self) -> impl DoubleEndedIterator
pub fn iter_view( &self, range: Range<(usize, usize)> ) -> impl DoubleEndedIterator
pub fn iter_view_mut( &mut self, range: Range<(usize, usize)> ) -> impl DoubleEndedIterator
pub fn iter_sample( &self, range: Range<(usize, usize)>, margin: usize ) -> impl DoubleEndedIterator
pub fn neighbor_sample(&self, _: (usize, usize)) -> Grid2dNeighborSample<T>where T: Default + Copy,
pub fn windows(&self, _: (usize, usize)) -> impl DoubleEndedIterator
pub fn windows_seamless(&self, _: (usize, usize)) -> impl DoubleEndedIterator
pub fn into_inner(self) -> (usize, usize, Vec<T, Global>)
pub fn from_view(view: &Grid2d<&T>) -> Grid2d<T>
pub fn get_common_areas( first_size: (usize, usize), second_size: (usize, usize), second_offset: (usize, usize) ) -> Option<(Range<(usize, usize)>, Range<(usize, usize)>)>
pub fn access_decoupled<'a>( &'a self, read: &[(usize, usize)], write: &[(usize, usize)], reads: &mut [&'a T], writes: &mut [&'a mut T] ) -> Result<(), Grid2dError>
pub unsafe fn access_decoupled_unsafe<'a>( &'a self, read: &[(usize, usize)], write: &[(usize, usize)], reads: &mut [&'a T], writes: &mut [&'a mut T] ) -> Result<(), Grid2dError>
Trait Implementations§
source§impl<'de, T> Deserialize<'de> for Grid2d<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Grid2d<T>where T: Deserialize<'de>,
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Grid2d<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<Grid2d<T>, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<I, T> From<(usize, I)> for Grid2d<T>where
I: Iterator<Item = T>,
T: Clone + Send + Sync,
impl<I, T> From<(usize, I)> for Grid2d<T>where I: Iterator<Item = T>, T: Clone + Send + Sync,
source§impl<T> PartialEq<Grid2d<T>> for Grid2d<T>where
T: PartialEq<T>,
impl<T> PartialEq<Grid2d<T>> for Grid2d<T>where T: PartialEq<T>,
source§impl<T> Serialize for Grid2d<T>where
T: Serialize,
impl<T> Serialize for Grid2d<T>where T: Serialize,
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl<T> RefUnwindSafe for Grid2d<T>where T: RefUnwindSafe,
impl<T> Send for Grid2d<T>where T: Send,
impl<T> Sync for Grid2d<T>where T: Sync,
impl<T> Unpin for Grid2d<T>where T: Unpin,
impl<T> UnwindSafe for Grid2d<T>where 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