pub trait GetPixel: Sync {
    type Pixel;

    // Required method
    fn get_pixel(&self, position: Vec2<usize>) -> Self::Pixel;
}
Expand description

Define how to get a pixel from your custom pixel storage. Can be a closure of type [Sync + Fn(Vec2<usize>) -> YourPixel].

Required Associated Types§

source

type Pixel

The pixel tuple containing f32, f16, u32 and Sample values. The length of the tuple must match the number of channels in the image.

Required Methods§

source

fn get_pixel(&self, position: Vec2<usize>) -> Self::Pixel

Inspect a single pixel at the requested position. Will be called exactly once for each pixel in the image. The position will not exceed the image dimensions. Might be called from multiple threads at the same time.

Implementors§

source§

impl<F, P> GetPixel for Fwhere F: Sync + Fn(Vec2<usize>) -> P,

§

type Pixel = P

source§

impl<Px> GetPixel for PixelVec<Px>where Px: Clone + Sync,

§

type Pixel = Px