/** * What every painter of a comic page shares (#563, #565): the outline of a * panel as an SVG path, its seeded rough border, the grouping of balloons * into join groups, and how a balloon reads as text (its kind, its words, * its speaker's name) for the outputs that set the dialogue apart from the * art (tagged PDF, HTML, EPUB). Pure functions over the VDT. */ import type { ComicCastMember } from '../types.js'; import type { VDTComicBalloon, VDTComicPage, VDTComicPanel, VDTPoint } from '../vdt.js'; /** The affine matrix `[a, b, c, d, e, f]` (canvas order, page px, y down: * x' = a·x + c·y + e, y' = b·x + d·y + f) a balloon is painted through: * its letters leaned by `skew` degrees, then turned by `rotate` degrees * clockwise, both about the centre of its box. Undefined when it has * neither. */ export declare function comicBalloonMatrix(balloon: Pick): [number, number, number, number, number, number] | undefined; /** A small deterministic hash (FNV-1a) for seeding a rough border. */ export declare function comicHashString(s: string): number; /** A hand-drawn version of a closed outline: points every few px pushed * off the line by a seeded amount. */ export declare function roughOutline(points: readonly VDTPoint[], seed: number, amplitude: number, step: number): VDTPoint[]; /** The rough border of a panel (`border.style: 'rough'`): its polygon * wobbled with a seed taken from the panel, the same on every output. */ export declare function comicRoughBorder(panel: Pick): VDTPoint[]; /** A closed polyline as SVG path data. */ export declare function polygonPathData(points: readonly VDTPoint[]): string; /** A panel's outline as SVG path data (page px): its polygon, or a * rounded rectangle when it has a radius — the path the canvas clips to * and strokes (`comicPanelPath`). */ export declare function comicPanelPathData(panel: Pick): string; /** The path a panel's border is stroked along: its outline, or the * wobbled one of a rough border. Empty when it has no border. */ export declare function comicBorderPathData(panel: VDTComicPanel): string; /** What a balloon is to a reader: words a character says or thinks * (`speech`), narration in a box (`caption`, also an editor's note), or a * sound effect drawn into the art (`sfx`). Told from its style (`sfx`, * `caption`, `note`) and whether it has a speaker. */ export type ComicBalloonKind = 'speech' | 'caption' | 'sfx'; export declare function comicBalloonKind(balloon: Pick & { kind?: VDTComicBalloon['kind']; }): ComicBalloonKind; /** The words of a balloon as plain text: its lines in order, joined by a * space, or by nothing between two Chinese or Japanese characters (a * line break there is no word space). */ export declare function comicBalloonText(balloon: Pick): string; /** The name a speaker is shown under in the text outputs: its * `comics.cast` entry's `name`, else its id. */ export declare function comicSpeakerName(speaker: string, cast: readonly ComicCastMember[] | undefined): string; /** The balloons of a page as join groups, in reading order: each group's * members in order, the first (the one with the `shape`, when the group * has an outline) first. A group never spans two panels. */ export declare function comicBalloonGroups(balloons: readonly VDTComicBalloon[]): VDTComicBalloon[][]; /** * Whether a panel of one page of a two-page spread (`comic.spread`) is the * second half of a panel that crosses the spine: the part on the page read * second (the right page left to right, the left page right to left). Its * picture is painted, but it is read, listed and named once, with the half * on the page read first. */ export declare function comicPanelContinues(comic: Pick, panel: Pick): boolean; /** Whether `b` is the other page of the spread `a` belongs to. */ export declare function isComicSpreadPartner(a: Pick, b: Pick | undefined): boolean; /** * The two pages of a spread joined back into one comic, in the left page's * coordinates (the right page set against it at the spine): each panel * once, a panel crossing the spine whole again (its two halves' outlines * joined; its picture's box is the same on both), balloons of both pages, * in reading order. What an output that does not show pages reads (the * reflowable EPUB). */ export declare function joinComicSpread(left: VDTComicPage, right: VDTComicPage): VDTComicPage; //# sourceMappingURL=paint.d.ts.map