X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=flow.h;h=08b25904356ab61265835e46cf219105c5ae88d2;hb=3795723be95f2fe82f3c8b8b45b1a905b2c811fd;hp=31111f5bd42b17f1aa20453ac24694e744d9af79;hpb=8deea0eee4f9b18540463ba253747c232873527b;p=nageru diff --git a/flow.h b/flow.h index 31111f5..08b2590 100644 --- a/flow.h +++ b/flow.h @@ -5,13 +5,13 @@ // in-between frames. The main user interface is the DISComputeFlow and Interpolate // classes (also GrayscaleConversion can be useful). -#include -#include #include +#include #include #include -#include +#include #include +#include class ScopedTimer; @@ -111,7 +111,6 @@ private: std::map, GLuint> fbos; }; - // Same, but with a depth texture. template class PersistentFBOSetWithDepth { @@ -422,7 +421,8 @@ public: // after use. GLuint exec(GLuint tex, FlowDirection flow_direction, ResizeStrategy resize_strategy); - void release_texture(GLuint tex) { + void release_texture(GLuint tex) + { pool.release_texture(tex); } @@ -522,11 +522,15 @@ private: class Blend { public: - Blend(); - void exec(GLuint image_tex, GLuint flow_tex, GLuint output_tex, int width, int height, float alpha); + Blend(bool split_ycbcr_output); + + // output2_tex is only used if split_ycbcr_output was true. + void exec(GLuint image_tex, GLuint flow_tex, GLuint output_tex, GLuint output2_tex, int width, int height, float alpha); private: + bool split_ycbcr_output; PersistentFBOSet<1> fbos; + PersistentFBOSet<2> fbos_split; GLuint blend_vs_obj; GLuint blend_fs_obj; GLuint blend_program; @@ -537,22 +541,23 @@ private: class Interpolate { public: - Interpolate(int width, int height, const OperatingPoint &op); + Interpolate(const OperatingPoint &op, bool split_ycbcr_output); - // Returns a texture that must be released with release_texture() - // after use. image_tex must be a two-layer RGBA8 texture with mipmaps - // (unless flow_level == 0). - GLuint exec(GLuint image_tex, GLuint gray_tex, GLuint bidirectional_flow_tex, GLuint width, GLuint height, float alpha); + // Returns a texture (or two, if split_ycbcr_output is true) that must + // be released with release_texture() after use. image_tex must be a + // two-layer RGBA8 texture with mipmaps (unless flow_level == 0). + std::pair exec(GLuint image_tex, GLuint gray_tex, GLuint bidirectional_flow_tex, GLuint width, GLuint height, float alpha); - void release_texture(GLuint tex) { + void release_texture(GLuint tex) + { pool.release_texture(tex); } private: - int width, height, flow_level; + int flow_level; GLuint vertex_vbo, vao; TexturePool pool; - const OperatingPoint op; + const bool split_ycbcr_output; Splat splat; HoleFill hole_fill;