Squash linear gamma back into the sRGB curve at the end.
[movit] / gamma_compression_effect.cpp
1 #include <assert.h>
2
3 #include "gamma_compression_effect.h"
4 #include "util.h"
5
6 GammaCompressionEffect::GammaCompressionEffect()
7         : destination_curve(GAMMA_LINEAR)
8 {
9         register_int("destination_curve", (int *)&destination_curve);
10 }
11
12 std::string GammaCompressionEffect::output_glsl()
13 {
14         switch (destination_curve) {
15         case GAMMA_sRGB:
16                 return read_file("gamma_compression_effect_srgb.glsl");
17         case GAMMA_REC_709:  // and GAMMA_REC_601
18                 // Not implemented yet.
19                 assert(false);
20         default:
21                 assert(false);
22         }
23 }