[−][src]Type Definition imgref::ImgVec
type ImgVec<Pixel> = Img<Vec<Pixel>>;
Image owning its pixels.
A 2D array of pixels. The pixels are oriented top-left first and rows are stride
pixels wide.
If size of the buf
is larger than width
*height
, then any excess space is a padding (see width_padded()
/height_padded()
).
Implementations
impl<'a, T: Copy> ImgVec<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]
Notable traits for PixelsIter<'a, T>
impl<'a, T: Copy + 'a> Iterator for PixelsIter<'a, T> type Item = T;
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]
Notable traits for PixelsIterMut<'a, T>
impl<'a, T: Copy + 'a> Iterator for PixelsIterMut<'a, T> type Item = &'a mut T;
Panics
if width is 0
impl<T> ImgVec<T>
[src]
#[must_use]pub fn sub_image_mut(
&mut self,
left: usize,
top: usize,
width: usize,
height: usize
) -> ImgRefMut<'_, T>
[src]
&mut self,
left: usize,
top: usize,
width: usize,
height: usize
) -> ImgRefMut<'_, T>
Create a mutable view into a region within the image. See sub_image()
for read-only views.
#[must_use]pub fn sub_image(
&self,
left: usize,
top: usize,
width: usize,
height: usize
) -> ImgRef<'_, T>
[src]
&self,
left: usize,
top: usize,
width: usize,
height: usize
) -> ImgRef<'_, T>
Make a reference for a part of the image, without copying any pixels.
#[must_use]pub fn as_ref(&self) -> ImgRef<'_, T>
[src]
Make a reference to this image to pass it to functions without giving up ownership
The reference should be passed by value (ImgRef
, not &ImgRef
).
If you need a mutable reference, see as_mut()
and sub_image_mut()
pub fn as_mut(&mut self) -> ImgRefMut<'_, T>
[src]
Make a mutable reference to the entire image
The reference should be passed by value (ImgRefMut
, not &mut ImgRefMut
).
See also sub_image_mut()
and rows_mut()
pub fn iter(&self) -> Iter<'_, T>
[src]
Size of this buffer may be unpredictable. Use .rows() instead
#[must_use]pub fn rows(&self) -> RowsIter<'_, T>ⓘ
[src]
Iterate over rows of the image as slices
Each slice is guaranteed to be exactly width
pixels wide.
#[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]
Notable traits for RowsIterMut<'a, T>
impl<'a, T: 'a> Iterator for RowsIterMut<'a, T> type Item = &'a mut [T];
Iterate over rows of the image as mutable slices
Each slice is guaranteed to be exactly width
pixels wide.
Trait Implementations
impl<T: Eq> Eq for ImgVec<T>
[src]
impl<T: Hash> Hash for ImgVec<T>
[src]
pub fn hash<H: Hasher>(&self, state: &mut H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<'a, T, U> PartialEq<Img<&'a [U]>> for ImgVec<T> where
T: PartialEq<U>,
[src]
T: PartialEq<U>,
pub fn eq(&self, other: &ImgRef<'a, U>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T, U> PartialEq<Img<Vec<U, Global>>> for ImgVec<T> where
T: PartialEq<U>,
[src]
T: PartialEq<U>,