Trait GetPixel

pub trait GetPixel: Sync

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

Associated Types

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

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