Class ChdCodecs

Namespace
CHDSharp.Encoder
Assembly
CHDSharpLib.dll

Creates codec instances from four-character tags.

public static class ChdCodecs
Inheritance
ChdCodecs
Inherited Members

Fields

SupportedCodecNames

Comma-separated list of codec names the encoder can actually compress with.

public const string SupportedCodecNames = "zlib, zstd, lzma, huff, flac, cdzl, cdlz, cdzs, cdfl, avhu, none"

Field Value

string

Methods

CreateAll(IReadOnlyList<uint>, uint)

Creates one codec instance per tag, in order (up to 4, per the CHD header). The single tag None produces an empty codec list (uncompressed CHD: hunks are stored raw and the encoder writes the V5 raw map instead of the Huffman-compressed one). Any other request that the encoder does not implement throws instead of silently degrading: a requested codec that the encoder cannot write would otherwise store every hunk uncompressed while the header claims the codec is in use.

public static IChdCodec[] CreateAll(IReadOnlyList<uint> codecTags, uint hunkBytes)

Parameters

codecTags IReadOnlyList<uint>

The codec tags to instantiate.

hunkBytes uint

The hunk size in bytes (codec configuration).

Returns

IChdCodec[]

An array of codec instances (empty when the single tag is None).

Exceptions

ArgumentException

A tag is unknown, not implemented by the encoder, combined with other codecs, or (Cdfl) used on non-CD-sized hunks.

ParseCodecTags(string?)

Parses a comma-separated codec list ("zlib,zstd,lzma") into tags.

public static uint[] ParseCodecTags(string? codecString)

Parameters

codecString string

The comma-separated codec names.

Returns

uint[]

The parsed codec tags.

Exceptions

ArgumentException

An unknown codec name was supplied.