Sample

Trait Sample 

Source
pub trait Sample {
    type Pixel: HardwarePixel;

    // Required method
    fn sample(
        &mut self,
        rect: &Rectangle<Virtual>,
    ) -> impl PixelView<Pixel = Self::Pixel>;
}
Expand description

Types that can provide direct hardware access to individual pixels within a given Virtual rectangle shaped selection

Required Associated Types§

Source

type Pixel: HardwarePixel

The underlying hardware pixel type

Required Methods§

Source

fn sample( &mut self, rect: &Rectangle<Virtual>, ) -> impl PixelView<Pixel = Self::Pixel>

Provides a PixelView over the given Rectangle selection

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'a, P: HardwarePixel, PB: IndexMut<usize, Output = P>> Sample for LinearSampler<'a, P, PB>

Source§

type Pixel = P

Source§

impl<'a, P: HardwarePixel, PB: IndexMut<usize, Output = P>> Sample for StrideSampler<'a, P, PB>

Source§

type Pixel = P