Skip to main content

composite_spread

Function composite_spread 

Source
pub fn composite_spread(
    left: &RasterImage,
    right: &RasterImage,
    gutter_px: u32,
) -> Result<RasterImage, RenderError>
Expand description

Composite two rasterized pages SIDE BY SIDE into one image with an optional transparent gutter between them.

left is blitted at x = 0, right at x = left.width + gutter_px, both at y = 0. The gutter_px columns between the two pages remain fully transparent (the canvas is initialised to straight-alpha 0,0,0,0; no special fill is required). When gutter_px = 0 the output is byte-identical to the pre-gutter behavior.

The output canvas is width = left.width + gutter_px + right.width and height = max(left.height, right.height). Pixels are copied verbatim (straight-alpha RGBA8) — there is no blending, so the result is deterministic.

§Errors

Returns RenderError if the combined width overflows u32.