(IImageDecoder): new interface.

This commit is contained in:
morkt
2016-10-25 18:18:51 +04:00
parent 27dbb52b89
commit b05c54047d
6 changed files with 118 additions and 27 deletions

View File

@@ -197,6 +197,15 @@ namespace GameRes
return arc.File.CreateStream (entry.Offset, entry.Size, entry.Name);
}
/// <summary>
/// Open <paramref name="entry"> as image. Throws InvalidFormatException if entry is not an image.
/// </summary>
public virtual IImageDecoder OpenImage (ArcFile arc, Entry entry)
{
var input = arc.OpenBinaryEntry (entry);
return new ImageStreamDecoder (input);
}
/// <summary>
/// Create file corresponding to <paramref name="entry"/> in current directory and open it
/// for writing. Overwrites existing file, if any.