]> git.sesse.net Git - movit/blob - unsharp_mask_effect.h
Promote MultiplyEffect to a real effect.
[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 <GL/glew.h>
14 #include <assert.h>
15 #include <string>
16
17 #include "effect.h"
18
19 class BlurEffect;
20 class EffectChain;
21 class MixEffect;
22 class Node;
23
24 class UnsharpMaskEffect : public Effect {
25 public:
26         UnsharpMaskEffect();
27         virtual std::string effect_type_id() const { return "UnsharpMaskEffect"; }
28
29         virtual bool needs_srgb_primaries() const { return false; }
30
31         virtual void rewrite_graph(EffectChain *graph, Node *self);
32         virtual bool set_float(const std::string &key, float value);
33
34         virtual std::string output_fragment_shader() {
35                 assert(false);
36         }
37         virtual void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) {
38                 assert(false);
39         }
40
41 private:
42         BlurEffect *blur;
43         MixEffect *mix;
44 };
45
46 #endif // !defined(_MOVIT_UNSHARP_MASK_EFFECT_H)