Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 6th February 2019, 09:16   #11  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
Quote:
Originally Posted by StainlessS View Post
EDIT: Or in full as here: (3 out of the 4 original lines look messed up to me)
Code:
//RGB:
      if constexpr(mode == LIGHTEN) {
        alpha = luma_ovr > (luma_src + thresh) ? alpha : 0;    // As original
      } else { // EDIT: DARKEN
        alpha = luma_ovr < (luma_src - thresh) ? alpha : 0
      }


//YUV:
      if constexpr (mode == LIGHTEN) {
        alpha_mask = ovr > (src + thresh) ? level : 0;
      }
      else { // EDIT: DARKEN
        alpha_mask = ovr < (src - thresh) ? level : 0;
      }
I spent too much time yesterday with not understanding what really happens and why my code produces different results than existing rgb version. I was thinking it over by a bottle of dark Staropramen and finally voted for this very same logic.

"Where overlay is brigher by threshold" =>
Where overlay is brigther by 10 =>
Where overlay > src + 10

and "Where overlay is darker by threshold" =>
Where overlay is darker by 10 =>
Where overlay < src - 10
pinterf is offline  
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:46.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.