Fix and improve Texture2D convert

This commit is contained in:
Perfare
2022-03-22 01:00:20 +08:00
parent 7d3a4a10fc
commit b1205808e2
4 changed files with 103 additions and 36 deletions

View File

@ -43,7 +43,7 @@ namespace AssetStudio
return stream;
}
public static byte[] ConvertToBgra32Bytes(this Image<Bgra32> image)
public static byte[] ConvertToBytes<TPixel>(this Image<TPixel> image) where TPixel : unmanaged, IPixel<TPixel>
{
if (image.TryGetSinglePixelSpan(out var pixelSpan))
{