Type Definition imgref::ImgRef[][src]

type ImgRef<'a, Pixel> = Img<&'a [Pixel]>;
Expand description

Reference to pixels inside another image. Pass this structure by value (i.e. ImgRef, not &ImgRef).

Only width of pixels of every stride can be modified. The buf may be longer than height*stride, but the extra space should be ignored.

Implementations

Make a reference for a part of the image, without copying any pixels.

Panics

It will panic if sub_image is outside of the image area (left + width must be <= container width, etc.)

Iterate over whole rows of pixels as slices

Panics

If stride is 0

See also pixels()

👎 Deprecated:

Size of this buffer is unpredictable. Use .rows() instead

Deprecated

Note: it iterates all pixels in the underlying buffer, not just limited by width/height.

Returns a reference to the buffer, width, height. Guarantees that the buffer is contiguous, i.e. it’s width*height elements long, and [x + y*width] addresses each pixel.

It will create a copy if the buffer isn’t contiguous (width != stride). For a more efficient version, see into_contiguous_buf()

Iterate width*height pixels in the Img, ignoring padding area

Panics

if width is 0

Iterate width*height pixels in the Img, by reference, ignoring padding area

Panics

if width is 0

Trait Implementations

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.