]> git.sesse.net Git - movit/blobdiff - gamma_expansion_effect_test.cpp
Add some sRGB conversion functions to test_util.{h,cpp}.
[movit] / gamma_expansion_effect_test.cpp
index 499a0d47caba00a71cdc068a9fb956d7759df292..1e399dc87be126e0059d78f1872a0228e0df04bc 100644 (file)
@@ -62,13 +62,7 @@ TEST(GammaExpansionEffectTest, sRGB_Accuracy) {
                double x = i / 255.0;
 
                data[i] = x;
-
-               // From the Wikipedia article on sRGB.
-               if (x < 0.04045) {
-                       expected_data[i] = x / 12.92;
-               } else {
-                       expected_data[i] = pow((x + 0.055) / 1.055, 2.4);
-               }
+               expected_data[i] = srgb_to_linear(x);
        }
 
        EffectChainTester tester(data, 256, 1, FORMAT_GRAYSCALE, COLORSPACE_sRGB, GAMMA_sRGB, GL_RGBA32F);