/** * The `/CCITTFaxDecode` parameters that drive {@link decodeCcitt} (ISO 32000-1 * §7.4.6), pulled from the filter's `/DecodeParms`. */ export interface CcittParams { /** `/K` — `<0` Group 4, `0` Group 3 1-D, `>0` Group 3 mixed 1-D/2-D. */ readonly k: number; /** `/Columns` (pixels per row). */ readonly columns: number; /** `/Rows` (or the image `/Height`) — the row count to decode. */ readonly rows: number; /** `/EncodedByteAlign` — pad each row to a byte boundary. */ readonly byteAlign: boolean; } /** * Decode a CCITT Group 3 / Group 4 fax stream into a packed 1-bit-per-pixel * bitmap. * * @param data The raw fax codestream (any wrapping filters already stripped). * @param params The `/CCITTFaxDecode` parameters. * @returns The packed bitmap (`rowBytes × rows`, bit 1 = black, MSB first), or * `undefined` when nothing could be decoded at all. */ export declare function decodeCcitt(data: Uint8Array, params: CcittParams): Uint8Array | undefined; /** * ISO/IEC 14492 §C.5 — the bitplanes of a grey-scale image, all MMR-coded into * ONE stream, one after another with an EOFB between them. * * They cannot be decoded a plane at a time from the head of the data, because * nothing says how many BYTES a plane took: the reader has to carry its place * across them. Advancing instead by the size of what came OUT left every plane * after the first reading from the middle of the one before it, and * bitmap-halftone-10bpp-mmr.pdf came back as three specks. * * @param data The stream holding all the planes. * @param columns Each plane's width, in pixels. * @param rows Each plane's height. * @param count How many planes to read. * @returns One packed bitmap per plane, or `undefined` if the first will not * decode at all. */ export declare function decodeCcittPlanes(data: Uint8Array, columns: number, rows: number, count: number): Array | undefined; /** A decoded T.6 two-dimensional mode code: pass, horizontal, or vertical V(d). */ export interface Mode { readonly kind: 'pass' | 'horizontal' | 'vertical'; /** Vertical offset (−3..3); meaningful only when `kind` is `'vertical'`. */ readonly d: number; } /** * T.4 white-run modified-Huffman codes as `[run, bit-string]` (terminating runs * 0..63, make-up runs multiples of 64). Exported so the test can build an * independent encoder and validate the codes form a valid prefix set. */ export declare const WHITE_CODES: ReadonlyArray; export declare const BLACK_CODES: ReadonlyArray; export declare const SHARED_MAKEUP: ReadonlyArray; export declare const MODE_CODES: ReadonlyArray;