/** * HDRBlitCanvas - an on-screen WebGL2 canvas that displays a decoded frame * with the same HDR colorspace handling as the main CanvasRenderer. * * Why this exists: poster + hover-preview frames are HDR (rec2100-pq). The old * path encoded them to an 8-bit SDR JPEG via canvas.toBlob and showed an , * which clamps PQ highlights → the picture looked dull next to the live video. * A 2D canvas cannot carry a rec2100-pq tag (only srgb/display-p3), so to keep * full HDR peak brightness the display surface must be a WebGL canvas tagged * rec2100-pq — exactly what CanvasRenderer does to composite to screen. * * This class is a thin passthrough blitter: it uploads a source (another canvas, * a VideoFrame, or raw RGBA) as a texture and draws it 1:1 onto its own canvas, * which is tagged with the appropriate colorspace. The heavy decode + (for * non-Chromium) PQ tone-mapping already happened in ThumbnailRenderer; here we * only transport the pixels to screen without an SDR round-trip. */ export interface HDRBlitOptions { /** Source color primaries (e.g. "bt2020"). Drives colorspace selection. */ colorPrimaries?: string; /** Source transfer characteristics (e.g. "pq", "hlg"). */ colorTransfer?: string; /** Whether HDR upgrade is allowed; false forces srgb. Default true. */ hdrEnabled?: boolean; } export declare class HDRBlitCanvas { readonly canvas: HTMLCanvasElement; private gl; private program; private texture; private vao; private appliedColorSpace; constructor(canvas?: HTMLCanvasElement); private detectChromium; /** * Choose the wide-gamut SDR colorspace for a source. HDR upgrade to * rec2100-pq/hlg is attempted separately at apply time (it can throw when the * Chromium experimental flag is off), so this only ever returns a value the * 2D/WebGL spec guarantees: srgb or display-p3. */ private detectColorSpace; /** * Lazily create the WebGL2 context + passthrough program and apply the * colorspace tag. Safe to call repeatedly; only the first call builds GL * state, later calls just re-apply the colorspace for the current source. */ private ensureGL; /** Mirror of ThumbnailRenderer/CanvasRenderer colorspace setup. */ private applyColorSpace; private buildProgram; /** * Blit a source (a canvas, VideoFrame, ImageBitmap, etc. — anything * texImage2D accepts) onto the display canvas at the given size. */ blit(source: TexImageSource, width: number, height: number, opts?: HDRBlitOptions): boolean; get colorSpace(): string; destroy(): void; } //# sourceMappingURL=HDRBlitCanvas.d.ts.map