Package-level declarations

Types

Link copied to clipboard

PDF blend modes (ISO 32000-1 §11.3.5).

Link copied to clipboard
sealed class ColorSpace

Colour-space resolution + sample-to-RGB conversion (ISO 32000-1 §8.6).

Link copied to clipboard
data class ExtGState(val fillAlpha: Double? = null, val strokeAlpha: Double? = null, val blendMode: BlendMode? = null, val softMask: SoftMask? = null, val lineWidth: Double? = null)

Parsed Extended Graphics State (ISO 32000-1 §8.4.5).

Link copied to clipboard
data class GradientStops(val offsets: DoubleArray, val colors: Array<RgbColor>)

Parallel offset/colour arrays describing a sampled gradient.

Link copied to clipboard
class GraphicsStack(initial: GraphicsState = GraphicsState(), maxDepth: Int = 64)

Mutable stack façade. Holds the current state plus a save stack for q/Q.

Link copied to clipboard
data class GraphicsState(val ctm: Matrix = Matrix.IDENTITY, val strokeColor: RgbColor = RgbColor.BLACK, val fillColor: RgbColor = RgbColor.BLACK, val lineWidth: Double = 1.0, val text: TextState = TextState(), val fillColorSpace: ColorSpace = ColorSpace.DeviceGray, val strokeColorSpace: ColorSpace = ColorSpace.DeviceGray, val fillAlpha: Double = 1.0, val strokeAlpha: Double = 1.0, val blendMode: BlendMode = BlendMode.Normal, val softMask: SoftMask? = null, val fillPattern: PdfPattern? = null, val strokePattern: PdfPattern? = null, val dashArray: List<Double>? = null, val dashPhase: Double = 0.0)

Graphics state (ISO 32000-1 §8.4).

Link copied to clipboard

An XObject Image extracted from a /XObject resource entry (ISO 32000-1 §8.9.5).

Link copied to clipboard
data class Matrix(val a: Double, val b: Double, val c: Double, val d: Double, val e: Double, val f: Double)

2D affine transformation matrix as PDF uses it (ISO 32000-1 §8.3.4).

Link copied to clipboard

Backend that ignores everything — handy for benchmarks and content-stream sanity tests.

Link copied to clipboard
class PageRenderer(canvas: PdfCanvas, resolver: IndirectResolver)

The content-stream interpreter — translates parsed Operations into PdfCanvas draw calls while maintaining the full PDF graphics-state stack (ISO 32000-1 §8 + §9).

Link copied to clipboard
interface PdfCanvas

High-level drawing target. Implement this to add a new render backend; use PdfPage.renderTo to drive an existing one.

Link copied to clipboard
sealed class PdfFunction

A PDF function (ISO 32000-1 §7.10). Functions map an n-component input to an m-component output, typically used by shadings, transparency groups, tint transforms, and halftone phase calculations.

Link copied to clipboard
data class PdfPath(val segments: List<PdfPath.Segment>)

A geometric path accumulated by m/l/c/v/y/h/re operators before being painted by S/f/B/n.

Link copied to clipboard
sealed class PdfPattern

Parsed /Pattern resource entry (ISO 32000-1 §8.7).

Link copied to clipboard
sealed class PdfShading

A PDF shading (ISO 32000-1 §8.7.4). Shadings define smooth color transitions used as fills via the sh content-stream operator or via a shading pattern referenced by SCN/scn.

Link copied to clipboard

Records every device call — useful for tests + verifying operator dispatch.

Link copied to clipboard

A rectangle in PDF user-space — re-exposed here for the PdfCanvas surface.

Link copied to clipboard
data class RgbColor(val r: Double, val g: Double, val b: Double)

Simple RGB colour in 0,1³. Greyscale collapses to all-equal channels.

Link copied to clipboard
sealed class SoftMask

Soft mask source (ISO 32000-1 §11.6.5). Either explicitly disabled (None) or a MaskGroup containing a Form XObject whose rendered luminosity or alpha channel becomes the per-pixel mask.

Link copied to clipboard
data class TextState(val font: PdfFont? = null, val fontSize: Double = 12.0, val textMatrix: Matrix = Matrix.IDENTITY, val lineMatrix: Matrix = Matrix.IDENTITY, val charSpacing: Double = 0.0, val wordSpacing: Double = 0.0, val horizontalScaling: Double = 100.0, val leading: Double = 0.0, val rise: Double = 0.0, val renderingMode: Int = 0)

Per-BT/ET block text state — reset at BT, mutated by text operators.

Functions

Link copied to clipboard

Merge the non-null fields of ext into this state. Spec semantics for gs <name>: only entries present in the ExtGState override; everything else passes through.

Link copied to clipboard

Sample a PdfShading.Axial or PdfShading.Radial at evenly-spaced stops between domain[0] and domain[1]. Returns parallel t and RGB arrays the backend uses to build a gradient brush.

Link copied to clipboard

Assemble a Kind.RAW image's already-inflated samples into a flat RGBA8888 buffer (R,G,B,A per pixel, row-major, no padding) that a platform backend can wrap in a bitmap.