[−][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()
).
Methods
impl<'a, T: Copy> ImgVec<T>
[src]
ⓘImportant traits for PixelsIter<'a, T>pub fn pixels(&self) -> PixelsIter<T>
[src]
impl<T> ImgVec<T>
[src]
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.
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.
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
ⓘImportant traits for RowsIter<'a, T>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.
ⓘImportant traits for RowsIterMut<'a, T>pub fn rows_mut(&mut self) -> RowsIterMut<T>
[src]
Iterate over rows of the image as mutable slices
Each slice is guaranteed to be exactly width
pixels wide.