Fix HSV unittests.

This commit is contained in:
David Capello 2010-12-11 22:14:38 -03:00
parent 7e8ea5886a
commit 1d5274d435

View File

@ -36,19 +36,19 @@ TEST(Hsv, Ctor)
TEST(Hsv, FromRgb)
{
EXPECT_EQ(Hsv( 0.0, 0.000, 0.000), Hsv(Rgb( 0, 0, 0)));
EXPECT_EQ(Hsv( 0.0, 1.000, 0.010), Hsv(Rgb( 3, 0, 0)));
EXPECT_EQ(Hsv( 0.0, 1.000, 0.990), Hsv(Rgb(252, 0, 0)));
EXPECT_EQ(Hsv( 0.0, 1.000, 1.000), Hsv(Rgb(255, 0, 0)));
EXPECT_EQ(Hsv( 60.0, 1.000, 0.750), Hsv(Rgb(191, 191, 0)));
EXPECT_EQ(Hsv(120.0, 1.000, 0.500), Hsv(Rgb( 0, 128, 0)));
EXPECT_EQ(Hsv(120.0, 1.000, 1.000), Hsv(Rgb( 0, 255, 0)));
EXPECT_EQ(Hsv(180.0, 0.500, 1.000), Hsv(Rgb(128, 255, 255)));
EXPECT_EQ(Hsv(240.0, 0.500, 1.000), Hsv(Rgb(128, 128, 255)));
EXPECT_EQ(Hsv(240.0, 1.000, 1.000), Hsv(Rgb( 0, 0, 255)));
EXPECT_EQ(Hsv(300.0, 0.667, 0.750), Hsv(Rgb(191, 64, 191)));
EXPECT_EQ(Hsv(360.0, 1.000, 0.990), Hsv(Rgb(252, 0, 0)));
EXPECT_EQ(Hsv(360.0, 1.000, 1.000), Hsv(Rgb(255, 0, 0)));
EXPECT_EQ(Hsv( 0.0, 0.00, 0.00), Hsv(Rgb( 0, 0, 0)));
EXPECT_EQ(Hsv( 0.0, 1.00, 0.01), Hsv(Rgb( 3, 0, 0)));
EXPECT_EQ(Hsv( 0.0, 1.00, 0.99), Hsv(Rgb(252, 0, 0)));
EXPECT_EQ(Hsv( 0.0, 1.00, 1.00), Hsv(Rgb(255, 0, 0)));
EXPECT_EQ(Hsv( 60.0, 1.00, 0.75), Hsv(Rgb(191, 191, 0)));
EXPECT_EQ(Hsv(120.0, 1.00, 0.50), Hsv(Rgb( 0, 128, 0)));
EXPECT_EQ(Hsv(120.0, 1.00, 1.00), Hsv(Rgb( 0, 255, 0)));
EXPECT_EQ(Hsv(180.0, 0.50, 1.00), Hsv(Rgb(128, 255, 255)));
EXPECT_EQ(Hsv(240.0, 0.50, 1.00), Hsv(Rgb(128, 128, 255)));
EXPECT_EQ(Hsv(240.0, 1.00, 1.00), Hsv(Rgb( 0, 0, 255)));
EXPECT_EQ(Hsv(300.0, 0.66, 0.75), Hsv(Rgb(191, 64, 191)));
EXPECT_EQ(Hsv(360.0, 1.00, 0.99), Hsv(Rgb(252, 0, 0)));
EXPECT_EQ(Hsv(360.0, 1.00, 1.00), Hsv(Rgb(255, 0, 0)));
}
int main(int argc, char** argv)