X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=mix_effect.h;h=9abe6010a86d1aabb4640759c99fef537cb4caae;hp=8032062077491e7b545fc0df5e208d0b13f20a45;hb=cbb75714cc61421ec9730bb0eb6cf2875636b3de;hpb=f99ad333a7acbb6c8c995dbb036484ae8940c490 diff --git a/mix_effect.h b/mix_effect.h index 8032062..9abe601 100644 --- a/mix_effect.h +++ b/mix_effect.h @@ -1,10 +1,15 @@ -#ifndef _MIX_EFFECT_H -#define _MIX_EFFECT_H 1 +#ifndef _MOVIT_MIX_EFFECT_H +#define _MOVIT_MIX_EFFECT_H 1 -// Combine two images: a*x + b*y. (If you set a within [0,1] and b=1-a, you will get a fade.) +// Combine two images: a*x + b*y. If you set a within [0,1] and b=1-a, +// you will get a fade; if not, you may get surprising results (consider alpha). + +#include #include "effect.h" +namespace movit { + class MixEffect : public Effect { public: MixEffect(); @@ -14,8 +19,14 @@ public: virtual bool needs_srgb_primaries() const { return false; } virtual unsigned num_inputs() const { return 2; } + // TODO: In the common case where a+b=1, it would be useful to be able to set + // alpha_handling() to INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK. However, right now + // we have no way of knowing that at instantiation time. + private: float strength_first, strength_second; }; -#endif // !defined(_MIX_EFFECT_H) +} // namespace movit + +#endif // !defined(_MOVIT_MIX_EFFECT_H)