Trait show_image::ImageData [−][src]
Allows a type to be displayed as an image.
This trait is implemented for tuples of (Data, ImageInfo)
if Data
can be converted into a Box<[u8]>
,
and for &(Data, ImageInfo)
if Data
is AsRef<[u8]>
.
Amongst others, that includes &[u8]
, Box<[u8]>
, Vec<u8>
.
Implementations for types from third-party libraries can be enabled using feature flags.
Required methods
fn data(self) -> Box<[u8]>
[src]
Get the image data as boxed slice.
This function takes self by value to prevent copying if possible. If the data can not be moved into a box, consider implementing the trait for references.
fn info(&self) -> Result<ImageInfo, String>
[src]
Get the ImageInfo
describing the binary data.
This function may fail at runtime if the data can not be described properly.
Provided methods
fn into_image_tuple(self) -> Result<(Box<[u8]>, ImageInfo), String> where
Self: Sized,
[src]
Self: Sized,
Convert the image into a tuple containing the image info and data.
Implementations on Foreign Types
impl ImageData for DynamicImage
[src]
impl ImageData for &DynamicImage
[src]
impl<P> ImageData for ImageBuffer<P, Vec<u8>> where
P: Pixel<Subpixel = u8> + 'static,
[src]
P: Pixel<Subpixel = u8> + 'static,
impl<P> ImageData for &ImageBuffer<P, Vec<u8>> where
P: Pixel<Subpixel = u8> + 'static,
[src]
P: Pixel<Subpixel = u8> + 'static,
impl ImageData for DrawTarget
[src]
impl ImageData for &DrawTarget
[src]
impl<'a> ImageData for Image<'a>
[src]
impl<'a> ImageData for &Image<'a>
[src]
impl ImageData for Result<TensorImage<'_>, String>
[src]
impl<Container> ImageData for (Container, ImageInfo) where
Box<[u8]>: From<Container>,
[src]
Box<[u8]>: From<Container>,
impl<Container> ImageData for (Container, &ImageInfo) where
Box<[u8]>: From<Container>,
[src]
Box<[u8]>: From<Container>,
impl<Container> ImageData for &(Container, ImageInfo) where
Container: AsRef<[u8]>,
[src]
Container: AsRef<[u8]>,
impl<Container> ImageData for &(Container, &ImageInfo) where
Container: AsRef<[u8]>,
[src]
Loading content...Container: AsRef<[u8]>,