X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=mix_effect.h;h=fda06a6f9426426e9794637348c19f907a5894d5;hp=7342b90500538b10c08fb27840a3744a1a304cb7;hb=ac4fc36aa70ffefb6b9632dc0abea5cbbce5387b;hpb=ef7665d0d3854b3464800d8d7fef9a90f14d9a9f diff --git a/mix_effect.h b/mix_effect.h index 7342b90..fda06a6 100644 --- a/mix_effect.h +++ b/mix_effect.h @@ -1,20 +1,28 @@ -#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" class MixEffect : public Effect { public: MixEffect(); + virtual std::string effect_type_id() const { return "MixEffect"; } std::string output_fragment_shader(); 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) +#endif // !defined(_MOVIT_MIX_EFFECT_H)