pub struct Composite { /* private fields */ }Expand description
Draw an overlay over a base.
Input order is [base, overlay], matching the reading order of “composite
this over that”. The two may differ in format: the result has the base’s
depth, gains colour when the overlay has it and the base is grey, and
gains alpha when the blend can make an opaque base translucent.
Implementations§
Source§impl Composite
impl Composite
Sourcepub const fn new(placement: Placement, blend: Blend) -> Self
pub const fn new(placement: Placement, blend: Blend) -> Self
Draw the overlay where placement says, combined by blend.
Sourcepub const fn at(x: i64, y: i64, blend: Blend) -> Self
pub const fn at(x: i64, y: i64, blend: Blend) -> Self
Draw the overlay with its top-left corner at (x, y) in base
coordinates.
Negative offsets are allowed: the overlay is clipped to the base rather than rejected, which is what makes “centre a watermark” expressible without the caller doing the clipping arithmetic.
Trait Implementations§
Source§impl Op for Composite
impl Op for Composite
Source§fn rescaled(&self) -> Option<Arc<dyn Op>>
fn rescaled(&self) -> Option<Arc<dyn Op>>
Never rescaled, for two independent reasons: the overlay position is in pixels, and the second input is a separate image that would not be reduced alongside the first.
Source§fn output_descriptor(
&self,
inputs: &[ImageDescriptor],
) -> Result<ImageDescriptor>
fn output_descriptor( &self, inputs: &[ImageDescriptor], ) -> Result<ImageDescriptor>
Source§fn input_regions(
&self,
output: Region,
inputs: &[ImageDescriptor],
) -> Result<Vec<Region>>
fn input_regions( &self, output: Region, inputs: &[ImageDescriptor], ) -> Result<Vec<Region>>
output. Read more