mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
7b46a88fc0
* Fix BA2 compilation errors by implementing mipmap detection and usage during texture recompression * Update CHANGELOG.md * Fix broken mipmap support on Linux/OSX
27 lines
912 B
C#
27 lines
912 B
C#
using System.IO;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using Shipwreck.Phash;
|
|
using Wabbajack.DTOs.Texture;
|
|
using Wabbajack.Paths;
|
|
|
|
namespace Wabbajack.Hashing.PHash;
|
|
|
|
public interface IImageLoader
|
|
{
|
|
public ValueTask<ImageState> Load(AbsolutePath path);
|
|
public ValueTask<ImageState> Load(Stream stream);
|
|
public static float ComputeDifference(DTOs.Texture.PHash a, DTOs.Texture.PHash b)
|
|
{
|
|
return ImagePhash.GetCrossCorrelation(
|
|
new Digest {Coefficients = a.Data},
|
|
new Digest {Coefficients = b.Data});
|
|
}
|
|
|
|
public Task Recompress(AbsolutePath input, int width, int height, int mipMaps, DXGI_FORMAT format,
|
|
AbsolutePath output,
|
|
CancellationToken token);
|
|
|
|
public Task Recompress(Stream input, int width, int height, int mipMaps, DXGI_FORMAT format, Stream output,
|
|
CancellationToken token, bool leaveOpen = false);
|
|
} |