Skip to main content

PixelRead

Trait PixelRead 

Source
pub trait PixelRead: DrawTarget {
    // Required method
    fn get_pixel(&self, point: Point) -> Self::Color;
}
Expand description

Capability trait for draw targets that can read back a pixel they’ve already written. Optional: the default opacity/blend APIs on RenderCtx only require DrawTarget and approximate translucency with ordered dithering, so they keep working on write-only displays. Implementing PixelRead additionally unlocks the *_true_alpha methods, which composite against the destination’s actual current contents instead of dithering.

Required Methods§

Source

fn get_pixel(&self, point: Point) -> Self::Color

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<const N: usize> PixelRead for Framebuffer<N>