1 #ifndef _GAMMA_EXPANSION_EFFECT_H
2 #define _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 and Rec. 601/709.
13 #include "effect_chain.h"
14 #include "image_format.h"
16 #define EXPANSION_CURVE_SIZE 256
18 class GammaExpansionEffect : public Effect {
20 // Should not be instantiated by end users.
21 GammaExpansionEffect();
22 friend class EffectChain;
25 virtual std::string effect_type_id() const { return "GammaExpansionEffect"; }
26 std::string output_fragment_shader();
28 virtual bool needs_linear_light() const { return false; }
29 virtual bool needs_srgb_primaries() const { return false; }
31 // Actually processes its input in a nonlinear fashion,
32 // but does not touch alpha, and we are a special case anyway.
33 virtual AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; }
36 GammaCurve source_curve;
37 float expansion_curve[EXPANSION_CURVE_SIZE];
40 #endif // !defined(_GAMMA_EXPANSION_EFFECT_H)