From 0d7fe66361a40702cb97357955cf35256f1d2c26 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 2 Feb 2015 19:25:43 +0000 Subject: Rename XYZFrame -> XYZImage and ARGBFrame -> ARGBImage. --- test/argb_frame_test.cc | 31 ------------------------------- test/argb_image_test.cc | 31 +++++++++++++++++++++++++++++++ test/decryption_test.cc | 10 +++++----- test/rgb_xyz_test.cc | 8 ++++---- test/round_trip_test.cc | 8 ++++---- test/wscript | 2 +- 6 files changed, 45 insertions(+), 45 deletions(-) delete mode 100644 test/argb_frame_test.cc create mode 100644 test/argb_image_test.cc (limited to 'test') diff --git a/test/argb_frame_test.cc b/test/argb_frame_test.cc deleted file mode 100644 index e5c881af..00000000 --- a/test/argb_frame_test.cc +++ /dev/null @@ -1,31 +0,0 @@ -/* - Copyright (C) 2014 Carl Hetherington - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -#include "argb_frame.h" -#include - -/** Very simple tests of ARGBFrame */ -BOOST_AUTO_TEST_CASE (argb_frame_test) -{ - dcp::ARGBFrame f (dcp::Size (100, 200)); - - BOOST_CHECK (f.data() != 0); - BOOST_CHECK_EQUAL (f.stride(), 100 * 4); - BOOST_CHECK_EQUAL (f.size(), dcp::Size (100, 200)); -} diff --git a/test/argb_image_test.cc b/test/argb_image_test.cc new file mode 100644 index 00000000..e88d208b --- /dev/null +++ b/test/argb_image_test.cc @@ -0,0 +1,31 @@ +/* + Copyright (C) 2014 Carl Hetherington + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include "argb_image.h" +#include + +/** Very simple tests of ARGBImage */ +BOOST_AUTO_TEST_CASE (argb_image_test) +{ + dcp::ARGBImage f (dcp::Size (100, 200)); + + BOOST_CHECK (f.data() != 0); + BOOST_CHECK_EQUAL (f.stride(), 100 * 4); + BOOST_CHECK_EQUAL (f.size(), dcp::Size (100, 200)); +} diff --git a/test/decryption_test.cc b/test/decryption_test.cc index d9170daa..a28f3c64 100644 --- a/test/decryption_test.cc +++ b/test/decryption_test.cc @@ -23,7 +23,7 @@ #include "cpl.h" #include "decrypted_kdm.h" #include "encrypted_kdm.h" -#include "argb_frame.h" +#include "argb_image.h" #include "mono_picture_mxf.h" #include "reel_picture_asset.h" #include "reel.h" @@ -32,7 +32,7 @@ using boost::dynamic_pointer_cast; using boost::shared_ptr; -static shared_ptr +static shared_ptr get_frame (dcp::DCP const & dcp) { shared_ptr reel = dcp.cpls().front()->reels().front (); @@ -41,7 +41,7 @@ get_frame (dcp::DCP const & dcp) shared_ptr mono_picture = dynamic_pointer_cast (picture); shared_ptr j2k_frame = mono_picture->get_frame (0); - return j2k_frame->argb_frame (); + return j2k_frame->argb_image (); } /** Decrypt an encrypted test DCP and check that its first frame is the same as the unencrypted version */ @@ -68,8 +68,8 @@ BOOST_AUTO_TEST_CASE (decryption_test) encrypted.add (kdm); - shared_ptr plaintext_frame = get_frame (plaintext); - shared_ptr encrypted_frame = get_frame (encrypted); + shared_ptr plaintext_frame = get_frame (plaintext); + shared_ptr encrypted_frame = get_frame (encrypted); /* Check that plaintext and encrypted are the same */ BOOST_CHECK_EQUAL (plaintext_frame->stride(), encrypted_frame->stride()); diff --git a/test/rgb_xyz_test.cc b/test/rgb_xyz_test.cc index da897b9f..6ee62dbf 100644 --- a/test/rgb_xyz_test.cc +++ b/test/rgb_xyz_test.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Carl Hetherington + Copyright (C) 2014-2015 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -19,7 +19,7 @@ #include "image.h" #include "rgb_xyz.h" -#include "xyz_frame.h" +#include "xyz_image.h" #include "colour_conversion.h" #include #include @@ -77,7 +77,7 @@ BOOST_AUTO_TEST_CASE (rgb_xyz_test) } } - shared_ptr xyz = dcp::rgb_to_xyz (rgb, dcp::ColourConversion::srgb_to_xyz ()); + shared_ptr xyz = dcp::rgb_to_xyz (rgb, dcp::ColourConversion::srgb_to_xyz ()); for (int y = 0; y < size.height; ++y) { uint16_t* p = reinterpret_cast (rgb->data()[0] + y * rgb->stride()[0]); @@ -144,7 +144,7 @@ note_handler (dcp::NoteType n, string s) /** Check that xyz_to_rgb clamps XYZ values correctly */ BOOST_AUTO_TEST_CASE (xyz_rgb_range_test) { - shared_ptr xyz (new dcp::XYZFrame (dcp::Size (2, 2))); + shared_ptr xyz (new dcp::XYZImage (dcp::Size (2, 2))); xyz->data(0)[0] = -4; xyz->data(0)[1] = 6901; diff --git a/test/round_trip_test.cc b/test/round_trip_test.cc index 94097e75..6f5372ec 100644 --- a/test/round_trip_test.cc +++ b/test/round_trip_test.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2013 Carl Hetherington + Copyright (C) 2013-2015 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -27,7 +27,7 @@ #include "test.h" #include "cpl.h" #include "mono_picture_frame.h" -#include "argb_frame.h" +#include "argb_image.h" #include "certificate_chain.h" #include "mono_picture_mxf_writer.h" #include "reel_picture_asset.h" @@ -102,8 +102,8 @@ BOOST_AUTO_TEST_CASE (round_trip_test) BOOST_CHECK (!kdm_B.keys().empty ()); mxf_B->set_key (kdm_B.keys().front().key()); - shared_ptr frame_A = mxf_A->get_frame(0)->argb_frame (); - shared_ptr frame_B = mxf_B->get_frame(0)->argb_frame (); + shared_ptr frame_A = mxf_A->get_frame(0)->argb_image (); + shared_ptr frame_B = mxf_B->get_frame(0)->argb_image (); BOOST_CHECK_EQUAL (frame_A->size().width, frame_B->size().width); BOOST_CHECK_EQUAL (frame_A->size().height, frame_B->size().height); BOOST_CHECK_EQUAL (memcmp (frame_A->data(), frame_B->data(), frame_A->size().width * frame_A->size().height), 0); diff --git a/test/wscript b/test/wscript index f669c378..b723f54c 100644 --- a/test/wscript +++ b/test/wscript @@ -25,7 +25,7 @@ def build(bld): else: obj.use = 'libdcp%s' % bld.env.API_VERSION obj.source = """ - argb_frame_test.cc + argb_image_test.cc certificates_test.cc colour_test.cc colour_conversion_test.cc -- cgit v1.2.3