X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=test_util.h;h=69efe358b10d60b0e0556751b7d1d6ea313cee1f;hp=b44d326d8d51a3c57390f7c8968efa541d9802bd;hb=009c7510df1ac1b70662b0085ebaf1a619dd761a;hpb=8ea03db1932e4a76f457e0ecdfe31a4c8be0e0eb diff --git a/test_util.h b/test_util.h index b44d326..69efe35 100644 --- a/test_util.h +++ b/test_util.h @@ -15,21 +15,32 @@ public: MovitPixelFormat pixel_format = FORMAT_GRAYSCALE, Colorspace color_space = COLORSPACE_sRGB, GammaCurve gamma_curve = GAMMA_LINEAR, - GLenum framebuffer_format = GL_RGBA16F_ARB); + GLenum framebuffer_format = GL_RGBA16F_ARB, + GLenum intermediate_format = GL_RGBA16F_ARB); ~EffectChainTester(); EffectChain *get_chain() { return &chain; } - Input *add_input(const float *data, MovitPixelFormat pixel_format, Colorspace color_space, GammaCurve gamma_curve); - Input *add_input(const unsigned char *data, MovitPixelFormat pixel_format, Colorspace color_space, GammaCurve gamma_curve); + Input *add_input(const float *data, MovitPixelFormat pixel_format, Colorspace color_space, GammaCurve gamma_curve, int input_width = -1, int input_height = -1); + Input *add_input(const unsigned char *data, MovitPixelFormat pixel_format, Colorspace color_space, GammaCurve gamma_curve, int input_width = -1, int input_height = -1); void run(float *out_data, GLenum format, Colorspace color_space, GammaCurve gamma_curve, OutputAlphaFormat alpha_format = OUTPUT_ALPHA_FORMAT_POSTMULTIPLIED); + void run(float *out_data, float *out_data2, GLenum format, Colorspace color_space, GammaCurve gamma_curve, OutputAlphaFormat alpha_format = OUTPUT_ALPHA_FORMAT_POSTMULTIPLIED); + void run(float *out_data, float *out_data2, float *out_data3, GLenum format, Colorspace color_space, GammaCurve gamma_curve, OutputAlphaFormat alpha_format = OUTPUT_ALPHA_FORMAT_POSTMULTIPLIED); void run(unsigned char *out_data, GLenum format, Colorspace color_space, GammaCurve gamma_curve, OutputAlphaFormat alpha_format = OUTPUT_ALPHA_FORMAT_POSTMULTIPLIED); + void run(unsigned char *out_data, unsigned char *out_data2, GLenum format, Colorspace color_space, GammaCurve gamma_curve, OutputAlphaFormat alpha_format = OUTPUT_ALPHA_FORMAT_POSTMULTIPLIED); + void run(unsigned char *out_data, unsigned char *out_data2, unsigned char *out_data3, GLenum format, Colorspace color_space, GammaCurve gamma_curve, OutputAlphaFormat alpha_format = OUTPUT_ALPHA_FORMAT_POSTMULTIPLIED); + void add_output(const ImageFormat &format, OutputAlphaFormat alpha_format); + void add_ycbcr_output(const ImageFormat &format, OutputAlphaFormat alpha_format, const YCbCrFormat &ycbcr_format, YCbCrOutputSplitting output_splitting = YCBCR_OUTPUT_INTERLEAVED); private: void finalize_chain(Colorspace color_space, GammaCurve gamma_curve, OutputAlphaFormat alpha_format); + template + void internal_run(T *out_data, T *out_data2, T *out_data3, GLenum internal_format, GLenum format, Colorspace color_space, GammaCurve gamma_curve, OutputAlphaFormat alpha_format = OUTPUT_ALPHA_FORMAT_POSTMULTIPLIED); + EffectChain chain; - GLuint fbo, texnum; unsigned width, height; + GLenum framebuffer_format; + bool output_added; bool finalized; };