]> git.sesse.net Git - movit/blob - white_balance_effect.h
Release Movit 1.6.0.
[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         std::string effect_type_id() const override { return "WhiteBalanceEffect"; }
18         AlphaHandling alpha_handling() const override { return DONT_CARE_ALPHA_TYPE; }
19         bool strong_one_to_one_sampling() const override { return true; }
20         std::string output_fragment_shader() override;
21
22         void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num) override;
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)