]> git.sesse.net Git - movit/blobdiff - gamma_compression_effect_test.cpp
Prefix include guards with _MOVIT to avoid clashes with external files.
[movit] / gamma_compression_effect_test.cpp
index 4662a01aa31af7dc6caea5e1828c353ce6ba1e63..c0b4ccf141e1d58a2d456b03acedae725ac42399 100644 (file)
@@ -3,9 +3,10 @@
 // Pretty much the inverse of the GammaExpansionEffect tests;
 // EffectChainTest tests that they are actually inverses.
 
-#include "test_util.h"
+#include <GL/glew.h>
 #include "gtest/gtest.h"
-#include "gamma_expansion_effect.h"
+#include "image_format.h"
+#include "test_util.h"
 
 TEST(GammaCompressionEffectTest, sRGB_KeyValues) {
        float data[] = {
@@ -17,8 +18,8 @@ TEST(GammaCompressionEffectTest, sRGB_KeyValues) {
                0.040f, 0.041f,
        };
        float out_data[4];
-       EffectChainTester tester(data, 2, 2, COLORSPACE_sRGB, GAMMA_LINEAR);
-       tester.run(out_data, COLORSPACE_sRGB, GAMMA_sRGB);
+       EffectChainTester tester(data, 2, 2, FORMAT_GRAYSCALE, COLORSPACE_sRGB, GAMMA_LINEAR);
+       tester.run(out_data, GL_RED, COLORSPACE_sRGB, GAMMA_sRGB);
 
        expect_equal(expected_data, out_data, 2, 2);
 }
@@ -28,8 +29,8 @@ TEST(GammaCompressionEffectTest, sRGB_RampAlwaysIncreases) {
        for (unsigned i = 0; i < 256; ++i) {
                data[i] = i / 255.0f;
        }
-       EffectChainTester tester(data, 256, 1, COLORSPACE_sRGB, GAMMA_LINEAR);
-       tester.run(out_data, COLORSPACE_sRGB, GAMMA_sRGB);
+       EffectChainTester tester(data, 256, 1, FORMAT_GRAYSCALE, COLORSPACE_sRGB, GAMMA_LINEAR);
+       tester.run(out_data, GL_RED, COLORSPACE_sRGB, GAMMA_sRGB);
 
        for (unsigned i = 1; i < 256; ++i) {
                EXPECT_GT(out_data[i], out_data[i - 1])
@@ -47,8 +48,8 @@ TEST(GammaCompressionEffectTest, Rec709_KeyValues) {
                0.080f, 0.082f,
        };
        float out_data[4];
-       EffectChainTester tester(data, 2, 2, COLORSPACE_sRGB, GAMMA_LINEAR);
-       tester.run(out_data, COLORSPACE_sRGB, GAMMA_REC_709);
+       EffectChainTester tester(data, 2, 2, FORMAT_GRAYSCALE, COLORSPACE_sRGB, GAMMA_LINEAR);
+       tester.run(out_data, GL_RED, COLORSPACE_sRGB, GAMMA_REC_709);
 
        expect_equal(expected_data, out_data, 2, 2);
 }
@@ -58,8 +59,8 @@ TEST(GammaCompressionEffectTest, Rec709_RampAlwaysIncreases) {
        for (unsigned i = 0; i < 256; ++i) {
                data[i] = i / 255.0f;
        }
-       EffectChainTester tester(data, 256, 1, COLORSPACE_sRGB, GAMMA_LINEAR);
-       tester.run(out_data, COLORSPACE_sRGB, GAMMA_REC_709);
+       EffectChainTester tester(data, 256, 1, FORMAT_GRAYSCALE, COLORSPACE_sRGB, GAMMA_LINEAR);
+       tester.run(out_data, GL_RED, COLORSPACE_sRGB, GAMMA_REC_709);
 
        for (unsigned i = 1; i < 256; ++i) {
                EXPECT_GT(out_data[i], out_data[i - 1])