]> git.sesse.net Git - movit/blob - gamma_compression_effect.h
Fix a typo in the README.
[movit] / gamma_compression_effect.h
1 #ifndef _GAMMA_COMPRESSION_EFFECT_H 
2 #define _GAMMA_COMPRESSION_EFFECT_H 1
3
4 // An effect to convert linear light to the given gamma curve,
5 // typically inserted by the framework automatically at the end
6 // of the processing chain.
7 //
8 // Currently supports sRGB and Rec. 601/709.
9
10 #include "effect.h"
11 #include "effect_chain.h"
12
13 #define COMPRESSION_CURVE_SIZE 4096
14
15 class GammaCompressionEffect : public Effect {
16 public:
17         GammaCompressionEffect();
18         virtual std::string effect_type_id() const { return "GammaCompressionEffect"; }
19         std::string output_fragment_shader();
20
21         virtual bool needs_srgb_primaries() const { return false; }
22
23         // Actually needs postmultiplied input as well as outputting it.
24         // EffectChain will take care of that.
25         virtual AlphaHandling alpha_handling() const { return OUTPUT_ALPHA_POSTMULTIPLIED; }
26
27 private:
28         GammaCurve destination_curve;
29         float compression_curve[COMPRESSION_CURVE_SIZE];
30 };
31
32 #endif // !defined(_GAMMA_COMPRESSION_EFFECT_H)