diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-02-02 18:42:54 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-02-02 18:42:54 +0000 |
| commit | 923d5a17cdbe4c4ae947bbb45493be0792cfd54e (patch) | |
| tree | c30cc659bb94aaf8231bb5f8c790e3d60a3362b1 /test | |
| parent | b47a54b85aee24795008463681cb31f4307ffe84 (diff) | |
Unpack XYZ to RGB into an Image class rather than a raw buffer.
Diffstat (limited to 'test')
| -rw-r--r-- | test/rgb_xyz_test.cc | 5 |
1 files changed, 3 insertions, 2 deletions
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<SimpleImage> image (new SimpleImage (dcp::Size (2, 2))); notes.clear (); - dcp::xyz_to_rgb (xyz, dcp::ColourConversion::xyz_to_srgb (), buffer, boost::optional<dcp::NoteHandler> (boost::bind (¬e_handler, _1, _2))); + dcp::xyz_to_rgb (xyz, dcp::ColourConversion::xyz_to_srgb (), image, boost::optional<dcp::NoteHandler> (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<uint16_t*> (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]); |
