X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=glow_effect.cpp;h=778c55752fecceb984e4a9f97d39ba7cc4186e9d;hp=a4775052d4503dbf7b6c0fc7f5b5d53ad584f811;hb=a5f32397f9c23fa8644fe195865d6c36685cf866;hpb=771acfe782f3052bb7326ee7f066ed78657754b4 diff --git a/glow_effect.cpp b/glow_effect.cpp index a477505..778c557 100644 --- a/glow_effect.cpp +++ b/glow_effect.cpp @@ -1,21 +1,25 @@ -#include #include +#include -#include "glow_effect.h" #include "blur_effect.h" -#include "mix_effect.h" #include "effect_chain.h" +#include "glow_effect.h" +#include "mix_effect.h" #include "util.h" +using namespace std; + +namespace movit { + GlowEffect::GlowEffect() : blur(new BlurEffect), cutoff(new HighlightCutoffEffect), mix(new MixEffect) { - blur->set_float("radius", 20.0f); - mix->set_float("strength_first", 1.0f); - mix->set_float("strength_second", 1.0f); - cutoff->set_float("cutoff", 0.2f); + CHECK(blur->set_float("radius", 20.0f)); + CHECK(mix->set_float("strength_first", 1.0f)); + CHECK(mix->set_float("strength_second", 1.0f)); + CHECK(cutoff->set_float("cutoff", 0.2f)); } void GlowEffect::rewrite_graph(EffectChain *graph, Node *self) @@ -35,7 +39,7 @@ void GlowEffect::rewrite_graph(EffectChain *graph, Node *self) self->disabled = true; } -bool GlowEffect::set_float(const std::string &key, float value) { +bool GlowEffect::set_float(const string &key, float value) { if (key == "blurred_mix_amount") { return mix->set_float("strength_second", value); } @@ -51,7 +55,9 @@ HighlightCutoffEffect::HighlightCutoffEffect() register_float("cutoff", &cutoff); } -std::string HighlightCutoffEffect::output_fragment_shader() +string HighlightCutoffEffect::output_fragment_shader() { return read_file("highlight_cutoff_effect.frag"); } + +} // namespace movit