X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=test_util.h;h=728f84b6d53c3920e836d6feb9a2283cd31123ca;hb=bb578b403deef87c90b330f860ad35d80433b702;hp=1f9e47fa207725bb944f59ffdd3406ab174d7fe0;hpb=d2050acb601e0d16bb33b1c1e7cf443dce2d3c93;p=movit diff --git a/test_util.h b/test_util.h index 1f9e47f..728f84b 100644 --- a/test_util.h +++ b/test_util.h @@ -47,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)