1 #ifndef _MOVIT_GAMMA_EXPANSION_EFFECT_H
2 #define _MOVIT_GAMMA_EXPANSION_EFFECT_H 1
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.
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.
16 #include "image_format.h"
20 class GammaExpansionEffect : public Effect {
22 // Should not be instantiated by end users.
23 GammaExpansionEffect();
24 friend class EffectChain;
27 virtual std::string effect_type_id() const { return "GammaExpansionEffect"; }
28 std::string output_fragment_shader();
29 virtual void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num);
31 virtual bool needs_linear_light() const { return false; }
32 virtual bool needs_srgb_primaries() const { return false; }
33 virtual bool one_to_one_sampling() const { return true; }
35 // Actually processes its input in a nonlinear fashion,
36 // but does not touch alpha, and we are a special case anyway.
37 virtual AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; }
40 GammaCurve source_curve;
41 float uniform_linear_scale, uniform_c[5], uniform_beta;
46 #endif // !defined(_MOVIT_GAMMA_EXPANSION_EFFECT_H)