]> git.sesse.net Git - movit/blobdiff - white_balance_effect.h
Add a white balance effect (port of my white balance effect from Frei0r).
[movit] / white_balance_effect.h
diff --git a/white_balance_effect.h b/white_balance_effect.h
new file mode 100644 (file)
index 0000000..80416cb
--- /dev/null
@@ -0,0 +1,25 @@
+#ifndef _WHITE_BALANCE_EFFECT_H
+#define _WHITE_BALANCE_EFFECT_H 1
+
+// Color correction in LMS color space.
+
+#include "effect.h"
+
+class WhiteBalanceEffect : public Effect {
+public:
+       WhiteBalanceEffect();
+       virtual std::string effect_type_id() const { return "WhiteBalanceEffect"; }
+       std::string output_fragment_shader();
+
+       void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num);
+
+private:
+       // The neutral color, in linear sRGB.
+       RGBTriplet neutral_color;
+
+       // Output color temperature (in Kelvins).
+       // Choosing 6500 will lead to no color cast (ie., the neutral color becomes perfectly gray).
+       float output_color_temperature;
+};
+
+#endif // !defined(_WHITE_BALANCE_EFFECT_H)