Skip to main content

ImageSource

Trait ImageSource 

Source
pub trait ImageSource {
    // Required methods
    fn span(&mut self, x: i32, y: i32, len: u32) -> &[u8] ;
    fn next_x(&mut self) -> &[u8] ;
    fn next_y(&mut self) -> &[u8] ;
}
Expand description

Trait for image pixel sources used by span image filters.

All image accessor types implement this trait, providing a common interface for the span generators to read pixels.

Required Methods§

Source

fn span(&mut self, x: i32, y: i32, len: u32) -> &[u8]

Begin reading a span at (x, y) with len pixels. Returns first pixel.

Source

fn next_x(&mut self) -> &[u8]

Advance to the next pixel in the x direction.

Source

fn next_y(&mut self) -> &[u8]

Advance to the next row (y+1), resetting x to the span start.

Implementors§

Source§

impl<const PIX_WIDTH: usize> ImageSource for ImageAccessorClip<'_, PIX_WIDTH>

Source§

impl<const PIX_WIDTH: usize> ImageSource for ImageAccessorClone<'_, PIX_WIDTH>

Source§

impl<const PIX_WIDTH: usize> ImageSource for ImageAccessorNoClip<'_, PIX_WIDTH>

Source§

impl<const PIX_WIDTH: usize, WX: WrapMode, WY: WrapMode> ImageSource for ImageAccessorWrap<'_, PIX_WIDTH, WX, WY>