public override IImageDecoder OpenImage(ArcFile arc, Entry entry) { if (arc.File.View.ReadUInt32(entry.Offset) != 0x88888888 || arc.File.View.ReadUInt16(entry.Offset + 0x10) != 0x4D42) // 'BM' { return(base.OpenImage(arc, entry)); } var info = new Lb5MetaData { Width = arc.File.View.ReadUInt32(entry.Offset + 4), Height = arc.File.View.ReadUInt32(entry.Offset + 8), UnpackedSize = arc.File.View.ReadUInt32(entry.Offset + 0xC), BPP = arc.File.View.ReadUInt16(entry.Offset + 0x1C), }; var input = arc.File.CreateStream(entry.Offset + 0x10, entry.Size - 0x10); return(new Lb5ImageDecoder(input, info)); }
public Lb5ImageDecoder(IBinaryStream input, Lb5MetaData info) : base(input, info) { m_output = new byte[info.UnpackedSize]; }