-
-
Notifications
You must be signed in to change notification settings - Fork 556
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chromakey.frag: Fix color distance equation
The equation for calculating the distance from the key color to a pixels color was missing the red channel component.
- Loading branch information
1 parent
b04d16c
commit 8ce00fd
Showing
1 changed file
with
1 addition
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,7 +48,7 @@ vec4 CIExyz_to_Lab(vec4 CIE) { | |
|
||
float colorclose(vec4 col, vec4 key, float tola,float tolb) { | ||
// Decides if a color is close to the specified hue | ||
float temp = sqrt(((key.g-col.g)*(key.g-col.g))+((key.b-col.b)*(key.b-col.b))); | ||
float temp = sqrt(((key.g-col.g)*(key.g-col.g))+((key.b-col.b)*(key.b-col.b))+((key.b-col.r)*(key.b-col.r))); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
ThomasWilshaw
Author
Collaborator
|
||
if (temp < tola) {return (0.0);} | ||
if (temp < tolb) {return ((temp-tola)/(tolb-tola));} | ||
return (1.0); | ||
|
@ThomasWilshaw I am just a passer-by browsing OSS video editing projects, and I know it is bad to comment on unfamiliar code base. But is it a kind of distance in a 3-dimensional space ? If so, the third part should be
key.r-col.r ...
?