import type { DepthColormap, DepthMap } from "supervision-js-core"; import type { BufferImageSource as PixiBufferImageSource } from "pixi.js"; export type DepthTextureFormat = "rg8unorm" | "r8unorm"; export type DepthBufferImageSourceConstructor = new (options: { alphaMode?: "no-premultiply-alpha"; autoGenerateMipmaps?: boolean; dynamic: boolean; format: DepthTextureFormat | "rgba8unorm"; height: number; resource: Uint8Array; scaleMode?: "linear" | "nearest"; width: number; }) => PixiBufferImageSource; export interface DepthTextureUpload { readonly bytes: Uint8Array; readonly format: DepthTextureFormat; /** Texels per row, which can exceed the map width by row padding. */ readonly textureWidth: number; } export interface DepthDisplaySize { readonly width: number; readonly height: number; } export interface DepthMapUpload extends DepthTextureUpload { readonly displaySize: DepthDisplaySize; } /** * With a `displaySize` smaller than the map, the bytes are a decimated copy; * the map keeps its full samples for readouts. */ export declare function rememberPreparedDepthUpload(map: DepthMap, upload: DepthTextureUpload & { readonly displaySize?: DepthDisplaySize; }): void; /** * Exact samples go up as two unorm bytes per texel, low byte in red, and the * shader rebuilds `red + 256 * green`. Pixi cannot upload a 16-bit integer * texture on WebGL, and a half float cannot hold every 1/256 step. * Every supported browser runs little-endian, where a `Uint16Array` already * is those bytes, so aligned rows go up without a copy. */ export declare function createPackedDepthUpload(values: Uint16Array, width: number, height: number, acceptsUnalignedRows: boolean): DepthTextureUpload; export declare function createPreviewUpload(codes: Uint8Array, width: number, height: number, acceptsUnalignedRows: boolean): DepthTextureUpload; /** * A map larger than `maxTextureSize` on either side goes up as a * nearest-decimated copy that fits; the full-resolution samples stay on the * map for readouts. */ export declare function createDepthMapUpload(map: DepthMap, acceptsUnalignedRows: boolean, maxTextureSize?: number): DepthMapUpload; export interface DepthTextureSlot { readonly source: PixiBufferImageSource; readonly textureWidth: number; /** The map size the texture holds, smaller than the map's when decimated. */ readonly displaySize: DepthDisplaySize; } export interface DepthTextureRing { /** * The texture holding `map`, uploading it into the stalest slot if needed. * A slot holding a map in `keep` is reused only when every slot does. */ acquire(map: DepthMap, keep?: ReadonlySet): DepthTextureSlot; has(map: DepthMap): boolean; destroy(): void; } export declare function createDepthTextureRing(options: { readonly BufferImageSource: DepthBufferImageSourceConstructor; readonly acceptsUnalignedTextureRows: () => boolean; readonly maxTextureSize?: () => number; readonly size?: number; }): DepthTextureRing; export declare function createDepthLutCache(BufferImageSource: DepthBufferImageSourceConstructor): { get(name: DepthColormap): PixiBufferImageSource; destroy(): void; }; /** * An unreadable limit falls back to the minimum each backend guarantees: * 2048 on WebGL 2, 8192 on WebGPU. */ export declare function queryMaxTextureSize(renderer: unknown): number; //# sourceMappingURL=depth-textures.d.ts.map