drawImage

open fun drawImage(image: KiteImageData, ctm: KiteMatrix, alpha: Double = 1.0)

Paint an XObject Image under ctm. PDF defines the image's bounds as the unit square (0..1, 0..1); the CTM already encodes the scale + position. Backends that can decode image paint the pixels; others draw a placeholder rather than throw.


open fun drawImage(image: KiteImageData, ctm: KiteMatrix, alpha: Double, blendMode: KiteBlendMode)

Paint an XObject Image as drawImage does, composited with blendMode. The blend mode of the graphics state applies to an image as to every other paint (ISO 32000-1, 11.3.5).

The default paints the image with drawImage inside an isolated transparency group that composites with blendMode. A group that holds one paint composites as that paint does, so the result is the same, only slower. A canvas that blends images itself overrides this, and its drawImage then calls this with KiteBlendMode.Normal.

The renderer calls this overload only for a blend mode other than Normal. A wrapper that delegates with by must override both overloads: Kotlin sends an overload that the wrapper does not override straight to the wrapped canvas.