CcittEncodeOptions

class CcittEncodeOptions(val k: Int = -1, val encodedByteAlign: Boolean = false, val blackIs1: Boolean = false, val endOfLine: Boolean = false, val endOfBlock: Boolean = true)(source)

How ImageKodec.encodeCcitt writes fax data. The parameters are the ones PDF's CCITTFaxDecode filter and io.github.yuroyami.imagekodec.codec.CcittFax.decode take, with PDF's defaults except for k, so a reader given the same values reads the data back.

  • k selects the coding: negative is Group 4 (ITU-T T.6), the default and the smallest; 0 is Group 3 one-dimensional (T.4 Modified Huffman); a positive value is Group 3 two-dimensional, each row coded alone followed by up to k - 1 rows coded against the row above. T.4 uses 2 at standard resolution and 4 at fine.

  • encodedByteAlign starts each row on a byte, its EOL included. TIFF compression 2 is Group 3 one-dimensional with this set and no EOL.

  • blackIs1 is the polarity the reader is told: it does not change the coded data.

  • endOfLine writes an EOL before each Group 3 row, as TIFF compression 3 and fax machines expect. T.6 has no EOL, so Group 4 refuses it.

  • endOfBlock ends the data with EOFB in Group 4 and RTC in Group 3, so a reader given no row count knows where the page ends.

Throws

if k is negative and endOfLine is set

Constructors

Link copied to clipboard
constructor(k: Int = -1, encodedByteAlign: Boolean = false, blackIs1: Boolean = false, endOfLine: Boolean = false, endOfBlock: Boolean = true)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val k: Int

Functions

Link copied to clipboard
open override fun toString(): String