|
5 | 5 |
|
6 | 6 | namespace SixLabors.ImageSharp.Formats.Ani; |
7 | 7 |
|
8 | | -[StructLayout(LayoutKind.Sequential, Pack = 1, Size = Size)] |
| 8 | +[StructLayout(LayoutKind.Sequential, Pack = 1, Size = 36)] |
9 | 9 | internal readonly struct AniHeader |
10 | 10 | { |
11 | | - public const int Size = 36; |
| 11 | + public uint Size { get; } |
12 | 12 |
|
13 | | - public ushort Frames { get; } |
| 13 | + public uint Frames { get; } |
14 | 14 |
|
15 | | - public ushort Steps { get; } |
| 15 | + public uint Steps { get; } |
16 | 16 |
|
17 | | - public ushort Width { get; } |
| 17 | + public uint Width { get; } |
18 | 18 |
|
19 | | - public ushort Height { get; } |
| 19 | + public uint Height { get; } |
20 | 20 |
|
21 | | - public ushort BitCount { get; } |
| 21 | + public uint BitCount { get; } |
22 | 22 |
|
23 | | - public ushort Planes { get; } |
| 23 | + public uint Planes { get; } |
24 | 24 |
|
25 | | - public ushort DisplayRate { get; } |
| 25 | + public uint DisplayRate { get; } |
26 | 26 |
|
27 | | - public ushort Flags { get; } |
| 27 | + public AniHeaderFlags Flags { get; } |
28 | 28 |
|
29 | 29 | public static AniHeader Parse(in ReadOnlySpan<byte> data) |
30 | 30 | => MemoryMarshal.Cast<byte, AniHeader>(data)[0]; |
31 | 31 |
|
32 | 32 | public readonly unsafe void WriteTo(in Stream stream) |
33 | 33 | => stream.Write(MemoryMarshal.Cast<AniHeader, byte>([this])); |
34 | 34 | } |
| 35 | + |
| 36 | +[Flags] |
| 37 | +public enum AniHeaderFlags : uint |
| 38 | +{ |
| 39 | + IsIcon = 1, |
| 40 | + ContainsSeq = 2 |
| 41 | +} |
0 commit comments