1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00
Artemis/src/Artemis.Core/Extensions/RgbDeviceExtensions.cs
Robert eb7c89d4ad Rendering - Sovled inconsistencies between software and Vulkan rendering
LED sampling - Improved LED sampling on <100% scale
2021-03-25 19:59:28 +01:00

40 lines
1.1 KiB
C#

using System.Text;
using RGB.NET.Core;
using SkiaSharp;
namespace Artemis.Core
{
internal static class RgbDeviceExtensions
{
public static string GetDeviceIdentifier(this IRGBDevice rgbDevice)
{
StringBuilder builder = new();
builder.Append(rgbDevice.DeviceInfo.DeviceName);
builder.Append('-');
builder.Append(rgbDevice.DeviceInfo.Manufacturer);
builder.Append('-');
builder.Append(rgbDevice.DeviceInfo.Model);
builder.Append('-');
builder.Append(rgbDevice.DeviceInfo.DeviceType);
return builder.ToString();
}
}
internal static class RgbRectangleExtensions
{
public static SKRect ToSKRect(this Rectangle rectangle)
{
return SKRect.Create(
rectangle.Location.X,
rectangle.Location.Y,
rectangle.Size.Width,
rectangle.Size.Height
);
}
public static SKRectI ToSKRectI(this Rectangle rectangle)
{
return SKRectI.Round(ToSKRect(rectangle));
}
}
}