]> git.sesse.net Git - movit/blob - luma_mix_effect.h
Revert "Stop using -rpath when linking libmovit."
[movit] / luma_mix_effect.h
1 #ifndef _MOVIT_LUMA_MIX_EFFECT_H
2 #define _MOVIT_LUMA_MIX_EFFECT_H 1
3
4 // Fade between two images based on a third monochrome one; lighter pixels
5 // will be faded before darker pixels. This allows a wide range of different
6 // video wipes implemented using a single effect.
7 //
8 // Note that despite the name, the third input's _red_ channel is what's used
9 // for transitions; there is no luma calculation done. If you need that,
10 // put a SaturationEffect in front to desaturate (which calculates luma).
11
12 #include <string>
13
14 #include "effect.h"
15
16 namespace movit {
17
18 class LumaMixEffect : public Effect {
19 public:
20         LumaMixEffect();
21         virtual std::string effect_type_id() const { return "LumaMixEffect"; }
22         std::string output_fragment_shader();
23         virtual void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num);
24
25         virtual bool needs_srgb_primaries() const { return false; }
26         virtual unsigned num_inputs() const { return 3; }
27         virtual AlphaHandling alpha_handling() const { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; }
28
29 private:
30         float transition_width, progress;
31 };
32
33 }  // namespace movit
34
35 #endif // !defined(_MOVIT_MIX_EFFECT_H)