X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=test_util.h;h=43d0216f032774d985cbb0da2c791479cec7470e;hp=69efe358b10d60b0e0556751b7d1d6ea313cee1f;hb=d2eee22b0440147f69038e3cf829910b18526efc;hpb=72c893b5313744226d9496e8682071dfb373d56c diff --git a/test_util.h b/test_util.h index 69efe35..43d0216 100644 --- a/test_util.h +++ b/test_util.h @@ -48,6 +48,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)