Class CcittFaxParameters
The parameters of CCITT fax data as a PDF's CCITTFaxDecode filter gives them in its DecodeParms dictionary, with PDF's defaults. One record serves both Decode(ReadOnlySpan<byte>, CcittFaxParameters, out int, EgamiContext?) and CcittReaderOptions.
public sealed record CcittFaxParameters : IEquatable<CcittFaxParameters>
- Inheritance
-
CcittFaxParameters
- Implements
- Inherited Members
Examples
// A PDF image with /Filter /CCITTFaxDecode: its DecodeParms become the parameters, and the result is the filter's
// output, packed rows with black 0 and white 1, ready for the image's /Decode array and color space.
CcittFaxParameters parameters = new() { K = -1, EncodedByteAlign = true, Columns = 301, Rows = 48 };
byte[] rows = CcittFax.Decode(stream, parameters, out int rowCount);
Properties
BlackIs1
Gets the bit sense of Decode(ReadOnlySpan<byte>, CcittFaxParameters, out int, EgamiContext?)'s output: false (the default) gives 0 for black and 1 for white, as PDF defines the filter; true gives 1 for black. CcittFormat always loads black as 0 and white as 255.
public bool BlackIs1 { get; init; }
Property Value
Columns
Gets the row width in pixels. Defaults to 1728.
public int Columns { get; init; }
Property Value
DamagedRowsBeforeError
Gets how many damaged rows are tolerated when EndOfLine is true and K is 0 or above: each is skipped to the next EOL and repeats the row before it. After that, or without EOLs, decoding stops at the first damaged row, keeps the rows before it, leaves the rest white and warns. Defaults to 0.
public int DamagedRowsBeforeError { get; init; }
Property Value
EncodedByteAlign
Gets whether rows are byte-aligned: with K below 0 each row starts on a byte boundary; otherwise fill bits before each EOL make it end on one, and a row without an EOL starts on one. Defaults to false.
public bool EncodedByteAlign { get; init; }
Property Value
EndOfBlock
Gets whether the data ends with an end-of-block code: RTC (six EOLs) for Group 3, EOFB (two EOLs) for Group 4. Decoding stops there either way. Defaults to true.
public bool EndOfBlock { get; init; }
Property Value
EndOfLine
Gets whether an EOL is required before each row. EOLs are accepted where present either way. Defaults to false.
public bool EndOfLine { get; init; }
Property Value
K
Gets the coding: below 0 pure Group 4 (ITU-T T.6), 0 (the default) one-dimensional Group 3, above 0 mixed Group 3 (ITU-T T.4), where the bit after each EOL says whether the next row is one- or two-dimensional.
public int K { get; init; }
Property Value
Rows
Gets the number of rows, or 0 (the default) to decode until the data or its end-of-block code ends. Rows the data does not reach are white.
public int Rows { get; init; }