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 std::string effect_type_id() const override { return "LumaMixEffect"; }
24 std::string output_fragment_shader() override;
25 void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override;
27 bool needs_srgb_primaries() const override { return false; }
28 unsigned num_inputs() const override { return 3; }
29 bool strong_one_to_one_sampling() const override { return true; }
30 AlphaHandling alpha_handling() const override { 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)