// ReSharper disable MemberCanBePrivate.Global
// ReSharper disable UnusedMember.Global
using RGB.NET.Core;
namespace RGB.NET.Devices.WS281X.Bitwizard;
// ReSharper disable once InconsistentNaming
///
///
/// Represents an bitwizard WS2812 USB device.
///
public sealed class BitwizardWS2812USBDevice : AbstractRGBDevice, ILedStripe
{
#region Properties & Fields
private readonly int _ledOffset;
#endregion
#region Constructors
///
/// Initializes a new instance of the class.
///
/// The device info of this device.
/// The update queue performing updates for this device.
/// The offset used to access the leds on this device.
/// The amount of leds on this device.
public BitwizardWS2812USBDevice(BitwizardWS2812USBDeviceInfo deviceInfo, BitwizardWS2812USBUpdateQueue updateQueue, int ledOffset, int ledCount)
: base(deviceInfo, updateQueue)
{
this._ledOffset = ledOffset;
InitializeLayout(ledCount);
}
#endregion
#region Methods
private void InitializeLayout(int ledCount)
{
for (int i = 0; i < ledCount; i++)
AddLed(LedId.LedStripe1 + i, new Point(i * 10, 0), new Size(10, 10));
}
///
protected override object GetLedCustomData(LedId ledId) => _ledOffset + ((int)ledId - (int)LedId.LedStripe1);
#endregion
}