From 193e18b583fde18f2f3b3192d61121f3173e0e27 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Mon, 1 Oct 2012 20:49:50 +0200 Subject: [PATCH] Add do-nothing-conversions for gamma expansion/compression if we are already linear. Mostly for completeness. --- gamma_compression_effect.cpp | 2 ++ gamma_expansion_effect.cpp | 2 ++ identity.glsl | 5 +++++ 3 files changed, 9 insertions(+) create mode 100644 identity.glsl diff --git a/gamma_compression_effect.cpp b/gamma_compression_effect.cpp index 2c88b02..5815428 100644 --- a/gamma_compression_effect.cpp +++ b/gamma_compression_effect.cpp @@ -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 diff --git a/gamma_expansion_effect.cpp b/gamma_expansion_effect.cpp index 1ecc897..74a8de9 100644 --- a/gamma_expansion_effect.cpp +++ b/gamma_expansion_effect.cpp @@ -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 index 0000000..ca41262 --- /dev/null +++ b/identity.glsl @@ -0,0 +1,5 @@ +// Identity transformation (sometimes useful to do nothing). +vec4 FUNCNAME(vec2 tc) +{ + return LAST_INPUT(tc); +} -- 2.39.2