]> git.sesse.net Git - movit/blob - unsharp_mask_effect.h
Do not unconditionally profile (that was a miscommit). Instead, make a PROFILE=1...
[movit] / unsharp_mask_effect.h
1 #ifndef _UNSHARP_MASK_EFFECT_H
2 #define _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 "effect.h"
14
15 class BlurEffect;
16 class MixEffect;
17
18 class UnsharpMaskEffect : public Effect {
19 public:
20         UnsharpMaskEffect();
21         virtual std::string effect_type_id() const { return "UnsharpMaskEffect"; }
22
23         virtual bool needs_srgb_primaries() const { return false; }
24
25         virtual void rewrite_graph(EffectChain *graph, Node *self);
26         virtual bool set_float(const std::string &key, float value);
27
28         virtual std::string output_fragment_shader() {
29                 assert(false);
30         }
31         virtual void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) {
32                 assert(false);
33         }
34
35 private:
36         BlurEffect *blur;
37         MixEffect *mix;
38 };
39
40 #endif // !defined(_UNSHARP_MASK_EFFECT_H)