]> git.sesse.net Git - movit/blobdiff - glow_effect.h
Fix a Valgrind hit.
[movit] / glow_effect.h
index 3453c997d82ee2938b987089774b2a5677309bde..340cf3d76888950ee3c536794c1bb32f1b360595 100644 (file)
@@ -1,15 +1,17 @@
-#ifndef _GLOW_EFFECT_H
-#define _GLOW_EFFECT_H 1
+#ifndef _MOVIT_GLOW_EFFECT_H
+#define _MOVIT_GLOW_EFFECT_H 1
 
 // Glow: Cut out the highlights of the image (everything above a certain threshold),
 // blur them, and overlay them onto the original image.
 
-#include <GL/glew.h>
+#include <epoxy/gl.h>
 #include <assert.h>
 #include <string>
 
 #include "effect.h"
 
+namespace movit {
+
 class BlurEffect;
 class EffectChain;
 class HighlightCutoffEffect;
@@ -19,17 +21,17 @@ class Node;
 class GlowEffect : public Effect {
 public:
        GlowEffect();
-       virtual std::string effect_type_id() const { return "GlowEffect"; }
+       std::string effect_type_id() const override { return "GlowEffect"; }
 
-       virtual bool needs_srgb_primaries() const { return false; }
+       bool needs_srgb_primaries() const override { return false; }
 
-       virtual void rewrite_graph(EffectChain *graph, Node *self);
-       virtual bool set_float(const std::string &key, float value);
+       void rewrite_graph(EffectChain *graph, Node *self) override;
+       bool set_float(const std::string &key, float value) override;
 
-       virtual std::string output_fragment_shader() {
+       std::string output_fragment_shader() override {
                assert(false);
        }
-       virtual void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) {
+       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override {
                assert(false);
        }
 
@@ -46,13 +48,16 @@ private:
 class HighlightCutoffEffect : public Effect {
 public:
        HighlightCutoffEffect();
-       virtual std::string effect_type_id() const { return "HighlightCutoffEffect"; }
-       std::string output_fragment_shader();
+       std::string effect_type_id() const override { return "HighlightCutoffEffect"; }
+       std::string output_fragment_shader() override;
        
-       virtual AlphaHandling alpha_handling() const { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; }
+       AlphaHandling alpha_handling() const override { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; }
+       bool strong_one_to_one_sampling() const override { return true; }
 
 private:
        float cutoff;
 };
 
-#endif // !defined(_GLOW_EFFECT_H)
+}  // namespace movit
+
+#endif // !defined(_MOVIT_GLOW_EFFECT_H)