/** * Minimal PNG decoder for PDF image embedding. * * Extracts raw RGB pixel data from a PNG file. Handles: * - Color types: RGB (2), RGBA (6), Grayscale (0), Grayscale+Alpha (4), Palette (3) * - Bit depth: 8 (most common) * - Interlacing: non-interlaced only (Adam7 interlacing is not supported) * - All 5 PNG filter types (None, Sub, Up, Average, Paeth) * * For RGBA images, produces separate RGB pixels and an alpha mask (for PDF SMask). */ export interface DecodedPng { width: number; height: number; /** Raw RGB pixel data (3 bytes per pixel, row-major) */ pixels: Uint8Array; /** Alpha channel (1 byte per pixel) — null if image is fully opaque */ alpha: Uint8Array | null; /** Bits per component (always 8 after decoding) */ bitsPerComponent: number; } /** * Decode a PNG file to raw RGB pixels for PDF embedding. * @throws on invalid or unsupported PNG data */ export declare function decodePng(data: Uint8Array): DecodedPng;