X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=effect_chain_test.cpp;h=d79c933431cdaa2d8c5f78924a970748a3f66fa4;hp=28ccc70b0bde6c136705d7bbba685a93e390763d;hb=419bbfe5e46add3df115882dbf489ccfe080d2f9;hpb=06ba8d86c019208682d8883dc7187df37b027814 diff --git a/effect_chain_test.cpp b/effect_chain_test.cpp index 28ccc70..d79c933 100644 --- a/effect_chain_test.cpp +++ b/effect_chain_test.cpp @@ -98,6 +98,25 @@ TEST(MirrorTest, BasicTest) { expect_equal(expected_data, out_data, 3, 2); } +TEST(EffectChainTest, TopLeftOrigin) { + float data[] = { + 0.0f, 0.25f, 0.3f, + 0.75f, 1.0f, 1.0f, + }; + // Note that EffectChainTester assumes bottom-left origin, so by setting + // top-left, we will get flipped data back. + float expected_data[6] = { + 0.75f, 1.0f, 1.0f, + 0.0f, 0.25f, 0.3f, + }; + float out_data[6]; + EffectChainTester tester(data, 3, 2, FORMAT_GRAYSCALE, COLORSPACE_sRGB, GAMMA_LINEAR); + tester.get_chain()->set_output_origin(OUTPUT_ORIGIN_TOP_LEFT); + tester.run(out_data, GL_RED, COLORSPACE_sRGB, GAMMA_LINEAR); + + expect_equal(expected_data, out_data, 3, 2); +} + // A dummy effect that inverts its input. class InvertEffect : public Effect { public: