mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-20 09:15:26 +00:00
Bring storytold/pdfcraft#2974 (source commit bae69819594a6385a027fec1f67e6b3c36c259b4) onto the vendored hayro-interpret and hayro. Knockout transparency groups (/K true) knock out: while one is innermost, fills, strokes, glyph outlines and shadings are drawn with Compose::Copy, weighted by coverage. An unmasked image's rectangle and a nested group's shape are cleared before their layer composites; the nested group's shape comes from an erase pass over its content. Masked images and stencils composite as before. Code comments label the change "Knockout patch (pdfcraft #2974)": the pull request numbers it hayro-interpret patch 39 and hayro patch 19, which pdfcraft may renumber. The erase pass resolves resources with Resources::from_scope, as this tree's form drawing does. crates/pdf/tests/knockout.rs adapts the pull request's test to the raster path (without its preview case: craft-pdf has no preview mode). A plate-mode test checks that a knockout group of two 50% squares separates with only the top square in the overlap. Options documents that color_replacement also maps plate films. Ledger, NOTICE and the source manifests are updated. Co-authored-by: mtlcl410 <2368091+mtlcl410@users.noreply.github.com>