Switched to ThumbHasher over BlurHasher
This commit is contained in:
31
ThumbHash/Models/ThumbHash.Channel.cs
Normal file
31
ThumbHash/Models/ThumbHash.Channel.cs
Normal file
@ -0,0 +1,31 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace View_by_Distance.ThumbHash.Models;
|
||||
|
||||
public static partial class ThumbHash
|
||||
{
|
||||
private readonly ref struct Channel
|
||||
{
|
||||
|
||||
public float DC { init; get; }
|
||||
public SpanOwner<float> AC { init; get; }
|
||||
public float Scale { init; get; }
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public Channel(float dc, SpanOwner<float> ac, float scale)
|
||||
{
|
||||
DC = dc;
|
||||
AC = ac;
|
||||
Scale = scale;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Deconstruct(out float dc, out SpanOwner<float> ac, out float scale)
|
||||
{
|
||||
dc = DC;
|
||||
ac = AC;
|
||||
scale = Scale;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user