diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-10-18 22:18:15 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-10-18 22:18:15 +0100 |
| commit | 734340b52d30cb2dde9aa9e81c77277b261b128e (patch) | |
| tree | 1671d2f9c409cf2c58570b3d068bb4f071355848 /test | |
| parent | 49a5dd1b69c4bb7ed27ba0e23b2161fe4521f775 (diff) | |
Fix build on Debian unstable which now has GraphicsMagick rather than ImageMagick.
Diffstat (limited to 'test')
| -rw-r--r-- | test/image_test.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/image_test.cc b/test/image_test.cc index 51ad49ebf..5662c729b 100644 --- a/test/image_test.cc +++ b/test/image_test.cc @@ -174,16 +174,24 @@ read_file (string file) 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]; } @@ -195,14 +203,20 @@ 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; } |
