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
].
The pixel tuple containing f32
, f16
, u32
and Sample
values.
The length of the tuple must match the number of channels in the image.
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.