/**
 * Shader Transition Math Utilities
 *
 * Sampling helpers and math primitives for rgb48le shader transitions.
 * Functions are ported from GLSL to operate on 16-bit little-endian pixel
 * buffers (6 bytes per pixel: R, G, B each stored as UInt16LE).
 */
/**
 * Convert an rgb48le buffer from HDR signal space to linear light, in-place.
 * Uses precomputed 65536-entry LUT for O(1) per-sample conversion.
 * @param transfer "pq" or "hlg"
 */
export declare function hdrToLinear(buf: Buffer, transfer: "pq" | "hlg"): void;
/**
 * Convert an rgb48le buffer from linear light back to HDR signal space, in-place.
 * Uses precomputed 65536-entry LUT for O(1) per-sample conversion.
 * @param transfer "pq" or "hlg"
 */
export declare function linearToHdr(buf: Buffer, transfer: "pq" | "hlg"): void;
/**
 * Convert an rgb48le buffer between HDR transfer functions, in-place.
 * Uses a composite 65536-entry LUT (source EOTF → linear → target OETF)
 * for O(1) per-sample conversion. No-op if from === to.
 */
export declare function convertTransfer(buf: Buffer, from: "pq" | "hlg", to: "pq" | "hlg"): void;
/**
 * Sample an rgb48le buffer at floating-point UV coordinates (0–1 range, clamped).
 * Uses bilinear interpolation between the 4 nearest pixels, equivalent to
 * GLSL `texture2D` with clamp-to-edge wrapping.
 *
 * @param buf  rgb48le buffer — w * h * 6 bytes
 * @param u    Horizontal coordinate in [0, 1]
 * @param v    Vertical coordinate in [0, 1]
 * @param w    Image width in pixels
 * @param h    Image height in pixels
 * @returns    [r, g, b] as 16-bit values (0–65535)
 */
export declare function sampleRgb48le(buf: Buffer, u: number, v: number, w: number, h: number): [number, number, number];
/**
 * Linear interpolate two 16-bit values. Equivalent to GLSL `mix(a, b, t)`.
 */
export declare function mix16(a: number, b: number, t: number): number;
/**
 * Clamp a value to the 16-bit unsigned range [0, 65535].
 */
export declare function clamp16(v: number): number;
/**
 * Hermite interpolation from GLSL `smoothstep(edge0, edge1, x)`.
 * Returns 0 for x ≤ edge0, 1 for x ≥ edge1, and a smooth S-curve between.
 */
export declare function smoothstep(edge0: number, edge1: number, x: number): number;
/**
 * Deterministic pseudo-random value in [0, 1).
 * Port of the GLSL idiom: `fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453)`.
 */
export declare function hash(x: number, y: number): number;
/**
 * Value noise with C2-continuous quintic interpolation.
 * Samples `hash()` at the 4 surrounding integer grid corners and blends
 * using the quintic fade f = f³(f(6f − 15) + 10).
 *
 * Returns a value in [0, 1].
 */
export declare function vnoise(px: number, py: number): number;
/**
 * Fractal Brownian motion — 5-octave accumulation of value noise.
 *
 * Each octave: accumulate `amplitude * vnoise(p)`, rotate p by 36.87°,
 * scale by 2.02, halve the amplitude. Matching the GLSL convention of
 * `mat2(0.8, 0.6, -0.6, 0.8)` for the rotation.
 */
export declare function fbm(px: number, py: number): number;
/** A transition function that blends two rgb48le buffers into an output buffer. */
export type TransitionFn = (from: Buffer, to: Buffer, output: Buffer, width: number, height: number, progress: number) => void;
/** Registry of all available transitions by name. */
export declare const TRANSITIONS: Record<string, TransitionFn>;
/**
 * Simple linear blend between two frames. Equivalent to GLSL `mix(from, to, progress)`.
 */
export declare const crossfade: TransitionFn;
/**
 * Flash-through-white transition: the outgoing scene brightens to white while
 * the incoming scene emerges from white, creating a bright flash at the midpoint.
 *
 * Port of the GLSL flash-through-white shader.
 */
