Switched to ThumbHasher over BlurHasher

This commit is contained in:
2023-05-21 23:56:10 -07:00
parent 514637b9c6
commit a0c880c7ba
26 changed files with 803 additions and 121 deletions

View File

@ -0,0 +1,38 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace View_by_Distance.ThumbHash.Models;
public static partial class ThumbHash
{
[StructLayout(LayoutKind.Sequential)]
private readonly struct RGBA
{
public byte R { init; get; }
public byte G { init; get; }
public byte B { init; get; }
public byte A { init; get; }
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public RGBA(byte r, byte g, byte b, byte a)
{
R = r;
G = g;
B = b;
A = a;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Deconstruct(out byte r, out byte g, out byte b, out byte a)
{
r = R;
g = G;
b = B;
a = A;
}
}
}