pub struct MutableSubgrid<'g, V = f32> { /* private fields */ }
Expand description
A mutable subgrid of the underlying buffer.
Implementations§
Source§impl<'g, V> MutableSubgrid<'g, V>
impl<'g, V> MutableSubgrid<'g, V>
pub fn empty() -> Self
Sourcepub fn from_buf(
buf: &'g mut [V],
width: usize,
height: usize,
stride: usize,
) -> Self
pub fn from_buf( buf: &'g mut [V], width: usize, height: usize, stride: usize, ) -> Self
Create a CutGrid
from buffer slice, width, height and stride.
§Panic
Panics if:
width
is greater thanstride
,- or the area specified by
width
,height
andstride
is larger thanbuf
.
pub fn into_ptr(self) -> NonNull<V>
pub fn width(&self) -> usize
pub fn height(&self) -> usize
pub fn stride(&self) -> usize
pub fn get_row(&self, row: usize) -> &[V]
pub fn get_mut(&mut self, x: usize, y: usize) -> &mut V
pub fn get_row_mut(&mut self, row: usize) -> &mut [V]
pub fn swap(&mut self, (ax, ay): (usize, usize), (bx, by): (usize, usize))
Source§impl<'g, V> MutableSubgrid<'g, V>
impl<'g, V> MutableSubgrid<'g, V>
pub fn borrow_mut(&mut self) -> MutableSubgrid<'_, V>
pub fn subgrid( self, range_x: impl RangeBounds<usize>, range_y: impl RangeBounds<usize>, ) -> MutableSubgrid<'g, V>
Sourcepub fn split_horizontal(
&mut self,
x: usize,
) -> (MutableSubgrid<'_, V>, MutableSubgrid<'_, V>)
pub fn split_horizontal( &mut self, x: usize, ) -> (MutableSubgrid<'_, V>, MutableSubgrid<'_, V>)
Sourcepub fn split_horizontal_in_place(&mut self, x: usize) -> MutableSubgrid<'g, V>
pub fn split_horizontal_in_place(&mut self, x: usize) -> MutableSubgrid<'g, V>
Sourcepub fn split_vertical(
&mut self,
y: usize,
) -> (MutableSubgrid<'_, V>, MutableSubgrid<'_, V>)
pub fn split_vertical( &mut self, y: usize, ) -> (MutableSubgrid<'_, V>, MutableSubgrid<'_, V>)
Sourcepub fn split_vertical_in_place(&mut self, y: usize) -> MutableSubgrid<'g, V>
pub fn split_vertical_in_place(&mut self, y: usize) -> MutableSubgrid<'g, V>
pub fn merge_horizontal_in_place(&mut self, right: Self)
pub fn merge_vertical_in_place(&mut self, bottom: Self)
Source§impl<'g, V: Copy> MutableSubgrid<'g, V>
impl<'g, V: Copy> MutableSubgrid<'g, V>
pub fn into_groups( self, group_width: usize, group_height: usize, ) -> Vec<MutableSubgrid<'g, V>>
pub fn into_groups_with_fixed_count( self, group_width: usize, group_height: usize, num_cols: usize, num_rows: usize, ) -> Vec<MutableSubgrid<'g, V>>
Source§impl MutableSubgrid<'_, f32>
impl MutableSubgrid<'_, f32>
pub fn as_vectored<V: SimdVector>(&mut self) -> Option<MutableSubgrid<'_, V>>
Trait Implementations§
Source§impl<'g, V: Debug> Debug for MutableSubgrid<'g, V>
impl<'g, V: Debug> Debug for MutableSubgrid<'g, V>
Source§impl<'g, V> From<&'g mut AlignedGrid<V>> for MutableSubgrid<'g, V>
impl<'g, V> From<&'g mut AlignedGrid<V>> for MutableSubgrid<'g, V>
Source§fn from(grid: &'g mut AlignedGrid<V>) -> Self
fn from(grid: &'g mut AlignedGrid<V>) -> Self
Converts to this type from the input type.
impl<'g, V> Send for MutableSubgrid<'g, V>
impl<'g, V> Sync for MutableSubgrid<'g, V>
Auto Trait Implementations§
impl<'g, V> Freeze for MutableSubgrid<'g, V>
impl<'g, V> RefUnwindSafe for MutableSubgrid<'g, V>where
V: RefUnwindSafe,
impl<'g, V> Unpin for MutableSubgrid<'g, V>
impl<'g, V = f32> !UnwindSafe for MutableSubgrid<'g, V>
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