2 #define _GLOW_EFFECT_H 1
4 // Glow: Cut out the highlights of the image (everything above a certain threshold),
5 // blur them, and overlay them onto the original image.
7 // FIXME: This might be broken after MixEffect started working in premultiplied alpha.
8 // We need to think about how this is going to work, and then add a test.
14 class HighlightCutoffEffect;
16 class GlowEffect : public Effect {
19 virtual std::string effect_type_id() const { return "GlowEffect"; }
21 virtual bool needs_srgb_primaries() const { return false; }
23 virtual void rewrite_graph(EffectChain *graph, Node *self);
24 virtual bool set_float(const std::string &key, float value);
26 virtual std::string output_fragment_shader() {
29 virtual void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) {
35 HighlightCutoffEffect *cutoff;
39 // An effect that cuts out only the highlights of an image;
40 // anything at the cutoff or below is set to 0.0, and then all other pixels
41 // get the cutoff subtracted. Used only as part of GlowEffect.
43 class HighlightCutoffEffect : public Effect {
45 HighlightCutoffEffect();
46 virtual std::string effect_type_id() const { return "HighlightCutoffEffect"; }
47 std::string output_fragment_shader();
53 #endif // !defined(_GLOW_EFFECT_H)