/**
 * Alpha Blit — in-memory PNG decode + alpha compositing over rgb48le HDR frames.
 *
 * Replaces per-frame FFmpeg spawns for the two-pass HDR compositing path.
 * Uses only Node.js built-ins (zlib) — no additional dependencies.
 */
/**
 * Decode a PNG buffer to raw RGBA pixel data (8-bit per channel).
 *
 * Supports color type 6 (RGBA) and color type 2 (RGB) at 8-bit depth,
 * non-interlaced. Chrome's Page.captureScreenshot always emits this format.
 *
 * Returns a Uint8Array of width*height*4 bytes in RGBA order.
 */
export declare function decodePng(buf: Buffer): {
    width: number;
    height: number;
    data: Uint8Array;
};
/**
 * Decode a 16-bit RGB PNG (from FFmpeg) to an rgb48le Buffer.
 *
 * FFmpeg's `-pix_fmt rgb48le -c:v png` produces 16-bit RGB PNGs.
 * PNG stores 16-bit values in big-endian; this function swaps to little-endian
 * for the streaming encoder's rgb48le input format.
 *
 * Supports colorType 2 (RGB) and 6 (RGBA) at 16-bit depth, non-interlaced.
 */
export declare function decodePngToRgb48le(buf: Buffer): {
    width: number;
    height: number;
    data: Buffer;
};
/**
 * Alpha-composite a DOM RGBA overlay (8-bit sRGB) onto an HDR canvas
 * (rgb48le) in-place.
 *
 * DOM pixels are converted from sRGB to the target HDR signal space (HLG or PQ)
 * before blending so the composited output is uniformly encoded. Without this
 * conversion, sRGB content appears orange/washed in HDR playback.
 *
 * @param domRgba   Raw RGBA pixel data from decodePng() — width*height*4 bytes
 * @param canvas    HDR canvas in rgb48le format — width*height*6 bytes, mutated in-place
 * @param width     Canvas width in pixels
 * @param height    Canvas height in pixels
 * @param transfer  HDR transfer function — selects the correct sRGB→HDR LUT
 */
export declare function blitRgba8OverRgb48le(domRgba: Uint8Array, canvas: Buffer, width: number, height: number, transfer?: "hlg" | "pq" | "srgb"): void;
/**
 * Compute the alpha (0.0–1.0) for a point inside a rounded rectangle.
 * Returns 1.0 for interior pixels, 0.0 for exterior, and a smooth
 * transition at the corner edges (1px anti-aliasing).
 *
 * @param px     X coordinate (continuous, e.g. pixel center or subpixel)
 * @param py     Y coordinate
 * @param w      Rectangle width
 * @param h      Rectangle height
 * @param radii  Corner radii [topLeft, topRight, bottomRight, bottomLeft]
 */
export declare function roundedRectAlpha(px: number, py: number, w: number, h: number, radii: [number, number, number, number]): number;
/**
 * Copy a rectangular region of an rgb48le source onto an rgb48le canvas
 * at position (dx, dy). Clips to canvas bounds. Optional opacity blending
 * (0.0–1.0) over existing canvas content.
 *
 * @param canvas       Destination rgb48le buffer (canvasWidth * canvasHeight * 6 bytes)
 * @param source       Source rgb48le buffer (sw * sh * 6 bytes)
 * @param dx           Destination X offset on canvas
 * @param dy           Destination Y offset on canvas
 * @param sw           Source width in pixels
 * @param sh           Source height in pixels
 * @param canvasWidth  Canvas width in pixels (needed for stride calculation)
 * @param canvasHeight Canvas height in pixels (used to clip the destination region)
 * @param opacity      Optional opacity 0.0–1.0 (default 1.0 = fully opaque copy)
 */
export declare function blitRgb48leRegion(canvas: Buffer, source: Buffer, dx: number, dy: number, sw: number, sh: number, canvasWidth: number, canvasHeight: number, opacity?: number, borderRadius?: [number, number, number, number]): void;
/**
 * Apply a 2D affine transform to an rgb48le source and composite onto a canvas.
 *
 * For each destination pixel, the inverse transform maps back to source coordinates.
 * Bilinear interpolation samples the 4 nearest source pixels for smooth scaling/rotation.
 *
 * @param canvas     Destination rgb48le buffer, mutated in-place
 * @param source     Source rgb48le buffer (srcW * srcH * 6 bytes)
 * @param matrix     CSS transform matrix [a, b, c, d, tx, ty]
 * @param srcW       Source width in pixels
 * @param srcH       Source height in pixels
 * @param canvasW    Canvas width in pixels
 * @param canvasH    Canvas height in pixels
 * @param opacity    Optional opacity 0.0–1.0 (default 1.0)
 */
