X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=luma_mix_effect.h;h=3ff81bf6b1641794c2d6db379027d50f0737615e;hp=8bd3c506bc8bbc0c1e206cdf215af666a02037b2;hb=90ac46cdc5845432df13385f946c63b5496c685e;hpb=36d9ece323c89dbd553644c80fea449c5dd1e685 diff --git a/luma_mix_effect.h b/luma_mix_effect.h index 8bd3c50..3ff81bf 100644 --- a/luma_mix_effect.h +++ b/luma_mix_effect.h @@ -2,8 +2,10 @@ #define _MOVIT_LUMA_MIX_EFFECT_H 1 // Fade between two images based on a third monochrome one; lighter pixels -// will be faded before darker pixels. This allows a wide range of different -// video wipes implemented using a single effect. +// will be faded before darker pixels (unless the inverse flag is set, +// in which case darker pixels will be faded before lighter pixels). +// This allows a wide range of different video wipes implemented using +// a single effect. // // Note that despite the name, the third input's _red_ channel is what's used // for transitions; there is no luma calculation done. If you need that, @@ -24,10 +26,14 @@ public: virtual bool needs_srgb_primaries() const { return false; } virtual unsigned num_inputs() const { return 3; } + virtual bool one_to_one_sampling() const { return true; } virtual AlphaHandling alpha_handling() const { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; } private: float transition_width, progress; + int inverse; // 0 or 1. + bool uniform_inverse; + float uniform_progress_mul_w_plus_one; }; } // namespace movit