Skip to content

Commit 2fb2fc9

Browse files
xknsLord-Grey
andauthored
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 <[email protected]>
1 parent a2266b1 commit 2fb2fc9

File tree

17 files changed

+1033
-32
lines changed

17 files changed

+1033
-32
lines changed

3RD_PARTY_LICENSES

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1874,3 +1874,27 @@ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
18741874
POSSIBILITY OF SUCH DAMAGES.
18751875

18761876
END OF TERMS AND CONDITIONS
1877+
1878+
==========================================
1879+
Oklab Color Space Reference Implementation
1880+
==========================================
1881+
1882+
Copyright (c) 2021 Björn Ottosson
1883+
1884+
Permission is hereby granted, free of charge, to any person obtaining a copy of
1885+
this software and associated documentation files (the "Software"), to deal in
1886+
the Software without restriction, including without limitation the rights to
1887+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
1888+
of the Software, and to permit persons to whom the Software is furnished to do
1889+
so, subject to the following conditions:
1890+
1891+
The above copyright notice and this permission notice shall be included in all
1892+
copies or substantial portions of the Software.
1893+
1894+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1895+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1896+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1897+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1898+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1899+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1900+
SOFTWARE.

CHANGELOG.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010

1111
### Added
1212

13+
- Added saturation gain and brightness/value gain as new color processing settings
14+
1315
### Changed
1416

