9391a91f55bd9be3c171a9ad911d71d1e4ca6a9c
[movit] / gamma_expansion_effect.cpp
1 #include <assert.h>
2
3 #include "gamma_expansion_effect.h"
4 #include "util.h"
5
6 GammaExpansionEffect::GammaExpansionEffect()
7         : source_curve(GAMMA_LINEAR)
8 {
9         register_int("source_curve", (int *)&source_curve);
10 }
11
12 std::string GammaExpansionEffect::output_fragment_shader()
13 {
14         switch (source_curve) {
15         case GAMMA_LINEAR:
16                 return read_file("identity-fs.glsl");
17         case GAMMA_sRGB:
18                 return read_file("gamma_expansion_effect_srgb.glsl");
19         case GAMMA_REC_709:  // and GAMMA_REC_601
20                 return read_file("gamma_expansion_effect_rec709.glsl");
21         default:
22                 assert(false);
23         }
24 }