pub type ImgVec<Pixel> = Img<Vec<Pixel>>;Expand description
Owned image type (from imgref).
Owns its pixel buffer. 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()).
Aliased Type§
pub struct ImgVec<Pixel> {
pub buf: Vec<Pixel>,
pub stride: usize,
pub width: u32,
pub height: u32,
}Fields§
§buf: Vec<Pixel>Storage for the pixels. Usually Vec<Pixel> or &[Pixel]. See ImgVec and ImgRef.
Note that future version will make this field private. Use .rows() and .pixels() iterators where possible, or buf()/buf_mut()/into_buf().
stride: usizeNumber of pixels to skip in the container to advance to the next row.
Note: pixels between width and stride may not be usable, and may not even exist in the last row.
width: u32Width of the image in pixels.
Note that this isn’t same as the width of the row in the buf, see stride
height: u32Height of the image in pixels.