CoreGraphicsCanvas

class CoreGraphicsCanvas(ctx: CGContextRef) : KiteCanvas

KiteCanvas backed by an iOS / macOS CGContextRef. Pure CoreGraphics: no Compose, no Skia. The natural choice for native iOS apps using UIKit or SwiftUI; pass the context from your custom UIView's drawRect: or the UIGraphicsImageRenderer.image { ctx in … } block straight in.

Pair with ApplePdfRasterizer for the "give me a PNG" headless use case.

Memory: every Core Foundation / Core Graphics ref we allocate (gradient, colour space, image, CFData) is paired with a release call. Nothing escapes. Kotlin/Native objects don't leak, and we never hand a CG ref to caller code.

Constructors

Link copied to clipboard
constructor(ctx: CGContextRef)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open override fun applySoftMask(kind: SoftMask.Kind, maskBBox: Rectangle, maskCtm: Matrix, render: () -> Unit, renderMask: (KiteCanvas) -> Unit)
Link copied to clipboard
open override fun beginPage(widthPt: Double, heightPt: Double, deviceCtm: Matrix)
Link copied to clipboard
open override fun beginTransparencyGroup(bbox: Rectangle, ctm: Matrix, isolated: Boolean, knockout: Boolean, alpha: Double, blendMode: BlendMode)
Link copied to clipboard
open override fun drawGlyphs(glyphs: List<TextGlyph>, fontSize: Double, unitsPerEm: Int, hasOutlines: Boolean, fontSpec: FontSpec, textToDevice: Matrix, color: RgbColor, alpha: Double, blendMode: BlendMode)
Link copied to clipboard
open override fun drawImage(image: ImageXObject, ctm: Matrix, alpha: Double)
Link copied to clipboard
open override fun endPage()
Link copied to clipboard
open override fun endTransparencyGroup()
Link copied to clipboard
open override fun fillPath(path: KitePath, ctm: Matrix, color: RgbColor, evenOdd: Boolean, alpha: Double, blendMode: BlendMode)
Link copied to clipboard
open override fun fillShading(shading: KiteShading, ctm: Matrix, clipPath: KitePath?, alpha: Double, blendMode: BlendMode)
Link copied to clipboard
open override fun popClip()
Link copied to clipboard
open override fun pushClip(path: KitePath, ctm: Matrix, evenOdd: Boolean)
Link copied to clipboard
open override fun strokePath(path: KitePath, ctm: Matrix, color: RgbColor, lineWidth: Double, alpha: Double, blendMode: BlendMode, dashArray: List<Double>?, dashPhase: Double, lineCap: Int, lineJoin: Int, miterLimit: Double)