]> git.sesse.net Git - movit/blobdiff - glow_effect.h
Revert all the changes in demo.cpp that were never supposed to be there in the last...
[movit] / glow_effect.h
index 04b48f9aa165e55ab7ba139dba36c883fb492f9b..c0ac9ce5ee4163516ee2806557196447786099a7 100644 (file)
@@ -1,12 +1,17 @@
 #ifndef _GLOW_EFFECT_H
 #define _GLOW_EFFECT_H 1
 
-// Glow: Simply add a blurred version of the image to itself.
+// Glow: Cut out the highlights of the image (everything above a certain threshold),
+// blur them, and overlay them onto the original image.
+//
+// FIXME: This might be broken after MixEffect started working in premultiplied alpha.
+// We need to think about how this is going to work, and then add a test.
 
 #include "effect.h"
 
 class BlurEffect;
 class MixEffect;
+class HighlightCutoffEffect;
 
 class GlowEffect : public Effect {
 public:
@@ -27,7 +32,22 @@ public:
 
 private:
        BlurEffect *blur;
+       HighlightCutoffEffect *cutoff;
        MixEffect *mix;
 };
 
+// An effect that cuts out only the highlights of an image;
+// anything at the cutoff or below is set to 0.0, and then all other pixels
+// get the cutoff subtracted. Used only as part of GlowEffect.
+
+class HighlightCutoffEffect : public Effect {
+public:
+       HighlightCutoffEffect();
+       virtual std::string effect_type_id() const { return "HighlightCutoffEffect"; }
+       std::string output_fragment_shader();
+
+private:
+       float cutoff;
+};
+
 #endif // !defined(_GLOW_EFFECT_H)