fix bt709 check (#1039)

This commit is contained in:
Jason Dove
2022-11-25 10:09:58 -06:00
committed by GitHub
parent 47fbb2b1b7
commit 32edf77d35
+15 -1
View File
@@ -10,5 +10,19 @@ public record ColorParams(string ColorRange, string ColorSpace, string ColorTran
string.IsNullOrWhiteSpace(ColorTransfer) &&
string.IsNullOrWhiteSpace(ColorPrimaries);
public bool IsBt709 => this == Default;
public bool IsBt709
{
get
{
if (this == Default)
{
return true;
}
// some sources don't set transfer and primaries metadata
return ColorRange == "tv" && ColorSpace == "bt709"
&& string.IsNullOrWhiteSpace(ColorTransfer)
&& string.IsNullOrWhiteSpace(ColorPrimaries);
}
}
}