]> git.sesse.net Git - movit/blob - mix_effect.h
Add a new alpha handling method, INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK.
[movit] / mix_effect.h
1 #ifndef _MIX_EFFECT_H
2 #define _MIX_EFFECT_H 1
3
4 // Combine two images: a*x + b*y. If you set a within [0,1] and b=1-a,
5 // you will get a fade; if not, you may get surprising results (consider alpha).
6
7 #include "effect.h"
8
9 class MixEffect : public Effect {
10 public:
11         MixEffect();
12         virtual std::string effect_type_id() const { return "MixEffect"; }
13         std::string output_fragment_shader();
14
15         virtual bool needs_srgb_primaries() const { return false; }
16         virtual unsigned num_inputs() const { return 2; }
17
18         // TODO: In the common case where a+b=1, it would be useful to be able to set
19         // alpha_handling() to INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK. However, right now
20         // we have no way of knowing that at instantiation time.
21
22 private:
23         float strength_first, strength_second;
24 };
25
26 #endif // !defined(_MIX_EFFECT_H)