]> git.sesse.net Git - movit/blobdiff - effect_chain_test.cpp
Allow setting the intermediate texture format; useful for reducing bandwidth at the...
[movit] / effect_chain_test.cpp
index 6ab874d2e4e32507beb5cc9eeb546fac69e9f546..a8cb41f044d1fa9b6070fb32b676abc3f373a195 100644 (file)
@@ -1303,5 +1303,20 @@ TEST(EffectChainTest, StringStreamLocalesWork) {
        free(saved_locale);
 }
 
+TEST(EffectChainTest, sRGBIntermediate) {
+       float data[] = {
+               0.0f, 0.25f, 0.0f, 1.0f,
+       };
+       float expected_data[] = {
+               0.0f, 0.25048828125f, 0.0f, 1.0f,
+       };
+       float out_data[4];
+       EffectChainTester tester(data, 1, 1, FORMAT_RGBA_PREMULTIPLIED_ALPHA, COLORSPACE_sRGB, GAMMA_LINEAR, GL_RGBA16F_ARB, GL_SRGB8);
+       tester.get_chain()->add_effect(new IdentityEffect());
+       tester.get_chain()->add_effect(new BouncingIdentityEffect());
+       tester.run(out_data, GL_RGBA, COLORSPACE_sRGB, GAMMA_LINEAR);
+
+       expect_equal(expected_data, out_data, 4, 1, 1e-4);
+}
 
 }  // namespace movit