CcittFax

object CcittFax

CCITT fax decoding. Bilevel scan-world compression: there is no standalone container/magic for it, so this is a parameterized codec API, not part of io.github.yuroyami.kiteimage.KiteImage.decode's sniffing.

Output is 1 bit per pixel, packed MSB-first, padded to a byte boundary per row; polarity follows CcittOptions.blackIs1.

Functions

Link copied to clipboard
fun decode(input: ByteArray, k: Int, options: CcittOptions): ByteArray

Decode with the mode selection PDF's /K uses: negative = pure 2D (Group 4, T.6), zero = pure 1D (Group 3, T.4). Positive (mixed 1D/2D) falls back to 1D, matching the KitePDF behavior this came from.