export declare function blitRgb48leAffine(canvas: Buffer, source: Buffer, matrix: number[], srcW: number, srcH: number, canvasW: number, canvasH: number, opacity?: number, borderRadius?: [number, number, number, number]): void;
/**
 * CSS `object-fit` values supported by the HDR image/video resampler.
 *
 * Matches the CSS spec subset that browsers actually render for replaced
 * elements (`<img>`, `<video>`). `scale-down` is normalized to whichever of
 * `none` or `contain` produces the smaller rendered size, mirroring the spec.
 */
export type ObjectFit = "fill" | "cover" | "contain" | "none" | "scale-down";
/**
 * Resample an `rgb48le` image buffer into a destination box of `dstW × dstH`,
 * honoring CSS `object-fit` and `object-position` semantics.
 *
 * Used at HDR-image setup so the per-frame blit can treat the buffer as if it
 * were sized to the element's layout box, mirroring how browsers render
 * `<img object-fit:…>` for SDR content. Pixels that fall outside the rendered
 * rectangle (the letterboxed/pillarboxed area for `contain` and `none`) are
 * filled with opaque black, matching the default background for replaced
 * elements without a transparent canvas.
 *
 * Sampling is bilinear, which is what `blitRgb48leAffine` already uses for
 * its on-canvas affine scale, so a one-time resample here matches the visual
 * quality the rest of the pipeline produces.
 *
 * Returns the source buffer unchanged when `dstW === srcW && dstH === srcH`
 * and `fit === "fill"`, so callers can call this unconditionally without
 * paying for an unnecessary copy.
 */
export declare function resampleRgb48leObjectFit(source: Buffer, srcW: number, srcH: number, dstW: number, dstH: number, fit?: ObjectFit, objectPosition?: string): Buffer;
/**
 * Coerce a CSS `object-fit` value to the supported subset. Anything else
 * (including `inherit`, `initial`, the empty string, or vendor-prefixed
 * values) collapses to `"fill"` — the CSS default for replaced elements.
 */
export declare function normalizeObjectFit(value: string | undefined): ObjectFit;
/**
 * Parse a CSS `matrix(a,b,c,d,e,f)` or `matrix3d(...)` string into a 6-element
 * 2D affine array.
 *
 * Returns null for `"none"`, empty input, or syntactically malformed values.
 *
 * The returned array maps to the CSS matrix: [a, b, c, d, tx, ty] where:
 *   | a  c  tx |     (a=scaleX, b=skewY, c=skewX, d=scaleY, tx/ty=translate)
 *   | b  d  ty |
 *   | 0  0  1  |
 *
 * `matrix3d` is the default output of `DOMMatrix.toString()` whenever any
 * ancestor in the chain has used a 3D transform — most importantly GSAP's
 * default `force3D: true`, which converts `translate(...)` into
 * `translate3d(..., 0)` and surfaces as `matrix3d(...)` even for purely 2D
 * animations. Without explicit handling we'd silently drop every transform
 * driven by GSAP. The 16 values are in column-major order:
 *
 *   matrix3d(m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34,
 *            m41, m42, m43, m44)
 *
 * The 2D affine corresponds to indices 0, 1, 4, 5, 12, 13 (m11, m12, m21,
 * m22, m41, m42). Z, perspective, and out-of-plane rotation components are
 * dropped — for true 3D transforms the resulting 2D projection is only
 * approximate, but for the GSAP `force3D: true` flat-matrix case it is exact.
 *
 * When a `matrix3d` arrives with Z-significant components (m13, m23, m31,
 * m32, m34, m43 != 0 or m33 != 1) we emit a one-time `console.warn` so
 * authors using real 3D transforms know the engine path is silently
 * flattening their scene rather than failing it.
 */
export declare function parseTransformMatrix(css: string): number[] | null;
//# sourceMappingURL=alphaBlit.d.ts.map