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
fn buffer_ref(&self) -> ImageBufferRef<'_, F>
fn buffer_ref(&self) -> ImageBufferRef<'_, F>
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.
fn buffer(self) -> ImageBuffer<F>
fn buffer(self) -> ImageBuffer<F>
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
fn image_data(&self) -> &[u8]
fn image_data(&self) -> &[u8]
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
.