mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2026-11-11 04:57:15 +00:00
Simplified span-fixes in Samplers
This commit is contained in:
1 parent
4a0ae1a185
commit
93cd8055a2
3 files changed
+3
-6
No files matched your search
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Numerics;
|
||||
using System.Runtime.InteropServices;
|
||||
using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Presets.Textures.Sampler;
|
||||
@@ -42,7 +41,7 @@ public sealed class AverageByteSampler : ISampler<byte>
|
||||
{
|
||||
ReadOnlySpan<byte> data = info[y];
|
||||
|
||||
fixed (byte* colorPtr = &MemoryMarshal.GetReference(data))
|
||||
fixed (byte* colorPtr = data)
|
||||
{
|
||||
byte* current = colorPtr;
|
||||
for (int i = 0; i < chunks; i++)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Numerics;
|
||||
using System.Runtime.InteropServices;
|
||||
using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Presets.Textures.Sampler;
|
||||
@@ -33,7 +32,7 @@ public sealed class AverageFloatSampler : ISampler<float>
|
||||
{
|
||||
ReadOnlySpan<float> data = info[y];
|
||||
|
||||
fixed (float* colorPtr = &MemoryMarshal.GetReference(data))
|
||||
fixed (float* colorPtr = data)
|
||||
{
|
||||
float* current = colorPtr;
|
||||
for (int i = 0; i < chunks; i++)
|
||||
|
||||
Reference in new issue
Block a user