pub trait Compositor<D: DrawTarget<Color = Rgb565>> {
// Required method
fn plot(
target: &mut D,
x: i32,
y: i32,
color: Rgb565,
opacity: u8,
blend: BlendMode,
backdrop: Rgb565,
) -> Result<(), D::Error>;
}Expand description
Pixel-plotting policy for a RenderCtx. Selected by the ctx’s C type
parameter so the same drawing calls composite differently depending on
the target’s capabilities — with no runtime branch and no specialization.
Dither(the default) approximates translucency with ordered dithering and works on any write-onlyDrawTarget.Blendperforms true per-pixel alpha compositing and requires a readback-capable target (PixelRead), e.g. aFramebuffer.
plot receives screen-space coords already transformed and clipped, the
layer-combined opacity, and the active layer blend mode + backdrop.
Required Methods§
fn plot( target: &mut D, x: i32, y: i32, color: Rgb565, opacity: u8, blend: BlendMode, backdrop: Rgb565, ) -> Result<(), D::Error>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".