X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=test_util.h;h=728f84b6d53c3920e836d6feb9a2283cd31123ca;hb=bb578b403deef87c90b330f860ad35d80433b702;hp=69efe358b10d60b0e0556751b7d1d6ea313cee1f;hpb=9c6b86affb570a2e2d18c6da795c359da393f9a3;p=movit diff --git a/test_util.h b/test_util.h index 69efe35..728f84b 100644 --- a/test_util.h +++ b/test_util.h @@ -15,8 +15,7 @@ public: MovitPixelFormat pixel_format = FORMAT_GRAYSCALE, Colorspace color_space = COLORSPACE_sRGB, GammaCurve gamma_curve = GAMMA_LINEAR, - GLenum framebuffer_format = GL_RGBA16F_ARB, - GLenum intermediate_format = GL_RGBA16F_ARB); + GLenum framebuffer_format = GL_RGBA16F_ARB); ~EffectChainTester(); EffectChain *get_chain() { return &chain; } @@ -48,6 +47,14 @@ void expect_equal(const float *ref, const float *result, unsigned width, unsigne void expect_equal(const unsigned char *ref, const unsigned char *result, unsigned width, unsigned height, unsigned largest_difference_limit = 1, float rms_limit = 0.2); void test_accuracy(const float *expected, const float *result, unsigned num_values, double absolute_error_limit, double relative_error_limit, double local_relative_error_limit, double rms_limit); +// Convert an sRGB encoded value (0.0 to 1.0, inclusive) to linear light. +// Undefined for values outside 0.0..1.0. +double srgb_to_linear(double x); + +// Convert a value in linear light (0.0 to 1.0, inclusive) to sRGB. +// Undefined for values outside 0.0..1.0. +double linear_to_srgb(double x); + } // namespace movit #endif // !defined(_MOVIT_TEST_UTIL_H)