]> git.sesse.net Git - movit/blob - glow_effect.h
Add sdl-config --cflags and --libs when compiling.
[movit] / glow_effect.h
1 #ifndef _GLOW_EFFECT_H
2 #define _GLOW_EFFECT_H 1
3
4 // Glow: Cut out the highlights of the image (everything above a certain threshold),
5 // blur them, and overlay them onto the original image.
6
7 #include "effect.h"
8
9 class BlurEffect;
10 class MixEffect;
11 class HighlightCutoffEffect;
12
13 class GlowEffect : public Effect {
14 public:
15         GlowEffect();
16         virtual std::string effect_type_id() const { return "GlowEffect"; }
17
18         virtual bool needs_srgb_primaries() const { return false; }
19
20         virtual void rewrite_graph(EffectChain *graph, Node *self);
21         virtual bool set_float(const std::string &key, float value);
22
23         virtual std::string output_fragment_shader() {
24                 assert(false);
25         }
26         virtual void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) {
27                 assert(false);
28         }
29
30 private:
31         BlurEffect *blur;
32         HighlightCutoffEffect *cutoff;
33         MixEffect *mix;
34 };
35
36 // An effect that cuts out only the highlights of an image;
37 // anything at the cutoff or below is set to 0.0, and then all other pixels
38 // get the cutoff subtracted. Used only as part of GlowEffect.
39
40 class HighlightCutoffEffect : public Effect {
41 public:
42         HighlightCutoffEffect();
43         virtual std::string effect_type_id() const { return "HighlightCutoffEffect"; }
44         std::string output_fragment_shader();
45
46 private:
47         float cutoff;
48 };
49
50 #endif // !defined(_GLOW_EFFECT_H)