Don't check the impossible cases in rgb2hsvtc()

This commit is contained in:
heckflosse
2018-01-04 23:15:53 +01:00
parent 8287044f02
commit 0f25bfe87b

View File

@@ -313,18 +313,12 @@ public:
s = del_Max / var_Max;
if (r == var_Max) {
h = (g - b) / del_Max;
h = (g < b ? 6.f : 0.f) + (g - b) / del_Max;
} else if (g == var_Max) {
h = 2.f + (b - r) / del_Max;
} else { /*if ( b == var_Max ) */
h = 4.f + (r - g) / del_Max;
}
if (h < 0.f) {
h += 6.f;
} else if (h > 6.f) {
h -= 6.f;
}
}
}