/** A decoded 16-bit grayscale PNG, samples in host byte order. */ export interface DecodedPng16 { readonly width: number; readonly height: number; readonly values: Uint16Array; /** * The samples as `rg8` texture bytes with every row padded to a multiple of * four bytes, present only when padding was asked for and the width is odd. */ readonly paddedUpload?: { readonly bytes: Uint8Array; readonly textureWidth: number; }; } export interface DecodedPng8 { readonly width: number; readonly height: number; readonly values: Uint8Array; } /** * Inflates a zlib stream split over `chunks` into exactly `byteLength` bytes. * A PNG's IDAT chunks, joined, are one zlib stream. */ export type PngInflate = (chunks: readonly Uint8Array[], byteLength: number) => Promise; export interface DecodePng16Options { readonly inflate?: PngInflate; /** Also return WebGL-aligned upload bytes when the width is odd. */ readonly padRowsForWebGl?: boolean; } export declare function decodePng16(bytes: ArrayBuffer | Uint8Array, options?: DecodePng16Options): Promise; export declare function decodePng8Gray(bytes: ArrayBuffer | Uint8Array, options?: { readonly inflate?: PngInflate; }): Promise; /** * Inflates with the platform's `DecompressionStream("deflate")` (zlib * framing, which is what PNG uses) straight into one buffer of the expected * size, so no second copy joins the output chunks. */ export declare function inflateWithDecompressionStream(chunks: readonly Uint8Array[], byteLength: number): Promise; //# sourceMappingURL=png16.d.ts.map