import { ShapeGradient, VectorShape } from '../core/vector.js'; import { PdfRef } from './objects.js'; import { PdfDocument } from './writer.js'; interface Bbox { readonly minX: number; readonly minY: number; readonly maxX: number; readonly maxY: number; } /** * The local-space bounding box of a shape's paths (y-up). * * @returns The bounding box, or `undefined` for an empty/degenerate shape (where * no gradient can be placed). */ export declare function shapeBbox(shape: VectorShape): Bbox | undefined; /** * Build the PatternType-2 shading pattern object (axial or radial) for a * DrawingML gradient (EP16b) and add it to `doc`. The pattern's `/Matrix` is the * shape's CTM and the shading `/Coords` are in the shape's local space. * * @param gradient The gradient fill (kind, angle, colour stops). * @param bbox The shape's local-space bounding box, from {@link shapeBbox}. * @param ctm The shape's current transformation matrix, used as `/Matrix`. * @returns A reference to the `/Pattern` object, for a `/Pattern cs /Pn scn` fill. */ export declare function buildGradientPattern(doc: PdfDocument, gradient: ShapeGradient, bbox: Bbox, ctm: readonly [number, number, number, number, number, number]): PdfRef; /** * §11.6.5.2 — the luminosity soft mask a gradient with per-stop TRANSPARENCY is * painted through. * * A PDF shading has one colour per point and no alpha, so a gradient that fades * out is drawn as the colour shading masked by a second shading of the same * geometry whose GREY is the transparency: white where the stop is opaque, * black where it is clear. 45541_Footer's master lays a white band down the * left of every slide that starts half transparent, and painted flat it covered * the artwork behind it. * * @param doc The document to add the objects to. * @param gradient The gradient fill. * @param bbox The shape's local-space bounding box. * @param ctm The shape's CTM, as the form's `/Matrix`. * @returns The mask form XObject, or `undefined` when every stop is opaque or * the sweep has no shading type that can carry a mask. */ export declare function buildGradientAlphaMask(doc: PdfDocument, gradient: ShapeGradient, bbox: Bbox, ctm: readonly [number, number, number, number, number, number]): PdfRef | undefined; export {};