Class ChdCodecs
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
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
codecTagsIReadOnlyList<uint>The codec tags to instantiate.
hunkBytesuintThe hunk size in bytes (codec configuration).
Returns
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
codecStringstringThe comma-separated codec names.
Returns
- uint[]
The parsed codec tags.
Exceptions
- ArgumentException
An unknown codec name was supplied.