/** * Pure, DOM-free per-channel ink-coverage math for the separations panel. * * Computes the page-average coverage of each ink (mean ink % over every * sampled pixel, `[0, 100]`) from an RGBA buffer — process inks via the * closed-form CMYK approximation, spots via the cosine-similarity estimate. * Extracted (like `rasterCoords.ts` / `cappedBacking.ts`) so it unit-tests * without pdf.js or a canvas, and so the in-browser separations service and * any other consumer share one definition of "coverage". * * The two per-pixel primitives are **injected** (`CoverageMath`) rather than * imported, so this file stays off `browser/index.ts`'s circular-import * surface (the TDZ hazard `constants.ts` exists to avoid) and the aggregation * logic is testable with trivial stubs. */ /** Minimal ink shape the coverage math needs (a subset of `DetectedInk`). */ export interface CoverageInk { name: string; type: "process" | "spot"; altRgb: [number, number, number]; } /** The per-pixel primitives, injected so this module imports nothing. */ export interface CoverageMath { rgbToCmyk(r: number, g: number, b: number): { c: number; m: number; y: number; k: number; }; estimateInkCoverage(r: number, g: number, b: number, altR: number, altG: number, altB: number): number; } /** * Page-average coverage per channel from an RGBA buffer, keyed by `ink.name`. * * Process inks → mean of the closed-form CMYK plate value; spots → mean of the * cosine-similarity estimate. Both averaged over the sampled pixels and scaled * to `[0, 100]`. `step` strides the pixel grid (1 → every pixel) so a large * raster can be sub-sampled without changing the mean in expectation. Returns * `{}` for an empty ink list or a zero-area buffer. */ export declare function channelCoverageFromRaster(rgba: Uint8ClampedArray | ReadonlyArray, width: number, height: number, inks: ReadonlyArray, math: CoverageMath, step?: number): Record; //# sourceMappingURL=channelCoverage.d.ts.map