]> git.sesse.net Git - movit/blob - gamma_expansion_effect.h
679c16d24d92c2adb28ebe1eac708048e2d9029c
[movit] / gamma_expansion_effect.h
1 #ifndef _MOVIT_GAMMA_EXPANSION_EFFECT_H 
2 #define _MOVIT_GAMMA_EXPANSION_EFFECT_H 1
3
4 // An effect to convert the given gamma curve into linear light,
5 // typically inserted by the framework automatically at the beginning
6 // of the processing chain.
7 //
8 // Currently supports sRGB, Rec. 601/709 and Rec. 2020 (10- and 12-bit).
9
10 #include <string>
11
12 #include "effect.h"
13 #include "image_format.h"
14
15 class GammaExpansionEffect : public Effect {
16 private:
17         // Should not be instantiated by end users.
18         GammaExpansionEffect();
19         friend class EffectChain;
20
21 public:
22         virtual std::string effect_type_id() const { return "GammaExpansionEffect"; }
23         std::string output_fragment_shader();
24         virtual void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num);
25
26         virtual bool needs_linear_light() const { return false; }
27         virtual bool needs_srgb_primaries() const { return false; }
28
29         // Actually processes its input in a nonlinear fashion,
30         // but does not touch alpha, and we are a special case anyway.
31         virtual AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; }
32
33 private:
34         GammaCurve source_curve;
35 };
36
37 #endif // !defined(_MOVIT_GAMMA_EXPANSION_EFFECT_H)