Skip to content

Commit 021c4ba

Browse files
committed
Revert changes from PR1902
1 parent 1d4487b commit 021c4ba

File tree

9 files changed

+9
-111
lines changed

9 files changed

+9
-111
lines changed

wled00/cfg.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,6 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
274274
CJSON(arlsDisableGammaCorrection, if_live[F("no-gc")]); // false
275275
CJSON(arlsOffset, if_live[F("offset")]); // 0
276276

277-
CJSON(liveHSVCorrection, if_live[F("corr")]);
278-
CJSON(liveHSVSaturation, if_live[F("hsvsat")]);
279-
CJSON(liveHSVValue, if_live[F("hsvval")]);
280-
281277
CJSON(alexaEnabled, interfaces["va"][F("alexa")]); // false
282278

283279
CJSON(macroAlexaOn, interfaces["va"]["macros"][0]);
@@ -622,9 +618,6 @@ void serializeConfig() {
622618
if_live[F("maxbri")] = arlsForceMaxBri;
623619
if_live[F("no-gc")] = arlsDisableGammaCorrection;
624620
if_live[F("offset")] = arlsOffset;
625-
if_live[F("corr")] = liveHSVCorrection;
626-
if_live[F("hsvsat")] = liveHSVSaturation;
627-
if_live[F("hsvval")] = liveHSVValue;
628621

629622
JsonObject if_va = interfaces.createNestedObject("va");
630623
if_va[F("alexa")] = alexaEnabled;

wled00/colors.cpp

Lines changed: 0 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -47,77 +47,6 @@ void relativeChangeWhite(int8_t amount, byte lowerBoundary)
4747
col[3] = new_val;
4848
}
4949

