]> git.sesse.net Git - movit/blob - unsharp_mask_effect.h
Use C++11 override everywhere it is appropriate.
[movit] / unsharp_mask_effect.h
1 #ifndef _MOVIT_UNSHARP_MASK_EFFECT_H
2 #define _MOVIT_UNSHARP_MASK_EFFECT_H 1
3
4 // Unsharp mask is probably the most popular way of doing sharpening today,
5 // although it does not always deliver the best results (it is very prone
6 // to haloing). It simply consists of removing a blurred copy of the image from
7 // itself (multiplied by some strength factor). In this aspect, it's similar to
8 // glow, except by subtracting instead of adding.
9 //
10 // See DeconvolutionSharpenEffect for a different, possibly better
11 // sharpening algorithm.
12
13 #include <epoxy/gl.h>
14 #include <assert.h>
15 #include <string>
16
17 #include "effect.h"
18
19 namespace movit {
20
21 class BlurEffect;
22 class EffectChain;
23 class MixEffect;
24 class Node;
25
26 class UnsharpMaskEffect : public Effect {
27 public:
28         UnsharpMaskEffect();
29         std::string effect_type_id() const override { return "UnsharpMaskEffect"; }
30
31         bool needs_srgb_primaries() const override { return false; }
32
33         void rewrite_graph(EffectChain *graph, Node *self) override;
34         bool set_float(const std::string &key, float value) override;
35
36         std::string output_fragment_shader() override {
37                 assert(false);
38         }
39         void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override {
40                 assert(false);
41         }
42
43 private:
44         BlurEffect *blur;
45         MixEffect *mix;
46 };
47
48 }  // namespace movit
49
50 #endif // !defined(_MOVIT_UNSHARP_MASK_EFFECT_H)