IDS peak ICV v1.3.0
Loading...
Searching...
No Matches
PixelFormatDefinitions.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3
5{
6 internal sealed partial class PixelFormatDefinition
7 {
8 internal static IReadOnlyDictionary<PixelFormat, PixelFormatDefinition> FormatMap => _formatMap;
9 internal static IReadOnlyDictionary<string, PixelFormatDefinition> NameMap => _nameMap;
10
11 private static readonly Dictionary<PixelFormat, PixelFormatDefinition> _formatMap = new();
12 private static readonly Dictionary<string, PixelFormatDefinition> _nameMap =
13 new(StringComparer.OrdinalIgnoreCase);
14
15 private static PixelFormatDefinition Register(PixelFormatDefinition info)
16 {
17 _formatMap.Add(info.Format, info);
18 _nameMap.Add(info.Name, info);
19 return info;
20 }
21
22 private PixelFormatDefinition(
23 PixelFormat format,
24 string name,
25 Channel[] channels,
26 uint storageBitsPerPixel,
27 uint allocatedBitsPerPixel,
28 bool isPacked,
29 bool isFloat,
30 bool isInterleaved,
31 PixelFormat unpackedFormat)
32 {
33 Format = format;
34 Name = name;
35 Channels = channels;
36 StorageBitsPerPixel = storageBitsPerPixel;
37 AllocatedBitsPerPixel = allocatedBitsPerPixel;
38 IsPacked = isPacked;
39 IsFloat = isFloat;
40 IsInterleaved = isInterleaved;
41 UnpackedFormat = unpackedFormat;
42 }
43
44 public override int GetHashCode()
45 {
46 return Format.GetHashCode();
47 }
48
49 internal PixelFormat Format { get; }
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; }
57 internal PixelFormat UnpackedFormat { get; }
58 }
59}
Channel
Represents the various data channels in image or spatial data formats. /// This enumeration defines s...
Definition Channel.cs:13
PixelFormat
Each enumerator represents a specific pixel layout and bit-depth, used for interpreting raw image dat...