ImageViewMut

Trait ImageViewMut 

Source
pub unsafe trait ImageViewMut: ImageView {
    // Required method
    fn iter_rows_mut(
        &mut self,
        start_row: u32,
    ) -> impl Iterator<Item = &mut [Self::Pixel]>;

    // Provided methods
    fn iter_2_rows_mut(
        &mut self,
    ) -> ArrayChunks<impl Iterator<Item = &mut [Self::Pixel]>, 2>  { ... }
    fn iter_4_rows_mut(
        &mut self,
    ) -> ArrayChunks<impl Iterator<Item = &mut [Self::Pixel]>, 4>  { ... }
    fn split_by_height_mut(
        &mut self,
        start_row: u32,
        height: NonZeroU32,
        num_parts: NonZeroU32,
    ) -> Option<Vec<impl ImageViewMut<Pixel = Self::Pixel>>> { ... }
    fn split_by_width_mut(
        &mut self,
        start_col: u32,
        width: NonZeroU32,
        num_parts: NonZeroU32,
    ) -> Option<Vec<impl ImageViewMut<Pixel = Self::Pixel>>> { ... }
}
Expand description

A trait for getting mutable access to image data.

§Safety

The length of the image rows returned by methods of this trait must be equal or greater than the image width.

Required Methods§

Source

fn iter_rows_mut( &mut self, start_row: u32, ) -> impl Iterator<Item = &mut [Self::Pixel]>

Returns iterator by mutable slices with image rows.

Provided Methods§

Source

fn iter_2_rows_mut( &mut self, ) -> ArrayChunks<impl Iterator<Item = &mut [Self::Pixel]>, 2>

Returns iterator by arrays with two mutable image rows.

Source

fn iter_4_rows_mut( &mut self, ) -> ArrayChunks<impl Iterator<Item = &mut [Self::Pixel]>, 4>

Returns iterator by arrays with four mutable image rows.

Source

fn split_by_height_mut( &mut self, start_row: u32, height: NonZeroU32, num_parts: NonZeroU32, ) -> Option<Vec<impl ImageViewMut<Pixel = Self::Pixel>>>

Takes a part of the image from the given start row with the given height and divides it by height into num_parts of small mutable images without mutual intersections.

Source

fn split_by_width_mut( &mut self, start_col: u32, width: NonZeroU32, num_parts: NonZeroU32, ) -> Option<Vec<impl ImageViewMut<Pixel = Self::Pixel>>>

Takes a part of the image from the given start column with the given width and divides it by width into num_parts of small mutable images without mutual intersections.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§