1517
### Fixed
@@ -22,15 +24,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2224
- Allow to build a "light" version of Hyperion, i.e. no grabbers, or services like flat-/proto buffers, boblight, CEC
2325
- Allow to restart Hyperion via Systray
2426
- mDNS support for all platforms inkl. Windows (#740)
25-
- Forwarder: mDNS discovery support and ease of configuration of other Hyperion instances
27+
- Forwarder: mDNS discovery support and ease of configuration of other Hyperion instances
2628
- Grabber: mDNS discovery for standalone grabbers
2729
- Grabber: Dynamic loading of the Dispmanx Grabber (#1418)
2830
- Flatbuffer/Protobuf are now able to receive RGBA data
2931
- Added the instance number as part of the logline (#910). In the UI Log the instance is presented as a readable name.
3032
- New language: Japanese
3133

3234
##### LED-Devices
33-
- Support retry attempts enabling devices, e.g. to open devices after network or a device itself got available (#1302). Fixes that devices got "stuck", if initial open failed e.g. for WLED, Hue
35+
- Support retry attempts enabling devices, e.g. to open devices after network or a device itself got available (#1302). Fixes that devices got "stuck", if initial open failed e.g. for WLED, Hue
3436
- New UDP-DDP (Distributed Display Protocol) device to overcome the 490 LEDs limitation of UDP-RAW
3537
- mDNS discovery support and ease of configuration (Cololight, Nanoleaf, Philips-Hue, WLED, Yeelight); removes the need to configure IP-Address, as address is resolved automatically.
3638
- Allow to disable switching LEDs on during startup (#1390)
@@ -116,7 +118,7 @@ Note: Existing configurations are migrated to new structures automatically
116118
- Fixed hyperion-remote when sending multiple Hex-Colors with "Set Color" option
117119
- UI: Fixed "Selected Hyperion instance isn't running" issue (#1357)
118120
- Fixed Database migration version handling
119-
- Fixed Python ModuleNotFoundError (#1109)
121+
- Fixed Python ModuleNotFoundError (#1109)
120122

121123
### Technical
122124

@@ -135,7 +137,7 @@ We did not weaken security, but provide you with an easy to use script to switch
135137
### Added:
136138
- Script to change the user Hyperion is executed with.
137139
To run Hyperion with root privileges (e.g. for WS281x) execute <br> `sudo updateHyperionUser -u root`
138-
- Gif effects can source Gifs via URLs in addition to local files as input
140+
- Gif effects can source Gifs via URLs in addition to local files as input
139141

140142
- System info screen: Added used config path and "is run under root/admin"
141143
- LED-Device enhancements
@@ -167,7 +169,7 @@ To run Hyperion with root privileges (e.g. for WS281x) execute <br> `sudo update
167169
- Escape XSS payload to avoid execution (#1292)
168170
- Include libqt5sql5-sqlite packaging dependency
169171
- Fixed embedded Python location (#1109)
170-
172+
171173
- LED-Devices
172174
- Fixed Philips Hue wizard (#1276)
173175
- Fixed AtmoOrb wizard
@@ -193,12 +195,12 @@ The refined color coding in the user-interfaces, helps you to quickly identify i
193195

194196
Of course, the release brings new features (e.g. USB Capture on Windows), as well as minor enhancements and a good number of fixes.
195197

196-
Note:
198+
Note:
197199

198200
- **IMPORTANT:** Due to the rework of the grabbers, both screen- and video grabbers are disabled after the upgrade to the new version.
199201
Please, re-enable the grabber of choice via the UI, validate the configuration and save the setup. The grabber should the restart.
200202

201-
- Hyperion packages can now be installed under Ubuntu (x64) and Debian (amd64/armhf) (incl. Raspberry Pi OS) via our own APT server.
203+
- Hyperion packages can now be installed under Ubuntu (x64) and Debian (amd64/armhf) (incl. Raspberry Pi OS) via our own APT server.
202204
Details about the installation can be found in the [installation.md](https://github.com/hyperion-project/hyperion.ng/blob/master/Installation.md) and at [apt.hyperion-project.org](apt.hyperion-project.org).
203205
- Find here more details on [supported platforms and configuration sets](https://github.com/hyperion-project/hyperion.ng/blob/master/doc/development/SupportedPlatforms.md)
204206

assets/webconfig/i18n/en.json

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,16 @@
8888
"conf_leds_layout_cl_leftbottom": "Left 50% - 100% Bottom",
8989
"conf_leds_layout_cl_leftmiddle": "Left 25% - 75% Middle",
9090
"conf_leds_layout_cl_lefttop": "Left 0% - 50% Top",
91-
"conf_leds_layout_cl_lightPosBottomLeft14": "Bottom: 0 - 25% from Left",
91+
"conf_leds_layout_cl_lightPosBottomLeft14": "Bottom: 0 - 25% from Left",
9292
"conf_leds_layout_cl_lightPosBottomLeft12": "Bottom: 25 - 50% from Left",
9393
"conf_leds_layout_cl_lightPosBottomLeft34": "Bottom: 50 - 75% from Left",
9494
"conf_leds_layout_cl_lightPosBottomLeft11": "Bottom: 75 - 100% from Left",
95-
"conf_leds_layout_cl_lightPosBottomLeft112": "Bottom: 0 - 50% from Left",
95+
"conf_leds_layout_cl_lightPosBottomLeft112": "Bottom: 0 - 50% from Left",
9696
"conf_leds_layout_cl_lightPosBottomLeft121": "Bottom: 50 - 100% from Left",
9797
"conf_leds_layout_cl_lightPosBottomLeftNewMid": "Bottom: 25 - 75% from Left",
98-
"conf_leds_layout_cl_lightPosTopLeft112": "Top: 0 - 50% from Left",
98+
"conf_leds_layout_cl_lightPosTopLeft112": "Top: 0 - 50% from Left",
9999
"conf_leds_layout_cl_lightPosTopLeft121": "Top: 50 - 100% from Left",
100-
"conf_leds_layout_cl_lightPosTopLeftNewMid": "Top: 25 - 75% from Left",
100+
"conf_leds_layout_cl_lightPosTopLeftNewMid": "Top: 25 - 75% from Left",
101101
"conf_leds_layout_cl_overlap": "Overlap",
102102
"conf_leds_layout_cl_reversdir": "Reverse direction",
103103
"conf_leds_layout_cl_right": "Right",
@@ -284,6 +284,10 @@
284284
"edt_conf_color_magenta_title": "Magenta",
285285
"edt_conf_color_red_expl": "The calibrated red value.",
286286
"edt_conf_color_red_title": "Red",
287+
"edt_conf_color_saturationGain_expl": "Adjusts the saturation of colors. 1.0 means no change, over 1.0 increases saturation, under 1.0 desaturates.",
288+
"edt_conf_color_saturationGain_title": "Saturation gain",
289+
"edt_conf_color_brightnessGain_expl": "Adjusts the brightness of colors. 1.0 means no change, over 1.0 increases brightness, under 1.0 decreases brightness.",
290+
"edt_conf_color_brightnessGain_title": "Brightness gain",
287291
"edt_conf_color_white_expl": "The calibrated white value.",
288292
"edt_conf_color_white_title": "White",
289293
"edt_conf_color_yellow_expl": "The calibrated yellow value.",
@@ -551,7 +555,7 @@
551555
"edt_dev_spec_brightnessOverwrite_title": "Overwrite brightness",
552556
"edt_dev_spec_brightnessThreshold_title": "Signal detection brightness minimum",
553557
"edt_dev_spec_brightness_title": "Brightness",
554-
"edt_dev_spec_candyGamma_title" : "'Candy' mode (double gamma correction)",
558+
"edt_dev_spec_candyGamma_title" : "'Candy' mode (double gamma correction)",
555559
"edt_dev_spec_chanperfixture_title": "Channels per Fixture",
556560
"edt_dev_spec_cid_title": "CID",
557561
"edt_dev_spec_clientKey_title": "Clientkey",
@@ -862,7 +866,7 @@
862866
"general_speech_fr": "French",
863867
"general_speech_hu": "Hungarian",
864868
"general_speech_it": "Italian",
865-
"general_speech_ja": "Japanese",
869+
"general_speech_ja": "Japanese",
866870
"general_speech_nb": "Norwegian (Bokmål)",
867871
"general_speech_nl": "Dutch",
868872
"general_speech_pl": "Polish",

assets/webconfig/js/content_remote.js

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,20 @@ $(document).ready(function () {
5656
});
5757
}
5858
else {
59-
if (sColor[key].key == "brightness" || sColor[key].key == "brightnessCompensation" || sColor[key].key == "backlightThreshold")
60-
property = '<div class="input-group"><input id="cr_' + sColor[key].key + '" type="number" class="form-control" min="0" max="100" step="10" value="' + value + '"/><span class="input-group-addon">' + $.i18n("edt_append_percent") + '</span></div>';
61-
else
59+
if (sColor[key].key == "brightness" ||
60+
sColor[key].key == "brightnessCompensation" ||
61+
sColor[key].key == "backlightThreshold" ||
62+
sColor[key].key == "saturationGain" ||
63+
sColor[key].key == "brightnessGain") {
64+
65+
property = '<input id="cr_' + sColor[key].key + '" type="number" class="form-control" min="' + sColor[key].minimum + '" max="' + sColor[key].maximum + '" step="' + sColor[key].step + '" value="' + value + '"/>';
66+
if (sColor[key].append === "edt_append_percent") {
67+
property = '<div class="input-group">' + property + '<span class="input-group-addon">' + $.i18n("edt_append_percent") + '</span></div>';
68+
}
69+
}
70+
else {
6271
property = '<input id="cr_' + sColor[key].key + '" type="number" class="form-control" min="0.1" max="4.0" step="0.1" value="' + value + '"/>';
72+
}
6373

6474
$('.crtbody').append(createTableRow([title, property], false, true));
6575
$('#cr_' + sColor[key].key).off().on('change', function (e) {
@@ -134,7 +144,7 @@ $(document).ready(function () {
134144
owner = $.i18n('remote_color_label_color') + ' ' + '<div style="width:18px; height:18px; border-radius:20px; margin-bottom:-4px; border:1px grey solid; background-color: rgb(' + value + '); display:inline-block" title="RGB: (' + value + ')"></div>';
135145
break;
136146
case "IMAGE":
137-
owner = $.i18n('remote_effects_label_picture') + (owner !== undefined ? (' ' + owner): "");
147+
owner = $.i18n('remote_effects_label_picture') + (owner !== undefined ? (' ' + owner) : "");
138148
break;
139149
case "GRABBER":
140150
owner = $.i18n('general_comp_GRABBER') + ': (' + owner + ')';
@@ -153,8 +163,7 @@ $(document).ready(function () {
153163
break;
154164
}
155165

156-
if (!(duration && duration < 0))
157-
{
166+
if (!(duration && duration < 0)) {
158167
if (duration && compId != "GRABBER" && compId != "FLATBUFSERVER" && compId != "PROTOSERVER")
159168
owner += '<br/><span style="font-size:80%; color:grey;">' + $.i18n('remote_input_duration') + ' ' + duration.toFixed(0) + $.i18n('edt_append_s') + '</span>';
160169

@@ -386,7 +395,6 @@ $(document).ready(function () {
386395
$('#effect_row').hide();
387396
}
388397

389-
390398
// interval updates
391399

392400
$(window.hyperion).on('components-updated', function (e, comp) {
@@ -415,3 +423,4 @@ $(document).ready(function () {
415423

416424
removeOverlay();
417425
});
426+

config/hyperion.config.json.default

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@
4646
"backlightThreshold" : 0,
4747
"backlightColored" : false,
4848
"brightness" : 100,
49-
"brightnessCompensation" : 100
49+
"brightnessCompensation" : 100,
50+
"saturationGain" : 1.0,
51+
"brightnessGain" : 1.0
5052
}
5153
]
5254
},

0 commit comments

Comments
 (0)