]> git.sesse.net Git - movit/blob - glow_effect.cpp
Remove draw_vertex() declaration; the function was never implemented.
[movit] / glow_effect.cpp
1 #include <math.h>
2 #include <assert.h>
3
4 #include "glow_effect.h"
5 #include "blur_effect.h"
6 #include "mix_effect.h"
7 #include "effect_chain.h"
8 #include "util.h"
9
10 GlowEffect::GlowEffect()
11         : blur(new BlurEffect),
12           mix(new MixEffect)
13 {
14         mix->set_float("strength_first", 1.0f);
15         mix->set_float("strength_second", 0.3f);
16 }
17
18 void GlowEffect::add_self_to_effect_chain(EffectChain *chain, const std::vector<Effect *> &inputs) {
19         assert(inputs.size() == 1);
20         blur->add_self_to_effect_chain(chain, inputs);
21
22         std::vector<Effect *> mix_inputs;
23         mix_inputs.push_back(inputs[0]);
24         mix_inputs.push_back(chain->last_added_effect());  // FIXME
25         mix->add_self_to_effect_chain(chain, mix_inputs);
26 }
27
28 bool GlowEffect::set_float(const std::string &key, float value) {
29         if (key == "blurred_mix_amount") {
30                 return mix->set_float("strength_second", value);
31         }
32         return blur->set_float(key, value);
33 }