Trait plot_interface::dependency::image::GenericImageView
[−]pub trait GenericImageView {
type Pixel: Pixel;
fn dimensions(&self) -> (u32, u32);
fn bounds(&self) -> (u32, u32, u32, u32);
fn get_pixel(&self, x: u32, y: u32) -> Self::Pixel;
fn width(&self) -> u32 { ... }
fn height(&self) -> u32 { ... }
fn in_bounds(&self, x: u32, y: u32) -> bool { ... }
unsafe fn unsafe_get_pixel(&self, x: u32, y: u32) -> Self::Pixel { ... }
fn pixels(&self) -> Pixels<'_, Self>ⓘNotable traits for Pixels<'a, I>impl<'a, I> Iterator for Pixels<'a, I> where
I: GenericImageView, type Item = (u32, u32, <I as GenericImageView>::Pixel);
{ ... }
fn view(&self, x: u32, y: u32, width: u32, height: u32) -> SubImage<&Self> { ... }
}
Expand description
Trait to inspect an image.
use image::{GenericImageView, Rgb, RgbImage};
let buffer = RgbImage::new(10, 10);
let image: &dyn GenericImageView<Pixel=Rgb<u8>> = &buffer;
Required Associated Types
Required Methods
fn dimensions(&self) -> (u32, u32)
fn dimensions(&self) -> (u32, u32)
The width and height of this image.
Provided Methods
Returns true if this x, y coordinate is contained inside the image.
unsafe fn unsafe_get_pixel(&self, x: u32, y: u32) -> Self::Pixel
unsafe fn unsafe_get_pixel(&self, x: u32, y: u32) -> Self::Pixel
Returns an Iterator over the pixels of this image. The iterator yields the coordinates of each pixel along with their value