Skip to main content

Segmentation

Struct Segmentation 

Source
pub struct Segmentation<const D: usize, T> { /* private fields */ }

Implementations§

Source§

impl<const D: usize, T> Segmentation<D, T>

Source

pub fn new( grid: Grid<D, T>, scale: Coordinate<D>, translate: Coordinate<D>, ) -> Self

Source

pub fn grid(&self) -> &Grid<D, T>

Source

pub fn into_parts(self) -> (Grid<D, T>, Coordinate<D>, Coordinate<D>)

Source

pub fn scale(&self) -> &Coordinate<D>

Source

pub fn translate(&self) -> &Coordinate<D>

Source§

impl<const D: usize, T: Copy> Segmentation<D, T>

Source

pub fn extract(&self, ranges: [Range<usize>; D]) -> Self

Methods from Deref<Target = Grid<D, T>>§

Source

pub fn data(&self) -> &[T]

Source

pub fn flat(&self, index: [usize; D]) -> usize

Source

pub fn logical_iter<'a>( &'a self, ) -> impl Iterator<Item = ([usize; D], &'a T)> + 'a

Source

pub fn nel(&self) -> &[usize; D]

Source

pub fn is_col_major(&self) -> bool

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn data_col_major(&self) -> Cow<'_, [T]>

Source

pub fn extract(&self, ranges: [Range<usize>; D]) -> Self

Source

pub fn diff(&self, other: &Self) -> Grid<D, u8>

Trait Implementations§

Source§

impl<const D: usize, T> Deref for Segmentation<D, T>

Source§

type Target = Grid<D, T>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<const D: usize, T> DerefMut for Segmentation<D, T>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<const D: usize, T> From<Grid<D, T>> for Segmentation<D, T>

Source§

fn from(grid: Grid<D, T>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<const D: usize, T> Freeze for Segmentation<D, T>

§

impl<const D: usize, T> RefUnwindSafe for Segmentation<D, T>
where T: RefUnwindSafe,

§

impl<const D: usize, T> Send for Segmentation<D, T>
where T: Send,

§

impl<const D: usize, T> Sync for Segmentation<D, T>
where T: Sync,

§

impl<const D: usize, T> Unpin for Segmentation<D, T>
where T: Unpin,

§

impl<const D: usize, T> UnsafeUnpin for Segmentation<D, T>

§

impl<const D: usize, T> UnwindSafe for Segmentation<D, T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.