summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/colour_conversion_test.cc16
1 files changed, 14 insertions, 2 deletions
diff --git a/test/colour_conversion_test.cc b/test/colour_conversion_test.cc
index aff178f5..9f5476b8 100644
--- a/test/colour_conversion_test.cc
+++ b/test/colour_conversion_test.cc
@@ -273,8 +273,8 @@ BOOST_AUTO_TEST_CASE(rgb_xyz_test)
}
-/** Check the piecewise LUT that is used for inverse gamma calculation */
-BOOST_AUTO_TEST_CASE (rgb_xyz_lut_test)
+/** Check the piecewise LUT that is used for inverse J2K gamma calculation */
+BOOST_AUTO_TEST_CASE(inverse_j2k_lut_test)
{
auto conversion = dcp::ColourConversion::rec709_to_dcp();
auto lut = dcp::make_inverse_gamma_lut(conversion.out_j2k(), 4095);
@@ -285,6 +285,18 @@ BOOST_AUTO_TEST_CASE (rgb_xyz_lut_test)
}
+/** Check the piecewise LUT that is used for inverse MPEG2 gamma calculation */
+BOOST_AUTO_TEST_CASE(inverse_mpeg2_lut_test)
+{
+ auto conversion = dcp::ColourConversion::rec709_to_dcp();
+ auto lut = dcp::make_inverse_gamma_lut(conversion.out_mpeg2(), 255);
+
+ for (double x = 0; x < 1; x += 0.000001) {
+ BOOST_CHECK(std::abs(lut.lookup(x) - lrint(pow(x, 1 / 2.4) * 255)) < 2);
+ }
+}
+
+
static list<string> notes;
static void