Type Definition imgref::ImgRefMut[][src]

type ImgRefMut<'a, Pixel> = Img<&'a mut [Pixel]>;

Same as ImgRef, but mutable Pass this structure by value (i.e. ImgRef, not &ImgRef).

Implementations

impl<'a, T> ImgRefMut<'a, T>[src]

#[must_use]pub fn sub_image(
    &'a mut self,
    left: usize,
    top: usize,
    width: usize,
    height: usize
) -> ImgRef<'a, T>
[src]

Turn this into immutable reference, and slice a subregion of it

#[must_use]pub fn sub_image_mut(
    &mut self,
    left: usize,
    top: usize,
    width: usize,
    height: usize
) -> ImgRefMut<'_, T>
[src]

Trim this image without copying. Note that mutable borrows are exclusive, so it’s not possible to have more than one mutable subimage at a time.

#[must_use]pub fn as_ref(&self) -> ImgRef<'_, T>[src]

Make mutable reference immutable

impl<'a, T: Copy> ImgRefMut<'a, T>[src]

#[must_use]pub fn pixels(&self) -> PixelsIter<'_, T>

Notable traits for PixelsIter<'a, T>

impl<'a, T: Copy + 'a> Iterator for PixelsIter<'a, T> type Item = T;
[src]

Panics

if width is 0

#[must_use]pub fn pixels_mut(&mut self) -> PixelsIterMut<'_, T>

Notable traits for PixelsIterMut<'a, T>

impl<'a, T: Copy + 'a> Iterator for PixelsIterMut<'a, T> type Item = &'a mut T;
[src]

Panics

if width is 0

impl<'a, T> ImgRefMut<'a, T>[src]

#[must_use]pub fn rows(&self) -> RowsIter<'_, T>

Notable traits for RowsIter<'a, T>

impl<'a, T: 'a> Iterator for RowsIter<'a, T> type Item = &'a [T];
[src]

Panics

if stride is 0

#[must_use]pub fn rows_mut(&mut self) -> RowsIterMut<'_, T>

Notable traits for RowsIterMut<'a, T>

impl<'a, T: 'a> Iterator for RowsIterMut<'a, T> type Item = &'a mut [T];
[src]

Panics

if stride is 0

Trait Implementations

impl<'a, T: Eq> Eq for ImgRefMut<'a, T>[src]

impl<'a, T: Hash> Hash for ImgRefMut<'a, T>[src]

impl<'a, 'b, T, U> PartialEq<Img<&'b [U]>> for ImgRefMut<'a, T> where
    T: PartialEq<U>, 
[src]

impl<'a, 'b, T, U> PartialEq<Img<&'b mut [U]>> for ImgRefMut<'a, T> where
    T: PartialEq<U>, 
[src]