applySoftMask

open fun applySoftMask(kind: SoftMask.Kind, maskBBox: Rectangle, maskCtm: Matrix, render: () -> Unit, renderMask: (PdfCanvas) -> Unit)

Apply a soft mask to the content rendered inside render (ISO 32000-1 §11.6.5). The default implementation just calls render — backends without offscreen compositing fall back to painting through the mask.

Concrete implementations: open a saveLayer for the content, render() it, then over-paint via renderMask using DstIn blend mode so the mask's alpha determines the visible region.

Honest scope: KitePDF v0.0.x's ComposeCanvas implements the Alpha SMask kind correctly and approximates Luminosity as if it were alpha. True luminosity-to-alpha conversion requires a custom shader and is on the roadmap.