Merge pull request #517 from Artemis-RGB/feature/color-calibration

Added Per device color calibration
This commit is contained in:
Robert Beekman authored and GitHub committed 2020-12-12 21:11:41 +01:00
commit 36058efc4d
8 files changed
+343 -46

No files matched your search

@@ -27,6 +27,9 @@ namespace Artemis.Core
Rotation = 0;
Scale = 1;
ZIndex = 1;
RedScale = 1;
GreenScale = 1;
BlueScale = 1;
deviceProvider.DeviceLayoutPaths.TryGetValue(rgbDevice, out string? layoutPath);
LayoutPath = layoutPath;
@@ -171,6 +174,45 @@ namespace Artemis.Core
}
}
/// <summary>
/// Gets or sets the scale of the red color component used for calibration
/// </summary>
public double RedScale
{
get => DeviceEntity.RedScale;
set
{
DeviceEntity.RedScale = value;
OnPropertyChanged(nameof(RedScale));
}
}
/// <summary>
/// Gets or sets the scale of the green color component used for calibration
/// </summary>
public double GreenScale
{
get => DeviceEntity.GreenScale;
set
{
DeviceEntity.GreenScale = value;
OnPropertyChanged(nameof(GreenScale));
}
}
/// <summary>
/// Gets or sets the scale of the blue color component used for calibration
/// </summary>
public double BlueScale
{
get => DeviceEntity.BlueScale;
set
{
DeviceEntity.BlueScale = value;
OnPropertyChanged(nameof(BlueScale));
}
}
/// <summary>
/// Gets the path to where the layout of the device was (attempted to be) loaded from
/// </summary>
@@ -57,5 +57,14 @@ namespace Artemis.Core
{
return RgbLed.ToString();
}
/// <summary>
/// Gets the color of this led, reverting the correction done to the parent device
/// </summary>
/// <returns></returns>
public Color GetOriginalColor()
{
return RgbLed.Color.DivideRGB(Device.RedScale, Device.GreenScale, Device.BlueScale);
}
}
}