From 3bd44601d084d7139a81e787bd72fdf80832f2c3 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 10 May 2015 01:59:37 +0100 Subject: Possibly inaccurate port of master; build system cleanups. --- test/image_test.cc | 61 ------------------------------------------------------ test/wscript | 18 ++++++++++++++++ 2 files changed, 18 insertions(+), 61 deletions(-) (limited to 'test') diff --git a/test/image_test.cc b/test/image_test.cc index 9aca9878d..5561f021c 100644 --- a/test/image_test.cc +++ b/test/image_test.cc @@ -171,67 +171,6 @@ BOOST_AUTO_TEST_CASE (crop_image_test2) } } -static -boost::shared_ptr -read_file (string file) -{ - Magick::Image magick_image (file.c_str ()); - dcp::Size size (magick_image.columns(), magick_image.rows()); - - boost::shared_ptr image (new Image (PIX_FMT_RGB24, size, true)); - -#ifdef DCPOMATIC_IMAGE_MAGICK - using namespace MagickCore; -#endif - - uint8_t* p = image->data()[0]; - for (int y = 0; y < size.height; ++y) { - uint8_t* q = p; - for (int x = 0; x < size.width; ++x) { - Magick::Color c = magick_image.pixelColor (x, y); -#ifdef DCPOMATIC_IMAGE_MAGICK - *q++ = c.redQuantum() * 255 / QuantumRange; - *q++ = c.greenQuantum() * 255 / QuantumRange; - *q++ = c.blueQuantum() * 255 / QuantumRange; -#else - *q++ = c.redQuantum() * 255 / MaxRGB; - *q++ = c.greenQuantum() * 255 / MaxRGB; - *q++ = c.blueQuantum() * 255 / MaxRGB; -#endif - } - p += image->stride()[0]; - } - - return image; -} - -static -void -write_file (shared_ptr image, string file) -{ -#ifdef DCPOMATIC_IMAGE_MAGICK - using namespace MagickCore; -#endif - - Magick::Image magick_image (Magick::Geometry (image->size().width, image->size().height), Magick::Color (0, 0, 0)); - uint8_t*p = image->data()[0]; - for (int y = 0; y < image->size().height; ++y) { - uint8_t* q = p; - for (int x = 0; x < image->size().width; ++x) { -#ifdef DCPOMATIC_IMAGE_MAGICK - Magick::Color c (q[0] * QuantumRange / 256, q[1] * QuantumRange / 256, q[2] * QuantumRange / 256); -#else - Magick::Color c (q[0] * MaxRGB / 256, q[1] * MaxRGB / 256, q[2] * MaxRGB / 256); -#endif - magick_image.pixelColor (x, y, c); - q += 3; - } - p += image->stride()[0]; - } - - magick_image.write (file.c_str ()); -} - static void crop_scale_window_single (AVPixelFormat in_format, dcp::Size in_size, Crop crop, dcp::Size inter_size, dcp::Size out_size) diff --git a/test/wscript b/test/wscript index ffc93ea5e..a5556e25d 100644 --- a/test/wscript +++ b/test/wscript @@ -1,3 +1,21 @@ +# +# Copyright (C) 2012-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 +# 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. +# + def configure(conf): boost_test_suffix='' if conf.env.TARGET_WINDOWS: -- cgit v1.2.3