6 internal sealed partial class PixelFormatDefinition
8 internal static IReadOnlyDictionary<PixelFormat, PixelFormatDefinition> FormatMap => _formatMap;
9 internal static IReadOnlyDictionary<string, PixelFormatDefinition> NameMap => _nameMap;
11 private static readonly Dictionary<PixelFormat, PixelFormatDefinition> _formatMap =
new();
12 private static readonly Dictionary<string, PixelFormatDefinition> _nameMap =
13 new(StringComparer.OrdinalIgnoreCase);
15 private static PixelFormatDefinition Register(PixelFormatDefinition info)
17 _formatMap.Add(info.Format, info);
18 _nameMap.Add(info.Name, info);
22 private PixelFormatDefinition(
26 uint storageBitsPerPixel,
27 uint allocatedBitsPerPixel,
36 StorageBitsPerPixel = storageBitsPerPixel;
37 AllocatedBitsPerPixel = allocatedBitsPerPixel;
40 IsInterleaved = isInterleaved;
41 UnpackedFormat = unpackedFormat;
44 public override int GetHashCode()
46 return Format.GetHashCode();
50 internal string Name {
get; }
51 internal Channel[] Channels {
get; }
52 internal uint StorageBitsPerPixel {
get; }
53 internal uint AllocatedBitsPerPixel {
get; }
54 internal bool IsPacked {
get; }
55 internal bool IsFloat {
get; }
56 internal bool IsInterleaved {
get; }