Format ImageHeader

This commit is contained in:
Jason Nelson 2024-04-03 22:02:12 -07:00 committed by BobLd
parent a68febfa95
commit 215e12543c

View File

@ -8,17 +8,15 @@
/// </summary>
internal readonly struct ImageHeader
{
internal static ReadOnlySpan<byte> HeaderBytes => [
73, 72, 68, 82
];
internal static ReadOnlySpan<byte> HeaderBytes => [73, 72, 68, 82];
private static readonly IReadOnlyDictionary<ColorType, HashSet<byte>> PermittedBitDepths = new Dictionary<ColorType, HashSet<byte>>
{
{ColorType.None, new HashSet<byte> {1, 2, 4, 8, 16}},
{ColorType.ColorUsed, new HashSet<byte> {8, 16}},
{ColorType.PaletteUsed | ColorType.ColorUsed, new HashSet<byte> {1, 2, 4, 8}},
{ColorType.AlphaChannelUsed, new HashSet<byte> {8, 16}},
{ColorType.AlphaChannelUsed | ColorType.ColorUsed, new HashSet<byte> {8, 16}},
{ColorType.None, [1, 2, 4, 8, 16]},
{ColorType.ColorUsed, [8, 16]},
{ColorType.PaletteUsed | ColorType.ColorUsed, [1, 2, 4, 8]},
{ColorType.AlphaChannelUsed, [8, 16]},
{ColorType.AlphaChannelUsed | ColorType.ColorUsed, [8, 16]},
};
/// <summary>