]> git.sesse.net Git - movit/blobdiff - gamma_expansion_effect.cpp
Add a mirror effect.
[movit] / gamma_expansion_effect.cpp
index cef1416ae5b8f7f5c7f9fc8c74641c11927412ef..61f0330f1671967cb4f85786085bbf771352b57b 100644 (file)
@@ -1,7 +1,24 @@
+#include <assert.h>
+
 #include "gamma_expansion_effect.h"
+#include "util.h"
 
 GammaExpansionEffect::GammaExpansionEffect()
        : source_curve(GAMMA_LINEAR)
 {
        register_int("source_curve", (int *)&source_curve);
 }
+
+std::string GammaExpansionEffect::output_fragment_shader()
+{
+       switch (source_curve) {
+       case GAMMA_LINEAR:
+               return read_file("identity.frag");
+       case GAMMA_sRGB:
+               return read_file("gamma_expansion_effect_srgb.frag");
+       case GAMMA_REC_709:  // and GAMMA_REC_601
+               return read_file("gamma_expansion_effect_rec709.frag");
+       default:
+               assert(false);
+       }
+}