X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=gamma_expansion_effect_test.cpp;h=1e399dc87be126e0059d78f1872a0228e0df04bc;hp=499a0d47caba00a71cdc068a9fb956d7759df292;hb=d2eee22b0440147f69038e3cf829910b18526efc;hpb=72c893b5313744226d9496e8682071dfb373d56c diff --git a/gamma_expansion_effect_test.cpp b/gamma_expansion_effect_test.cpp index 499a0d4..1e399dc 100644 --- a/gamma_expansion_effect_test.cpp +++ b/gamma_expansion_effect_test.cpp @@ -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);