diff --git a/HyperDRM.manifest.json b/HyperDRM.manifest.json index da9365d..b86b875 100644 --- a/HyperDRM.manifest.json +++ b/HyperDRM.manifest.json @@ -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 } diff --git a/HyperDRM_0.7.1_arm.ipk b/HyperDRM_0.7.2_arm.ipk similarity index 96% rename from HyperDRM_0.7.1_arm.ipk rename to HyperDRM_0.7.2_arm.ipk index 01aa196..2758c25 100644 Binary files a/HyperDRM_0.7.1_arm.ipk and b/HyperDRM_0.7.2_arm.ipk differ diff --git a/README.md b/README.md index fc92d39..cc4c8a0 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/app/appinfo.json b/app/appinfo.json index ce27495..cbf8a19 100644 --- a/app/appinfo.json +++ b/app/appinfo.json @@ -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"} diff --git a/native/color_boost.h b/native/color_boost.h index c2652c3..940f0c6 100644 --- a/native/color_boost.h +++ b/native/color_boost.h @@ -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]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 diff --git a/native/service.c b/native/service.c index ceda79b..343dd1e 100644 --- a/native/service.c +++ b/native/service.c @@ -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=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; diff --git a/native/test_color_boost.c b/native/test_color_boost.c index 006d301..24dd626 100644 --- a/native/test_color_boost.c +++ b/native/test_color_boost.c @@ -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]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"); } diff --git a/package/packageinfo.json b/package/packageinfo.json index e800d45..fca1700 100644 --- a/package/packageinfo.json +++ b/package/packageinfo.json @@ -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"} diff --git a/service/histogram-service b/service/histogram-service index 07171dc..e147095 100644 Binary files a/service/histogram-service and b/service/histogram-service differ