Skip to content

Commit

Permalink
Format ImageHeader
Browse files Browse the repository at this point in the history
  • Loading branch information
iamcarbon authored and BobLd committed Apr 12, 2024
1 parent a68febf commit 215e125
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/UglyToad.PdfPig/Images/Png/ImageHeader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 215e125

Please sign in to comment.