50-
void colorHSVtoRGB(float hue, float saturation, float value, byte& red, byte& green, byte& blue)
51-
{
52-
float r, g, b;
53-
54-
auto i = static_cast<int>(hue * 6);
55-
auto f = hue * 6 - i;
56-
auto p = value * (1 - saturation);
57-
auto q = value * (1 - f * saturation);
58-
auto t = value * (1 - (1 - f) * saturation);
59-
60-
switch (i % 6)
61-
{
62-
case 0: r = value, g = t, b = p;
63-
break;
64-
case 1: r = q, g = value, b = p;
65-
break;
66-
case 2: r = p, g = value, b = t;
67-
break;
68-
case 3: r = p, g = q, b = value;
69-
break;
70-
case 4: r = t, g = p, b = value;
71-
break;
72-
case 5: r = value, g = p, b = q;
73-
break;
74-
}
75-
76-
red = static_cast<uint8_t>(r * 255);
77-
green = static_cast<uint8_t>(g * 255);
78-
blue = static_cast<uint8_t>(b * 255);
79-
}
80-
81-
void colorRGBtoHSV(byte red, byte green, byte blue, float& hue, float& saturation, float& value)
82-
{
83-
auto rd = static_cast<float>(red) / 255;
84-
auto gd = static_cast<float>(green) / 255;
85-
auto bd = static_cast<float>(blue) / 255;
86-
auto max = std::max({ rd, gd, bd }), min = std::min({ rd, gd, bd });
87-
88-
value = max;
89-
90-
auto d = max - min;
91-
saturation = max == 0 ? 0 : d / max;
92-
93-
hue = 0;
94-
if (max != min)
95-
{
96-
if (max == rd) hue = (gd - bd) / d + (gd < bd ? 6 : 0);
97-
else if (max == gd) hue = (bd - rd) / d + 2;
98-
else if (max == bd) hue = (rd - gd) / d + 4;
99-
hue /= 6;
100-
}
101-
}
102-
103-
#define SATURATION_THRESHOLD 0.1
104-
#define MAX_HSV_VALUE 1
105-
#define MAX_HSV_SATURATION 1
106-
107-
//corrects the realtime colors. 10 is the unchanged saturation/value
108-
//this feature might cause slowdowns with large LED counts
109-
void correctColors(byte r, byte g, byte b, byte* rgb) {
110-
float hsv[3] = { 0,0,0 };
111-
colorRGBtoHSV(r, g,b , hsv[0], hsv[1], hsv[2]);
112-
float saturated = hsv[1] > SATURATION_THRESHOLD ?
113-
hsv[1] * ((float)liveHSVSaturation / 10) : hsv[1];
114-
float saturation = saturated < MAX_HSV_SATURATION ? saturated : MAX_HSV_SATURATION;
115-
116-
float valued = hsv[2] * ((float)liveHSVValue/10);
117-
float value = valued < MAX_HSV_VALUE ? valued : MAX_HSV_VALUE;
118-
colorHSVtoRGB(hsv[0], saturation, value, rgb[0], rgb[1], rgb[2]);
119-
}
120-
12150
void colorHStoRGB(uint16_t hue, byte sat, byte* rgb) //hue, sat to rgb
12251
{
12352
float h = ((float)hue)/65535.0;

wled00/data/settings_sync.htm

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ <h3>WLED Broadcast</h3>
2828
<i>Reboot required to apply changes. </i>
2929
<h3>Instance List</h3>
3030
Enable instance list: <input type="checkbox" name="NL"><br>
31-
Make this instance discoverable: <input type="checkbox" name="NB">
31+
Make this instance discoverable: <input type="checkbox" name="NB"><br>
3232
<h3>Realtime</h3>
3333
Receive UDP realtime: <input type="checkbox" name="RD"><br><br>
3434
<i>Network DMX input</i><br>
@@ -59,10 +59,7 @@ <h3>Realtime</h3>
5959
Timeout: <input name="ET" type="number" min="1" max="65000" required> ms<br>
6060
Force max brightness: <input type="checkbox" name="FB"><br>
6161
Disable realtime gamma correction: <input type="checkbox" name="RG"><br>
62-
Realtime LED offset: <input name="WO" type="number" min="-255" max="255" required><br><br>
63-
Realtime HSV color correction: <input type="checkbox" name="HX"><br>
64-
Saturation (1-30): <input name="HS" type="number" min="1" max="30" value="1" step="1"><br>
65-
Value (1-60): <input name="HV" type="number" min="1" max="60" value="10" step="1">
62+
Realtime LED offset: <input name="WO" type="number" min="-255" max="255" required>
6663
<h3>Alexa Voice Assistant</h3>
6764
Emulate Alexa device: <input type="checkbox" name="AL"><br>
6865
Alexa invocation name: <input name="AI" maxlength="32">

wled00/fcn_declare.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ void colorFromUint32(uint32_t in, bool secondary = false);
5858
void colorFromUint24(uint32_t in, bool secondary = false);
5959
uint32_t colorFromRgbw(byte* rgbw);
6060
void relativeChangeWhite(int8_t amount, byte lowerBoundary = 0);
61-
void colorHSVtoRGB(float hue, float saturation, float value, byte& red, byte& green, byte& blue);
62-
void colorRGBtoHSV(byte red, byte green, byte blue, float& hue, float& saturation, float& value);
63-
void correctColors(byte r, byte g, byte b, byte* rgb);
6461
void colorHStoRGB(uint16_t hue, byte sat, byte* rgb); //hue, sat to rgb
6562
void colorKtoRGB(uint16_t kelvin, byte* rgb);
6663
void colorCTtoRGB(uint16_t mired, byte* rgb); //white spectrum to rgb

wled00/html_settings.h

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,8 @@ Send Macro notifications: <input type="checkbox" name="SM"><br>
254254
Send notifications twice: <input type="checkbox" name="S2"><br><i>
255255
Reboot required to apply changes.</i><h3>Instance List</h3>
256256
Enable instance list: <input type="checkbox" name="NL"><br>
257-
Make this instance discoverable: <input type="checkbox" name="NB"><h3>Realtime
258-
</h3>Receive UDP realtime: <input type="checkbox" name="RD"><br><br><i>
257+
Make this instance discoverable: <input type="checkbox" name="NB"><br><h3>
258+
Realtime</h3>Receive UDP realtime: <input type="checkbox" name="RD"><br><br><i>
259259
Network DMX input</i><br>Type: <select name="DI" onchange="SP(),adj()"><option
260260
value="5568">E1.31 (sACN)</option><option value="6454">Art-Net</option><option
261261
value="4048">DDP</option><option value="0" selected="selected">Custom port
@@ -275,12 +275,9 @@ E1.31 info</a><br>Timeout: <input name="ET" type="number" min="1" max="65000"
275275
required> ms<br>Force max brightness: <input type="checkbox" name="FB"><br>
276276
Disable realtime gamma correction: <input type="checkbox" name="RG"><br>
277277
Realtime LED offset: <input name="WO" type="number" min="-255" max="255"
278-
required><br><br>Realtime HSV color correction: <input type="checkbox"
279-
name="HX"><br>Saturation (1-30): <input name="HS" type="number" min="1"
280-
max="30" value="1" step="1"><br>Value (1-60): <input name="HV" type="number"
281-
min="1" max="60" value="10" step="1"><h3>Alexa Voice Assistant</h3>
282-
Emulate Alexa device: <input type="checkbox" name="AL"><br>
283-
Alexa invocation name: <input name="AI" maxlength="32"><h3>Blynk</h3><b>
278+
required><h3>Alexa Voice Assistant</h3>Emulate Alexa device: <input
279+
type="checkbox" name="AL"><br>Alexa invocation name: <input name="AI"
280+
maxlength="32"><h3>Blynk</h3><b>
284281
Blynk, MQTT and Hue sync all connect to external hosts!<br>
285282
This may impact the responsiveness of the ESP8266.</b><br>
286283
For best results, only use one of these services at a time.<br>

wled00/set.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,6 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage)
221221
notifyMacro = request->hasArg(F("SM"));
222222
notifyTwice = request->hasArg(F("S2"));
223223

