[][src]Trait ffimage::core::traits::GenericImageView

pub trait GenericImageView<'a> {
    type T: Pixel;
    type SubImage;
    fn width(&self) -> u32;
fn height(&self) -> u32;
fn pixel(&self, x: u32, y: u32) -> Option<Self::T>;
fn view(
        &'a self,
        x: u32,
        y: u32,
        width: u32,
        height: u32
    ) -> Option<Self::SubImage>; }

View into an image, provides read-only pixel access

Associated Types

type T: Pixel

Pixel type

type SubImage

Type of sub images

Loading content...

Required methods

fn width(&self) -> u32

Width in pixels

fn height(&self) -> u32

Height in pixels

fn pixel(&self, x: u32, y: u32) -> Option<Self::T>

Returns the pixel at the specified coordinates

fn view(
    &'a self,
    x: u32,
    y: u32,
    width: u32,
    height: u32
) -> Option<Self::SubImage>

Returns a sub image view backed by the same data

Loading content...

Implementors

impl<'a, I: GenericImageView<'a>> GenericImageView<'a> for SubImageView<'a, I>[src]

type T = I::T

type SubImage = Self

impl<'a, T: Pixel + 'a> GenericImageView<'a> for ImageBuffer<T>[src]

type T = T

type SubImage = SubImageView<'a, Self>

impl<'a, T: Pixel + 'a> GenericImageView<'a> for ImageView<'a, T>[src]

type T = T

type SubImage = SubImageView<'a, Self>

impl<'a, T: Pixel + 'a> GenericImageView<'a> for ImageViewMut<'a, T>[src]

type T = T

type SubImage = SubImageView<'a, Self>

Loading content...