Restore original saturation and brightness

This commit is contained in:
matze19999 committed 2026-10-06 16:23:09 +02:00
1 parent 81087448b2
commit c3a2ac8002
9 files changed
+16 -25

No files matched your search

+4 -4
View File
@@ -1,15 +1,15 @@
{
"id": "org.webosbrew.histogramhyperion",
"version": "0.7.1",
"version": "0.7.2",
"type": "web",
"title": "HyperDRM",
"appDescription": "Ambient lighting for webOS and Hyperion",
"iconUri": "https://gitea.adnau.de/matze19999/HyperDRM/raw/branch/main/app/icon.png",
"sourceUrl": "https://gitea.adnau.de/matze19999/HyperDRM",
"rootRequired": true,
"ipkUrl": "https://gitea.adnau.de/matze19999/HyperDRM/raw/branch/main/HyperDRM_0.7.1_arm.ipk",
"ipkUrl": "https://gitea.adnau.de/matze19999/HyperDRM/raw/branch/main/HyperDRM_0.7.2_arm.ipk",
"ipkHash": {
"sha256": "05d266c4ab36a1b1a5fb7f952a67ea9c9af61ef12cf0a1e27eafafd5189cb90f"
"sha256": "cc73ed6b93caf86b32df52a87b0160a8cdec34b79802fcc71fc1f0f04d5fcf74"
},
"ipkSize": 1170022
"ipkSize": 1169234
}
Binary file not shown.
+2 -2
View File
@@ -9,7 +9,7 @@ Ambient Light for webOS and Hyperion. An own webOS app and native ARM service th
- Spatial colors from 16 LG histogram regions with interpolated transitions along the screen perimeter.
- LED count, ordering and screen rectangles read from Hyperion at each service start. No fixed 200-LED layout; layouts with 50 and 500 LEDs were tested.
- Automatic detection of top/bottom black bars on the calibrated LG G4.
- Saturation and brightness boost (2.0 and 1.33 respectively).
- Original saturation and brightness (both gains 1.0).
- Start, stop, status and persistent boot autostart switch in the TV app.
- Local Hyperion JSON connection on `127.0.0.1:19444`, priority 149, up to 10 updates per second.
@@ -25,7 +25,7 @@ Only the own service is modified. Optional Auto PicCap can start and stop the in
## Installation
The current package is [HyperDRM_0.7.1_arm.ipk](HyperDRM_0.7.1_arm.ipk). Install it using the TV's webOS/Homebrew package installation workflow.
The current package is [HyperDRM_0.7.2_arm.ipk](HyperDRM_0.7.2_arm.ipk). Install it using the TV's webOS/Homebrew package installation workflow.
Elevate the installed own service through Homebrew Channel:
+1 -1
View File
@@ -1 +1 @@
{"id": "org.webosbrew.histogramhyperion", "version": "0.7.1", "vendor": "Local development", "type": "web", "main": "index.html", "title": "HyperDRM", "icon": "icon.png", "resolution": "1920x1080", "disableBackHistoryAPI": true, "largeIcon": "large-icon.png", "appDescription": "Ambient lighting for webOS and Hyperion", "sourceUrl": "https://gitea.adnau.de/matze19999/HyperDRM"}
{"id": "org.webosbrew.histogramhyperion", "version": "0.7.2", "vendor": "Local development", "type": "web", "main": "index.html", "title": "HyperDRM", "icon": "icon.png", "resolution": "1920x1080", "disableBackHistoryAPI": true, "largeIcon": "large-icon.png", "appDescription": "Ambient lighting for webOS and Hyperion", "sourceUrl": "https://gitea.adnau.de/matze19999/HyperDRM"}
+2 -11
View File
@@ -1,16 +1,7 @@
#ifndef COLOR_BOOST_H
#define COLOR_BOOST_H
/* HSV saturation x2 and value x1.33, preserving hue and clamping value. */
/* Preserve the original saturation and brightness. */
static inline void boost_color(const unsigned char in[3],unsigned char out[3]){
unsigned lo=in[0],hi=in[0];
for(unsigned c=1;c<3;c++){if(in[c]<lo)lo=in[c];if(in[c]>hi)hi=in[c];}
unsigned chroma=hi-lo;
unsigned peak=(hi*133+50)/100;if(peak>255)peak=255;
if(!chroma){for(unsigned c=0;c<3;c++)out[c]=(unsigned char)peak;return;}
unsigned expanded=chroma*2;if(expanded>hi)expanded=hi;
for(unsigned c=0;c<3;c++){
unsigned value=hi-expanded+((in[c]-lo)*expanded+chroma/2)/chroma;
out[c]=(unsigned char)((value*peak+hi/2)/hi);
}
for(unsigned c=0;c<3;c++)out[c]=in[c];
}
#endif
+2 -2
View File
@@ -175,11 +175,11 @@ static bool handover(void *h,void *m,void *ctx){
static bool status(void *h,void *m,void *ctx){
(void)ctx;char json[4096],safe[512];size_t n=0;
for(size_t i=0;last_error[i] && n+2<sizeof(safe);i++){char c=last_error[i];if(c=='"'||c=='\\')safe[n++]='\\';if((unsigned char)c>=32)safe[n++]=c;}safe[n]=0;
int used=snprintf(json,sizeof(json),"{\"returnValue\":true,\"version\":\"0.7.1\",\"running\":%s,\"colorValid\":%s,\"frames\":%lu,\"captureRecoveries\":%u,\"lastRecoveryMs\":%llu,\"endpoint\":\"127.0.0.1:19444\",\"priority\":%d,\"uid\":%u,\"drmVerified\":false,\"mappingVerified\":false,\"outputColor\":[%u,%u,%u],\"error\":\"%s\",\"regions\":[",(capture||capture_source==SOURCE_PICCAP)?"true":"false",color_valid?"true":"false",frames,capture_recoveries,(unsigned long long)last_recovery_ms,PRIORITY,(unsigned)geteuid(),sent_rgb[0],sent_rgb[1],sent_rgb[2],safe);
int used=snprintf(json,sizeof(json),"{\"returnValue\":true,\"version\":\"0.7.2\",\"running\":%s,\"colorValid\":%s,\"frames\":%lu,\"captureRecoveries\":%u,\"lastRecoveryMs\":%llu,\"endpoint\":\"127.0.0.1:19444\",\"priority\":%d,\"uid\":%u,\"drmVerified\":false,\"mappingVerified\":false,\"outputColor\":[%u,%u,%u],\"error\":\"%s\",\"regions\":[",(capture||capture_source==SOURCE_PICCAP)?"true":"false",color_valid?"true":"false",frames,capture_recoveries,(unsigned long long)last_recovery_ms,PRIORITY,(unsigned)geteuid(),sent_rgb[0],sent_rgb[1],sent_rgb[2],safe);
for(int i=0;i<16;i++)used+=snprintf(json+used,sizeof(json)-used,"%s[%u,%u,%u]",i?",":"",rgb[i][0],rgb[i][1],rgb[i][2]);
used+=snprintf(json+used,sizeof(json)-used,"],\"ledCount\":%u,\"spatialOutput\":%s,\"blackPercent\":[",led_count,led_count?"true":"false");
for(int i=0;i<16;i++)used+=snprintf(json+used,sizeof(json)-used,"%s%u",i?",":"",black_percent[i]);
snprintf(json+used,sizeof(json)-used,"],\"preset\":%u,\"saturationGain\":2.0,\"brightnessGain\":1.33,\"spatialInterpolation\":%s,\"blackBarDetection\":true,\"autostart\":%s,\"retryScheduled\":%s,\"retryPaused\":%s,\"retryBlocked\":%s,\"retryAttempts\":%u,\"piccapInstalled\":%s,\"piccapHandover\":%s,\"piccapConnected\":%s,\"activeSource\":\"%s\",\"playbackProtection\":\"%s\",\"letterboxDetected\":%s}",capture_preset,interpolation_enabled?"true":"false",boot_enabled()?"true":"false",retries.due?"true":"false",retries.paused?"true":"false",retries.blocked?"true":"false",retries.attempts,piccap_installed()?"true":"false",handover_enabled?"true":"false",piccap_connected?"true":"false",piccap_owned?"PicCap":"HyperDRM",protection==PLAYBACK_PROTECTED?"protected":protection==PLAYBACK_CLEAR?"non-secure decoder":"unknown",capture&&letterbox_mode?"true":"false");return respond(h,m,json);
snprintf(json+used,sizeof(json)-used,"],\"preset\":%u,\"saturationGain\":1.0,\"brightnessGain\":1.0,\"spatialInterpolation\":%s,\"blackBarDetection\":true,\"autostart\":%s,\"retryScheduled\":%s,\"retryPaused\":%s,\"retryBlocked\":%s,\"retryAttempts\":%u,\"piccapInstalled\":%s,\"piccapHandover\":%s,\"piccapConnected\":%s,\"activeSource\":\"%s\",\"playbackProtection\":\"%s\",\"letterboxDetected\":%s}",capture_preset,interpolation_enabled?"true":"false",boot_enabled()?"true":"false",retries.due?"true":"false",retries.paused?"true":"false",retries.blocked?"true":"false",retries.attempts,piccap_installed()?"true":"false",handover_enabled?"true":"false",piccap_connected?"true":"false",piccap_owned?"PicCap":"HyperDRM",protection==PLAYBACK_PROTECTED?"protected":protection==PLAYBACK_CLEAR?"non-secure decoder":"unknown",capture&&letterbox_mode?"true":"false");return respond(h,m,json);
}
static int tick(void *unused){
(void)unused;
+4 -4
View File
@@ -5,16 +5,16 @@ int main(void){
unsigned char out[3];
for(unsigned v=0;v<256;v++){
unsigned char gray[3]={v,v,v};boost_color(gray,out);
unsigned expected=(v*133+50)/100;if(expected>255)expected=255;
unsigned expected=v;
assert(out[0]==expected && out[1]==expected && out[2]==expected);
}
unsigned char cyan[3]={93,224,242};boost_color(cyan,out);
assert(out[0]<93 && out[1]>out[0] && out[1]<out[2] && out[2]==255);
assert(out[0]==93 && out[1]==224 && out[2]==242);
for(unsigned c=0;c<3;c++){
unsigned char primary[3]={0};primary[c]=255;boost_color(primary,out);
for(unsigned j=0;j<3;j++)assert(out[j]==primary[j]);
}
unsigned char warm[3]={171,82,0};boost_color(warm,out);
assert(out[0]==227 && out[1]>82 && out[2]==0);
puts("PASS: neutral grays, stronger cyan, brighter warm color, clamped primaries");
assert(out[0]==171 && out[1]==82 && out[2]==0);
puts("PASS: neutral grays, unchanged cyan, warm color and primaries");
}
+1 -1
View File
@@ -1 +1 @@
{"id": "org.webosbrew.histogramhyperion", "version": "0.7.1", "vendor": "Local development", "app": "org.webosbrew.histogramhyperion", "services": ["org.webosbrew.histogramhyperion.service"], "sourceUrl": "https://gitea.adnau.de/matze19999/HyperDRM"}
{"id": "org.webosbrew.histogramhyperion", "version": "0.7.2", "vendor": "Local development", "app": "org.webosbrew.histogramhyperion", "services": ["org.webosbrew.histogramhyperion.service"], "sourceUrl": "https://gitea.adnau.de/matze19999/HyperDRM"}
Binary file not shown.