]> git.sesse.net Git - movit/blob - colorspace_conversion_effect.h
Give SizeStoringEffect an effect_type_id(), for easier debugging of the unit test.
[movit] / colorspace_conversion_effect.h
1 #ifndef _COLORSPACE_CONVERSION_EFFECT_H
2 #define _COLORSPACE_CONVERSION_EFFECT_H 1
3
4 // An effect to convert between different color spaces.
5 // Can convert freely between sRGB/Rec. 709 and the two different Rec. 601
6 // color spaces (which thankfully have the same white point).
7 //
8 // We don't do any fancy gamut mapping or similar; colors that are out-of-gamut
9 // will simply stay out-of-gamut, and probably clip in the output stage.
10
11 #include "effect.h"
12 #include "effect_chain.h"
13
14 class ColorspaceConversionEffect : public Effect {
15 private:
16         // Should not be instantiated by end users.
17         ColorspaceConversionEffect();
18         friend class EffectChain;
19
20 public:
21         virtual std::string effect_type_id() const { return "ColorspaceConversionEffect"; }
22         std::string output_fragment_shader();
23
24         virtual bool needs_srgb_primaries() const { return false; }
25         virtual AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; }
26
27 private:
28         Colorspace source_space, destination_space;
29 };
30
31 #endif // !defined(_COLORSPACE_CONVERSION_EFFECT_H)