X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=effect_chain.h;h=4abfb97eba1390f0ca7f16daff094bea14dabd60;hp=9622abc0eef1abf824b3b83f2c9fbdd151eef104;hb=b618b34070d23b6da35c77f004678d8a9e55575b;hpb=a592c55caca0fb654bad4ec43b84c46abcee21c2 diff --git a/effect_chain.h b/effect_chain.h index 9622abc..4abfb97 100644 --- a/effect_chain.h +++ b/effect_chain.h @@ -6,7 +6,7 @@ #include "effect.h" #include "effect_id.h" -enum PixelFormat { FORMAT_RGB, FORMAT_RGBA }; +enum PixelFormat { FORMAT_RGB, FORMAT_RGBA, FORMAT_BGR, FORMAT_BGRA }; enum ColorSpace { COLORSPACE_sRGB = 0, @@ -46,11 +46,31 @@ 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 effects; - int glsl_program_num; + GLuint source_image_num; + bool use_srgb_texture_format; + + GLuint fbo; + GLuint temp_textures[2]; + + std::vector phases; + + GLenum format, bytes_per_pixel; bool finalized; // Used during the building of the effect chain.