mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-02 07:06:37 +08:00
项目结构调整
This commit is contained in:
28
Others/WpfAnimatedGif/Decoding/GifBlock.cs
Normal file
28
Others/WpfAnimatedGif/Decoding/GifBlock.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace WpfAnimatedGif.Decoding
|
||||
{
|
||||
internal abstract class GifBlock
|
||||
{
|
||||
internal static GifBlock ReadBlock(Stream stream, IEnumerable<GifExtension> controlExtensions, bool metadataOnly)
|
||||
{
|
||||
int blockId = stream.ReadByte();
|
||||
if (blockId < 0)
|
||||
throw GifHelpers.UnexpectedEndOfStreamException();
|
||||
switch (blockId)
|
||||
{
|
||||
case GifExtension.ExtensionIntroducer:
|
||||
return GifExtension.ReadExtension(stream, controlExtensions, metadataOnly);
|
||||
case GifFrame.ImageSeparator:
|
||||
return GifFrame.ReadFrame(stream, controlExtensions, metadataOnly);
|
||||
case GifTrailer.TrailerByte:
|
||||
return GifTrailer.ReadTrailer();
|
||||
default:
|
||||
throw GifHelpers.UnknownBlockTypeException(blockId);
|
||||
}
|
||||
}
|
||||
|
||||
internal abstract GifBlockKind Kind { get; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user