Trait fast_image_resize::ImageView

source ·
pub unsafe trait ImageView {
    type Pixel: InnerPixel;

    // Required methods
    fn width(&self) -> u32;
    fn height(&self) -> u32;
    fn iter_rows(&self, start_row: u32) -> impl Iterator<Item = &[Self::Pixel]>;

    // Provided methods
    fn iter_2_rows(
        &self,
        start_y: u32,
        max_rows: u32,
    ) -> ArrayChunks<impl Iterator<Item = &[Self::Pixel]>, 2>  { ... }
    fn iter_4_rows(
        &self,
        start_y: u32,
        max_rows: u32,
    ) -> ArrayChunks<impl Iterator<Item = &[Self::Pixel]>, 4>  { ... }
    fn iter_rows_with_step(
        &self,
        start_y: f64,
        step: f64,
        max_rows: u32,
    ) -> impl Iterator<Item = &[Self::Pixel]> { ... }
}
Expand description

A trait for getting access to image data.

§Safety

The length of the image rows returned by methods of this trait must be equal or greater than the image width.

Required Associated Types§

Required Methods§

source

fn width(&self) -> u32

source

fn height(&self) -> u32

source

fn iter_rows(&self, start_row: u32) -> impl Iterator<Item = &[Self::Pixel]>

Returns iterator by slices with image rows.

Provided Methods§

source

fn iter_2_rows( &self, start_y: u32, max_rows: u32, ) -> ArrayChunks<impl Iterator<Item = &[Self::Pixel]>, 2>

Returns iterator by arrays with two image rows.

source

fn iter_4_rows( &self, start_y: u32, max_rows: u32, ) -> ArrayChunks<impl Iterator<Item = &[Self::Pixel]>, 4>

Returns iterator by arrays with four image rows.

source

fn iter_rows_with_step( &self, start_y: f64, step: f64, max_rows: u32, ) -> impl Iterator<Item = &[Self::Pixel]>

Returns iterator by slices with image rows selected from the image with the given step.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'a, P: InnerPixel> ImageView for TypedImage<'a, P>

§

type Pixel = P

source§

impl<'a, P: InnerPixel> ImageView for TypedImageRef<'a, P>

§

type Pixel = P

source§

impl<'a, V: ImageView> ImageView for TypedCroppedImage<'a, V>

§

type Pixel = <V as ImageView>::Pixel

source§

impl<'a, V: ImageViewMut> ImageView for TypedCroppedImageMut<'a, V>

§

type Pixel = <V as ImageView>::Pixel