Describe the bug
There is a typo in the equality operator operator== of the MSE struct in ConversionDifferenceRGB.h.
Specifically, a (the alpha component of this) is tie-compared to itself a on the right-hand side, instead of other.a. This causes any difference in the alpha channel's MSE to be completely ignored during comparison.
bool operator==(const MSE &other) const
{
return std::tie(r, g, b, a) == std::tie(other.r, other.g, other.b, a); // typo: comparing 'a' to 'a'
}
To Reproduce
This typo resides in the static analysis of the equality check. It is also reproducible when writing a unit test that compares two MSE structs with different a values but identical r, g, and b values. The comparison will incorrectly evaluate to true.
Expected behavior
operator== should compare other.a to correctly assert equality across all four color/alpha channels:
bool operator==(const MSE &other) const
{
return std::tie(r, g, b, a) == std::tie(other.r, other.g, other.b, other.a);
}
Version
- OS: macOS
- Version: develop branch (including commit b5b1b6e)
- If you compiled YUView yourself then which Qt version did you use? Qt 6.x
Describe the bug
There is a typo in the equality operator
operator==of theMSEstruct inConversionDifferenceRGB.h.Specifically,
a(the alpha component ofthis) is tie-compared to itselfaon the right-hand side, instead ofother.a. This causes any difference in the alpha channel's MSE to be completely ignored during comparison.To Reproduce
This typo resides in the static analysis of the equality check. It is also reproducible when writing a unit test that compares two
MSEstructs with differentavalues but identicalr,g, andbvalues. The comparison will incorrectly evaluate totrue.Expected behavior
operator==should compareother.ato correctly assert equality across all four color/alpha channels:Version