]> git.sesse.net Git - movit/blobdiff - effect_chain.h
Make a new system for meta-effects, and convert the blur to use it. Hides the two...
[movit] / effect_chain.h
index 5b8ddbca45295f54a2bc4db4b132b1eeaa1efbb4..4abfb97eba1390f0ca7f16daff094bea14dabd60 100644 (file)
@@ -46,9 +46,18 @@ public:
        void render_to_screen(unsigned char *src);
 
 private:
+       struct Phase {
+               GLint glsl_program_num;
+               bool input_needs_mipmaps;
+               unsigned start, end;
+       };
+
        void normalize_to_linear_gamma();
        void normalize_to_srgb();
 
+       // Create a GLSL program computing effects [start, end>.
+       Phase compile_glsl_program(unsigned start_index, unsigned end_index);
+
        unsigned width, height;
        ImageFormat input_format, output_format;
        std::vector<Effect *> effects;
@@ -56,7 +65,11 @@ private:
        GLuint source_image_num;
        bool use_srgb_texture_format;
 
-       GLint glsl_program_num;
+       GLuint fbo;
+       GLuint temp_textures[2];
+
+       std::vector<Phase> phases;
+
        GLenum format, bytes_per_pixel;
        bool finalized;