224-
liveHSVCorrection = request->hasArg(F("HX"));
225-
liveHSVSaturation = request->arg(F("HS")).toInt();
226-
liveHSVValue = request->arg(F("HV")).toInt();
227-
228224
nodeListEnabled = request->hasArg(F("NL"));
229225
if (!nodeListEnabled) Nodes.clear();
230226
nodeBroadcastEnabled = request->hasArg(F("NB"));

wled00/udp.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ void handleNotifications()
161161
for (uint16_t i = 0; i < packetSize -2; i += 3)
162162
{
163163
setRealtimePixel(id, lbuf[i], lbuf[i+1], lbuf[i+2], 0);
164-
id++; if (id >= ledCount) break;
164+
id++;
165+
if (id >= ledCount) break;
165166
}
166167
strip.show();
167168
return;
@@ -423,11 +424,6 @@ void setRealtimePixel(uint16_t i, byte r, byte g, byte b, byte w)
423424
uint16_t pix = i + arlsOffset;
424425
if (pix < ledCount)
425426
{
426-
if (liveHSVCorrection) {
427-
byte correctedColors[3] = {0,0,0};
428-
correctColors(r, g, b, correctedColors);
429-
r = correctedColors[0]; g = correctedColors[1]; b = correctedColors[2];
430-
}
431427
if (!arlsDisableGammaCorrection && strip.gammaCorrectCol)
432428
{
433429
strip.setPixelColor(pix, strip.gamma8(r), strip.gamma8(g), strip.gamma8(b), strip.gamma8(w));

wled00/wled.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,6 @@ WLED_GLOBAL byte irEnabled _INIT(0); // Infrared receiver
294294
WLED_GLOBAL uint16_t udpPort _INIT(21324); // WLED notifier default port
295295
WLED_GLOBAL uint16_t udpPort2 _INIT(65506); // WLED notifier supplemental port
296296
WLED_GLOBAL uint16_t udpRgbPort _INIT(19446); // Hyperion port
297-
WLED_GLOBAL bool liveHSVCorrection _INIT(false);
298-
WLED_GLOBAL uint16_t liveHSVSaturation _INIT(13);
299-
WLED_GLOBAL uint16_t liveHSVValue _INIT(10);
300297

301298
WLED_GLOBAL bool receiveNotificationBrightness _INIT(true); // apply brightness from incoming notifications
302299
WLED_GLOBAL bool receiveNotificationColor _INIT(true); // apply color

wled00/xml.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -397,10 +397,6 @@ void getSettingsJS(byte subPage, char* dest)
397397
sappend('v',SET_F("UP"),udpPort);
398398
sappend('v',SET_F("U2"),udpPort2);
399399

400-
sappend('c',SET_F("HX"),liveHSVCorrection);
401-
sappend('v',SET_F("HS"),liveHSVSaturation);
402-
sappend('v',SET_F("HV"),liveHSVValue);
403-
404400
sappend('c',SET_F("RB"),receiveNotificationBrightness);
405401
sappend('c',SET_F("RC"),receiveNotificationColor);
406402
sappend('c',SET_F("RX"),receiveNotificationEffects);

0 commit comments

Comments
 (0)