Table of Contents

Class GifApplicationExtension

Namespace
Egami.Formats.Gif
Assembly
Egami.dll

An application extension block kept unchanged for round trips.

public sealed record GifApplicationExtension : IEquatable<GifApplicationExtension>
Inheritance
GifApplicationExtension
Implements
Inherited Members

Examples

using Raster<Rgba8> clip = Raster.Load<Rgba8>("pan.gif");
GifDetails details = (GifDetails)clip.Metadata.FormatDetails!;
Console.WriteLine($"GIF{details.Version}, {details.GlobalPalette.Length} global colors, repeats {details.RepetitionCount}");
foreach (GifApplicationExtension extension in details.OtherExtensions)
{
    Console.WriteLine($"Kept extension {extension.Identifier}: {extension.Data.Length} bytes");
}

foreach (Frame<Rgba8> frame in clip.Frames)
{
    if (frame.Metadata.FormatDetails is GifFrameDetails frameDetails)
    {
        Console.WriteLine($"Frame: {frameDetails.LocalPalette.Length} local colors, transparent index {frameDetails.TransparentIndex}");
    }
}

Constructors

GifApplicationExtension(string, ReadOnlyMemory<byte>)

An application extension block kept unchanged for round trips.

public GifApplicationExtension(string Identifier, ReadOnlyMemory<byte> Data)

Parameters

Identifier string

The 8-character application identifier and 3-character authentication code, such as "NETSCAPE2.0".

Data ReadOnlyMemory<byte>

The data of its sub-blocks, joined.

Examples

using Raster<Rgba8> clip = Raster.Load<Rgba8>("pan.gif");
GifDetails details = (GifDetails)clip.Metadata.FormatDetails!;
Console.WriteLine($"GIF{details.Version}, {details.GlobalPalette.Length} global colors, repeats {details.RepetitionCount}");
foreach (GifApplicationExtension extension in details.OtherExtensions)
{
    Console.WriteLine($"Kept extension {extension.Identifier}: {extension.Data.Length} bytes");
}

foreach (Frame<Rgba8> frame in clip.Frames)
{
    if (frame.Metadata.FormatDetails is GifFrameDetails frameDetails)
    {
        Console.WriteLine($"Frame: {frameDetails.LocalPalette.Length} local colors, transparent index {frameDetails.TransparentIndex}");
    }
}

Properties

Data

The data of its sub-blocks, joined.

public ReadOnlyMemory<byte> Data { get; init; }

Property Value

ReadOnlyMemory<byte>

Identifier

The 8-character application identifier and 3-character authentication code, such as "NETSCAPE2.0".

public string Identifier { get; init; }

Property Value

string