In ResampleEffect, precompute the Lanczos function into a table.
[movit] / luma_mix_effect.cpp
1 #include "luma_mix_effect.h"
2 #include "effect_util.h"
3 #include "util.h"
4
5 using namespace std;
6
7 namespace movit {
8
9 LumaMixEffect::LumaMixEffect()
10         : transition_width(1.0f), progress(0.5f), inverse(0)
11 {
12         register_float("transition_width", &transition_width);
13         register_float("progress", &progress);
14         register_int("inverse", &inverse);
15         register_uniform_bool("inverse", &uniform_inverse);
16         register_uniform_float("progress_mul_w_plus_one", &uniform_progress_mul_w_plus_one);
17 }
18
19 string LumaMixEffect::output_fragment_shader()
20 {
21         return read_file("luma_mix_effect.frag");
22 }
23
24 void LumaMixEffect::set_gl_state(GLuint glsl_program_num, const string &prefix, unsigned *sampler_num)
25 {
26         Effect::set_gl_state(glsl_program_num, prefix, sampler_num);
27         uniform_progress_mul_w_plus_one = progress * (transition_width + 1.0);
28         uniform_inverse = inverse;
29 }
30
31 }  // namespace movit