]> git.sesse.net Git - movit/blob - gamma_expansion_effect.h
Another round of include-what-you-use.
[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 // Note that Movit's internal formats generally do not have enough accuracy
10 // for 12-bit input or output.
11
12 #include <GL/glew.h>
13 #include <string>
14
15 #include "effect.h"
16 #include "image_format.h"
17
18 class GammaExpansionEffect : public Effect {
19 private:
20         // Should not be instantiated by end users.
21         GammaExpansionEffect();
22         friend class EffectChain;
23
24 public:
25         virtual std::string effect_type_id() const { return "GammaExpansionEffect"; }
26         std::string output_fragment_shader();
27         virtual void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num);
28
29         virtual bool needs_linear_light() const { return false; }
30         virtual bool needs_srgb_primaries() const { return false; }
31
32         // Actually processes its input in a nonlinear fashion,
33         // but does not touch alpha, and we are a special case anyway.
34         virtual AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; }
35
36 private:
37         GammaCurve source_curve;
38 };
39
40 #endif // !defined(_MOVIT_GAMMA_EXPANSION_EFFECT_H)