diff options
Diffstat (limited to 'gfx/gl/gtest/TestColorspaces.cpp')
-rw-r--r-- | gfx/gl/gtest/TestColorspaces.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/gfx/gl/gtest/TestColorspaces.cpp b/gfx/gl/gtest/TestColorspaces.cpp index c437e204af..31a907115f 100644 --- a/gfx/gl/gtest/TestColorspaces.cpp +++ b/gfx/gl/gtest/TestColorspaces.cpp @@ -650,7 +650,7 @@ TEST(Colorspaces, ColorProfileConversionDesc_SrgbFromRec709) .dst = srgb, }); auto src = vec3(16.0); - auto dst = conv.Apply(src / 255) * 255; + auto dst = conv.DstFromSrc(src / 255) * 255; const auto tfa = PiecewiseGammaDesc::Srgb(); const auto tfb = PiecewiseGammaDesc::Srgb(); @@ -667,7 +667,7 @@ TEST(Colorspaces, ColorProfileConversionDesc_SrgbFromRec709) .dst = rec709, }); auto src = vec3(16.0); - auto dst = conv.Apply(src / 255) * 255; + auto dst = conv.DstFromSrc(src / 255) * 255; const auto tfa = PiecewiseGammaDesc::Rec709(); const auto tfb = PiecewiseGammaDesc::Rec709(); @@ -684,7 +684,7 @@ TEST(Colorspaces, ColorProfileConversionDesc_SrgbFromRec709) .dst = srgb, }); auto src = vec3(16.0); - auto dst = conv.Apply(src / 255) * 255; + auto dst = conv.DstFromSrc(src / 255) * 255; const auto tfa = PiecewiseGammaDesc::Rec709(); const auto tfb = PiecewiseGammaDesc::Srgb(); @@ -696,3 +696,9 @@ TEST(Colorspaces, ColorProfileConversionDesc_SrgbFromRec709) EXPECT_LT(Stats::Diff(dst.data, vec3(expected).data), (Stats::Error{0.12})); } } + +TEST(Colorspaces, SampleOutByIn_NegativeInputs) +{ + const auto tf = MakeGamma(1.0 / 2.2, 256); + EXPECT_LT(SampleOutByIn(tf, -0.1f), 0.0f); +} |