]> git.sesse.net Git - movit/blob - effect.h
Give HSV parameters to LGG effect.
[movit] / effect.h
1 #ifndef _EFFECT_H
2 #define _EFFECT_H 1
3
4 #include <map>
5 #include <string>
6
7 // Can alias on a float[3].
8 struct RGBTriplet {
9         RGBTriplet(float r, float g, float b)
10                 : r(r), g(g), b(b) {}
11
12         float r, g, b;
13 };
14
15 class Effect {
16 public: 
17         virtual bool needs_linear_light() { return true; }
18         virtual bool needs_srgb_primaries() { return true; }
19         virtual bool needs_many_samples() { return false; }
20         virtual bool needs_mipmaps() { return false; }
21
22         virtual std::string output_convenience_uniforms();
23         virtual std::string output_glsl() = 0;
24
25         // Neither of these take ownership.
26         bool set_int(const std::string&, int value);
27         bool set_float(const std::string &key, float value);
28         bool set_vec3(const std::string &key, const float *values);
29
30 protected:
31         // Neither of these take ownership.
32         void register_int(const std::string &key, int *value);
33         void register_float(const std::string &key, float *value);
34         void register_vec3(const std::string &key, float *values);
35         
36 private:
37         std::map<std::string, int *> params_int;
38         std::map<std::string, float *> params_float;
39         std::map<std::string, float *> params_vec3;
40 };
41
42 #endif // !defined(_EFFECT_H)