Sample

Trait Sample 

Source
pub trait Sample<'a, Space: CoordinateSpace> {
    type Output: 'a;

    // Required method
    fn sample(
        &mut self,
        rect: &Rectangle<Space>,
    ) -> impl Iterator<Item = (Coordinates<Space>, &'a mut Self::Output)>;
}
Expand description

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

Required Associated Types§

Source

type Output: 'a

The type of pixel this sampler supports

Required Methods§

Source

fn sample( &mut self, rect: &Rectangle<Space>, ) -> impl Iterator<Item = (Coordinates<Space>, &'a mut Self::Output)>

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.

Implementations on Foreign Types§

Source§

impl<'a, Pixel: 'a> Sample<'a, LinearSpace> for [Pixel]

Source§

type Output = Pixel

Source§

fn sample( &mut self, rect: &Rectangle<LinearSpace>, ) -> impl Iterator<Item = (Coordinates<LinearSpace>, &'a mut Self::Output)>

Source§

impl<'a, Pixel: 'a, const N: usize> Sample<'a, LinearSpace> for [Pixel; N]

Source§

type Output = Pixel

Source§

fn sample( &mut self, rect: &Rectangle<LinearSpace>, ) -> impl Iterator<Item = (Coordinates<LinearSpace>, &'a mut Self::Output)>

Implementors§