]> git.sesse.net Git - movit/blob - effect.h
Move slurping of files into its own function.
[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         // Neither of these take ownership.
23         bool set_int(const std::string&, int value);
24         bool set_float(const std::string &key, float value);
25         bool set_vec3(const std::string &key, const float *values);
26
27 protected:
28         // Neither of these take ownership.
29         void register_int(const std::string &key, int *value);
30         void register_float(const std::string &key, float *value);
31         void register_vec3(const std::string &key, float *values);
32         
33 private:
34         std::map<std::string, int *> params_int;
35         std::map<std::string, float *> params_float;
36         std::map<std::string, float *> params_vec3;
37 };
38
39 #endif // !defined(_EFFECT_H)