]> git.sesse.net Git - movit/blobdiff - gamma_expansion_effect.cpp
Rename identity.glsl to identity-fs.glsl.
[movit] / gamma_expansion_effect.cpp
index 1748ae93dcee81c7268f803c82a8dffb13c8495a..9391a91f55bd9be3c171a9ad911d71d1e4ca6a9c 100644 (file)
@@ -1,3 +1,5 @@
+#include <assert.h>
+
 #include "gamma_expansion_effect.h"
 #include "util.h"
 
@@ -7,7 +9,16 @@ GammaExpansionEffect::GammaExpansionEffect()
        register_int("source_curve", (int *)&source_curve);
 }
 
-std::string GammaExpansionEffect::output_glsl()
+std::string GammaExpansionEffect::output_fragment_shader()
 {
-       return read_file("todo.glsl");
+       switch (source_curve) {
+       case GAMMA_LINEAR:
+               return read_file("identity-fs.glsl");
+       case GAMMA_sRGB:
+               return read_file("gamma_expansion_effect_srgb.glsl");
+       case GAMMA_REC_709:  // and GAMMA_REC_601
+               return read_file("gamma_expansion_effect_rec709.glsl");
+       default:
+               assert(false);
+       }
 }