mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2025-12-12 17:48:31 +00:00
Added SkipLocalsInitAttribute to Sample-Methods
This commit is contained in:
parent
4ee55c6725
commit
260a820b80
@ -76,6 +76,7 @@ public abstract class PixelTexture<T> : ITexture
|
|||||||
/// <param name="width">The with of the region.</param>
|
/// <param name="width">The with of the region.</param>
|
||||||
/// <param name="height">The height of the region.</param>
|
/// <param name="height">The height of the region.</param>
|
||||||
/// <returns>The sampled color.</returns>
|
/// <returns>The sampled color.</returns>
|
||||||
|
[SkipLocalsInit]
|
||||||
public virtual Color this[int x, int y, int width, int height]
|
public virtual Color this[int x, int y, int width, int height]
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using RGB.NET.Core;
|
using RGB.NET.Core;
|
||||||
|
|
||||||
@ -19,6 +20,7 @@ public class AverageByteSampler : ISampler<byte>
|
|||||||
#region Methods
|
#region Methods
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
[SkipLocalsInit]
|
||||||
public unsafe void Sample(in SamplerInfo<byte> info, in Span<byte> pixelData)
|
public unsafe void Sample(in SamplerInfo<byte> info, in Span<byte> pixelData)
|
||||||
{
|
{
|
||||||
int count = info.Width * info.Height;
|
int count = info.Width * info.Height;
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using RGB.NET.Core;
|
using RGB.NET.Core;
|
||||||
|
|
||||||
@ -13,6 +14,7 @@ public class AverageFloatSampler : ISampler<float>
|
|||||||
#region Methods
|
#region Methods
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
[SkipLocalsInit]
|
||||||
public unsafe void Sample(in SamplerInfo<float> info, in Span<float> pixelData)
|
public unsafe void Sample(in SamplerInfo<float> info, in Span<float> pixelData)
|
||||||
{
|
{
|
||||||
int count = info.Width * info.Height;
|
int count = info.Width * info.Height;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user