mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2025-12-13 10:08:31 +00:00
Compare commits
5 Commits
bc7c2374f9
...
41a1d5d97b
| Author | SHA1 | Date | |
|---|---|---|---|
| 41a1d5d97b | |||
| 6f0711564c | |||
| f21acbd767 | |||
| da2c2a678b | |||
| 5a13fcef7f |
@ -91,9 +91,8 @@ public static class FloatExtensions
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static byte GetByteValueFromPercentage(this float percentage)
|
||||
{
|
||||
if (float.IsNaN(percentage)) return 0;
|
||||
if (float.IsNaN(percentage) || (percentage <= 0)) return 0;
|
||||
|
||||
percentage = percentage.Clamp(0, 1.0f);
|
||||
return (byte)(percentage >= 1.0f ? 255 : percentage * 256.0f);
|
||||
}
|
||||
|
||||
|
||||
@ -126,7 +126,7 @@ public abstract class PixelTexture<T> : ITexture
|
||||
/// </summary>
|
||||
/// <param name="pixel">The pixel-data to convert.</param>
|
||||
/// <returns>The color represented by the specified pixel-data.</returns>
|
||||
protected abstract Color GetColor(in ReadOnlySpan<T> pixel);
|
||||
protected abstract Color GetColor(ReadOnlySpan<T> pixel);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the pixel-data at the specified location.
|
||||
@ -189,7 +189,7 @@ public sealed class PixelTexture : PixelTexture<Color>
|
||||
|
||||
/// <inheritdoc />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
protected override Color GetColor(in ReadOnlySpan<Color> pixel) => pixel[0];
|
||||
protected override Color GetColor(ReadOnlySpan<Color> pixel) => pixel[0];
|
||||
|
||||
#endregion
|
||||
}
|
||||
@ -22,7 +22,7 @@ public sealed class AverageColorSampler : ISampler<Color>
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
public unsafe void Sample(in SamplerInfo<Color> info, in Span<Color> pixelData)
|
||||
public unsafe void Sample(in SamplerInfo<Color> info, Span<Color> pixelData)
|
||||
{
|
||||
int count = info.Width * info.Height;
|
||||
if (count == 0) return;
|
||||
|
||||
@ -13,5 +13,5 @@ public interface ISampler<T>
|
||||
/// </summary>
|
||||
/// <param name="info">The information containing the data to sample.</param>
|
||||
/// <param name="pixelData">The buffer used to write the resulting pixel to.</param>
|
||||
void Sample(in SamplerInfo<T> info, in Span<T> pixelData);
|
||||
void Sample(in SamplerInfo<T> info, Span<T> pixelData);
|
||||
}
|
||||
@ -44,7 +44,7 @@ public readonly ref struct SamplerInfo<T>
|
||||
/// <param name="width">The width of the region the data comes from.</param>
|
||||
/// <param name="height">The height of region the data comes from.</param>
|
||||
/// <param name="data">The data to sample.</param>
|
||||
public SamplerInfo(int x, int y, int width, int height, int stride, int dataPerPixel, in ReadOnlySpan<T> data)
|
||||
public SamplerInfo(int x, int y, int width, int height, int stride, int dataPerPixel, ReadOnlySpan<T> data)
|
||||
{
|
||||
this._x = x;
|
||||
this._y = y;
|
||||
|
||||
@ -80,7 +80,7 @@ public abstract class UpdateQueue<TIdentifier, TData> : AbstractReferenceCountin
|
||||
/// Performs the update this queue is responsible for.
|
||||
/// </summary>
|
||||
/// <param name="dataSet">The set of data that needs to be updated.</param>
|
||||
protected abstract bool Update(in ReadOnlySpan<(TIdentifier key, TData color)> dataSet);
|
||||
protected abstract bool Update(ReadOnlySpan<(TIdentifier key, TData color)> dataSet);
|
||||
|
||||
/// <summary>
|
||||
/// Sets or merges the provided data set in the current dataset and notifies the trigger that there is new data available.
|
||||
|
||||
@ -43,7 +43,7 @@ public sealed class AsusUpdateQueue : UpdateQueue
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override bool Update(in ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
protected override bool Update(ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@ -37,7 +37,7 @@ public sealed class CoolerMasterUpdateQueue : UpdateQueue
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override bool Update(in ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
protected override bool Update(ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@ -40,7 +40,7 @@ public sealed class CorsairDeviceUpdateQueue : UpdateQueue
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override unsafe bool Update(in ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
protected override unsafe bool Update(ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@ -35,7 +35,7 @@ public class CorsairDeviceUpdateQueue : UpdateQueue
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override bool Update(in ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
protected override bool Update(ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@ -59,7 +59,7 @@ public sealed class E131UpdateQueue : UpdateQueue
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override bool Update(in ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
protected override bool Update(ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@ -7,7 +7,7 @@ internal sealed class DebugDeviceUpdateQueue() : UpdateQueue(new DeviceUpdateTri
|
||||
{
|
||||
#region Methods
|
||||
|
||||
protected override bool Update(in ReadOnlySpan<(object key, Color color)> dataSet) => true;
|
||||
protected override bool Update(ReadOnlySpan<(object key, Color color)> dataSet) => true;
|
||||
|
||||
#endregion
|
||||
}
|
||||
@ -25,7 +25,7 @@ public sealed class LogitechPerDeviceUpdateQueue : UpdateQueue
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override bool Update(in ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
protected override bool Update(ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@ -24,7 +24,7 @@ public sealed class LogitechPerKeyUpdateQueue : UpdateQueue
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override bool Update(in ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
protected override bool Update(ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@ -33,7 +33,7 @@ public sealed class LogitechZoneUpdateQueue : UpdateQueue
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override bool Update(in ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
protected override bool Update(ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@ -34,7 +34,7 @@ public sealed class MsiDeviceUpdateQueue : UpdateQueue
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override bool Update(in ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
protected override bool Update(ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@ -35,7 +35,7 @@ public abstract class MidiUpdateQueue : UpdateQueue
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override bool Update(in ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
protected override bool Update(ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@ -48,7 +48,7 @@ public sealed class OpenRGBUpdateQueue : UpdateQueue
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override bool Update(in ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
protected override bool Update(ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@ -44,7 +44,7 @@ public sealed class PicoPiBulkUpdateQueue : UpdateQueue
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override bool Update(in ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
protected override bool Update(ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@ -41,7 +41,7 @@ public sealed class PicoPiHIDUpdateQueue : UpdateQueue
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override bool Update(in ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
protected override bool Update(ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@ -212,7 +212,7 @@ public sealed class PicoPiSDK : IDisposable
|
||||
/// </summary>
|
||||
/// <param name="data">The data to send.</param>
|
||||
/// <param name="channel">The channel to update.</param>
|
||||
public void SendHidUpdate(in Span<byte> buffer, int channel)
|
||||
public void SendHidUpdate(Span<byte> buffer, int channel)
|
||||
{
|
||||
int chunks = buffer.Length / HID_OFFSET_MULTIPLIER;
|
||||
if ((chunks * HID_OFFSET_MULTIPLIER) < buffer.Length) chunks++;
|
||||
@ -232,7 +232,7 @@ public sealed class PicoPiSDK : IDisposable
|
||||
/// <param name="channel">The channel to update.</param>
|
||||
/// <param name="chunk">The chunk id of the packet. (Required if packets are fragmented.)</param>
|
||||
/// <param name="update">A value indicating if the device should update directly after receiving this packet. (If packets are fragmented this should only be true for the last chunk.)</param>
|
||||
public void SendHidUpdate(in Span<byte> data, int channel, int chunk, bool update)
|
||||
public void SendHidUpdate(Span<byte> data, int channel, int chunk, bool update)
|
||||
{
|
||||
if (data.Length == 0) return;
|
||||
|
||||
@ -253,7 +253,7 @@ public sealed class PicoPiSDK : IDisposable
|
||||
/// </remarks>
|
||||
/// <param name="data">The data packet to send.</param>
|
||||
/// <param name="channel">The channel to update.</param>
|
||||
public void SendBulkUpdate(in Span<byte> data, int channel)
|
||||
public void SendBulkUpdate(Span<byte> data, int channel)
|
||||
{
|
||||
if ((data.Length == 0) || !IsBulkSupported) return;
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@ public sealed class RazerChromaLinkUpdateQueue : RazerUpdateQueue
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override nint CreateEffectParams(in ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
protected override nint CreateEffectParams(ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
{
|
||||
_Color[] colors = new _Color[_Defines.CHROMALINK_MAX_LEDS];
|
||||
|
||||
|
||||
@ -13,10 +13,17 @@ public static class LedMappings
|
||||
/// </summary>
|
||||
public static LedMapping<int> Keyboard { get; } = new()
|
||||
{
|
||||
//Row 0 is empty
|
||||
#region Row 0
|
||||
|
||||
[LedId.LedStripe1] = (_Defines.KEYBOARD_MAX_COLUMN * 0) + 0,
|
||||
[LedId.LedStripe16] = (_Defines.KEYBOARD_MAX_COLUMN * 0) + 23,
|
||||
|
||||
#endregion
|
||||
|
||||
#region Row 1
|
||||
|
||||
[LedId.LedStripe2] = (_Defines.KEYBOARD_MAX_COLUMN * 1) + 0,
|
||||
[LedId.Custom1] = (_Defines.KEYBOARD_MAX_COLUMN * 1) + 1,
|
||||
[LedId.Keyboard_Escape] = (_Defines.KEYBOARD_MAX_COLUMN * 1) + 2,
|
||||
[LedId.Keyboard_F1] = (_Defines.KEYBOARD_MAX_COLUMN * 1) + 4,
|
||||
[LedId.Keyboard_F2] = (_Defines.KEYBOARD_MAX_COLUMN * 1) + 5,
|
||||
@ -33,12 +40,17 @@ public static class LedMappings
|
||||
[LedId.Keyboard_PrintScreen] = (_Defines.KEYBOARD_MAX_COLUMN * 1) + 16,
|
||||
[LedId.Keyboard_ScrollLock] = (_Defines.KEYBOARD_MAX_COLUMN * 1) + 17,
|
||||
[LedId.Keyboard_PauseBreak] = (_Defines.KEYBOARD_MAX_COLUMN * 1) + 18,
|
||||
[LedId.Logo] = (_Defines.KEYBOARD_MAX_COLUMN * 1) + 21,
|
||||
[LedId.Keyboard_MediaPreviousTrack] = (_Defines.KEYBOARD_MAX_COLUMN * 1) + 19,
|
||||
[LedId.Keyboard_MediaPlay] = (_Defines.KEYBOARD_MAX_COLUMN * 1) + 20,
|
||||
[LedId.Keyboard_MediaNextTrack] = (_Defines.KEYBOARD_MAX_COLUMN * 1) + 21,
|
||||
[LedId.Keyboard_MediaMute] = (_Defines.KEYBOARD_MAX_COLUMN * 1) + 22,
|
||||
[LedId.LedStripe15] = (_Defines.KEYBOARD_MAX_COLUMN * 1) + 23,
|
||||
|
||||
#endregion
|
||||
|
||||
#region Row 2
|
||||
|
||||
[LedId.LedStripe3] = (_Defines.KEYBOARD_MAX_COLUMN * 2) + 0,
|
||||
[LedId.Keyboard_Programmable1] = (_Defines.KEYBOARD_MAX_COLUMN * 2) + 1,
|
||||
[LedId.Keyboard_GraveAccentAndTilde] = (_Defines.KEYBOARD_MAX_COLUMN * 2) + 2,
|
||||
[LedId.Keyboard_1] = (_Defines.KEYBOARD_MAX_COLUMN * 2) + 3,
|
||||
@ -61,11 +73,13 @@ public static class LedMappings
|
||||
[LedId.Keyboard_NumSlash] = (_Defines.KEYBOARD_MAX_COLUMN * 2) + 20,
|
||||
[LedId.Keyboard_NumAsterisk] = (_Defines.KEYBOARD_MAX_COLUMN * 2) + 21,
|
||||
[LedId.Keyboard_NumMinus] = (_Defines.KEYBOARD_MAX_COLUMN * 2) + 22,
|
||||
[LedId.LedStripe14] = (_Defines.KEYBOARD_MAX_COLUMN * 2) + 23,
|
||||
|
||||
#endregion
|
||||
|
||||
#region Row 3
|
||||
|
||||
[LedId.LedStripe4] = (_Defines.KEYBOARD_MAX_COLUMN * 3) + 0,
|
||||
[LedId.Keyboard_Programmable2] = (_Defines.KEYBOARD_MAX_COLUMN * 3) + 1,
|
||||
[LedId.Keyboard_Tab] = (_Defines.KEYBOARD_MAX_COLUMN * 3) + 2,
|
||||
[LedId.Keyboard_Q] = (_Defines.KEYBOARD_MAX_COLUMN * 3) + 3,
|
||||
@ -88,11 +102,13 @@ public static class LedMappings
|
||||
[LedId.Keyboard_Num8] = (_Defines.KEYBOARD_MAX_COLUMN * 3) + 20,
|
||||
[LedId.Keyboard_Num9] = (_Defines.KEYBOARD_MAX_COLUMN * 3) + 21,
|
||||
[LedId.Keyboard_NumPlus] = (_Defines.KEYBOARD_MAX_COLUMN * 3) + 22,
|
||||
[LedId.LedStripe13] = (_Defines.KEYBOARD_MAX_COLUMN * 3) + 23,
|
||||
|
||||
#endregion
|
||||
|
||||
#region Row 4
|
||||
|
||||
[LedId.LedStripe5] = (_Defines.KEYBOARD_MAX_COLUMN * 4) + 0,
|
||||
[LedId.Keyboard_Programmable3] = (_Defines.KEYBOARD_MAX_COLUMN * 4) + 1,
|
||||
[LedId.Keyboard_CapsLock] = (_Defines.KEYBOARD_MAX_COLUMN * 4) + 2,
|
||||
[LedId.Keyboard_A] = (_Defines.KEYBOARD_MAX_COLUMN * 4) + 3,
|
||||
@ -111,11 +127,13 @@ public static class LedMappings
|
||||
[LedId.Keyboard_Num4] = (_Defines.KEYBOARD_MAX_COLUMN * 4) + 19,
|
||||
[LedId.Keyboard_Num5] = (_Defines.KEYBOARD_MAX_COLUMN * 4) + 20,
|
||||
[LedId.Keyboard_Num6] = (_Defines.KEYBOARD_MAX_COLUMN * 4) + 21,
|
||||
[LedId.LedStripe12] = (_Defines.KEYBOARD_MAX_COLUMN * 4) + 23,
|
||||
|
||||
#endregion
|
||||
|
||||
#region Row 5
|
||||
|
||||
[LedId.LedStripe6] = (_Defines.KEYBOARD_MAX_COLUMN * 5) + 0,
|
||||
[LedId.Keyboard_Programmable4] = (_Defines.KEYBOARD_MAX_COLUMN * 5) + 1,
|
||||
[LedId.Keyboard_LeftShift] = (_Defines.KEYBOARD_MAX_COLUMN * 5) + 2,
|
||||
[LedId.Keyboard_NonUsBackslash] = (_Defines.KEYBOARD_MAX_COLUMN * 5) + 3,
|
||||
@ -135,11 +153,13 @@ public static class LedMappings
|
||||
[LedId.Keyboard_Num2] = (_Defines.KEYBOARD_MAX_COLUMN * 5) + 20,
|
||||
[LedId.Keyboard_Num3] = (_Defines.KEYBOARD_MAX_COLUMN * 5) + 21,
|
||||
[LedId.Keyboard_NumEnter] = (_Defines.KEYBOARD_MAX_COLUMN * 5) + 22,
|
||||
[LedId.LedStripe11] = (_Defines.KEYBOARD_MAX_COLUMN * 5) + 23,
|
||||
|
||||
#endregion
|
||||
|
||||
#region Row 6
|
||||
|
||||
[LedId.LedStripe7] = (_Defines.KEYBOARD_MAX_COLUMN * 6) + 0,
|
||||
[LedId.Keyboard_Programmable5] = (_Defines.KEYBOARD_MAX_COLUMN * 6) + 1,
|
||||
[LedId.Keyboard_LeftCtrl] = (_Defines.KEYBOARD_MAX_COLUMN * 6) + 2,
|
||||
[LedId.Keyboard_LeftGui] = (_Defines.KEYBOARD_MAX_COLUMN * 6) + 3,
|
||||
@ -152,12 +172,18 @@ public static class LedMappings
|
||||
[LedId.Keyboard_ArrowLeft] = (_Defines.KEYBOARD_MAX_COLUMN * 6) + 16,
|
||||
[LedId.Keyboard_ArrowDown] = (_Defines.KEYBOARD_MAX_COLUMN * 6) + 17,
|
||||
[LedId.Keyboard_ArrowRight] = (_Defines.KEYBOARD_MAX_COLUMN * 6) + 18,
|
||||
[LedId.LedStripe9] = (_Defines.KEYBOARD_MAX_COLUMN * 6) + 19,
|
||||
[LedId.Keyboard_Num0] = (_Defines.KEYBOARD_MAX_COLUMN * 6) + 20,
|
||||
[LedId.Keyboard_NumPeriodAndDelete] = (_Defines.KEYBOARD_MAX_COLUMN * 6) + 21,
|
||||
[LedId.LedStripe10] = (_Defines.KEYBOARD_MAX_COLUMN * 6) + 23,
|
||||
|
||||
#endregion
|
||||
|
||||
//Row 7 is also empty
|
||||
#region Row 6
|
||||
|
||||
[LedId.LedStripe8] = (_Defines.KEYBOARD_MAX_COLUMN * 7) + 0,
|
||||
|
||||
#endregion
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ public abstract class RazerUpdateQueue : UpdateQueue
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override bool Update(in ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
protected override bool Update(ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -77,7 +77,7 @@ public abstract class RazerUpdateQueue : UpdateQueue
|
||||
/// </summary>
|
||||
/// <param name="dataSet">The data to be updated.</param>
|
||||
/// <returns>An <see cref="IntPtr"/> pointing to the effect parameter struct.</returns>
|
||||
protected abstract nint CreateEffectParams(in ReadOnlySpan<(object key, Color color)> dataSet);
|
||||
protected abstract nint CreateEffectParams(ReadOnlySpan<(object key, Color color)> dataSet);
|
||||
|
||||
#endregion
|
||||
}
|
||||
@ -25,7 +25,7 @@ public sealed class RazerHeadsetUpdateQueue : RazerUpdateQueue
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override nint CreateEffectParams(in ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
protected override nint CreateEffectParams(ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
{
|
||||
_Color[] colors = new _Color[_Defines.HEADSET_MAX_LEDS];
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@ public sealed class RazerKeyboardUpdateQueue : RazerUpdateQueue
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override nint CreateEffectParams(in ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
protected override nint CreateEffectParams(ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
{
|
||||
_Color[] colors = new _Color[_Defines.KEYBOARD_MAX_LEDS];
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@ public sealed class RazerKeypadUpdateQueue : RazerUpdateQueue
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override nint CreateEffectParams(in ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
protected override nint CreateEffectParams(ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
{
|
||||
_Color[] colors = new _Color[_Defines.KEYPAD_MAX_LEDS];
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@ public sealed class RazerMouseUpdateQueue : RazerUpdateQueue
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override nint CreateEffectParams(in ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
protected override nint CreateEffectParams(ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
{
|
||||
_Color[] colors = new _Color[_Defines.MOUSE_MAX_LEDS];
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@ public sealed class RazerMousepadUpdateQueue : RazerUpdateQueue
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override nint CreateEffectParams(in ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
protected override nint CreateEffectParams(ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
{
|
||||
_Color[] colors = new _Color[_Defines.MOUSEPAD_MAX_LEDS];
|
||||
|
||||
|
||||
@ -139,7 +139,7 @@ public sealed class RazerDeviceProvider : AbstractRGBDeviceProvider
|
||||
{ 0x028B, RGBDeviceType.Keyboard, "Blade 17 (2022)", LedMappings.Keyboard, RazerEndpointType.Keyboard },
|
||||
{ 0x028C, RGBDeviceType.Keyboard, "Blade 14 (2022)", LedMappings.Keyboard, RazerEndpointType.Keyboard },
|
||||
{ 0x029F, RGBDeviceType.Keyboard, "Blade 16 (2023)", LedMappings.Blade, RazerEndpointType.Keyboard },
|
||||
{ 0x028D, RGBDeviceType.Keyboard, "BlackWidow V4", LedMappings.Keyboard, RazerEndpointType.Keyboard },
|
||||
{ 0x028D, RGBDeviceType.Keyboard, "BlackWidow V4 Pro", LedMappings.Keyboard, RazerEndpointType.Keyboard },
|
||||
{ 0x0290, RGBDeviceType.Keyboard, "DeathStalker V2 Pro", LedMappings.Keyboard, RazerEndpointType.Keyboard }, // Wireless
|
||||
{ 0x0292, RGBDeviceType.Keyboard, "DeathStalker V2 Pro", LedMappings.Keyboard, RazerEndpointType.Keyboard }, // Wired
|
||||
{ 0x0294, RGBDeviceType.Keyboard, "Ornata V3 X", LedMappings.Keyboard, RazerEndpointType.Keyboard },
|
||||
|
||||
@ -51,7 +51,7 @@ internal sealed class SteelSeriesDeviceUpdateQueue : UpdateQueue
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override bool Update(in ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
protected override bool Update(ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@ -63,7 +63,7 @@ internal sealed class WledDeviceUpdateQueue : UpdateQueue
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override bool Update(in ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
protected override bool Update(ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@ -56,7 +56,7 @@ public abstract class SerialConnectionUpdateQueue<TData> : UpdateQueue
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override bool Update(in ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
protected override bool Update(ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@ -77,7 +77,7 @@ public sealed class NodeMCUWS2812USBUpdateQueue : UpdateQueue
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override bool Update(in ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
protected override bool Update(ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@ -33,7 +33,7 @@ public sealed class WootingUpdateQueue : UpdateQueue
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override bool Update(in ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
protected override bool Update(ReadOnlySpan<(object key, Color color)> dataSet)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@ -61,7 +61,7 @@ public sealed class BytePixelTexture : PixelTexture<byte>
|
||||
|
||||
/// <inheritdoc />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
protected override Color GetColor(in ReadOnlySpan<byte> pixel)
|
||||
protected override Color GetColor(ReadOnlySpan<byte> pixel)
|
||||
{
|
||||
return ColorFormat switch
|
||||
{
|
||||
|
||||
@ -61,7 +61,7 @@ public sealed class FloatPixelTexture : PixelTexture<float>
|
||||
|
||||
/// <inheritdoc />
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
protected override Color GetColor(in ReadOnlySpan<float> pixel)
|
||||
protected override Color GetColor(ReadOnlySpan<float> pixel)
|
||||
{
|
||||
return ColorFormat switch
|
||||
{
|
||||
|
||||
@ -18,7 +18,7 @@ public sealed class AverageByteSampler : ISampler<byte>
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
public unsafe void Sample(in SamplerInfo<byte> info, in Span<byte> pixelData)
|
||||
public unsafe void Sample(in SamplerInfo<byte> info, Span<byte> pixelData)
|
||||
{
|
||||
int count = info.Width * info.Height;
|
||||
if (count == 0) return;
|
||||
|
||||
@ -12,7 +12,7 @@ public sealed class AverageFloatSampler : ISampler<float>
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
public unsafe void Sample(in SamplerInfo<float> info, in Span<float> pixelData)
|
||||
public unsafe void Sample(in SamplerInfo<float> info, Span<float> pixelData)
|
||||
{
|
||||
int count = info.Width * info.Height;
|
||||
if (count == 0) return;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user