import { PNG } from "pngjs"; import type { PageReviewCaptureFidelity } from "./page-review-pack.js"; /** The band-diff reuse threshold doubles as the fidelity threshold: a probe * that would count as "unchanged" for reuse counts as "agrees" here. */ export declare const CAPTURE_FIDELITY_MISMATCH_THRESHOLD = 0.001; export type FidelityProbe = PageReviewCaptureFidelity["probed"][number]; /** * Pixel-compare a band cropped from the full-page screenshot with the same * band captured by scrolling. `mismatch_ratio` is measured over the area the * two images share (pixelmatch, anti-aliasing tolerant, the same math as * band-diff reuse). `size_mismatch` is set when the two differ by more than a * rounding pixel in either dimension; the caller treats that probe as * inconclusive rather than as proof the full page is wrong, because a page * wider than the viewport cannot be rendered whole by scrolling. */ export declare function compareBand(fullPageCrop: PNG, scrolledCapture: PNG, threshold?: number): { mismatch_ratio: number; exceeds: boolean; size_mismatch: boolean; }; /** * Turn the probe results into the record the context carries. Any probe over * the threshold means the full-page screenshot is not trustworthy for this * context and the tiles must come from scrolled captures. */ export declare function decideFidelity(probes: readonly FidelityProbe[], threshold?: number): PageReviewCaptureFidelity; /** * Join PNG pieces top to bottom into one image. The output takes the first * piece's width; a narrower piece leaves transparent pixels on its right, a * wider one is cropped. Used to assemble a band taller than the viewport from * viewport-height captures (see `Browser.captureRegionByScroll`). */ export declare function stitchPngRows(pieces: readonly Buffer[]): Buffer; /** Width and height from a PNG header, without decoding the image. */ export declare function pngDimensions(buffer: Buffer): { width: number; height: number; }; /** Crop already decoded native pixels; callers reuse one decode across all selected rectangles. */ export declare function cropNativePng(png: PNG, rect: { x: number; y: number; width: number; height: number; }): Buffer; //# sourceMappingURL=capture-fidelity.d.ts.map