mirror of https://github.com/SixLabors/ImageSharp
10 changed files with 87 additions and 86 deletions
@ -0,0 +1,21 @@ |
|||||
|
// Copyright (c) Six Labors.
|
||||
|
// Licensed under the Six Labors Split License.
|
||||
|
|
||||
|
namespace SixLabors.ImageSharp.Formats.Ani; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Flags for the ANI header.
|
||||
|
/// </summary>
|
||||
|
[Flags] |
||||
|
public enum AniHeaderFlags : uint |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// If set, the ANI file's "icon" chunk contains an ICO or CUR file, otherwise it contains a BMP file.
|
||||
|
/// </summary>
|
||||
|
IsIcon = 1, |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// If set, the ANI file contains a "seq " chunk.
|
||||
|
/// </summary>
|
||||
|
ContainsSeq = 2 |
||||
|
} |
||||
@ -0,0 +1,16 @@ |
|||||
|
// Copyright (c) Six Labors.
|
||||
|
// Licensed under the Six Labors Split License.
|
||||
|
|
||||
|
using System.Runtime.CompilerServices; |
||||
|
using System.Runtime.InteropServices; |
||||
|
|
||||
|
namespace SixLabors.ImageSharp.Formats.Webp; |
||||
|
|
||||
|
internal readonly struct RiffChunkHeader |
||||
|
{ |
||||
|
public readonly uint FourCc; |
||||
|
|
||||
|
public readonly uint Size; |
||||
|
|
||||
|
public ReadOnlySpan<byte> FourCcBytes => MemoryMarshal.CreateReadOnlySpan(ref Unsafe.As<uint, byte>(ref Unsafe.AsRef(in this.FourCc)), sizeof(uint)); |
||||
|
} |
||||
@ -0,0 +1,26 @@ |
|||||
|
// Copyright (c) Six Labors.
|
||||
|
// Licensed under the Six Labors Split License.
|
||||
|
|
||||
|
using System.Runtime.CompilerServices; |
||||
|
using System.Runtime.InteropServices; |
||||
|
|
||||
|
namespace SixLabors.ImageSharp.Formats.Webp; |
||||
|
|
||||
|
internal readonly struct RiffOrListChunkHeader |
||||
|
{ |
||||
|
public const int HeaderSize = 12; |
||||
|
|
||||
|
public readonly uint FourCc; |
||||
|
|
||||
|
public readonly uint Size; |
||||
|
|
||||
|
public readonly uint FormType; |
||||
|
|
||||
|
public ReadOnlySpan<byte> FourCcBytes => MemoryMarshal.CreateReadOnlySpan(ref Unsafe.As<uint, byte>(ref Unsafe.AsRef(in this.FourCc)), sizeof(uint)); |
||||
|
|
||||
|
public bool IsRiff => this.FourCc is 0x52_49_46_46; // "RIFF"
|
||||
|
|
||||
|
public bool IsList => this.FourCc is 0x4C_49_53_54; // "LIST"
|
||||
|
|
||||
|
public static ref RiffOrListChunkHeader Parse(ReadOnlySpan<byte> data) => ref Unsafe.As<byte, RiffOrListChunkHeader>(ref MemoryMarshal.GetReference(data)); |
||||
|
} |
||||
Loading…
Reference in new issue