summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-05-10 01:59:37 +0100
committerCarl Hetherington <cth@carlh.net>2015-05-10 01:59:37 +0100
commit3bd44601d084d7139a81e787bd72fdf80832f2c3 (patch)
tree941e9bf11e3661bc3a5c1bf09cc950d6bd37836d /test
parent773a9e0518f86b09cd1df81cef969a654c4018cf (diff)
Possibly inaccurate port of master; build system cleanups.
Diffstat (limited to 'test')
-rw-r--r--test/image_test.cc61
-rw-r--r--test/wscript18
2 files changed, 18 insertions, 61 deletions
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
@@ -172,67 +172,6 @@ BOOST_AUTO_TEST_CASE (crop_image_test2)
}
static
-boost::shared_ptr<Image>
-read_file (string file)
-{
- Magick::Image magick_image (file.c_str ());
- dcp::Size size (magick_image.columns(), magick_image.rows());
-
- boost::shared_ptr<Image> 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> 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 <cth@carlh.net>
+#
+# 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: