mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Saturation & Brightness/Value Gain using Oklab color space (#1477)
* Imported Oklab reference implementation * Add Okhsv conversions * Fixed formatting error * Add saturation and value gain to schemas * Add english translation for saturation, value gain * Created OkhsvTransform * Make OkhsvTransform configurable * Apply OkhvsTransform * Clamped values during transform * Precalculate isIdentity in OkhsvTransform * Skip OkhsvTransform if it is the identity function * Added changelog message * Allow for full desaturation * Imported recommended changes by LordGrey * Fixed typo in constant * Fixed anti-pattern in ok_color.h * Correct indentions * Correct remote-control * Limited maximum gain settings to practical range * Renane valueGain to brightnessGain for clarity and understanding Co-authored-by: LordGrey <lordgrey.emmel@gmail.com>
This commit is contained in:
@@ -112,8 +112,14 @@ void MultiColorAdjustment::applyAdjustment(std::vector<ColorRgb>& ledColors)
|
||||
uint8_t ored = color.red;
|
||||
uint8_t ogreen = color.green;
|
||||
uint8_t oblue = color.blue;
|
||||
uint8_t B_RGB = 0, B_CMY = 0, B_W = 0;
|
||||
uint8_t B_RGB = 0;
|
||||
uint8_t B_CMY = 0;
|
||||
uint8_t B_W = 0;
|
||||
|
||||
if (!adjustment->_okhsvTransform.isIdentity())
|
||||
{
|
||||
adjustment->_okhsvTransform.transform(ored, ogreen, oblue);
|
||||
}
|
||||
adjustment->_rgbTransform.transform(ored,ogreen,oblue);
|
||||
adjustment->_rgbTransform.getBrightnessComponents(B_RGB, B_CMY, B_W);
|
||||
|
||||
|
@@ -158,6 +158,17 @@
|
||||
"maxItems" : 3,
|
||||
"propertyOrder" : 10
|
||||
},
|
||||
"saturationGain" :
|
||||
{
|
||||
"type" : "number",
|
||||
"title" : "edt_conf_color_saturationGain_title",
|
||||
"required" : true,
|
||||
"minimum" : 0.0,
|
||||
"maximum": 10.0,
|
||||
"default" : 1.0,
|
||||
"step" : 0.1,
|
||||
"propertyOrder" : 11
|
||||
},
|
||||
"backlightThreshold" :
|
||||
{
|
||||
"type" : "integer",
|
||||
@@ -167,7 +178,7 @@
|
||||
"maximum": 100,
|
||||
"default" : 0,
|
||||
"append" : "edt_append_percent",
|
||||
"propertyOrder" : 11
|
||||
"propertyOrder" : 12
|
||||
},
|
||||
"backlightColored" :
|
||||
{
|
||||
@@ -175,7 +186,7 @@
|
||||
"title" : "edt_conf_color_backlightColored_title",
|
||||
"required" : true,
|
||||
"default" : false,
|
||||
"propertyOrder" : 12
|
||||
"propertyOrder" : 13
|
||||
},
|
||||
"brightness" :
|
||||
{
|
||||
@@ -186,7 +197,7 @@
|
||||
"maximum": 100,
|
||||
"default" : 100,
|
||||
"append" : "edt_append_percent",
|
||||
"propertyOrder" : 13
|
||||
"propertyOrder" : 14
|
||||
},
|
||||
"brightnessCompensation" :
|
||||
{
|
||||
@@ -197,7 +208,18 @@
|
||||
"maximum": 100,
|
||||
"default" : 0,
|
||||
"append" : "edt_append_percent",
|
||||
"propertyOrder" : 14
|
||||
"propertyOrder" : 15
|
||||
},
|
||||
"brightnessGain" :
|
||||
{
|
||||
"type" : "number",
|
||||
"title" : "edt_conf_color_brightnessGain_title",
|
||||
"required" : true,
|
||||
"minimum" : 0.1,
|
||||
"maximum": 10.0,
|
||||
"default" : 1.0,
|
||||
"step" : 0.1,
|
||||
"propertyOrder" : 16
|
||||
},
|
||||
"gammaRed" :
|
||||
{
|
||||
@@ -208,7 +230,7 @@
|
||||
"maximum": 100.0,
|
||||
"default" : 2.2,
|
||||
"step" : 0.1,
|
||||
"propertyOrder" : 15
|
||||
"propertyOrder" : 17
|
||||
},
|
||||
"gammaGreen" :
|
||||
{
|
||||
@@ -219,7 +241,7 @@
|
||||
"maximum": 100.0,
|
||||
"default" : 2.2,
|
||||
"step" : 0.1,
|
||||
"propertyOrder" : 16
|
||||
"propertyOrder" : 18
|
||||
},
|
||||
"gammaBlue" :
|
||||
{
|
||||
@@ -230,7 +252,7 @@
|
||||
"maximum": 100.0,
|
||||
"default" : 2.2,
|
||||
"step" : 0.1,
|
||||
"propertyOrder" : 17
|
||||
"propertyOrder" : 19
|
||||
}
|
||||
},
|
||||
"additionalProperties" : false
|
||||
|
Reference in New Issue
Block a user