From 923d5a17cdbe4c4ae947bbb45493be0792cfd54e Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 2 Feb 2015 18:42:54 +0000 Subject: Unpack XYZ to RGB into an Image class rather than a raw buffer. --- test/rgb_xyz_test.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/rgb_xyz_test.cc b/test/rgb_xyz_test.cc index 75e0d8b9..da897b9f 100644 --- a/test/rgb_xyz_test.cc +++ b/test/rgb_xyz_test.cc @@ -159,10 +159,10 @@ BOOST_AUTO_TEST_CASE (xyz_rgb_range_test) xyz->data(2)[2] = 0; xyz->data(2)[3] = 4095; - uint16_t buffer[12]; + shared_ptr image (new SimpleImage (dcp::Size (2, 2))); notes.clear (); - dcp::xyz_to_rgb (xyz, dcp::ColourConversion::xyz_to_srgb (), buffer, boost::optional (boost::bind (¬e_handler, _1, _2))); + dcp::xyz_to_rgb (xyz, dcp::ColourConversion::xyz_to_srgb (), image, boost::optional (boost::bind (¬e_handler, _1, _2))); /* The 6 out-of-range samples should have been noted */ BOOST_REQUIRE_EQUAL (notes.size(), 6); @@ -178,6 +178,7 @@ BOOST_AUTO_TEST_CASE (xyz_rgb_range_test) as inputs at the extremes (0 and 4095). */ + uint16_t* buffer = reinterpret_cast (image->data()[0]); BOOST_REQUIRE_EQUAL (buffer[0 * 3 + 0], buffer[2 * 3 + 1]); BOOST_REQUIRE_EQUAL (buffer[0 * 3 + 1], buffer[2 * 3 + 1]); BOOST_REQUIRE_EQUAL (buffer[0 * 3 + 2], buffer[2 * 3 + 2]); -- cgit v1.2.3