Switched to ThumbHasher over BlurHasher
This commit is contained in:
38
ThumbHash/Models/ThumbHash.RGBA.cs
Normal file
38
ThumbHash/Models/ThumbHash.RGBA.cs
Normal 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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user