mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-04 08:06:36 +08:00
项目结构调整
This commit is contained in:
32
Others/WpfAnimatedGif/Decoding/GifExtension.cs
Normal file
32
Others/WpfAnimatedGif/Decoding/GifExtension.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace WpfAnimatedGif.Decoding
|
||||
{
|
||||
internal abstract class GifExtension : GifBlock
|
||||
{
|
||||
internal const int ExtensionIntroducer = 0x21;
|
||||
|
||||
internal static GifExtension ReadExtension(Stream stream, IEnumerable<GifExtension> controlExtensions, bool metadataOnly)
|
||||
{
|
||||
// Note: at this point, the Extension Introducer (0x21) has already been read
|
||||
|
||||
int label = stream.ReadByte();
|
||||
if (label < 0)
|
||||
throw GifHelpers.UnexpectedEndOfStreamException();
|
||||
switch (label)
|
||||
{
|
||||
case GifGraphicControlExtension.ExtensionLabel:
|
||||
return GifGraphicControlExtension.ReadGraphicsControl(stream);
|
||||
case GifCommentExtension.ExtensionLabel:
|
||||
return GifCommentExtension.ReadComment(stream);
|
||||
case GifPlainTextExtension.ExtensionLabel:
|
||||
return GifPlainTextExtension.ReadPlainText(stream, controlExtensions, metadataOnly);
|
||||
case GifApplicationExtension.ExtensionLabel:
|
||||
return GifApplicationExtension.ReadApplication(stream);
|
||||
default:
|
||||
throw GifHelpers.UnknownExtensionTypeException(label);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user