Struct imgref::Img [] [src]

pub struct Img<Container> {
    pub buf: Container,
    pub stride: usize,
    pub width: u32,
    pub height: u32,
}

Basic struct used for both owned (alias ImgVec) and borrowed (alias ImgRef) image fragments.

Fields

Storage for the pixels. Usually Vec<Pixel> or &[Pixel]. See ImgVec and ImgRef.

Number 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 of the image in pixels.

Note that this isn't same as the width of the row in the buf, see stride

Height of the image in pixels.

Methods

impl<'a, T> Img<&'a [T]>
[src]

impl<T> Img<T>
[src]

impl<OldContainer> Img<OldContainer>
[src]

Trait Implementations

impl<Container: Clone> Clone for Img<Container>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<Pixel, Container> ImgExt<Pixel> for Img<Container> where
    Container: AsRef<[Pixel]>, 
[src]

Width of the image in pixels. Read more

Height of the image in pixels.

Number of pixels to skip in the container to advance to the next row. Note the last row may have fewer pixels than the stride. Read more

Height in number of full strides. If the underlying buffer is not an even multiple of strides, the last row is ignored. Read more

Maximum possible width of the data, including the stride. Read more

impl<'a, T> Copy for Img<&'a [T]>
[src]

impl<Container> IntoIterator for Img<Container> where
    Container: IntoIterator
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more