X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=unsharp_mask_effect.cpp;h=9c6804917eef8dc44b6fd5b8ca5670976951e0ad;hp=db8ccd21d767367c8b72d30b793310885ad11b59;hb=61e2a7671f7b22227dcdc34dd303ae4fcc802aaa;hpb=6da2b27aecd1e3ccea21abc6f57e219cd811aab6 diff --git a/unsharp_mask_effect.cpp b/unsharp_mask_effect.cpp index db8ccd2..9c68049 100644 --- a/unsharp_mask_effect.cpp +++ b/unsharp_mask_effect.cpp @@ -1,18 +1,22 @@ -#include #include +#include -#include "unsharp_mask_effect.h" #include "blur_effect.h" -#include "mix_effect.h" #include "effect_chain.h" +#include "mix_effect.h" +#include "unsharp_mask_effect.h" #include "util.h" +using namespace std; + +namespace movit { + UnsharpMaskEffect::UnsharpMaskEffect() : blur(new BlurEffect), mix(new MixEffect) { - mix->set_float("strength_first", 1.0f); - mix->set_float("strength_second", -0.3f); + CHECK(mix->set_float("strength_first", 1.0f)); + CHECK(mix->set_float("strength_second", -0.3f)); } void UnsharpMaskEffect::rewrite_graph(EffectChain *graph, Node *self) @@ -30,11 +34,12 @@ void UnsharpMaskEffect::rewrite_graph(EffectChain *graph, Node *self) self->disabled = true; } -bool UnsharpMaskEffect::set_float(const std::string &key, float value) { - printf("%s = %f\n", key.c_str(), value); +bool UnsharpMaskEffect::set_float(const string &key, float value) { if (key == "amount") { bool ok = mix->set_float("strength_first", 1.0f + value); return ok && mix->set_float("strength_second", -value); } return blur->set_float(key, value); } + +} // namespace movit