Trait machine_vision_formats::ImageData[][src]

pub trait ImageData<F> {
    fn width(&self) -> u32;
fn height(&self) -> u32;
fn buffer_ref(&self) -> ImageBufferRef<'_, F>;
fn buffer(self) -> ImageBuffer<F>; fn image_data(&self) -> &[u8] { ... } }
Expand description

An image.

The pixel format is specified as the type F.

Required methods

Number of pixel columns in the image. Note: this is not the stride.

Number of pixel rows in the image.

Returns the image buffer specified by pixel format F.

Ideally, prefer using this over image_data().

This does not copy the data but returns a view of it.

Returns the image buffer specified by pixel format F.

Implementations should move the data without copying it if possible. The implementation may copy the data if needed. To guarantee a move with no copy, use the Into<Vec<u8>> trait required by the OwnedImage trait.

Provided methods

Returns the raw image data as specified by pixel format F.

This does not copy the data but returns a view of it.

This method may be deprecated in factor of buffer_ref.

Implementors