1 #ifndef _MOVIT_GLOW_EFFECT_H
2 #define _MOVIT_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.
17 class HighlightCutoffEffect;
21 class GlowEffect : public Effect {
24 std::string effect_type_id() const override { return "GlowEffect"; }
26 bool needs_srgb_primaries() const override { return false; }
28 void rewrite_graph(EffectChain *graph, Node *self) override;
29 bool set_float(const std::string &key, float value) override;
31 std::string output_fragment_shader() override {
34 void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override {
40 HighlightCutoffEffect *cutoff;
44 // An effect that cuts out only the highlights of an image;
45 // anything at the cutoff or below is set to 0.0, and then all other pixels
46 // get the cutoff subtracted. Used only as part of GlowEffect.
48 class HighlightCutoffEffect : public Effect {
50 HighlightCutoffEffect();
51 std::string effect_type_id() const override { return "HighlightCutoffEffect"; }
52 std::string output_fragment_shader() override;
54 AlphaHandling alpha_handling() const override { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; }
55 bool strong_one_to_one_sampling() const override { return true; }
63 #endif // !defined(_MOVIT_GLOW_EFFECT_H)