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 2c88b02..5815428 100644 (file)
@@ -12,6 +12,8 @@ GammaCompressionEffect::GammaCompressionEffect()
 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
index 1ecc897..74a8de9 100644 (file)
@@ -12,6 +12,8 @@ GammaExpansionEffect::GammaExpansionEffect()
 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
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);
+}