using System.IO; namespace LibAPNG { public enum DisposeOps { APNGDisposeOpNone = 0, APNGDisposeOpBackground = 1, APNGDisposeOpPrevious = 2, } public enum BlendOps { APNGBlendOpSource = 0, APNGBlendOpOver = 1, } public class fcTLChunk : Chunk { public fcTLChunk(byte[] bytes) : base(bytes) { } public fcTLChunk(MemoryStream ms) : base(ms) { } public fcTLChunk(Chunk chunk) : base(chunk) { } /// /// Sequence number of the animation chunk, starting from 0 /// public uint SequenceNumber { get; private set; } /// /// Width of the following frame /// public uint Width { get; private set; } /// /// Height of the following frame /// public uint Height { get; private set; } /// /// X position at which to render the following frame /// public uint XOffset { get; private set; } /// /// Y position at which to render the following frame /// public uint YOffset { get; private set; } /// /// Frame delay fraction numerator /// public ushort DelayNum { get; private set; } /// /// Frame delay fraction denominator /// public ushort DelayDen { get; private set; } /// /// Type of frame area disposal to be done after rendering this frame /// public DisposeOps DisposeOp { get; private set; } /// /// Type of frame area rendering for this frame /// public BlendOps BlendOp { get; private set; } protected override void ParseData(MemoryStream ms) { SequenceNumber = Helper.ConvertEndian(ms.ReadUInt32()); Width = Helper.ConvertEndian(ms.ReadUInt32()); Height = Helper.ConvertEndian(ms.ReadUInt32()); XOffset = Helper.ConvertEndian(ms.ReadUInt32()); YOffset = Helper.ConvertEndian(ms.ReadUInt32()); DelayNum = Helper.ConvertEndian(ms.ReadUInt16()); DelayDen = Helper.ConvertEndian(ms.ReadUInt16()); DisposeOp = (DisposeOps)ms.ReadByte(); BlendOp = (BlendOps)ms.ReadByte(); } } }