]> git.sesse.net Git - movit/blob - white_balance_effect.h
Do not bother with unbinding vertex attributes; that is automatically done when we...
[movit] / white_balance_effect.h
1 #ifndef _MOVIT_WHITE_BALANCE_EFFECT_H
2 #define _MOVIT_WHITE_BALANCE_EFFECT_H 1
3
4 // Color correction in LMS color space.
5
6 #include <epoxy/gl.h>
7 #include <string>
8 #include <Eigen/Core>
9
10 #include "effect.h"
11
12 namespace movit {
13
14 class WhiteBalanceEffect : public Effect {
15 public:
16         WhiteBalanceEffect();
17         virtual std::string effect_type_id() const { return "WhiteBalanceEffect"; }
18         virtual AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; }
19         virtual bool one_to_one_sampling() const { return true; }
20         std::string output_fragment_shader();
21
22         void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num);
23
24 private:
25         // The neutral color, in linear sRGB.
26         RGBTriplet neutral_color;
27
28         // Output color temperature (in Kelvins).
29         // Choosing 6500 will lead to no color cast (ie., the neutral color becomes perfectly gray).
30         float output_color_temperature;
31
32         Eigen::Matrix3d uniform_correction_matrix;
33 };
34
35 }  // namespace movit
36
37 #endif // !defined(_MOVIT_WHITE_BALANCE_EFFECT_H)