]> git.sesse.net Git - movit/commitdiff
Add do-nothing-conversions for gamma expansion/compression if we are already linear...
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 1 Oct 2012 18:49:50 +0000 (20:49 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 1 Oct 2012 18:49:50 +0000 (20:49 +0200)
gamma_compression_effect.cpp
gamma_expansion_effect.cpp
identity.glsl [new file with mode: 0644]

index 2c88b02ffdefcc1a0babe551ae7da3e5a38c88a6..581542884aa81dab44e398e0818422c53763afcb 100644 (file)
@@ -12,6 +12,8 @@ GammaCompressionEffect::GammaCompressionEffect()
 std::string GammaCompressionEffect::output_glsl()
 {
        switch (destination_curve) {
 std::string GammaCompressionEffect::output_glsl()
 {
        switch (destination_curve) {
+       case GAMMA_LINEAR:
+               return read_file("identity.glsl");
        case GAMMA_sRGB:
                return read_file("gamma_compression_effect_srgb.glsl");
        case GAMMA_REC_709:  // and GAMMA_REC_601
        case GAMMA_sRGB:
                return read_file("gamma_compression_effect_srgb.glsl");
        case GAMMA_REC_709:  // and GAMMA_REC_601
index 1ecc897c00d73172e8205c48cb04a43a858eaea0..74a8de983a299dd85952ebf78e678851a8fcb1de 100644 (file)
@@ -12,6 +12,8 @@ GammaExpansionEffect::GammaExpansionEffect()
 std::string GammaExpansionEffect::output_glsl()
 {
        switch (source_curve) {
 std::string GammaExpansionEffect::output_glsl()
 {
        switch (source_curve) {
+       case GAMMA_LINEAR:
+               return read_file("identity.glsl");
        case GAMMA_sRGB:
                return read_file("gamma_expansion_effect_srgb.glsl");
        case GAMMA_REC_709:  // and GAMMA_REC_601
        case GAMMA_sRGB:
                return read_file("gamma_expansion_effect_srgb.glsl");
        case GAMMA_REC_709:  // and GAMMA_REC_601
diff --git a/identity.glsl b/identity.glsl
new file mode 100644 (file)
index 0000000..ca41262
--- /dev/null
@@ -0,0 +1,5 @@
+// Identity transformation (sometimes useful to do nothing).
+vec4 FUNCNAME(vec2 tc)
+{
+       return LAST_INPUT(tc);
+}