Struct HunkProgress

Namespace
CHDSharp.Encoder.Models
Assembly
CHDSharpLib.dll

Per-hunk progress information reported by ChdEncoder via HunkCompleted, useful for compression-ratio logging. Callbacks fire once per hunk, in hunk order, after the hunk has been compressed.

public readonly struct HunkProgress
Inherited Members

Constructors

HunkProgress(uint, uint, int, int, byte, string, double)

Initializes a new HunkProgress report for one compressed hunk.

public HunkProgress(uint hunkIndex, uint hunkCount, int rawBytes, int storedBytes, byte compressionType, string codecName, double ratio)

Parameters

hunkIndex uint

The zero-based index of the hunk being reported.

hunkCount uint

The total number of hunks in the image.

rawBytes int

The uncompressed hunk size in bytes.

storedBytes int

The number of bytes stored for this hunk.

compressionType byte

The map compression type.

codecName string

The codec name.

ratio double

Compression ratio.

Properties

CodecName

The codec name ("zlib", "zstd", "lzma", "cdfl", "none", "self").

public string CodecName { get; }

Property Value

string

CompressionType

The map compression type: 0-3 (codec index), 4 (none), 5 (SELF reference).

public byte CompressionType { get; }

Property Value

byte

HunkCount

The total number of hunks in the image.

public uint HunkCount { get; }

Property Value

uint

HunkIndex

The zero-based index of the hunk being reported.

public uint HunkIndex { get; }

Property Value

uint

Ratio

Compression ratio = StoredBytes / RawBytes; 0 for SELF references.

public double Ratio { get; }

Property Value

double

RawBytes

The uncompressed hunk size in bytes.

public int RawBytes { get; }

Property Value

int

StoredBytes

The number of bytes stored for this hunk: 0 for SELF references, the hunk size for COMPRESSION_NONE, otherwise the compressed length.

public int StoredBytes { get; }

Property Value

int