1 #ifndef _MOVIT_LUMA_MIX_EFFECT_H
2 #define _MOVIT_LUMA_MIX_EFFECT_H 1
4 // Fade between two images based on a third monochrome one; lighter pixels
5 // will be faded before darker pixels (unless the inverse flag is set,
6 // in which case darker pixels will be faded before lighter pixels).
7 // This allows a wide range of different video wipes implemented using
10 // Note that despite the name, the third input's _red_ channel is what's used
11 // for transitions; there is no luma calculation done. If you need that,
12 // put a SaturationEffect in front to desaturate (which calculates luma).
20 class LumaMixEffect : public Effect {
23 virtual std::string effect_type_id() const { return "LumaMixEffect"; }
24 std::string output_fragment_shader();
25 virtual void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num);
27 virtual bool needs_srgb_primaries() const { return false; }
28 virtual unsigned num_inputs() const { return 3; }
29 virtual bool one_to_one_sampling() const { return true; }
30 virtual AlphaHandling alpha_handling() const { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; }
33 float transition_width, progress;
34 int inverse; // 0 or 1.
36 float uniform_progress_mul_w_plus_one;
41 #endif // !defined(_MOVIT_MIX_EFFECT_H)