]> git.sesse.net Git - movit/blob - mix_effect.h
Some no-op cleanups.
[movit] / mix_effect.h
1 #ifndef _MOVIT_MIX_EFFECT_H
2 #define _MOVIT_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 <string>
8
9 #include "effect.h"
10
11 namespace movit {
12
13 class MixEffect : public Effect {
14 public:
15         MixEffect();
16         std::string effect_type_id() const override { return "MixEffect"; }
17         std::string output_fragment_shader() override;
18
19         bool needs_srgb_primaries() const override { return false; }
20         unsigned num_inputs() const override { return 2; }
21         bool strong_one_to_one_sampling() const override { return true; }
22
23         // TODO: In the common case where a+b=1, it would be useful to be able to set
24         // alpha_handling() to INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK. However, right now
25         // we have no way of knowing that at instantiation time.
26
27 private:
28         float strength_first, strength_second;
29 };
30
31 }  // namespace movit
32
33 #endif // !defined(_MOVIT_MIX_EFFECT_H)