export declare const flashThroughWhite: TransitionFn;
/**
 * RGB channel offset transition. Each channel is sampled at a different UV
 * offset, spreading apart as progress increases (outgoing) and converging
 * as progress approaches 1 (incoming). Port of the GLSL chromatic-split shader.
 */
export declare const chromaticSplit: TransitionFn;
/**
 * Circular iris reveal. A sharp edge expands from the center while golden
 * glow rings ripple outward at the boundary. Port of the GLSL sdf-iris shader.
 */
export declare const sdfIris: TransitionFn;
/**
 * Block displacement + scanlines + RGB channel split. Intensity peaks at the
 * midpoint (p=0.5) and decays at both ends. Port of the GLSL glitch shader.
 */
export declare const glitch: TransitionFn;
/**
 * Warm lens-flare from the upper-right corner. The incoming scene burns through
 * an overexposed flash, tonemapped with ACES and crossfaded with the outgoing
 * scene. Port of the GLSL light-leak shader.
 */
export declare const lightLeak: TransitionFn;
/**
 * FBM displacement warp. Both frames are warped in opposite directions by a
 * fractal noise field, then blended by a noise-threshold mask that sweeps
 * across the screen as progress advances. Port of the GLSL cross-warp-morph shader.
 */
export declare const crossWarpMorph: TransitionFn;
/**
 * Horizontal motion blur. The outgoing frame is sampled with offsets shifted
 * right (by progress*1.5) and the incoming frame is sampled with offsets shifted
 * left (by (1-progress)*1.5). Each direction uses 10 samples averaged together.
 * Port of the GLSL whip-pan shader.
 */
export declare const whipPan: TransitionFn;
/**
 * Radial zoom blur with chromatic aberration. Both frames are blurred along a
 * radial direction from center using 12 samples. R/G/B channels use slightly
 * different zoom factors (1.06, 1.0, 0.94) for chromatic aberration. The
 * outgoing frame zooms inward while the incoming zooms outward.
 * Port of the GLSL cinematic-zoom shader.
 */
export declare const cinematicZoom: TransitionFn;
/**
 * Radial warp toward center simulating a gravitational lens effect. The
 * outgoing frame is warped with chromatic separation, masked by a horizon
 * that depends on distance from center. Mixed to the incoming frame using
 * smoothstep(0.3, 0.9, progress). Port of the GLSL gravitational-lens shader.
 */
export declare const gravitationalLens: TransitionFn;
/**
 * Concentric wave distortion. Exponential wave functions create rings radiating
 * outward from center. Both frames are distorted — the outgoing with progress-
 * scaled amplitude, the incoming with (1-progress)-scaled amplitude. A warm
 * accent tint highlights wave peaks. Port of the GLSL ripple-waves shader.
 */
export declare const rippleWaves: TransitionFn;
/**
 * Rotational UV warp. The outgoing frame is rotated clockwise and the incoming
 * counter-clockwise. Rotation angle depends on distance from center and FBM
 * warp noise. Port of the GLSL swirl-vortex shader.
 */
export declare const swirlVortex: TransitionFn;
/**
 * Heat shimmer effect. Horizontal displacement based on a sin wave modulated by
 * FBM noise, fading toward the top of the screen. Both frames are displaced
 * independently, and a warm haze overlay fades as progress advances.
 * Port of the GLSL thermal-distortion shader.
 */
export declare const thermalDistortion: TransitionFn;
/**
 * FBM-driven UV warp with edge glow. Computes two layers of FBM (q and r) to
 * derive a warp direction. Both frames are displaced in opposite directions.
 * An edge-detection glow appears at the transition boundary.
 * Port of the GLSL domain-warp shader. Note: mix(B, A, e) ordering — e=1 shows A (from).
 */
export declare const domainWarp: TransitionFn;
export declare const ridgedBurn: TransitionFn;
//# sourceMappingURL=shaderTransitions.d.ts.map