From c4c8983b38413745f6bd869c6e6f500579b00e64 Mon Sep 17 00:00:00 2001 From: Sadaf Ebrahimi Date: Thu, 16 May 2024 20:36:19 +0000 Subject: Remove ImageMagick Please go through go/android-3p process if you need this project in the future. Bug: 155434586 Test: TreeHugger Change-Id: Ie00c117806c45dd13eefdce3ef123833148c6fbb --- Magick++/AUTHORS | 19 - Magick++/Android.bp | 52 - Magick++/ChangeLog | 1528 ------- Magick++/INSTALL | 164 - Magick++/LICENSE | 9 - Magick++/Makefile.am | 271 -- Magick++/NEWS | 383 -- Magick++/README | 55 - Magick++/bin/Magick++-config.1 | 99 - Magick++/bin/Magick++-config.in | 65 - Magick++/demo/analyze.cpp | 71 - Magick++/demo/button.cpp | 104 - Magick++/demo/demo.cpp | 525 --- Magick++/demo/demos.tap | 29 - Magick++/demo/detrans.cpp | 60 - Magick++/demo/flip.cpp | 60 - Magick++/demo/gravity.cpp | 83 - Magick++/demo/model.miff | Bin 25564 -> 0 bytes Magick++/demo/piddle.cpp | 184 - Magick++/demo/shapes.cpp | 127 - Magick++/demo/smile.miff | Bin 4814 -> 0 bytes Magick++/demo/smile_anim.miff | Bin 15448 -> 0 bytes Magick++/demo/tile.miff | Bin 6025 -> 0 bytes Magick++/demo/zoom.cpp | 191 - Magick++/fuzz/build.sh | 121 - Magick++/fuzz/build_fuzzers.sh | 52 - Magick++/fuzz/crop_fuzzer.cc | 28 - Magick++/fuzz/dictionaries/mvg.dict | 146 - Magick++/fuzz/encoder_format.h | 28 - Magick++/fuzz/encoder_fuzzer.cc | 68 - Magick++/fuzz/encoder_gradient_fuzzer.cc | 13 - Magick++/fuzz/encoder_label_fuzzer.cc | 22 - Magick++/fuzz/encoder_list.cc | 65 - Magick++/fuzz/encoder_pattern_fuzzer.cc | 13 - Magick++/fuzz/encoder_plasma_fuzzer.cc | 15 - Magick++/fuzz/encoder_radial-gradient_fuzzer.cc | 13 - Magick++/fuzz/encoder_utils.cc | 20 - Magick++/fuzz/encoder_xc_fuzzer.cc | 13 - Magick++/fuzz/enhance_fuzzer.cc | 20 - Magick++/fuzz/huffman_decode_fuzzer.cc | 23 - Magick++/fuzz/main.cc | 109 - Magick++/fuzz/ping_fuzzer.cc | 52 - Magick++/fuzz/rotate_fuzzer.cc | 27 - Magick++/fuzz/travis.cc | 6 - Magick++/fuzz/utils.cc | 36 - Magick++/lib/Blob.cpp | 132 - Magick++/lib/BlobRef.cpp | 67 - Magick++/lib/CoderInfo.cpp | 153 - Magick++/lib/Color.cpp | 930 ---- Magick++/lib/Drawable.cpp | 2500 ----------- Magick++/lib/Exception.cpp | 987 ----- Magick++/lib/Functions.cpp | 74 - Magick++/lib/Geometry.cpp | 709 ---- Magick++/lib/Image.cpp | 5170 ----------------------- Magick++/lib/ImageRef.cpp | 155 - Magick++/lib/Magick++.h | 23 - Magick++/lib/Magick++.pc.in | 14 - Magick++/lib/Magick++/Blob.h | 80 - Magick++/lib/Magick++/BlobRef.h | 52 - Magick++/lib/Magick++/CoderInfo.h | 88 - Magick++/lib/Magick++/Color.h | 444 -- Magick++/lib/Magick++/Drawable.h | 3138 -------------- Magick++/lib/Magick++/Exception.h | 425 -- Magick++/lib/Magick++/Functions.h | 40 - Magick++/lib/Magick++/Geometry.h | 261 -- Magick++/lib/Magick++/Image.h | 1554 ------- Magick++/lib/Magick++/ImageRef.h | 83 - Magick++/lib/Magick++/Include.h | 1575 ------- Magick++/lib/Magick++/Montage.h | 155 - Magick++/lib/Magick++/Options.h | 342 -- Magick++/lib/Magick++/Pixels.h | 152 - Magick++/lib/Magick++/ResourceLimits.h | 76 - Magick++/lib/Magick++/STL.h | 2869 ------------- Magick++/lib/Magick++/SecurityPolicy.h | 48 - Magick++/lib/Magick++/Statistic.h | 307 -- Magick++/lib/Magick++/Thread.h | 60 - Magick++/lib/Magick++/TypeMetric.h | 68 - Magick++/lib/Montage.cpp | 298 -- Magick++/lib/Options.cpp | 988 ----- Magick++/lib/Pixels.cpp | 202 - Magick++/lib/ResourceLimits.cpp | 115 - Magick++/lib/STL.cpp | 1637 ------- Magick++/lib/SecurityPolicy.cpp | 78 - Magick++/lib/Statistic.cpp | 660 --- Magick++/lib/Thread.cpp | 111 - Magick++/lib/TypeMetric.cpp | 75 - Magick++/lib/libMagick++.map | 4 - Magick++/tests/appendImages.cpp | 95 - Magick++/tests/attributes.cpp | 1450 ------- Magick++/tests/averageImages.cpp | 79 - Magick++/tests/coalesceImages.cpp | 62 - Magick++/tests/coderInfo.cpp | 134 - Magick++/tests/color.cpp | 154 - Magick++/tests/colorHistogram.cpp | 101 - Magick++/tests/exceptions.cpp | 102 - Magick++/tests/geometry.cpp | 71 - Magick++/tests/montageImages.cpp | 143 - Magick++/tests/morphImages.cpp | 71 - Magick++/tests/readWriteBlob.cpp | 255 -- Magick++/tests/readWriteImages.cpp | 179 - Magick++/tests/test_image.miff | Bin 44083 -> 0 bytes Magick++/tests/test_image_anim.miff | Bin 15229 -> 0 bytes Magick++/tests/tests.tap | 22 - 103 files changed, 34786 deletions(-) delete mode 100644 Magick++/AUTHORS delete mode 100644 Magick++/Android.bp delete mode 100644 Magick++/ChangeLog delete mode 100644 Magick++/INSTALL delete mode 100644 Magick++/LICENSE delete mode 100644 Magick++/Makefile.am delete mode 100644 Magick++/NEWS delete mode 100644 Magick++/README delete mode 100644 Magick++/bin/Magick++-config.1 delete mode 100755 Magick++/bin/Magick++-config.in delete mode 100644 Magick++/demo/analyze.cpp delete mode 100644 Magick++/demo/button.cpp delete mode 100644 Magick++/demo/demo.cpp delete mode 100755 Magick++/demo/demos.tap delete mode 100644 Magick++/demo/detrans.cpp delete mode 100644 Magick++/demo/flip.cpp delete mode 100644 Magick++/demo/gravity.cpp delete mode 100644 Magick++/demo/model.miff delete mode 100644 Magick++/demo/piddle.cpp delete mode 100644 Magick++/demo/shapes.cpp delete mode 100644 Magick++/demo/smile.miff delete mode 100644 Magick++/demo/smile_anim.miff delete mode 100644 Magick++/demo/tile.miff delete mode 100644 Magick++/demo/zoom.cpp delete mode 100644 Magick++/fuzz/build.sh delete mode 100644 Magick++/fuzz/build_fuzzers.sh delete mode 100644 Magick++/fuzz/crop_fuzzer.cc delete mode 100644 Magick++/fuzz/dictionaries/mvg.dict delete mode 100644 Magick++/fuzz/encoder_format.h delete mode 100644 Magick++/fuzz/encoder_fuzzer.cc delete mode 100644 Magick++/fuzz/encoder_gradient_fuzzer.cc delete mode 100644 Magick++/fuzz/encoder_label_fuzzer.cc delete mode 100644 Magick++/fuzz/encoder_list.cc delete mode 100644 Magick++/fuzz/encoder_pattern_fuzzer.cc delete mode 100644 Magick++/fuzz/encoder_plasma_fuzzer.cc delete mode 100644 Magick++/fuzz/encoder_radial-gradient_fuzzer.cc delete mode 100644 Magick++/fuzz/encoder_utils.cc delete mode 100644 Magick++/fuzz/encoder_xc_fuzzer.cc delete mode 100644 Magick++/fuzz/enhance_fuzzer.cc delete mode 100644 Magick++/fuzz/huffman_decode_fuzzer.cc delete mode 100644 Magick++/fuzz/main.cc delete mode 100644 Magick++/fuzz/ping_fuzzer.cc delete mode 100644 Magick++/fuzz/rotate_fuzzer.cc delete mode 100644 Magick++/fuzz/travis.cc delete mode 100644 Magick++/fuzz/utils.cc delete mode 100644 Magick++/lib/Blob.cpp delete mode 100644 Magick++/lib/BlobRef.cpp delete mode 100644 Magick++/lib/CoderInfo.cpp delete mode 100644 Magick++/lib/Color.cpp delete mode 100644 Magick++/lib/Drawable.cpp delete mode 100644 Magick++/lib/Exception.cpp delete mode 100644 Magick++/lib/Functions.cpp delete mode 100644 Magick++/lib/Geometry.cpp delete mode 100644 Magick++/lib/Image.cpp delete mode 100644 Magick++/lib/ImageRef.cpp delete mode 100644 Magick++/lib/Magick++.h delete mode 100644 Magick++/lib/Magick++.pc.in delete mode 100644 Magick++/lib/Magick++/Blob.h delete mode 100644 Magick++/lib/Magick++/BlobRef.h delete mode 100644 Magick++/lib/Magick++/CoderInfo.h delete mode 100644 Magick++/lib/Magick++/Color.h delete mode 100644 Magick++/lib/Magick++/Drawable.h delete mode 100644 Magick++/lib/Magick++/Exception.h delete mode 100644 Magick++/lib/Magick++/Functions.h delete mode 100644 Magick++/lib/Magick++/Geometry.h delete mode 100644 Magick++/lib/Magick++/Image.h delete mode 100644 Magick++/lib/Magick++/ImageRef.h delete mode 100644 Magick++/lib/Magick++/Include.h delete mode 100644 Magick++/lib/Magick++/Montage.h delete mode 100644 Magick++/lib/Magick++/Options.h delete mode 100644 Magick++/lib/Magick++/Pixels.h delete mode 100644 Magick++/lib/Magick++/ResourceLimits.h delete mode 100644 Magick++/lib/Magick++/STL.h delete mode 100644 Magick++/lib/Magick++/SecurityPolicy.h delete mode 100644 Magick++/lib/Magick++/Statistic.h delete mode 100644 Magick++/lib/Magick++/Thread.h delete mode 100644 Magick++/lib/Magick++/TypeMetric.h delete mode 100644 Magick++/lib/Montage.cpp delete mode 100644 Magick++/lib/Options.cpp delete mode 100644 Magick++/lib/Pixels.cpp delete mode 100644 Magick++/lib/ResourceLimits.cpp delete mode 100644 Magick++/lib/STL.cpp delete mode 100644 Magick++/lib/SecurityPolicy.cpp delete mode 100644 Magick++/lib/Statistic.cpp delete mode 100644 Magick++/lib/Thread.cpp delete mode 100644 Magick++/lib/TypeMetric.cpp delete mode 100644 Magick++/lib/libMagick++.map delete mode 100644 Magick++/tests/appendImages.cpp delete mode 100644 Magick++/tests/attributes.cpp delete mode 100644 Magick++/tests/averageImages.cpp delete mode 100644 Magick++/tests/coalesceImages.cpp delete mode 100644 Magick++/tests/coderInfo.cpp delete mode 100644 Magick++/tests/color.cpp delete mode 100644 Magick++/tests/colorHistogram.cpp delete mode 100644 Magick++/tests/exceptions.cpp delete mode 100644 Magick++/tests/geometry.cpp delete mode 100644 Magick++/tests/montageImages.cpp delete mode 100644 Magick++/tests/morphImages.cpp delete mode 100644 Magick++/tests/readWriteBlob.cpp delete mode 100644 Magick++/tests/readWriteImages.cpp delete mode 100644 Magick++/tests/test_image.miff delete mode 100644 Magick++/tests/test_image_anim.miff delete mode 100755 Magick++/tests/tests.tap (limited to 'Magick++') diff --git a/Magick++/AUTHORS b/Magick++/AUTHORS deleted file mode 100644 index 051068ce7..000000000 --- a/Magick++/AUTHORS +++ /dev/null @@ -1,19 +0,0 @@ -The author and maintainer of Magick++ is Bob Friesenhan -. - -Many thanks to Cristy for developing the powerful ImageMagick -package that Magick++ is based on and for enhancing ImageMagick API -features in order to allow a cleaner implementation. - -Thanks to Bill Radcliffe for his assistance with -getting Magick++ to compile under Visual C++, and for maintaining the -Windows build environment. - -Thanks to Albert Chin-A-Young for assisting -with compilation issues related to the SGI C++ compiler, for providing -access to the Sun C++ compiler, and for assistance with the configure -script. - -Thanks to Leonard Rosenthol for ensuring that -Magick++ compiles on the Mac. - diff --git a/Magick++/Android.bp b/Magick++/Android.bp deleted file mode 100644 index 918ebbb34..000000000 --- a/Magick++/Android.bp +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (C) 2016 The Android Open Source Project -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package { - default_applicable_licenses: ["external_ImageMagick_Magick++_license"], -} - -// Added automatically by a large-scale-change -// See: http://go/android-license-faq -license { - name: "external_ImageMagick_Magick++_license", - visibility: [":__subpackages__"], - license_kinds: [ - "SPDX-license-identifier-MIT", - ], - license_text: [ - "LICENSE", - ], -} - -cc_library_static { - name: "Magick++", - - srcs: ["lib/*.cpp"], - - cflags: [ - "-DHAVE_CONFIG_H", - "-Wall", - "-Werror", - "-Wno-deprecated-register", - "-Wno-unused-private-field", - ], - cppflags: ["-fexceptions"], - - header_libs: ["Magick_headers"], - export_header_lib_headers: ["Magick_headers"], - export_include_dirs: ["lib"], - sdk_version: "24", - stl: "c++_static", - visibility: ["//vendor:__subpackages__"], -} diff --git a/Magick++/ChangeLog b/Magick++/ChangeLog deleted file mode 100644 index a5d8edafb..000000000 --- a/Magick++/ChangeLog +++ /dev/null @@ -1,1528 +0,0 @@ -2017-07-12 7.0.6-1 Dirk Lemstra - * For portability, Color() arguments must be Magick::Quantum (reference - https://github.com/ImageMagick/ImageMagick/issues/510). - -2011-02-12 6.6.7-7 Cristy - * Add support for the strip() and stripImage() STL methods. - -2011-02-01 6.6.7-2 Cristy - * Remove extra '+' in the geometry operator. - -2010-06-16 6.6.2-2 Cristy - * Patch for compile problem in mapImages of the STL header. - -2010-02-21 6.5.9-10 Cristy - * Add extent() to extend the image as defined by the geometry, gravity, and - image background color. - -2009-11-14 6.5.7-8 Cristy - * Add forwardFourierTransform(), inverseFourierTransform(), and - inverseFourierTransformImage() methods to implement forward and inverse - discrete Fourier transform (DFT / IFT). - -2009-09-28 6.5.6-6 Cristy - * Add splice() method to splice the background color into the image. - -2009-04-01 6.5.1-1 Cristy - * Add virtualPixelMethod() method for image and options, required for - distort(). - -2008-09-09 6.4.3-7 Cristy - * Use ImagesToBlob() rather than ImageToBlob() for writeImages(). - -2007-10-02 6.3.6-7 Cristy - * Define USE_MAP for Magick++/tests/colorHistogram.cpp (patch provided by - albert chin ). - -2007-04-10 6.3.3-7 Cristy - * Add colorspaceType(RGBColorspace) to set RGB colorspace before an - image read (useful to convert CMYK Potscript to RGB). - -2006-02-05 6.3.2-3 Cristy - * Clear exception in throwException() method. - -2006-01-16 6.3.2-0 Cristy - * Add extent() method to extend the image as defined by the geometry. - -2003-12-04 Bob Friesenhahn - - * demo/analyze.cpp (main): New program to demonstrate using the - 'analyze' process module. - * demo/Makefile.am: Add rules to build analyze program. - * lib/Image.cpp (process): New method to execute process modules. - * lib/Image.cpp (attribute): New method to get and set named image - attributes. - -2003-10-01 Bob Friesenhahn - - * lib/Color.cpp: Ensure that all non-default constructors set - opacity to opaque. - -2003-09-17 Bob Friesenhahn - - * lib/Magick++/STL.h (colorHistogram): If map key is not const, - then implicit type conversion occurs. Sun's C++ compiler doesn't - seem to handle that. The map key is now defined as const in - the insert arguments. - -2003-09-01 Bob Friesenhahn - - * tests/Makefile.am: Add build support for colorHistogram.cpp. - * tests/colorHistogram.cpp: New test program to test retrieving - color histograms from the image using colorHistogram(). - * lib/Magick++/STL.h (colorHistogram): Added new template function - to retrieve a color histogram into a user-provided container. - Verified to work when using STL and as the target - container types. When is used, a user-specified color may - be used to perform lookups in the map to obtain the usage count for - that color. - * lib/Color.cpp (operator >=): Insufficient resolution was being - provided in order to reliably sort color objects in STL - containers. The updated algorithm should be fail-safe. - -2003-08-31 Bob Friesenhahn - - * lib/Image.cpp (channelDepth): New method to set or get the - modulus depth for a specified channel. - -2003-08-29 Bob Friesenhahn - - * lib/Magick++/Include.h (Magick): Added support for - CopyCyanCompositeOp, CopyMagentaCompositeOp, - CopyYellowCompositeOp, and CopyBlackCompositeOp, composition - operators. - -2003-08-12 Bob Friesenhahn - - * lib/Image.cpp (depth): Method now only updates the - Image/ImageInfo depth member and retrieves the value of the Image - depth member. - (modulusDepth): New method to inspect the pixels for actual - modulus depth, or update/reduce the pixels to a specified modulus - depth. The depth method was performing this function so any code - which depended on the depth method to compute or set the modulus - depth should be updated to use modulusDepth() instead. - -2003-08-03 Bob Friesenhahn - - * lib/Image.cpp (matte): If a new matte channel is created, - initialize it to opaque. Likewise, if the matte channel is - eliminated, initialize the unused channel to opaque. - -2003-07-09 Bob Friesenhahn - - * demo/demo.cpp (main): Don't crop logo image. * - * *.h, *.cpp: Include "Magick++/Include.h" before including any - compiler or system header in order to ensure that LFS defines are - properly applied. Inspired by patch from Albert Chin-A-Young. - -2003-06-29 Bob Friesenhahn - - * lib/Magick++/Include.h: Needed to import ThrowLoggedException. - * lib/Exception.cpp (throwException): Add originating source - module, source line, and function name (if available) to exception - report. This is useful in order to determine the exact conditions - that lead to the exception being thrown. - * lib/Magick++/Exception.h: Added ErrorCoder, WarningCoder, - ErrorConfigure, WarningConfigure, ErrorDraw, WarningDraw, - ErrorImage, WarningImage, ErrorMonitor, WarningMonitor, - ErrorRegistry, WarningRegistry, ErrorStream, WarningStream, - ErrorType, and WarningType, exception classes to support the full - set of exceptions that ImageMagick can throw. - -2003-06-22 Bob Friesenhahn - - * lib/CoderInfo.cpp (CoderInfo): Applied compilation fix from - Mike Chiarappa to compile using Borland C++. - -2003-06-06 Bob Friesenhahn - - * lib/Geometry.cpp (string): Throw an exception if a string is - requested from an invalid geometry object. - -2003-06-05 Bob Friesenhahn - - * lib/Geometry.cpp (operator =): If GetGeometry returns NoValue, - then assign an invalid geometry object to cause an exception if - the geometry is then used. - -2003-06-04 Bob Friesenhahn - - * lib/Magick++/Exception.h (ErrorModule): Added class to handle - module errors. - * lib/Magick++/Exception.h (WarningModule) Added class to handle - module warnings. - -2003-05-30 Bob Friesenhahn - - * lib/Magick++/STL.h (coderInfoList): Use GetMagickInfoArray to - access coder list. - -2003-05-22 Bob Friesenhahn - - * lib/Magick++/STL.h (affineTransformImage): Add function object - contributed by Vladimir Lukianov to apply an affine transform to - the image. - * lib/Image.cpp (affineTransform): Added method contributed by - Vladimir Lukianov to apply an affine transform to the image. - -2003-05-16 Bob Friesenhahn - - * lib/Magick++/Include.h: Decided to back out change - which used the _VISUALC_ define to trigger inclusion of - . - -2003-05-14 Bob Friesenhahn - - * lib/Magick++/Include.h: If _VISUALC_ is defined, - include . This ensures that this necessary - header is included even if HAVE_SYS_TYPES_H is not defined - in magick-config.h. - -2003-05-04 Bob Friesenhahn - - * lib/Image.cpp (InitializeMagick): InitializeMagick is - now a C++ function rather than a namespace inclusion. - An atexit() handler is registered to invoke DestroyMagick - when the program exits. Relying on static deconstruction - to invoke DestroyMagick proved to be unreliable due to - translation unit destruction uncertainty. - -2003-04-15 Bob Friesenhahn - - * lib/Image.cpp (Image::Image (MagickCore::Image* image_)): - Incorporated recommended fix from Jukka Manner to avoid - a scenario which leaks an Options object. - * tests/coalesceImages.cpp: Updated to use modified - coalesceImages() interface. - * lib/Magick++/STL.h (coalesceImages): Replaced implementation - with one from Felix Heimbrecht. The template signature has - changed to return a new image sequence. This template API - silently ceased to funtion due to an ImageMagick CoalesceImages - API change. - -2003-03-30 Bob Friesenhahn - - * tests/readWriteBlob.cpp (main): Added check for - stream read failure when reading blob data. - (class myBlob): Use get rather than read. - -2003-03-20 Bob Friesenhahn - - * tests/attributes.cpp : Change in the way that Magick++ - retrieves density caused tests to fail. Density now defaults - to 72x72 (ImageMagick default) rather than invalid. - -2003-03-15 Bob Friesenhahn - - * demo/Makefile.am (CLEANFILES): Fix clean target to remove - *_out.mvg output files as well. - * demo/zoom.cpp: Added a command-line parser for dash - arguments as well as an image "resample" capability. - * lib/Image.cpp (density): Obtain density from Image - rather than ImageInfo if the Image is valid. - -2003-03-01 Bob Friesenhahn - - * lib/Makefile.am : Added rules to install ImageMagick++.pc. - * lib/ImageMagick++.pc.in : Added pkgconfig file for - -lImageMagick++. - -2003-02-11 Bob Friesenhahn - - * lib/Image.cpp (colorSpace): Pass image->colorspace to - TransformRGBColorspace. - -2003-01-22 Bob Friesenhahn - - * lib/Magick++/STL.h (writeImages): Should have been invoking - WriteImages rather than WriteImage! - -2003-01-18 Bob Friesenhahn - - * lib/Magick++/Include.h: Add HSL and HWB colorspace - transformation support. - -2003-01-13 Bob Friesenhahn - - * lib/Image.cpp (colorSpace): Support colorspace transforms - other than to and from RGB by translating to RGB as an intermediate - step. - -2002-11-24 Bob Friesenhahn - - * lib/Drawable.cpp: Added DrawablePushClipPath, - DrawablePopClipPath, and DrawableClipPath. Implementation - contributed by Vladimir . - -2002-11-10 Bob Friesenhahn - - * lib/Image.cpp (colorMapSize): New method to set, or return - the colormap size. - -2002-11-08 Bob Friesenhahn - - * lib/Image.cpp (adaptiveThreshold): New method. - -2002-10-01 Bob Friesenhahn - - * lib/Magick++/STL.h (coderInfoList): Intentionally ignore missing - delegate exceptions. - -2002-09-24 Bob Friesenhahn - - * lib/Options.cpp (textEncoding): Had forgotten to implement - textEncoding! - -2002-09-16 Bob Friesenhahn - - * lib/Color.cpp (Color): Use of 'new' and 'delete' in inlines was - causing memory allocation/deallocation problems for users of the - DLL build. Problem was identified by Marc Iwan. - -2002-09-02 Bob Friesenhahn - - * lib/Image.cpp (compare): New method to compare current image - with a reference image. - -2002-08-19 Bob Friesenhahn - - * lib/Image.cpp (textEncoding): New method to allow setting the - default text encoding (e.g. "UTF-8"). - - * lib/Drawable.cpp (DrawableText): Added an alternate constructor - to allow specifying the text encoding (e.g. "UTF-8"). - -2002-08-02 Bob Friesenhahn - - * Overall: Now compiles as a DLL using Visual C++. - -2002-07-24 Bob Friesenhahn - - * lib/Image.cpp (profile): Added method to store, delete, or - retrieve named application profiles. - -2002-07-17 Bob Friesenhahn - - * lib/Image.cpp (type): Set the ImageInfo type attribute when - setting the image type. If the type attribute is set to something - other than UndefinedType (implying that the user has set a desired - output image type), then return that as the image type, otherwise - use GetImageType() to evaluate the image type. - -2002-05-20 Bob Friesenhahn - - * lib/Drawable.cpp (DrawableTextUnderColor): New class to set the - text undercolor. When text undercolor is set, a rectangle of the - specified color is rendered under text annotations. - -2002-05-19 Bob Friesenhahn - - * Magick++ library no longer depends on iostreams at all. - -2002-04-28 Bob Friesenhahn - - * lib/Image.cpp (throwImageException): ExceptionInfo was not being - properly initialized. This could cause some errors to cause an - abort in error.c rather than throwing an exception. - -2002-04-26 Bob Friesenhahn - - * lib/Image.cpp (draw): Use draw.h drawing APIs to draw on image. - This means that MVG output no longer comes from code in - Drawable.cpp. - -2002-04-25 Bob Friesenhahn - - * lib/STL.cpp: Moved function object implementations from STL.h to - STL.cpp. - -2002-04-20 Bob Friesenhahn - - * lib/Image.cpp (getConstPixels): Changed offset parameter type - from 'unsigned int' to 'int'. - (getPixels): Changed offset parameter type from 'unsigned int' to - 'int'. - (setPixels): Changed offset parameter type from 'unsigned int' to - 'int'. - (cacheThreshold): Changed argument type from 'const long' to - 'const int'. - (matteFloodfill): Changed offset parameter type from 'const long' to - 'const int'. - - * lib/Pixels.cpp (getConst): New method to return read-only pixels. - (get): Offset parameter types changed from 'unsigned int' to 'int'. - -2002-04-19 Bob Friesenhahn - - * lib/Magick++/Drawable.h (DrawableDashOffset): Change dashoffset - type to 'double' rather than 'unsigned int' in order to match - ImageMagick. - - * lib/Drawable.cpp (DrawableDashArray): Change dasharray type to - 'double' rather than 'unsigned int' in order to match - ImageMagick. Previous 'unsigned int' methods remain for - compatability reasons. - -2002-04-14 Bob Friesenhahn - - * lib/Drawable.cpp (DrawableCompositeImage): Always output - composite images as inlined Base64. - -2002-04-13 Bob Friesenhahn - - * lib/Drawable.cpp (DrawableCompositeImage): If magick attribute - string is specified, then composite image is supplied to - ImageMagick as inlined Base64 rather than by MPRI reference. - - * lib/Blob.cpp (base64): Added methods to update Blob with data - from Base64-encoded string, or to return a Base64-encoded string - from Blob. Still needs documentation. - -2002-04-09 Dom Lachowicz - - * lib/Image.cpp (Image::ping): Added PingBlob function - -2002-04-07 Bob Friesenhahn - - * lib/Drawable.cpp (DrawableDashArray::operator=): Added missing - assignment operator (fixes a bug). - (DrawableDashArray::DrawableDashArray): Added missing copy - constructor (fixes a bug). - - * lib/Image.cpp (oilPaint): Changed argument type from unsigned - int to double. - (chromaBluePrimary): Changed argument type from float to double. - (chromaGreenPrimary): Changed argument type from float to double. - (chromaRedPrimary): Changed argument type from float to double. - (chromaWhitePoint): Changed argument type from float to double. - (getConstPixels): Changed argument type of x_ & _y from 'int' to - 'unsigned int'. - (getPixels): Changed argument type of x_ & _y from 'int' to - 'unsigned int'. - -2002-04-05 Bob Friesenhahn - - * lib/Image.cpp (debug): Added method to set ImageMagick debug - flag so that it prints debugging information while it runs. - -2002-04-03 Bob Friesenhahn - - * lib/Drawable.cpp: Fixed a bunch of bugs related to - DrawableCompositeImage, DrawableFont, and inconsistencies - discovered by Gimpel lint. - -2002-04-02 Bob Friesenhahn - - * lib/Image.cpp (draw): Properly delimit individual drawing - commands so that MVG output is correct. - -2002-03-30 Bob Friesenhahn - - * lib/Drawable.cpp (DrawableViewbox): MVG syntax wasn't correct. - - * lib/Image.cpp (draw): Fix algorithm used to append newlines to - MVG commands so that draw() may be invoked multiple times while - still producing valid MVG. - -2002-03-29 Bob Friesenhahn - - * lib/Drawable.cpp (DrawableViewbox): New class to allow setting - the MVG output size. - -2002-03-26 Bob Friesenhahn - - * lib/Drawable.cpp (print): Changed "mpr:" to "mpri:" in order to - *finally* get DrawableCompositeImage to work as intended. - - * lib/Image.cpp (registerId): Bugfix. Register using - sizeof(MagickCore::Image) rather than sizeof(Image). - -2002-03-26 Bob Friesenhahn - - * lib/Drawable.cpp (DrawableCompositeImage): Had failed to - initialize width and height in object to image width and height. - -2002-02-28 Bob Friesenhahn - - * lib/Magick++/STL.h (endianImage): New class to specify the - endian option for formats which support this notion (e.g. TIFF). - - * lib/Image.cpp (endian): New method to specify the endian option - for formats which support this notion (e.g. TIFF). - -2002-02-11 Bob Friesenhahn - - * lib/Drawable.cpp (DrawableFont): Support specifying a font via - font-family, font-style, font-weight, and font-stretch. Wildcard - matches are supported. - -2002-02-06 Bob Friesenhahn - - * lib/Image.cpp (charcoal): Replace Magick++'s charcoal effect - with the output of ImageMagick's CharcoalImage function in order - to ensure consistency. - - * lib/Magick++/CoderInfo.h (MatchType): Scope the MatchType - enumeration to the CoderInfo class so these enumeration names can - be re-used elsewhere without conflict. This results in a minor - API change to the coderInfoList() templated function since - enumerations must be specified like "CoderInfo::TrueMatch" rather - than just "TrueMatch". Hopefully not a problem since this - function and class were not documented outside of the headers - until this release. - -2002-02-05 Bob Friesenhahn - - * lib/Magick++/STL.h (coderInfoList): Finally wrote some - documentation. - -2002-01-26 Bob Friesenhahn - - * lib/Options.cpp : Use DestroyImageList() rather than DestroyImage(). - - * lib/Geometry.cpp (operator =): Use GetPageGeometry() rather than - PostscriptGeometry() to parse geometry specifications containing a - page size. - -2002-01-21 Bob Friesenhahn - - * Remove bogus cast of blob data in readImages(). - -2002-01-20 Bob Friesenhahn - - * lib/Image.cpp (throwImageException): Throwing exceptions was - leaking memory. - - * lib/Exception.cpp (throwException): Throwing exceptions was - leaking memory. - - * lib/Image.cpp (replaceImage): Updated to properly handle - registration ids. - (modifyImage): Updated to properly handle registration ids. - -2002-01-15 Bob Friesenhahn - - * lib/Drawable.cpp (Magick::DrawableGravity::print): - Bugfix. Remove "Gravity" from the end of each gravity - specification string. Reported as PR#1084 by stefan@dotify.com. - -2002-01-12 Bob Friesenhahn - - * lib/Image.cpp, Magick++/Include.h: Use DestroyImageList() rather - than DestroyImages(). - -2002-01-10 Bob Friesenhahn - - * lib/Magick++/Options.h (antiAlias): Bugfix, set - drawInfo->text_antialias to control text antialiasing. - -2002-01-02 Bob Friesenhahn - - * lib/Magick++/Include.h : Imported new composition operators to - namespace: NoCompositeOp, DarkenCompositeOp, LightenCompositeOp, - HueCompositeOp, SaturateCompositeOp, ValueCompositeOp, - ColorizeCompositeOp, LuminizeCompositeOp, ScreenCompositeOp, - OverlayCompositeOp. - -2001-12-27 Bob Friesenhahn - - * lib/Image.cpp (strokePattern): New method to specify image to - use as pattern while drawing stroked-outlines of drawn objects. - (fillPattern): New method to specify image to use as pattern while - filling drawn objects. - (penTexture): Method is officially deprecated. Don't use anymore. - (penColor): Method is officially deprecated. Don't use anymore. - - * lib/Drawable.cpp (DrawablePushPattern): Support pushing - (starting) pattern definition. - (DrawablePopPattern): Support popping (terminating) pattern - definition. - -2001-12-26 Bob Friesenhahn - - * lib/Drawable.cpp (DrawableCompositeImage): Read image - immediately if provided by filename, register with peristent - registry, and pass as perisistant image type. - (DrawableCompositeImage): Support specifying Image in memory. - Passed as perisistant image type. - -2001-12-24 Bob Friesenhahn - - * lib/Color.cpp (operator std::string): Color string buffer was - one character too short! - -2001-12-20 Bob Friesenhahn - - * lib/TypeMetric.cpp (characterWidth): Eliminate method. - (characterHeight): Eliminate method. - (all remaining methods): Change return type to 'double'. Fix - documentation in source files to reflect that units are in pixels - rather than points. - (descent): Renamed method from 'decent' to 'descent'. - -2001-11-22 Bob Friesenhahn - - * lib/Image.cpp (Magick): Invoke DestroyMagick() to clean up - ImageMagick allocations. - - * lib/Magick++/Include.h (ImageType): Added some missing enums to - Magick namespace. - -2001-11-20 Bob Friesenhahn - - * lib/Magick++/CoderInfo.h (CoderInfo): Syntax fix. - ImageMagick bug #975. - - * lib/Image.cpp (draw): Delete ostrstream data when it is no - longer needed. ImageMagick bug #988. - -2001-11-07 Bob Friesenhahn - - * lib/Image.cpp (pixelColor): Implementation didn't handle pixels - indexes correctly. Now it does. - -2001-11-04 Bob Friesenhahn - - * lib/Image.cpp (matteFloodfill): Coordinates are long values. - (floodFillOpacity): New method to floodfill opacity across pixels - matching color (within fuzz-factor) at point. Similar to - matteFloodfill except that color is selected from starting point. - -2001-10-29 Bob Friesenhahn - - * lib/Image.cpp (strokeDashArray): Change to type double. - (strokeDashOffset): Change to type double. - -2001-10-24 Bob Friesenhahn - - * lib/Geometry.cpp (Geometry): Add constructor from - MagickCore::RectangleInfo. - - * lib/Image.cpp (boundingBox): Method to return smallest bounding - box enclosing non-border pixels. - -2001-10-20 Bob Friesenhahn - - * lib/Image.cpp (getConstIndexes): Add method to obtain read-only - pixel indexes. - (getIndexes): Add method to obtain read-write pixel indexes. - (Image::Image): Send warnings from Image constructor to cerr - rather than throwing. - - * lib/Color.cpp (Color(PixelPacket&)): Change argument to const - PixelPacket& as it should have been from the beginning. - - * lib/Image.cpp (pixelColor): Reimplemented to be a const method. - -2001-10-13 Bob Friesenhahn - - * lib/Image.cpp (getConstPixels): New method for returning a - read-only pixel view. Still requires documentation. - - * lib/Magick++/STL.h (coderInfoList): Fixed compilation problem - when compiling with Visual C++. - -2001-10-06 Bob Friesenhahn - - * lib/Magick++/Color.h (scaleQuantumToDouble): Add polymorphic - version that accepts double to avoid downconversion error. - -2001-10-05 Bob Friesenhahn - - * lib/Magick++/Color.h (scaleQuantumToDouble): Cast Quantum to - double prior to division. Hopefully fix bug. - -2001-10-01 Bob Friesenhahn - - * lib/Magick++/Color.h (Color(const std::string)): Pass argument by reference. - * (operator=): Pass argument by const reference. - -2001-09-23 Bob Friesenhahn - - * lib/Magick++/STL.h (coderInfoList): New function to support - obtaining format coder information (as a list of type CoderInfo). - - * lib/CoderInfo.cpp (CoderInfo): New class to support obtaining - format coder information. - -2001-09-15 Bob Friesenhahn - - * lib/Image.cpp (depth): Use GetImageDepth and SetImageDepth - rather than just getting/setting depth attributes. - - * lib/Magick++/STL.h (opacityImage): New unary function object to - set, or attenuate, image pixel opacity throughout the image. - - * lib/Image.cpp (opacity): New method to set, or attenuate, image - pixel opacity throughout the image. - - * lib/Magick++/STL.h (typeImage): New unary function object to set - image type. - - * lib/Image.cpp (type): Added ability to set image type. - -2001-09-12 Bob Friesenhahn - - * lib/Image.cpp (write(Blob)): Tell blob to use malloc allocator. - - * lib/Blob.cpp (updateNoCopy): Added parameter so that user can - specify the allocation system (malloc or new) the memory came - from. Defaults to C++ memory allocator. - -2001-09-09 Bob Friesenhahn - - * lib/Image.cpp (fileSize): Decided to change return type to off_t - for increased range and portability. - -2001-09-08 Bob Friesenhahn - - * lib/Image.cpp (fileSize): Changed return value to double. - -2001-09-05 Bob Friesenhahn - - * lib/Image.cpp (colorMap): Allocate a colormap if it does not - already exist. - - * lib/Pixels.cpp (indexes): Don't attempt to validate image type. - - * lib/Image.cpp (colorMap): Optimized more for performance. - -2001-09-03 Bob Friesenhahn - - * lib/Image.cpp (fontTypeMetrics): New method to support - retrieving font metrics. - - * lib/TypeMetric.cpp : New class to support font metrics - information. - -2001-09-02 Bob Friesenhahn - - * lib/Magick++/Color.h (scaleDoubleToQuantum): Inline static - method made from previous ScaleDoubleToQuantum #define. - (scaleQuantumToDouble): Inline static method made from previous - ScaleQuantumToDouble #define. Helps avoid possibility of clash - with user code. - -2001-08-25 Bob Friesenhahn - - * lib/Image.cpp (colorMap): Automagically extend colormap if - specified index is past end of current colormap. Colormap is - limited to a maximum depth of QuantumRange entries. - -2001-08-19 Bob Friesenhahn - - * lib/Image.cpp (clipMask): New method to add a clip mask to the - image. Adds clipping to any image operation wherever the clip - mask image is tranparent. - -2001-08-15 Bob Friesenhahn - - * lib/Drawable.cpp (print): Add single quotes around file names - and font specifications. - -2001-07-07 Bob Friesenhahn - - * lib/Image.cpp (read): Ensure that only a single image frame is read. - -2001-07-05 Bob Friesenhahn - - * lib/Magick++/STL.h (flattenImages): New function to flatten a - layered image. - - * lib/Montage.cpp (Montage): Montage initial defaults are no - longer drawn from ImageInfo. MontageInfo structure is entirely - filled out by updateMontageInfo(); - -2001-07-03 Bob Friesenhahn - - * lib/Montage.cpp (updateMontageInfo): Bugfix; colors which were - intentionally specified as invalid (unset) were being ignored. - This produced unattractive label text when doing a montage. - -2001-07-01 Bob Friesenhahn - - * lib/Magick++/STL.h (medianFilterImage): Changed argument from - unsigned int to const double. - (fillColorImage): New method. - (strokeColorImage): New method. - (isValidImage): New method. - - * lib/Magick++/Image.h (edge): Change argument from unsigned int to double. - (medianFilter): Changed argument from unsigned int to const double. - - * lib/Magick++/STL.h (edgeImage): Change argument from unsigned int to double. - - * demo/demo.cpp (main): Updated to match PerlMagick demo. - -2001-06-23 Bob Friesenhahn - - * lib/Magick++/STL.h (shaveImage): New function to shave edges from image. - - * lib/Image.cpp (shave): New method to shave edges from image. - -2001-06-22 Bob Friesenhahn - - * lib/Image.cpp (quantize): Remove conditions on whether - quantization should be done. Now quantization is always done. - -2001-06-14 Bob Friesenhahn - - * lib/Magick++/Image.h (blur,charcoal,emboss,sharpen): Changed - radius and sigma parameters to match current ImageMagick defaults. - -2001-02-22 Bob Friesenhahn - - * lib/Options.cpp (updateDrawInfo): The updateDrawInfo() method - was no longer needed. Due to ImageMagick changes, calling it was - causing some options to be lost. - -2001-01-31 Bob Friesenhahn - - * lib/Image.cpp (fillRule): New method to specify the rule to use when filling drawn objects. - -2001-01-25 Bob Friesenhahn - - * lib/Image.cpp (erase): New method to reset image to background - color. - (strokeAntiAlias): New method to control antialiasing of stroked - objects. - -2001-01-24 Bob Friesenhahn - - * lib/Image.cpp (channel): Renamed method from 'layer' to match - equivalent change in ImageMagick (ChannelImage). Enumeration - names *Layer renamed to *Channel. - -2001-01-13 Bob Friesenhahn - - * lib/Magick++/Montage.h (strokeColor): New method. - (fillColor): New method. - - * lib/Image.cpp (replaceImage): Revised logic so that an inValid - image should be returned if a NULL pointer is passed. Before this - change the existing image was preserved. - (label): Work-around ImageMagick SetImageAttribute bug. - -2001-01-10 Bob Friesenhahn - - * lib/Image.cpp : Adjusted to ImageMagick animation parameter API change. - -2000-12-31 Bob Friesenhahn - - * lib/Drawable.cpp (DrawableCompositeImage): Support specifying - composition rule. - -2000-12-27 Bob Friesenhahn - - * lib/Image.cpp (draw): Bugfix - the primitive string was not - properly null terminated. It is a wonder that the code usually - worked at all. Thanks to afatela@marktest.pt for reporting it. - -2000-12-24 Bob Friesenhahn - - * lib/Magick++/STL.h (deconstructImages): New STL function for - deconstructing an image list to assist with creating an animation. - (mosaicImages): New STL function for inlaying an image list to - form a single coherent picture. - -2000-12-17 Bob Friesenhahn - - * lib/Image.cpp (convolve): New method to convolve image using - user-supplied convolution matrix. - (unsharpmask): New method to replace image with a sharpened - version of the original image using the unsharp mask algorithm. - -2000-12-14 Bob Friesenhahn - - * : Adapted to ImageMagick API change which eliminates AnnotateInfo. - -2000-12-10 Bob Friesenhahn - - * lib/Magick++/STL.h (annotateImage): Brought into sync with - annotate methods in Image. - -2000-12-09 Bob Friesenhahn - - * lib/Image.cpp (annotate): Usage of Geometry parameter was - incorrect. Geometry parameter is used to specify bounding area. - This changes the interpretation for two of the annotate methods - (which probably weren't usable before). - -2000-11-29 Bob Friesenhahn - - * lib/Magick++/Color.h (alphaQuantum): Bugfix. Due to change in - treatment of opacity member, alphaQuantum() was not allowing value - to be set. - -2000-11-25 Bob Friesenhahn - - * lib/Drawable.cpp (DrawableFillRule): New class to specify fill - rule (see SVG's fill-rule). - (DrawableDashOffset): New class to specify initial offset in dash - array. - (DrawableDashArray): New class to specify a stroke dash pattern. - (DrawableStrokeLineCap): New class to specify the shape to be used - at the end of open subpaths when they are stroked. - (DrawableStrokeLineJoin): New class to specify the shape to be - used at the corners of paths (or other vector shapes) when they - are stroked. - (DrawableMiterLimit): New class to specify extension limit for - miter joins. - -2000-11-24 Bob Friesenhahn - - * lib/Image.cpp (annotate): Reimplement text rotation using affine - member of AnnotateInfo. - (strokeDashOffset): New method for specifying the dash offset to use for - drawing vector objects. Similar to SVG stroke-dashoffset. - (strokeDashArray): New method for specifying the dash pattern to use - for drawing vector objects. Similar to SVG stroke-dasharray - (strokeLineCap): New method to specify the shape to be used at the end - of open subpaths when they are stroked. Similar to SVG - stroke-linecap. - (strokLineJoin): New method to specify the shape to be used at the - corners of paths (or other vector shapes) when they are - stroked. Similar to SVG stroke-linejoin. - (strokeMiterLimit): New method to specify the miter limit when joining - lines using MiterJoin. Similar to SVG stroke-miterlimit. - (strokeWidth): Renamed lineWidth method to strokeWidth. - -2000-10-26 Bob Friesenhahn - - * lib/Magick++/Drawable.h (DrawableCompositeImage): Add a - short-form constructor to support specifying image location and - name, but without specifying rendered size (use existing image - size). - -2000-10-16 Bob Friesenhahn - - * lib/Magick++/Drawable.h (DrawablePopGraphicContext): New class - to pop graphic context. - (DrawablePushGraphicContext): New class to push graphic context. - - * lib/Drawable.cpp (DrawableStrokeAntialias): New class to set - stroke antialiasing. - (DrawableTextAntialias): New class to set text antialiasing. - -2000-10-15 Bob Friesenhahn - - * lib/Image.cpp (transformOrigin): New method to set origin of - coordinate system for use when annotating with text or drawing - (transformRotation): New method to set rotation for use when - annotating with text or drawing - (transformScale): New method to set scale for use when annotating - with text or drawing. - (transformSkewX): New method to set skew for use in X axis when - annotating with text or drawing. - (transformSkewY): New method to set skew for use in Y axis when - annotating with text or drawing. - (transformReset): New method to reset transformation to default. - - * lib/Drawable.cpp (DrawablePath): New class for drawing SVG-style - vector paths. - (PathArcArgs): New class. Argument for PathArcArgs & PathArcAbs. - (PathArcAbs): New class. Draw arc using absolute coordinates. - (PathArcRel): New class. Draw arc using relative coordinates. - (PathClosePath): New class. Close drawing path. - (PathCurvetoArgs): New class. Argument class for PathCurvetoAbs & - PathCurvetoRel. - (PathCurvetoAbs): New class. Cubic bezier, absolute coordinates - (PathCurvetoRel): New class. Cubic bezier, relative coordinates - (PathSmoothCurvetoAbs): New class. Cubic bezier, absolute - coordinates - (PathSmoothCurvetoRel): New class. Cubic bezier, relative - coordinates - (PathQuadraticCurvetoArgs): New class. Argument class for - PathQuadraticCurvetoAbs and PathQuadraticCurvetoRel. - (PathQuadraticCurvetoAbs): New class. Quadratic bezier, absolute - coordinates - (PathQuadraticCurvetoRel): New class. Quadratic bezier, relative - coordinates - (PathSmoothQuadraticCurvetoAbs): New class. Quadratic bezier, - absolute coordinates - (PathSmoothQuadraticCurvetoRel): New class. Quadratic bezier, - relative coordinates - (PathLinetoAbs): New class. Line to, absolute coordinates - (PathLinetoRel): New class. Line to, relative coordinates - (PathLinetoHorizontalAbs): New class. Horizontal lineto, absolute - coordinates - (PathLinetoHorizontalRel): New class. Horizontal lineto, relative - coordinates - (PathLinetoVerticalAbs): New class. Veritical lineto, absolute - coordinates. - (PathLinetoVerticalRel): New class. Vertical lineto, relative - coordinates. - (PathMovetoAbs): New class. Moveto, absolute coordinates - (PathMovetoRel): New class. Moveto, relative coordinates - -2000-10-10 Bob Friesenhahn - - * lib/Drawable.cpp (DrawableSkewX): New object to apply skew in X direction. - (DrawableSkewY): New object to apply skew in Y direction. - -2000-10-09 Bob Friesenhahn - - * lib/Image.cpp (edge): Change argument from 'unsigned int' to - 'double' in order to match ImageMagick API. - -2000-10-08 Bob Friesenhahn - - * lib/Drawable.cpp (DrawableCompositeImage): Renamed from - DrawableImage. - (DrawableTextDecoration): Renamed form DrawableDecoration. - (all-classes): Complete re-write to write the drawing command to a - stream when draw() is invoked rather than at object construction - time. This may be somewhat slower for individual draw operations - but should be at least as fast for lists of drawing commands, - and is more flexible going into the future. Drawable classes now - inherit from DrawableBase but are passed into STL lists and Image - draw() methods via the surrogate class Drawable. The upshot of - all this is that the existing published API has not been altered - but things work much differently under the covers. - -2000-10-05 Bob Friesenhahn - - * lib/Drawable.cpp (DrawableStrokeColor): Renamed from DrawableStroke - (DrawableFillColor): Renamed from DrawableFill - (DrawableRotation): New class to influence object rotation. - (DrawableScaling): New class to influence object scaling. - (DrawableTranslation): New class to influence object translation. - -2000-10-04 Bob Friesenhahn - - * lib/Drawable.cpp (DrawableAffine): New class to influence object - scaling, rotation, and translation (as defined by SVG XML). - (DrawableAngle): New class to influence drawing angle. - (DrawableDecoration): New class to influence text decoration such - as underline. - (DrawableFill): New class to set object filling color. - (DrawableFillOpacity): New class to set opacity to use when - filling object. - (DrawableFont::): New class to set font. - (DrawableGravity): New class to set text placement gravity. - (DrawablePointSize): New class to set font point size. - (DrawableStroke): New class to set drawing stroke color. - (DrawableStrokeOpacity): New class to set drawing stroke opacity. - (DrawableStrokeWidth): New class to set drawing stroke width. - -2000-10-03 Bob Friesenhahn - - * lib/Drawable.cpp (DrawableImage): Added width and height - parameters to specify size to scale rendered image to. This is - actually a bug-fix since it seems that the correct drawing command - was no longer being generated. - -2000-09-30 Bob Friesenhahn - - * lib/Image.cpp (read): New overloaded method to read an image - based on an array of raw pixels, of specified type and mapping, in - memory. - (write): New overloaded method to write image to an array of - pixels, of specified type and mapping. - (Image): New overloaded constructor to construct an image based on - an array of raw pixels, of specified type and mapping, in memory. - -2000-09-27 Bob Friesenhahn - - * lib/Image.cpp (colorize): API change to match change in - ImageMagick. Now accepts percentage of red, green, and blue to - colorize with using specified pen color. - -2000-09-20 Bob Friesenhahn - - * lib/Magick++/Drawable.h: Reverted Coordinate implemenation back - from and STL pair based implementation to a simple class. Maybe - this will improve portability. It is more understandable anyway. - -2000-09-18 Bob Friesenhahn - - * lib/Options.cpp : Bugfix. Some DrawInfo attributes were not - being updated. This lead to options like fontPointsize not - changing the font. - -2000-08-26 Bob Friesenhahn - - * lib/Magick++/STL.h (blurImage, charcoalImage, embossImage, - sharpenImage): Expand order_ argument to radius_ & sigma_ - arguments for more control (matches ImageMagick API change). - - * lib/Image.cpp (blur, charcoal, emboss, sharpen): Expand order_ - argument to radius_ & sigma_ arguments for more control (matches - ImageMagick API change). - -2000-08-24 Bob Friesenhahn - - * lib/Image.cpp (read): Check returned Image for embedded - exception, as well as the existing parameter check. This fixes - the bug that warnings are not reported. - -2000-07-26 Bob Friesenhahn - - * test/*.cpp demo/*.cpp: Added call to MagickIncarnate() to set - ImageMagick install location for Windows. Hopefully this hack can - be removed someday. - -2000-07-20 Bob Friesenhahn - - * lib/Image.cpp (colorFuzz): Changed type to 'double' from - 'unsigned int' to match change in ImageMagick. - - * lib/Color.cpp (Color*): Added copy constructor from base class. - (operator =): Added assignment operator from base class. - -2000-06-28 Bob Friesenhahn - - * lib/Magick++/Include.h : Changed enumeration FilterType to - FilterTypes, and QuantumTypes to QuantumType in order to match - last-minute API change in ImageMagick. - -2000-06-22 Bob Friesenhahn - - * lib/Magick++/Pixels.cpp (indexes): Bugfix, use GetCacheViewIndexes() - rather than GetIndexes(). - -2000-05-23 Bob Friesenhahn - - * lib/Magick++/Montage.h (gravity): Type of gravity_ argument, and - return value changed from 'unsigned int' to GravityType. - -2000-04-17 Bob Friesenhahn - - * lib/Drawable.cpp (DrawableArc, DrawableBezier, DrawablePolyline, - RoundRectangle): Added support for new drawing objects. - -2000-04-16 Bob Friesenhahn - - * lib/Drawable.cpp: Removed all public methods which accept - Coordinate arguments except those that accept lists of - Coordinates. Converted remaining drawable object methods into - individual classes which inherit from Drawable (e.g. "circle" - becomes "DrawableCircle"). The constructor for each class is - compatible with the original method. This results in annoying - changes to user code but provides more implementation flexibility. - -2000-04-09 Bob Friesenhahn - - * lib/Drawable.cpp - (fillEllipse,fillRectangle,fillCircle,fillPolygon): Removed - methods. Object filling is now based on whether fillColor or - penTexture are valid or not. This reflects ImageMagick internal - changes. - - * lib/Image.cpp (fillColor): New method to specify fill color when - drawing objects. - (strokeColor): New method to specify outline color when drawing - objects. - (penColor): Setting penColor now sets fillColor and - strokeColor. Getting penColor retrieves the value of - strokeColor. This supports backwards compatability. - -2000-03-28 Bob Friesenhahn - - * lib/Image.cpp (lineWidth): Type changed from unsigned int to double. - -2000-03-08 Bob Friesenhahn - - * lib/Magick++/STL.h (Magick): - -2000-03-07 Bob Friesenhahn - - * lib/Magick++/STL.h (blurImage,charcoalImage,edgeImage,embossImage, - reduceNoiseImage,sharpenImage): Modified to support order of the - pixel neighborhood. Backward compatable function objects constructors - are provided for embossImage, and reduceNoiseImage. - - * lib/Image.cpp (blur,charcoal,edge,emboss,reduceNoise,sharpen): - Now accept unsigned int argument which represents the order of the - pixel neighborhood (e.g. 3). This is not a backwards compatable - change, however, backward compatable methods are provided for emboss, - and reduceNoise. - -2000-03-02 Bob Friesenhahn - - * lib/Magick++/Pixels.h (Pixels): Moved Image pixel methods to - Pixels class. - -2000-02-29 Bob Friesenhahn - - * lib/Image.cpp (annotate): Re-wrote to improve performance. - (draw): Re-wrote to improve performance. - -2000-02-26 Bob Friesenhahn - - * lib/Drawable.cpp (text): Bugfix: support spaces in annotation text. - -2000-02-23 Bob Friesenhahn - - * lib/Magick++/STL.h (gaussianBlurImage): New function object to - Gaussian blur image. - - * lib/Image.cpp (gaussianBlur): New method to Gaussian blur image. - -2000-02-16 Bob Friesenhahn - - * lib/Image.cpp : Call-back based LastError class is eliminated in - favor of ImageMagick 5.2's re-entrant ExceptionInfo reporting. - This should make Magick++ thread safe under Win32. - -2000-02-08 Bob Friesenhahn - - * lib/Image.cpp (floodFillTexture): Fixed bug due to pixel pointer - becoming invalid in ImageMagick function. - -2000-01-24 Bob Friesenhahn - - * lib/Image.cpp : Added locking to reference counting to ensure - thread (pthread) safety. - - * lib/Blob.cpp : Added locking to reference counting to ensure - thread (pthread) safety. - - * lib/LastError.cpp: Added support for thread specific data - (pthreads) so that error reporting is thread safe. - - * lib/Magick++/Thread.h: Added thread wrapper class to provide - thread-safe locking (pthreads) to Magick++. - -2000-01-19 Bob Friesenhahn - - * lib/Image.cpp: Added methods getPixels, setPixels, syncPixels, - readPixels, and writePixels, in order to provide low-level access - to Image pixels. This approach (direct wrapper around ImageMagick - functions) does not mean that the planned object-oriented wrapper - has been forgotten, only that this wrapper is not ready yet, and - users need to manipulate pixels *now*. - -2000-01-16 Bob Friesenhahn - - * lib/LastError.cpp: Complete re-implementation of LastError so - that it hides its implementation. Also assures that all memory is - explicitly deallocated at program exit to avoid the appearance of - a leak. - -2000-01-11 Bob Friesenhahn - - * lib/Image.cpp (size): Bug-fix. Set image columns and rows as - well as image options columns and rows. - - * lib/Image.cpp :Depth parameters are now all unsigned in for consistency. - - * lib/Image.cpp (write): Parameters for writing Blobs re-arranged - again to hopefully be more sensible. - - * lib/Magick++/STL.h: Bug-fix. Re-number scenes from zero when linking - image range in container into a list. This provides expected results. - -1999-12-31 Bob Friesenhahn - - * lib/Image.cpp - (write): Additional overloaded methods for BLOBs. - (read): Additional overloaded methods for BLOBs. Re-ordered - parameters for one existing method. - (Image): Additional overloaded methods for BLOBs. Re-ordered - parameters for one existing method. - -1999-12-28 Bob Friesenhahn - - * lib/Image.cpp (floodFillTexture): Changed coordinates to unsigned. - -1999-12-21 Bob Friesenhahn - - * lib/Image.cpp (medianFilter): New method. - -1999-12-18 Bob Friesenhahn - - * lib/Image.cpp (density): Bug fix. Was not setting image x & y density. - -1999-11-30 Bob Friesenhahn - - * lib/Image.cpp (page): psPageSize() is renamed to page() and now - properly returns the attribute from the image. - -1999-11-25 Bob Friesenhahn - - * lib/Image.cpp: Rename transformColorSpace() to colorSpace(). - Added colorSpace() accessor method. - -1999-11-24 Bob Friesenhahn - - * lib/Color.cpp: Re-implemented PixelPacket pointer so that it is - never NULL and added a 'valid' field for tracking object validity. - -1999-11-13 Bob Friesenhahn - - * lib/Image.cpp (quantizeError): Eliminated method. - -1999-11-10 Bob Friesenhahn - - * lib/Image.cpp (annotate & draw): Changed implementation to - reflect change to the way AnnotateInfo is managed by ImageMagick. - -1999-11-07 Bob Friesenhahn - - * lib/Image.cpp (cacheThreshold): New method to set the pixel - cache threshold. - - * lib/Magick++/Include.h (Magick): Added new enumerations from - classify.h. - -1999-10-28 Bob Friesenhahn - - * lib/Magick++/Options.h (fontPointsize): Argument is now a double - to match change in ImageMagick. - - * lib/Image.cpp (fontPointsize): Argument is now a double to match - change in ImageMagick. - -1999-10-21 Bob Friesenhahn - - * lib/Blob.cpp (BlobRef): Bugfix -- start blob reference count at - one rather than zero. - -1999-10-19 Bob Friesenhahn - - * lib/Image.cpp (Image): Fixed Image constructors from Blob. The - image reference was not being instantiated as it should have been, - causing a crash. - -1999-10-05 Bob Friesenhahn - - * lib/Blob.cpp: All blob length parameters are now of type size_t. - - * lib/Image.cpp (write): Length estimate is now of type size_t. - -1999-09-20 Bob Friesenhahn - - * lib/Image.cpp (rotate): No longer accepts a crop option since - ImageMagick no longer supports this. - (shear): No longer accepts a crop option since ImageMagick no - longer supports this. - -1999-09-18 Bob Friesenhahn - - * lib/Image.cpp: - (rotate): No longer accepts sharpen argument. - User must sharpen separately if desired. This change is due to a - similar change in ImageMagick 5.0. - (condense): Removed method. - (uncondense): Removed method. - (condensed): Removed method. - (pixelColor): Adapted to 5.0. - - * lib/Magick++/Color.h : Rewrote to efficiently use ImageMagick - 5.0's PixelPacket color representation. - - * lib/Color.cpp : Rewrote to efficiently use ImageMagick 5.0's - PixelPacket color representation. - -1999-09-12 Bob Friesenhahn - - * lib/Image.cpp (condensed): Bug fix. The condensed() method was returning the opposite bool value than it should. Oops! - -1999-09-07 Bob Friesenhahn - - * lib/Magick++/Include.h (MagickCore): Eliminated requirement for - including . - -1999-08-07 Bob Friesenhahn - - * lib/Image.cpp: Added accessor methods for other key ImageMagick - structs. - - * lib/Options.cpp (penTexture): Fixed bug with removing texture - caused by change in Image constructor. - - * lib/Image.cpp: Changed strategy such that an Image containing a - null MagickCore::Image pointer is never constructed except for - under error conditions. Removed existing checks for null image - pointer on attribute methods. - - Use image() and constImage() accessor methods as part of Image - implementation in order to clean-up code and ensure - const-correctness. - -1999-08-03 Bob Friesenhahn - - * lib/Magick++/STL.h (Magick): Added STL function readImages(). - Not tested yet. - (Magick): Added STL function writeImages(). Not tested yet. - - * lib/Image.cpp: Removed support for 'text' attribute as this is - no longer present in ImageMagick as of 4.2.8. - -1999-07-21 Bob Friesenhahn - - * lib/Image.cpp (condense): Skip condensing image if already - condensed. - (uncondense): Skip uncondensing image if not condensed. - (condensed): New method to test if image is condensed. - (classType): New method which supports conversion of the image - storage class. May result in loss of color information - (quantization is used) if a DirectClass image is converted to - PseudoClass. - -1999-07-18 Bob Friesenhahn - - * lib/Magick++/Color.h (Magick::Color): Color parameters are now - stored in a MagickCore::RunlengthPacket structure which is - referenced via a pointer. This structure is either allocated by a - Magick::Color constructor or passed as an argument to a - Magick::Color constructor so that it may refer to a - MagickCore::Image pixel. The owner of the structure is managed so - that the structure is only deleted if it was allocated by - Magick::Color. - -1999-07-09 Bob Friesenhahn - - * overall : Removed 'Magick' prefix from all source file - names. Moved class headers to Magick++ subdirectory. This should - not break any code using the documented interface (via - Magick++.h). - -1999-07-08 Bob Friesenhahn - - * lib/MagickImage.cpp (composite): Support composition placement - by gravity like PerlMagick does. - -1999-07-07 Bob Friesenhahn - - * lib/MagickImage.cpp (Image): Added constructors to construct an - Image from a BLOB. - -1999-07-06 Bob Friesenhahn - - * tests/manipulate.cpp (main): Wrote a basic sanity test for - reading and writing BLOBS. - -1999-06-21 Bob Friesenhahn - - * lib/MagickImage.cpp (read): Added support for reading an encoded - image stored in a BLOB. Uses new ImageMagick APIs introduced on - July 21, 1999. - (write): Added support for writing an encoded image to a BLOB. - -1999-06-16 Bob Friesenhahn - - * lib/MagickInclude.h : Use new interface to - ImageMagick to avoid namespace-induced problems. - - * configure.in : CPPFLAGS and LDFLAGS specified via the - environment take precidence over flags from Magick-config. - -1999-05-31 Bob Friesenhahn - - * lib/MagickSTL.h (mapImages): New algorithm to map the sequence - of images to the color map of a provided image. - (quantizeImages): New algorithm to quantize a sequence of images - to a common color map. - -1999-05-24 Bob Friesenhahn - - * lib/MagickBlob.cpp (updateNoCopy): New method to allow derived - classes to insert data into the base class without making a copy - of the data. This represents a transfer of ownership of the data - from the derived class to the base class. - -1999-05-23 Bob Friesenhahn - - * lib/MagickColor.cpp (operator =): Adapted to new ImageMagick - 4.2.6 as of 5/23/99 which removes X11 compatability functions. - - * lib/MagickGeometry.cpp (operator =): Adapted to new ImageMagick - 4.2.6 as of 5/23/99 which removes X11 compatability functions. - -1999-05-17 Bob Friesenhahn - - * lib/MagickBlob.cpp (Blob): Support default constructor for Blob. - -1999-05-16 Bob Friesenhahn - - * lib/MagickSTL.h (transformColorSpaceImage): New unary function object - to invoke transformColorSpace on STL container object. - - * lib/MagickImage.cpp (transformColorSpace): New method to - transform the image data to a new colorspace. - -1999-05-15 Bob Friesenhahn - - * lib/MagickImage.cpp (ping): Re-implemented to match (requested) - API change in ImageMagick 4.2.5. Method signature has changed to - be like 'read'. - (annotate): Added two new overloaded methods for text annotation - in order to support the new rotated text capability in ImageMagick - 4.2.5. To accomplish this, the default for gravity had to be - removed from several methods. This may impact existing code. - Still not sure if this is the best set of method signatures. - -1999-05-13 Bob Friesenhahn - - * lib/MagickImage.cpp (ping): New method to obtain image size in - bytes and geometry without the overhead of reading the complete - image. - (uncondense): New method to uncompress run-length encoded pixels - into a simple array to make them easy to operate on. - -1999-05-12 Bob Friesenhahn - - * lib/MagickImage.cpp (comment): Passing an empty string as the - comment results in no comment at all rather than a comment with no - data. - -1999-05-11 Bob Friesenhahn - - * lib/MagickImage.cpp (iccColorProfile): Implemented method to set - ICC color profile from opaque object in memory (must be formatted - outside of Magick++). - (iptcProfile): Implemented method to set IPTC profile from opaque - object in memory (must be formatted outside of Magick++). - - * lib/MagickBlob.cpp: New class to support managing user-supplied - opaque Binary Large OBjects (BLOBS) in the API. Reference counted - to improve semantics and to possibly reduce memory consumption. - -1999-05-01 Bob Friesenhahn - - * lib/Makefile.am (libMagick): Updated to use libtool 1.3 so that - shared library can be built. - -1999-04-25 Bob Friesenhahn - - * lib/MagickImage.cpp (montageGeometry): Return Magick::Geometry - rather than std::string. - -1999-04-19 Bob Friesenhahn - - * lib/MagickColor.cpp (alpha): Added support for setting alpha via - scaled-double to the Color class. The new method name is 'alpha'. - -1999-04-13 Bob Friesenhahn - - * lib/MagickColor.cpp: Added support for setting an alpha value - (unscaled Quantum only) for use on DirectColor images that have - matte enabled. This requires ImageMagick 4.2.2 dated April 13, - 1999 or later to compile since Cristy added a special flag to - allow testing to see if the user has specified an opacity value: - "I added XColorFlags to magick/classify.h. If DoMatte is set in - color->flags then the opacity value is valid in color->pixel." - -1999-04-11 Bob Friesenhahn - - * demo/flip.cpp (main): New file. Demonstrates use of flipImage - function object as well as morphImages algorithm. - -1999-04-10 Bob Friesenhahn - - * tests/color.cpp : New file to support testing the Magick::Color - classes. - - * lib/MagickOptions.cpp: The ImageInfo filter member is now - ignored by ImageMagick (as of ImageMagick 4.2.2 April 10, 1998) so - support for setting it is removed. The Image filter member is - still updated. According to Cristy, this ImageMagick version - removes automatic sharpening of resized images. The blur member - is added to the Image structure. A blur value < 1 causes the image - to be sharpened when resizing while a value > 1 leaves the image - blurry. Magick++ does not yet support the blur member. - - diff --git a/Magick++/INSTALL b/Magick++/INSTALL deleted file mode 100644 index aac565410..000000000 --- a/Magick++/INSTALL +++ /dev/null @@ -1,164 +0,0 @@ - - - Installing Magick++ - -General - -In order to compile Magick++ you must have access to a standard C++ -implementation. The author uses gcc 3.1 (GNU C++) which is available under -UNIX and under the Cygwin UNIX-emulation environment for Windows. Standards -compliant commercial C++ compilers should also work fine. Most modern C++ -compilers for Microsoft Windows or the Mac should work (project files are -provided for Microsoft Visual C++ 6.0). - -It was decided that Magick++ will be around for the long-haul, so its API -definition depends on valuable C++ features which should be common in all -current and future C++ compilers. The compiler must support the following -C++ standard features: - - * templates - * static constructors - * C++-style casts (e.g. static_cast) - * bool type - * string class () - * exceptions () - * namespaces - * Standard Template Library (STL) (e.g. , ) - -The author has personally verified that Magick++ compiles and runs using the -following compiler/platform combinations: - - Tested Configurations - - Operating System Architecture Compiler - SunOS 5.6, 5.7, 5.8 - ("Solaris 2.6, 7, & 8) SPARC GCC 3.0.4 - SunOS 5.7 ("Solaris 7") SPARC Sun Workshop 5.0 C++ - - SunOS 5.8 ("Solaris 8") SPARC Sun WorkShop 6 update 2 C++ - 5.3 - FreeBSD 4.0 Intel Pentium II GCC 2.95 - - Windows NT 4.0 SP6a Intel Pentium II Visual C++ 6.0 Standard - Edition - - Windows XP Intel Pentium IV Visual C++ 6.0 Standard - Edition Service Pack 5 - Windows '98 + Cygwin 1.3.10 Intel Pentium III GCC 2.95.3-5 - Windows NT 4.0 SP6a Intel Pentium II GCC 2.95.3-5 - Windows XP + Cygwin 1.3.10 Intel Pentium IV GCC 2.95.3-5 - -Users of Magick++ have reported that the following configurations work with -Magick++: - - Other Known Working Configurations - - Operating - System Architecture Compiler Reported By - Red Hat i386 & alpha EGCS 1.1.2 Dr. Alexander Zimmermann - Linux 6.0 - Red Hat i386 GCC 2.95.2 Dr. Alexander Zimmermann - Linux 7.0 - Red Hat i386 GCC "2.96" ??? - Linux 7.0 snapshot - Red Hat Dr. Alexander Zimmermann - Linux 7.Xi386 & alpha GCC 3.0 - SGI IRIX MIPS IRIX C++ Albert Chin-A-Young - 6.2, 6.5 7.3.1.2m - SunOS Sun WorkShop Albert Chin-A-Young - 5.5.1 SPARC CC 5.0 - SunOS - 5.6, 5.7,SPARC Sun Forte CC Albert Chin-A-Young - 5.8 5.3 - HP-UX PA-RISC HP-UX aCC Albert Chin-A-Young - 11.00 A.03.30 - Mac OS 9 PowerPC CodeWarrior Leonard Rosenthol - Professional - Release 6 - Mac OS X GCC 2.95.2 - 10.1 PowerPC (apple gcc Cristy - "Darwin" -926) - -Please let me know if you have successfully built and executed Magick++ -using a different configuration so that I can add to the table of verified -configurations. - - ------------------------------------------------------------------------ - - Unix/Linux - -Building From Source - -Magick++ is now built using the ImageMagick configure script and Makefiles. -Please follow the installation instructions provided by its README.txt file. -The following instructions pertain to the Magick++ specific configuration -and build options. - -To install ImageMagick plus Magick++ under Unix, installation should be -similar to - -./configure [ --prefix=/prefix ] -make -make install - -The library is currently named similar to 'libMagick++.a' (and/or -libMagick++.so.5.0.39) and is installed under prefix/lib while the headers -are installed with Magick++.h being installed in prefix/include and the -remaining headers in prefix/include/Magick++. - -To influence the options the configure script chooses, you may specify -'make' option variables when running the configure script. For example, the -command - - - ./configure CXX=CC CXXFLAGS=-O2 LIBS=-lposix - -specifies additional options to the configure script. The following table -shows the available options. - - Environment Variables That Effect Configure - - Make Option - Variable Description - - CXX Name of C++ compiler (e.g. 'CC -Xa') to use - compiler 'CC -Xa' - CXXFLAGS Compiler flags (e.g. '-g -O2') to compile with - - CPPFLAGS Include paths (-I/somedir) to look for header - files - Library paths (-L/somedir) to look for - libraries. Systems that support the notion of a - LDFLAGS library run-path may additionally require - -R/somedir or '-rpath /somedir' in order to - find shared libraries at run time. - LIBS Extra libraries (-lsomelib) required to link - -Installing Linux RPMs - -Please note that the default version of the C++ compiler delivered with the -system may not be sufficient to support Magick++. Use of GCC 2.95 or later is -strongly recommended under Linux. - ------------------------------------------------------------------------ - - Windows '9X, NT, 2000, ME, & XP - -Visual C++ - -Windows '95 through Windows XP are supported by the ImageMagick source -package for NT available in the 'win2k' subdirectory of the ImageMagick ftp -site (and mirrors). The ImageMagick source package for NT provides sources -to ImageMagick, Magick++, add-on libraries (e.g. JPEG), and a ready-made -Visual C++ 6.0 build environment. Please read the configuration and build -instructions in README.txt (under the heading "Windows Win2K/95 VISUAL C++ -6.0 COMPILATION") in order to build Magick++. - -Cygwin & GCC - -It is possible to build both ImageMagick and Magick++ under the Cygwin -Unix-emulation environment for Windows NT. Obtain and install Cgywin from -http://www.cygwin.com/ . An X11R6 environment for Cygwin is available -from http://www.cygwin.com/xfree/ .To build using Cygwin and GCC, follow -the instructions for building under Unix. ImageMagick and Magick++ do not -yet include support for building Windows DLLs under Cygwin so do not enable -dynamic libraries when building ImageMagick. diff --git a/Magick++/LICENSE b/Magick++/LICENSE deleted file mode 100644 index 01c058eed..000000000 --- a/Magick++/LICENSE +++ /dev/null @@ -1,9 +0,0 @@ - -Copyright 1999 - 2002 Bob Friesenhahn - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files ("Magick++"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/Magick++/Makefile.am b/Magick++/Makefile.am deleted file mode 100644 index e1c8d5821..000000000 --- a/Magick++/Makefile.am +++ /dev/null @@ -1,271 +0,0 @@ -# -# Top Makefile for Magick++ -# -# Copyright Bob Friesenhahn, 1999, 2000, 2002, 2004, 2008 -# - -# AM_CPPFLAGS += -I$(top_srcdir)/Magick++/lib - -MAGICKPP_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/Magick++/lib - -if WITH_MAGICK_PLUS_PLUS -MAGICKPP_LIBS = Magick++/lib/libMagick++-@MAGICK_MAJOR_VERSION@.@MAGICK_ABI_SUFFIX@.la -MAGICKPP_LDADD = $(MAGICKPP_LIBS) $(top_builddir)/MagickCore/libMagickCore-@MAGICK_MAJOR_VERSION@.@MAGICK_ABI_SUFFIX@.la $(top_builddir)/MagickWand/libMagickWand-@MAGICK_MAJOR_VERSION@.@MAGICK_ABI_SUFFIX@.la -MAGICKPP_CHECK_PGRMS = $(MAGICKPP_CHECK_PGRMS_OPT) -MAGICKPP_MANS = $(MAGICKPP_MANS_OPT) -MAGICKPP_PKGCONFIG = $(MAGICKPP_PKGCONFIG_OPT) -MAGICKPP_SCRPTS = $(MAGICKPP_SCRPTS_OPT) -MAGICKPP_TESTS = $(MAGICKPP_TEST_SCRPTS_OPT) -MAGICKPP_TOP_INCHEADERS = $(MAGICKPP_TOP_INCHEADERS_OPT) -MAGICKPP_INCHEADERS = $(MAGICKPP_INCHEADERS_OPT) -else -MAGICKPP_LIBS = -MAGICKPP_LDADD = -MAGICKPP_CHECK_PGRMS = -MAGICKPP_MANS = -MAGICKPP_PKGCONFIG = -MAGICKPP_SCRPTS = -MAGICKPP_TESTS = -MAGICKPP_TOP_INCHEADERS = -MAGICKPP_INCHEADERS = -endif - -MAGICKPP_SCRPTS_OPT = \ - Magick++/bin/Magick++-config - -MAGICKPP_MANS_OPT = \ - Magick++/bin/Magick++-config.1 - -MAGICKPP_PKGCONFIG_OPT = \ - Magick++/lib/Magick++.pc \ - Magick++/lib/Magick++-@MAGICK_MAJOR_VERSION@.@MAGICK_ABI_SUFFIX@.pc - -MAGICKPP_TEST_SCRPTS_OPT = \ - Magick++/tests/tests.tap \ - Magick++/demo/demos.tap - -MAGICKPP_EXTRA_DIST = \ - Magick++/AUTHORS \ - Magick++/ChangeLog \ - Magick++/INSTALL \ - Magick++/LICENSE \ - Magick++/NEWS \ - Magick++/README \ - Magick++/bin/Magick++-config.1 \ - Magick++/bin/Magick++-config.in \ - Magick++/lib/libMagick++.map \ - Magick++/lib/Magick++.pc.in \ - Magick++/demo/model.miff \ - Magick++/demo/smile.miff \ - Magick++/demo/smile_anim.miff \ - Magick++/demo/tile.miff \ - $(MAGICKPP_TEST_SCRPTS_OPT) \ - Magick++/tests/test_image.miff \ - Magick++/tests/test_image_anim.miff - -MAGICKPP_CLEANFILES = \ - Magick++/demo/*_out* \ - Magick++/demo/ir.out \ - Magick++/tests/colorHistogram.txt \ - Magick++/tests/testmagick_anim_out.miff \ - Magick++/tests/ir.out - -Magick___lib_libMagick___@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la_SOURCES = \ - Magick++/lib/Blob.cpp \ - Magick++/lib/BlobRef.cpp \ - Magick++/lib/CoderInfo.cpp \ - Magick++/lib/Color.cpp \ - Magick++/lib/Drawable.cpp \ - Magick++/lib/Exception.cpp \ - Magick++/lib/Functions.cpp \ - Magick++/lib/Geometry.cpp \ - Magick++/lib/Image.cpp \ - Magick++/lib/ImageRef.cpp \ - Magick++/lib/Montage.cpp \ - Magick++/lib/Options.cpp \ - Magick++/lib/Pixels.cpp \ - Magick++/lib/ResourceLimits.cpp \ - Magick++/lib/SecurityPolicy.cpp \ - Magick++/lib/Statistic.cpp \ - Magick++/lib/STL.cpp \ - Magick++/lib/Thread.cpp \ - Magick++/lib/TypeMetric.cpp \ - Magick++/lib/Magick++.h \ - Magick++/lib/Magick++/Blob.h \ - Magick++/lib/Magick++/BlobRef.h \ - Magick++/lib/Magick++/CoderInfo.h \ - Magick++/lib/Magick++/Color.h \ - Magick++/lib/Magick++/Drawable.h \ - Magick++/lib/Magick++/Exception.h \ - Magick++/lib/Magick++/Functions.h \ - Magick++/lib/Magick++/Geometry.h \ - Magick++/lib/Magick++/Image.h \ - Magick++/lib/Magick++/ImageRef.h \ - Magick++/lib/Magick++/Include.h \ - Magick++/lib/Magick++/Montage.h \ - Magick++/lib/Magick++/Options.h \ - Magick++/lib/Magick++/Pixels.h \ - Magick++/lib/Magick++/ResourceLimits.h \ - Magick++/lib/Magick++/SecurityPolicy.h \ - Magick++/lib/Magick++/Statistic.h \ - Magick++/lib/Magick++/STL.h \ - Magick++/lib/Magick++/Thread.h \ - Magick++/lib/Magick++/TypeMetric.h - -Magick___lib_libMagick___@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la_CPPFLAGS = \ - $(MAGICKPP_CPPFLAGS) $(LIBRARY_EXTRA_CPPFLAGS) - -magickpptopincdir = $(INCLUDE_PATH) - -magickpptopinc_HEADERS = $(MAGICKPP_TOP_INCHEADERS) - -MAGICKPP_TOP_INCHEADERS_OPT = \ - Magick++/lib/Magick++.h - -magickppincdir = $(INCLUDE_PATH)/Magick++ - -magickppinc_HEADERS = $(MAGICKPP_INCHEADERS) - -MAGICKPP_INCHEADERS_OPT = \ - Magick++/lib/Magick++/Blob.h \ - Magick++/lib/Magick++/CoderInfo.h \ - Magick++/lib/Magick++/Color.h \ - Magick++/lib/Magick++/Drawable.h \ - Magick++/lib/Magick++/Exception.h \ - Magick++/lib/Magick++/Functions.h \ - Magick++/lib/Magick++/Geometry.h \ - Magick++/lib/Magick++/Image.h \ - Magick++/lib/Magick++/Include.h \ - Magick++/lib/Magick++/Montage.h \ - Magick++/lib/Magick++/Pixels.h \ - Magick++/lib/Magick++/ResourceLimits.h \ - Magick++/lib/Magick++/SecurityPolicy.h \ - Magick++/lib/Magick++/Statistic.h \ - Magick++/lib/Magick++/STL.h \ - Magick++/lib/Magick++/TypeMetric.h - -if HAVE_LD_VERSION_SCRIPT -Magick___lib_libMagick___@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la_LDFLAGS_VERSION = -Wl,--version-script=$(top_srcdir)/Magick++/lib/libMagick++.map -else -Magick___lib_libMagick___@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la_LDFLAGS_VERSION = -export-symbols-regex ".*" -endif - -Magick___lib_libMagick___@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la_LDFLAGS = -no-undefined \ - $(Magick___lib_libMagick___la_LDFLAGS_VERSION) $(MAGICK_LT_RELEASE_OPTS) \ - -version-info \ - $(MAGICKPP_LIBRARY_CURRENT):$(MAGICKPP_LIBRARY_REVISION):$(MAGICKPP_LIBRARY_AGE) -Magick___lib_libMagick___@MAGICK_MAJOR_VERSION@_@MAGICK_ABI_SUFFIX@_la_LIBADD = $(MAGICKCORE_LIBS) $(MAGICKWAND_LIBS) - -MAGICKPP_CHECK_PGRMS_OPT = \ - Magick++/demo/analyze \ - Magick++/demo/button \ - Magick++/demo/demo \ - Magick++/demo/detrans \ - Magick++/demo/flip \ - Magick++/demo/gravity \ - Magick++/demo/piddle \ - Magick++/demo/shapes \ - Magick++/demo/zoom \ - Magick++/tests/appendImages \ - Magick++/tests/attributes \ - Magick++/tests/averageImages \ - Magick++/tests/coalesceImages \ - Magick++/tests/coderInfo \ - Magick++/tests/color \ - Magick++/tests/colorHistogram \ - Magick++/tests/exceptions \ - Magick++/tests/geometry \ - Magick++/tests/montageImages \ - Magick++/tests/morphImages \ - Magick++/tests/readWriteBlob \ - Magick++/tests/readWriteImages - -Magick___demo_analyze_SOURCES = Magick++/demo/analyze.cpp -Magick___demo_analyze_LDADD = $(MAGICKPP_LDADD) -Magick___demo_analyze_CPPFLAGS = $(MAGICKPP_CPPFLAGS) - -Magick___demo_button_SOURCES = Magick++/demo/button.cpp -Magick___demo_button_LDADD = $(MAGICKPP_LDADD) -Magick___demo_button_CPPFLAGS = $(MAGICKPP_CPPFLAGS) - -Magick___demo_demo_SOURCES = Magick++/demo/demo.cpp -Magick___demo_demo_LDADD = $(MAGICKPP_LDADD) -Magick___demo_demo_CPPFLAGS = $(MAGICKPP_CPPFLAGS) - -Magick___demo_detrans_SOURCES = Magick++/demo/detrans.cpp -Magick___demo_detrans_LDADD = $(MAGICKPP_LDADD) -Magick___demo_detrans_CPPFLAGS = $(MAGICKPP_CPPFLAGS) - -Magick___demo_flip_SOURCES = Magick++/demo/flip.cpp -Magick___demo_flip_LDADD = $(MAGICKPP_LDADD) -Magick___demo_flip_CPPFLAGS = $(MAGICKPP_CPPFLAGS) - -Magick___demo_gravity_SOURCES = Magick++/demo/gravity.cpp -Magick___demo_gravity_LDADD = $(MAGICKPP_LDADD) -Magick___demo_gravity_CPPFLAGS = $(MAGICKPP_CPPFLAGS) - -Magick___demo_piddle_SOURCES = Magick++/demo/piddle.cpp -Magick___demo_piddle_LDADD = $(MAGICKPP_LDADD) -Magick___demo_piddle_CPPFLAGS = $(MAGICKPP_CPPFLAGS) - -Magick___demo_shapes_SOURCES = Magick++/demo/shapes.cpp -Magick___demo_shapes_LDADD = $(MAGICKPP_LDADD) -Magick___demo_shapes_CPPFLAGS = $(MAGICKPP_CPPFLAGS) - -Magick___demo_zoom_SOURCES = Magick++/demo/zoom.cpp -Magick___demo_zoom_LDADD = $(MAGICKPP_LDADD) -Magick___demo_zoom_CPPFLAGS = $(MAGICKPP_CPPFLAGS) - -Magick___tests_appendImages_SOURCES = Magick++/tests/appendImages.cpp -Magick___tests_appendImages_LDADD = $(MAGICKPP_LDADD) -Magick___tests_appendImages_CPPFLAGS = $(MAGICKPP_CPPFLAGS) - -Magick___tests_attributes_SOURCES = Magick++/tests/attributes.cpp -Magick___tests_attributes_LDADD = $(MAGICKPP_LDADD) -Magick___tests_attributes_CPPFLAGS = $(MAGICKPP_CPPFLAGS) - -Magick___tests_averageImages_SOURCES = Magick++/tests/averageImages.cpp -Magick___tests_averageImages_LDADD = $(MAGICKPP_LDADD) -Magick___tests_averageImages_CPPFLAGS = $(MAGICKPP_CPPFLAGS) - -Magick___tests_coalesceImages_SOURCES = Magick++/tests/coalesceImages.cpp -Magick___tests_coalesceImages_LDADD = $(MAGICKPP_LDADD) -Magick___tests_coalesceImages_CPPFLAGS= $(MAGICKPP_CPPFLAGS) - -Magick___tests_coderInfo_SOURCES = Magick++/tests/coderInfo.cpp -Magick___tests_coderInfo_LDADD = $(MAGICKPP_LDADD) -Magick___tests_coderInfo_CPPFLAGS = $(MAGICKPP_CPPFLAGS) - -Magick___tests_color_SOURCES = Magick++/tests/color.cpp -Magick___tests_color_LDADD = $(MAGICKPP_LDADD) -Magick___tests_color_CPPFLAGS = $(MAGICKPP_CPPFLAGS) - -Magick___tests_colorHistogram_SOURCES = Magick++/tests/colorHistogram.cpp -Magick___tests_colorHistogram_LDADD = $(MAGICKPP_LDADD) -Magick___tests_colorHistogram_CPPFLAGS= $(MAGICKPP_CPPFLAGS) - -Magick___tests_exceptions_SOURCES = Magick++/tests/exceptions.cpp -Magick___tests_exceptions_LDADD = $(MAGICKPP_LDADD) -Magick___tests_exceptions_CPPFLAGS = $(MAGICKPP_CPPFLAGS) - -Magick___tests_geometry_SOURCES = Magick++/tests/geometry.cpp -Magick___tests_geometry_LDADD = $(MAGICKPP_LDADD) -Magick___tests_geometry_CPPFLAGS = $(MAGICKPP_CPPFLAGS) - -Magick___tests_montageImages_SOURCES = Magick++/tests/montageImages.cpp -Magick___tests_montageImages_LDADD = $(MAGICKPP_LDADD) -Magick___tests_montageImages_CPPFLAGS = $(MAGICKPP_CPPFLAGS) - -Magick___tests_morphImages_SOURCES = Magick++/tests/morphImages.cpp -Magick___tests_morphImages_LDADD = $(MAGICKPP_LDADD) -Magick___tests_morphImages_CPPFLAGS = $(MAGICKPP_CPPFLAGS) - -Magick___tests_readWriteBlob_SOURCES = Magick++/tests/readWriteBlob.cpp -Magick___tests_readWriteBlob_LDADD = $(MAGICKPP_LDADD) -Magick___tests_readWriteBlob_CPPFLAGS = $(MAGICKPP_CPPFLAGS) - -Magick___tests_readWriteImages_SOURCES = Magick++/tests/readWriteImages.cpp -Magick___tests_readWriteImages_LDADD = $(MAGICKPP_LDADD) -Magick___tests_readWriteImages_CPPFLAGS = $(MAGICKPP_CPPFLAGS) - -MAGICKPP_LOCAL_TARGETS = www/Magick++/NEWS.html www/Magick++/ChangeLog.html diff --git a/Magick++/NEWS b/Magick++/NEWS deleted file mode 100644 index e60cefb35..000000000 --- a/Magick++/NEWS +++ /dev/null @@ -1,383 +0,0 @@ -This file records noteworthy changes in Magick++. - -(5.5.2) - * Added adaptiveThreshold() method. - * Added colorMapSize() method. - * Added DrawablePushClipPath, DrawablePopClipPath, and DrawableClipPath. - -(5.5.1) - * Fixed a Color memory allocation problem which became evident when - using the Magick++ DLL. - * Completed implementation of Image textEncoding() method. Oops! - -(5.4.9) - * Added the Image textEncoding() method and an encoding option to - DrawableText to support specifying "UTF-8" (Unicode) text encoding. - * Added the Image compare() method to support comparing two similar - images and obtaining error values. - * Magick++ compiles as a DLL under Visual C++ 7.0. - -(5.4.8) - * The image type() method now also specifies the output image type - to use while writing. - * Added a profile() method to Image to support adding, removing, - and retrieving named embedded application profiles. - * Magick++ compiles as a DLL under Visual C++ 6.0. - -(5.4.7) - * No changes to report. - -(5.4.6) - * Magick++ library no longer depends on C++ iostreams APIs. - * Added DrawableTextUnderColor class to set text underbox color. - -(5.4.5) - * Drawable classes have been re-written to use ImageMagick's draw.h - APIs. - * Fixed a nasty bug when reporting some forms of errors. The bug - was causing an exception in error.c. - * Template API implementation cleanup. - * Rationalized some parameter types. - * New method, Pixels::getConst() to obtain read-only pixels. - * DrawableDashArray() prefers an array of type 'double' rather than - 'unsigned int'. Please use the new form. - * Composite images are output as embedded inlined Base64 when - preparing MVG data. - * Blob class supports encoding and decoding Base64 data. - * New method, Image::ping to ping a Blob. - -(5.4.4) - * Fixed a bug in DrawableDashArray. - * Numerous consistency improvements based on findings from Gimpel lint. - * Added endian method to Image, and endianImage class to STL.h in - order to support setting endian option for formats which support - the notion (e.g. TIFF). - * DrawableCompositeImage was not working. Now it does. - -(5.4.3) - * Support selecting fonts via font-family, font-style, font-weight, - and font-stretch via the DrawableFont class. - * CoderInfo API change. MatchType is scoped to CoderInfo class. - * Bugfix for Magick::Exception memory leak. - * Bugfix for DrawableGravity class (had stopped working). - * Bugfix for Image antiAlias() method (wasn't working). - * Reimplemented image registration code (which passes image via - DrawableCompositeImage). - -(5.4.2) - * TypeMetric class revamped to match current ImageMagick type metrics - definition. - * Fixed possible stack corruption on some architectures when returning - Color as a string. - * DrawableCompositeImage can be constructed based on an Image in memory - rather than just a filename. - * Added Drawable objects (DrawablePushPattern & DrawablePopPattern) - for definining arbitrary named patterns to be used for stroke and fill. - * Added Image strokePattern() and fillPattern() methods for specifying - image to use while drawing stroked object outlines and while filling - objects, respectively. - -(5.4.1) - * Fixed memory leak in Image::draw(). - - * Automagically cleans up ImageMagick allocations prior to process - exit to avoid annoying memory leak tools. - -(5.4.0) - * Fixed bug when scaling from Quantum to double in derived Color classes. - - * Pass all input parameter strings as 'const std::string &' in Color class. - - * Added support for obtaining pixel indexes. - - * Implemented support for read-only pixels and pixel indexes. - - * Added Image boundingBox() method to return smallest bounding box - enclosing non-border pixels. - -(5.3.9) - * New class, CoderInfo, to return information for a specified image - format as well as the coderInfoList() template function to return - the list of coders which match a specification. - - * User now may tell Blob updateNoCopy() what memory system (C or C++) - the memory was allocated from. Used to assume the C++ allocator. - This resolves a bug on some platforms (e.g. Windows). - - * Added Image 'opacity' method (and STL opacityImage()) to set, or - attenuate, image opacity. - - * Added Image 'type' method (and STL typeImage()) to set image - representation type. - - * Image depth method now adjusts pixels to match specified image depth, - and reports depth based on current image pixels. - -(5.3.8) - * New class 'TypeMetric' to contain font type metrics. - - * New Image method 'fontTypeMetrics()' to obtain font type metrics. - - * Image colorMap method automatically extends the colormap if index - is past the end of the current colormap. - - * Added clipMask method to add a clip mask to the current - image. Prevents modification to image pixels wherever the - associated clip mask image is tranparent. - - * Documented methods which were added previously, but left - undocumented. - -(5.3.7) - * No changes. - -(5.3.6) - * Adjusted parameters to 'edge' and 'medianFilter' to match - equivalent libMagick functions. - * Fixed a Montage bug which was not allowing color options to be unset. - * Montage defaults are no longer taken from first Image in list. - * Magick++ demo output looks like PerlMagick demo output again. - -(5.3.5) - * Default radius and sigma parameters were changed on the blur, - charcoal, emboss, and sharpen methods to match ImageMagick defaults. - * Fixes to Magick++ demos to restore appearance. - * Added shave method for shaving edges from image (a form of crop). - -(5.3.1-5.3.4) - * No changes. - -(5.3.0) - * Released with ImageMagick 5.3.0 - * Bug fix. Under certain conditions, several annotation options - were being reset. - -(5.2.9) - * Released with ImageMagick 5.2.9 - * Added fillRule method to Image class. - -(5.2.8) - * Released with ImageMagick 5.2.8 - * Added 'fill' and 'stroke' methods to Montage class. - * Added 'erase' and 'strokeAntiAlias' methods to Image class. - * Renamed Image class 'layer' method to 'channel'. - * Support supplying composition rule to DrawableCompositeImage. - -(5.2.7) - * Released with ImageMagick 5.2.7 - * Added convolve and unsharpmask methods to Image. - * Added deconstructImages and mosaicImages template functions. - * Fixed handling of geometry parameter to annotate method. - -(5.2.6) - * Released with ImageMagick 5.2.6. - * Added support for a SVG-style dash array and dash offset - parameters (for drawing dashed lines). - * Added support for setting the shape to be used at the end of open - subpaths when they are stroked. - * Added support for setting the shape to be used at the corners of - paths (or other vector shapes) when they are stroked. - * Added support for setting extension limit for miter joins. - * Rotate text the proper way using an affine transform. - -(5.2.5) - * Released with ImageMagick 5.2.5. - * Completely re-wrote drawable object classes in order to support - all current ImageMagick drawing capabilities using a list-based paradigm. - New drawing capabilities include coordinate transformations and the - currently undocumented (but quite powerful) path capabilities. - -(5.2.4) - * Released with ImageMagick 5.2.4. - * Magick++ is now built by the regular ImageMagick build process. - when --with-magick_plus_plus is specified to configure. - * Fixed bug with setting text drawing options. - * Fixed API bug with colorize. Options adjusted to match ImageMagick - API change (API change was long ago). - * Library compiles using Sun Workshop 5.0 compiler. Linkage problems with - some demos/tests due to libtool-related compiler/linker bug. - * Compiles using Sun Forte 6.0 compiler. - -(5.2.3) - * Switched to new release numbering (match ImageMagick release number) - * Released with ImageMagick 5.2.3. - * Fixed bug in which the Image read method was not reporting - warnings (only errors). - * Parameter changes to blur, charcoal, emboss, and sharpen methods - of the Image class to match equivalent ImageMagick API changes. - * Parameter changes to blurImage, charcoalImage, embossImage, and - sharpenImage STL functions in order to match equivalent ImageMagick - API changes. - -(0.9.5) - * Released with ImageMagick 5.2.2. - -(0.9.4) - * Released with ImageMagick 5.2.1. - * Bugfix to the Pixels GetIndexes() method. - * Adapted to ImageMagick 5.2.1's revised matte channel interpretation. - -(0.9.3) - * Released with ImageMagick 5.2 - * New class 'Pixels' to support low-level pixel access in image. New - API supports multiple pixel views into the same image. Number of - available pixel views limited to the number of image rows + 1. - * Dramatically improved performance for text annotation and drawing. - * Fix text annotation bug which did not allow spaces in annotation text. - * Added gaussianBlurImage() method. - * Fixed bug in floodFillTexture(). - * Re-worked error reporting methodology to use re-entrant error - reporting rather than the previous method (based on call-backs) - which required thread specific data. - * Should be thread-safe under Win32 now. - -(0.9.2) - * Released with ImageMagick 5.1.1 - * Should be thread-safe when used with POSIX threads (pthreads). - * Added methods getPixels, setPixels, syncPixels, readPixels, and - writePixels, in order to provide low-level access to Image pixels. - * Bugfix: size method was setting Options size, but not Image rows - and columns. - -(0.9.1) - * Released with ImageMagick 5.1.0 - * Added additional constructors, read, and write methods for BLOBs - to make BLOBs easier to use. - * Added the medianFilter() method to Image. - * Renamed transformColorSpace() to colorSpace() and added a - colorSpace() accessor method. - * Renamed psPageSize() to page(), which now properly returns the - actual attribute from the image, rather than the image options. - This is important in order to manipulate GIF animations. - * Bug fixes. - -(0.9) - * Ported to ImageMagick 5.0. - * BLOB sizes are now specified using size_t type. - * Rotate() no longer accepts sharpen or crop options. - * Shear() No longer accepts a crop option. - * FontPointsize() now takes a double. - * The condense, uncondense, and condensed methods have been removed - since ImageMagick 5.0 no longer uses run-length encoding. - * The quantizeError method has been removed since it never worked. - * The cacheThreshold method is added to set the threshold of - ImageMagick's image cache. - -(0.8.9) - * Released with ImageMagick 4.2.9 - * Blob reference counting was totally broken, leading to a memory - leak if it was used. Fixed by starting reference count from one - rather than zero. - -(0.8.8) - * Fixed a Image constructor bug when constructing from a Blob - -(0.8.7) - * Bugfix: condensed() was returning wrong state. - -(0.8.6) - * Color is now based on ImageMagick's RunlengthPacket structure (via a - pointer) so that it may eventually be used to represent an image - pixel. This is currently a work in progress. - -(0.8.5) - * Headers are now installed under prefix/include/Magick++ on Unix - systems with the exception that Magick++.h is installed under - prefix/include as it was before. Programs which include Magick++.h - (the documented approach) should not be impacted. - * Image constructors to construct an image from a BLOB. - * Image read and write methods to decode and encode images stored in a - BLOB. This allows reading/writing image "files" from/to memory rather - than a traditional file. - -(0.8.4) - * New mapImages algorithm maps a sequence of images to the colormap of - a provided image. - * New quantizeImages algorithm computes and applies a common colormap - to a sequence of images. - -(0.8.3) - * Ported to ImageMagick 4.2.6. - * Blob supports default constructor. - * New Blob method updateNoCopy() to support efficient initialization by - derived class. - -(0.8.2) - * Uses libtool 1.3 to build library under Unix and Cygwin (static lib only). - * Added Blob class to support supplying formatted binary data to methods. - * Added support for setting ICC and IPTC profiles from a binary BLOB. - * Added support for transformations of image data to/from alternate - colorspace (e.g. CYMK). - * Added support for 'pinging' an image (get image dimensions/size quickly). - * Added 'uncondense' method to de-compress in-memory image data. - * Added support for annotation using rotated text. - -(0.8.1) - * Added support for setting alpha in Magick::Color - * Set/get color alpha in Magick::Image::pixelColor() for DirectClass images. - -(0.8) - * Transitioned to Beta - * Improved Microsoft Visual C++ build environment. - -(0.7.4) - * Added animateImages() and displayImages() to MagickSTL.h. - * Added function objects to support setting image attributes. - -(0.7.3) - * Image::penTexture() now takes Image reference rather than - Image pointer. Set Image to invalid using isValid(false) - to unset texture. - * Attribute methods that take Color, Geometry, Image, or string - arguments may now unset the attribute by setting the state of - the object to invalid using isValid(false), or the empty string - (in the case of string). This allows full control over ImageMagick - attributes which are stored as C strings which may be set to NULL. - * Updated for ImageMagick 4.2.1 - -(0.7.2) - * Added STL function object support for all Image manipulation - methods to support operating on all or part of the images - stored in an STL container. - -(0.7.1) - * Added Coordinate class and methods in Drawable to support x,y - coordinates. - * Changed coordinate parameters from unsigned int to double in Drawable. - * Changed polygon methods in Drawable to use STL list argument. - * Added STL list based draw method to Image. - * Changed Exception heirarchy to support Warning and Error sub-classes. - Most exception class names have changed. - -(0.7) - * Updated for ImageMagick 4.2.0 - * Added support for flood-filling and drawing with texture. - * Montage supported. - * Oodles of bugs fixed. - * Implemented image attribute tests. - * Implemented PerlMagick 'demo' and 'shapes' demo programs in Magick++. - * Some parameters re-ordered due to experience from writing demo programs. - -(0.6) - * Initial support for integrating image-list oriented operations with - STL containers. - -(0.5) - * Compiles and runs under Unix using egcs release 1.1 or later. - * Compiles and runs under Windows using Visual C++ 5.X or later. - * Users of Magick++ API are not exposed to ImageMagick headers. - * Magick++ API is namespaced under "Magick". - * "Magick" prefix removed from object names. - * User options are now completely contained within Image object. - There is no longer a MagickOptions parameter to some methods. - -(0.1) - * All ImageMagick operations which operate on individual images are - supported. - * Image objects have value semantics, avoid unnecessary image - copies through the use of reference counting, and may be compared - via standard operators. - * Geometry, color, annotations, and user-options are supported by - separate classes. - * Errors are reported synchronously via C++ exceptions. - diff --git a/Magick++/README b/Magick++/README deleted file mode 100644 index 74cb4e900..000000000 --- a/Magick++/README +++ /dev/null @@ -1,55 +0,0 @@ -This is Magick++, the object-oriented C++ API to the ImageMagick -image-processing library, the most comprehensive open-source image processing -solution available. Read the release notes for Magick++. - -Magick++ supports an object model which is inspired by PerlMagick. Magick++ -executes faster than PerlMagick since it is accessed from a compiled language -rather than from a scripting language. This makes it more suitable for Web CGI -programs which must start-up and execute quickly. Images support implicit -reference counting so that copy constructors and assignment incur almost no -cost. The cost of actually copying an image (if necessary) is done just before -modification and this copy is managed automatically by Magick++. De-referenced -copies are automatically deleted. The image objects support value (rather than -pointer) semantics so it is trivial to support multiple generations of an -image in memory at one time. - -Magick++ provides integrated support for the Standard Template Library (STL) so -that the powerful containers available (e.g. deque, vector, list, and map) can -be used to write programs similar to those possible with PERL & PerlMagick. -STL-compatable template versions of ImageMagick's list-style operations are -provided so that operations may be performed on multiple images stored in STL -containers. - -Documentation - -Detailed documentation are provided for all Magick++ classes, class methods, -and template functions which comprise the API. - -Obtaining Magick++ - -Magick++ is included as part of ImageMagick source releases and may be -retrieved via ftp or Subversion. - -Installation - -Once you have the sources available, follow these detailed installation -instructions for UNIX and Windows. - -Usage - -A helper script named Magick++-config is installed under Unix which assists -with recalling compilation options required to compile and link programs which -use Magick++. For example, the following command will compile and link the -source file example.cpp to produce the executable example (notice that quotes -are backward quotes): - - c++ `Magick++-config --cxxflags --cppflags --ldflags --libs` \ - -o example example.cpp - -Windows users may get started by manually editing a project file for one of the -Magick++ demo programs. - -Reporting Bugs - -Please report any bugs via the Magick++ Bug Tracking System at -https://imagemagick.org/discourse-server/. diff --git a/Magick++/bin/Magick++-config.1 b/Magick++/bin/Magick++-config.1 deleted file mode 100644 index 0df7258b8..000000000 --- a/Magick++/bin/Magick++-config.1 +++ /dev/null @@ -1,99 +0,0 @@ -.ad l -.nh -.TH Magick++-Config 1 "2 May 2002" "ImageMagick" -.SH NAME -Magick++-config \- get information about the installed version of Magick++ -.SH SYNOPSIS -.B Magick++-config -.B [--cppflags] -.B [--cxxflags] -.B [--exec-prefix] -.B [--ldflags] -.B [--libs] -.B [--prefix] -.B [--version] -.SH DESCRIPTION -.B Magick++-config -prints the compiler and linker flags required to compile and link programs -that use the -.BR ImageMagick -C++ Application Programmer Interface (known as -.BR Magick++ -). -.SH EXAMPLES -To print the version of the installed distribution of -.BR Magick++ , -use: - -.nf - Magick++-config \-\-version -.fi - -To compile a program that calls the -.BR ImageMagick -C++ Application Programmer Interface, use: - -.nf - c++ `Magick++-config \-\-cxxflags \-\-cppflags \-\-ldflags \-\-libs` program.cpp -.fi - -.SH OPTIONS -.TP -.B \-\-cppflags -Print the preprocessor flags that are needed to find the -.B ImageMagick -C and C++ include files and defines to ensures that the ImageMagick data structures match between -your program and the installed libraries. -.TP -.B \-\-cxxflags -Print the compiler flags that were used to compile -.BR libMagick++ . -.TP -.B \-\-exec-prefix -Print the directory under which target specific binaries and executables are installed. -.TP -.B \-\-ldflags -Print the linker flags that are needed to link with the -.B libMagick++ -library. -.TP -.B \-\-libs -Print the linker flags that are needed to link a program with -.BR libMagick++ . -.TP -.B \-\-prefix -Print the directory under which the package is installed. -.TP -.B \-\-version -Print the version of the -.B ImageMagick -distribution to standard output. -.SH COPYRIGHT -Copyright (C) 2000 ImageMagick Studio LLC, a non-profit organization dedicated -to making software imaging solutions freely available. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files ("ImageMagick"), -to deal in ImageMagick without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of ImageMagick, and to permit persons to whom the -ImageMagick is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of ImageMagick. - -The software is provided "as is", without warranty of any kind, express or -implied, including but not limited to the warranties of merchantability, -fitness for a particular purpose and noninfringement. In no event shall -ImageMagick Studio be liable for any claim, damages or other liability, -whether in an action of contract, tort or otherwise, arising from, out of -or in connection with ImageMagick or the use or other dealings in -ImageMagick. - -Except as contained in this notice, the name of the ImageMagick Studio -shall not be used in advertising or otherwise to promote the sale, use or -other dealings in ImageMagick without prior written authorization from the -ImageMagick Studio. -.SH AUTHORS -Bob Friesenhahn, ImageMagick Studio - diff --git a/Magick++/bin/Magick++-config.in b/Magick++/bin/Magick++-config.in deleted file mode 100755 index 76b686c96..000000000 --- a/Magick++/bin/Magick++-config.in +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/sh -# -# Configure options script for re-calling Magick+ compilation options -# required to use the Magick++ library. -# -# - -prefix=@prefix@ -exec_prefix=@exec_prefix@ - -usage='Usage: Magick++-config [--cppflags] [--cxxflags] [--exec-prefix] [--ldflags] [--libs] [--prefix] [--version] - - For example, "magick.cpp" may be compiled to produce "magick" as follows: - - "c++ -o magick magick.cpp `Magick++-config --cppflags --cxxflags --ldflags --libs`"' - -if test $# -eq 0; then - echo "${usage}" 1>&2 - exit 1 -fi - -while test $# -gt 0; do - case "$1" in - -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - case $1 in - --prefix=*) - prefix=$optarg - ;; - --prefix) - echo $prefix - ;; - --exec-prefix=*) - exec_prefix=$optarg - ;; - --exec-prefix) - echo $exec_prefix - ;; - --version) - echo '@PACKAGE_BASE_VERSION@ Q@QUANTUM_DEPTH@ @MAGICK_HDRI@' - ;; - --cflags) - @PKG_CONFIG@ --cflags Magick++-@MAGICK_MAJOR_VERSION@.@MAGICK_ABI_SUFFIX@ - ;; - --cxxflags) - @PKG_CONFIG@ --cflags Magick++-@MAGICK_MAJOR_VERSION@.@MAGICK_ABI_SUFFIX@ - ;; - --cppflags) - @PKG_CONFIG@ --cflags Magick++-@MAGICK_MAJOR_VERSION@.@MAGICK_ABI_SUFFIX@ - ;; - --ldflags) - @PKG_CONFIG@ --libs Magick++-@MAGICK_MAJOR_VERSION@.@MAGICK_ABI_SUFFIX@ - ;; - --libs) - @PKG_CONFIG@ --libs Magick++-@MAGICK_MAJOR_VERSION@.@MAGICK_ABI_SUFFIX@ - ;; - *) - echo "${usage}" 1>&2 - exit 1 - ;; - esac - shift -done - diff --git a/Magick++/demo/analyze.cpp b/Magick++/demo/analyze.cpp deleted file mode 100644 index 50f82e254..000000000 --- a/Magick++/demo/analyze.cpp +++ /dev/null @@ -1,71 +0,0 @@ -// -// Demonstrate using the 'analyze' process module to compute -// image statistics. -// -// Copyright Bob Friesenhahn, 2003, 2004 -// -// Usage: analyze file... -// - -#include -#include -#include -#include -using namespace std; -using namespace Magick; -int main(int argc,char **argv) -{ - if ( argc < 2 ) - { - cout << "Usage: " << argv[0] << " file..." << endl; - exit( 1 ); - } - - // Initialize ImageMagick install location for Windows - InitializeMagick(*argv); - - { - std::list attributes; - - attributes.push_back("TopLeftColor"); - attributes.push_back("TopRightColor"); - attributes.push_back("BottomLeftColor"); - attributes.push_back("BottomRightColor"); - attributes.push_back("filter:brightness:mean"); - attributes.push_back("filter:brightness:standard-deviation"); - attributes.push_back("filter:brightness:kurtosis"); - attributes.push_back("filter:brightness:skewness"); - attributes.push_back("filter:saturation:mean"); - attributes.push_back("filter:saturation:standard-deviation"); - attributes.push_back("filter:saturation:kurtosis"); - attributes.push_back("filter:saturation:skewness"); - - char **arg = &argv[1]; - while ( *arg ) - { - string fname(*arg); - try { - cout << "File: " << fname << endl; - Image image( fname ); - - /* Analyze module does not require an argument list */ - image.process("analyze",0,0); - - list::iterator pos = attributes.begin(); - while(pos != attributes.end()) - { - cout << " " << setw(16) << setfill(' ') << setiosflags(ios::left) - << *pos << " = " << image.attribute(*pos) << endl; - pos++; - } - } - catch( Exception &error_ ) - { - cout << error_.what() << endl; - } - ++arg; - } - } - - return 0; -} diff --git a/Magick++/demo/button.cpp b/Magick++/demo/button.cpp deleted file mode 100644 index 68c525849..000000000 --- a/Magick++/demo/button.cpp +++ /dev/null @@ -1,104 +0,0 @@ -// -// Magick++ demo to generate a simple text button -// -// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2003 -// - -#include -#include -#include - -using namespace std; - -using namespace Magick; - -int main( int /*argc*/, char ** argv) -{ - - // Initialize ImageMagick install location for Windows - InitializeMagick(*argv); - - try { - - string srcdir(""); - if(getenv("SRCDIR") != 0) - srcdir = getenv("SRCDIR"); - - // - // Options - // - - string backGround = "xc:#CCCCCC"; // A solid color - - // Color to use for decorative border - Color border = "#D4DCF3"; - - // Button size - string buttonSize = "120x20"; - - // Button background texture - string buttonTexture = "granite:"; - - // Button text - string text = "Button Text"; - - // Button text color - string textColor = "red"; - - // Font point size - int fontPointSize = 16; - - // - // Magick++ operations - // - - Image button; - - // Set button size - button.size( buttonSize ); - - // Read background image - button.read( backGround ); - - // Set background to buttonTexture - Image backgroundTexture( buttonTexture ); - button.texture( backgroundTexture ); - -#if MAGICKCORE_FREETYPE_DELEGATE - // Add some text - button.fillColor( textColor ); - button.fontPointsize( fontPointSize ); - if (getenv("MAGICK_FONT") != 0) - button.font(string(getenv("MAGICK_FONT"))); - button.annotate( text, CenterGravity ); -#endif - - // Add a decorative frame - button.borderColor( border ); - button.frame( "6x6+3+3" ); - - button.depth( 8 ); - - // Quantize to desired colors - // button.quantizeTreeDepth(8); - button.quantizeDither(false); - button.quantizeColors(64); - button.quantize(); - - // Save to file - cout << "Writing to \"button_out.miff\" ..." << endl; - button.compressType( RLECompression ); - button.write("button_out.miff"); - - // Display on screen - // button.display(); - - } - catch( exception &error_ ) - { - cout << "Caught exception: " << error_.what() << endl; - return 1; - } - - return 0; -} diff --git a/Magick++/demo/demo.cpp b/Magick++/demo/demo.cpp deleted file mode 100644 index b869fb6bb..000000000 --- a/Magick++/demo/demo.cpp +++ /dev/null @@ -1,525 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003 -// -// Simple demo program for Magick++ -// -// Concept and algorithms lifted from PerlMagick demo script written -// by John Christy. -// -// Max run-time size 60MB (as compared with 95MB for PerlMagick) under SPARC Solaris -// - -#include -#include -#include -#include - -using namespace std; - -using namespace Magick; - -#if MAGICKCORE_FREETYPE_DELEGATE - #define MakeLabel(image, text) image.label( (text) ) -#else - #define MakeLabel(image, text) -#endif - -int main( int /*argc*/, char ** argv) -{ - - // Initialize ImageMagick install location for Windows - InitializeMagick(*argv); - - const char *const p = getenv("MAGICK_FONT"); - const string MAGICK_FONT(p ? p : ""); - - try { - - string srcdir(""); - if(getenv("SRCDIR") != 0) - srcdir = getenv("SRCDIR"); - - list montage; - - { - // - // Read model & smile image. - // - cout << "Read images ..." << endl; - - Image model( srcdir + "model.miff" ); - MakeLabel(model, "Magick++"); - model.borderColor( "black" ); - model.backgroundColor( "black" ); - - Image smile( srcdir + "smile.miff" ); - MakeLabel(smile, "Smile"); - smile.borderColor( "black" ); - - // - // Create image stack. - // - cout << "Creating thumbnails..." << endl; - - // Construct initial list containing seven copies of a null image - Image null; - null.size( Geometry(70,70) ); - null.read( "NULL:black" ); - list images( 7, null ); - - Image example = model; - - // Each of the following follow the pattern - // 1. obtain reference to (own copy of) image - // 2. apply label to image - // 3. apply operation to image - // 4. append image to container - - cout << " add noise ..." << endl; - MakeLabel(example, "Add Noise"); - example.addNoise( LaplacianNoise ); - images.push_back( example ); - - cout << " add noise (blue) ..." << endl; - MakeLabel(example, "Add Noise\n(Blue Channel)"); - example.addNoiseChannel( BlueChannel, PoissonNoise ); - images.push_back( example ); - -#if MAGICKCORE_FREETYPE_DELEGATE - cout << " annotate ..." << endl; - example = model; - MakeLabel(example, "Annotate"); - example.density( "72x72" ); - example.fontPointsize( 18 ); - example.font(MAGICK_FONT); - example.strokeColor( Color() ); - example.fillColor( "gold" ); - example.annotate( "Magick++", "+0+20", NorthGravity ); - images.push_back( example ); -#endif - - cout << " blur ..." << endl; - example = model; - MakeLabel(example, "Blur"); - example.blur( 0, 1.5 ); - images.push_back( example ); - - cout << " blur red channel ..." << endl; - example = model; - MakeLabel(example, "Blur Channel\n(Red Channel)"); - example.blurChannel( RedChannel, 0, 3.0 ); - images.push_back( example ); - - cout << " border ..." << endl; - example = model; - MakeLabel(example, "Border"); - example.borderColor( "gold" ); - example.border( Geometry(6,6) ); - images.push_back( example ); - - cout << " channel ..." << endl; - example = model; - MakeLabel(example, "Channel\n(Red Channel)"); - example.channel( RedChannel ); - images.push_back( example ); - - cout << " charcoal ..." << endl; - example = model; - MakeLabel(example, "Charcoal"); - example.charcoal( ); - images.push_back( example ); - - cout << " composite ..." << endl; - example = model; - MakeLabel(example, "Composite"); - example.composite( smile, "+35+65", OverCompositeOp); - images.push_back( example ); - - cout << " contrast ..." << endl; - example = model; - MakeLabel(example, "Contrast"); - example.contrast( false ); - images.push_back( example ); - - cout << " convolve ..." << endl; - example = model; - MakeLabel(example, "Convolve"); - { - // 3x3 matrix - const double kernel[] = { 1, 1, 1, 1, 4, 1, 1, 1, 1 }; - example.convolve( 3, kernel ); - } - images.push_back( example ); - - cout << " crop ..." << endl; - example = model; - MakeLabel(example, "Crop"); - example.crop( "80x80+25+50" ); - images.push_back( example ); - - cout << " despeckle ..." << endl; - example = model; - MakeLabel(example, "Despeckle"); - example.despeckle( ); - images.push_back( example ); - - cout << " draw ..." << endl; - example = model; - MakeLabel(example, "Draw"); - example.fillColor(Color()); - example.strokeColor( "gold" ); - example.strokeWidth( 2 ); - example.draw( DrawableCircle( 60,90, 60,120 ) ); - images.push_back( example ); - - cout << " edge ..." << endl; - example = model; - MakeLabel(example, "Detect Edges"); - example.edge( ); - images.push_back( example ); - - cout << " emboss ..." << endl; - example = model; - MakeLabel(example, "Emboss"); - example.emboss( ); - images.push_back( example ); - - cout << " equalize ..." << endl; - example = model; - MakeLabel(example, "Equalize"); - example.equalize( ); - images.push_back( example ); - - cout << " explode ..." << endl; - example = model; - MakeLabel(example, "Explode"); - example.backgroundColor( "#000000FF" ); - example.implode( -1 ); - images.push_back( example ); - - cout << " flip ..." << endl; - example = model; - MakeLabel(example, "Flip"); - example.flip( ); - images.push_back( example ); - - cout << " flop ..." << endl; - example = model; - MakeLabel(example, "Flop"); - example.flop(); - images.push_back( example ); - - cout << " frame ..." << endl; - example = model; - MakeLabel(example, "Frame"); - example.frame( ); - images.push_back( example ); - - cout << " gamma ..." << endl; - example = model; - MakeLabel(example, "Gamma"); - example.gamma( 1.6 ); - images.push_back( example ); - - cout << " gaussian blur ..." << endl; - example = model; - MakeLabel(example, "Gaussian Blur"); - example.gaussianBlur( 0.0, 1.5 ); - images.push_back( example ); - - cout << " gaussian blur channel ..." << endl; - example = model; - MakeLabel(example, "Gaussian Blur\n(Green Channel)"); - example.gaussianBlurChannel( GreenChannel, 0.0, 1.5 ); - images.push_back( example ); - - cout << " gradient ..." << endl; - Image gradient; - gradient.size( "130x194" ); - gradient.read( "gradient:#20a0ff-#ffff00" ); - MakeLabel(gradient, "Gradient"); - images.push_back( gradient ); - - cout << " grayscale ..." << endl; - example = model; - MakeLabel(example, "Grayscale"); - example.quantizeColorSpace( GRAYColorspace ); - example.quantize( ); - images.push_back( example ); - - cout << " implode ..." << endl; - example = model; - MakeLabel(example, "Implode"); - example.implode( 0.5 ); - images.push_back( example ); - - cout << " level ..." << endl; - example = model; - MakeLabel(example, "Level"); - example.level( 0.20*QuantumRange, 0.90*QuantumRange, 1.20 ); - images.push_back( example ); - - cout << " level red channel ..." << endl; - example = model; - MakeLabel(example, "Level Channel\n(Red Channel)"); - example.levelChannel( RedChannel, 0.20*QuantumRange, 0.90*QuantumRange, 1.20 ); - images.push_back( example ); - - cout << " median filter ..." << endl; - example = model; - MakeLabel(example, "Median Filter"); - example.medianFilter( ); - images.push_back( example ); - - cout << " modulate ..." << endl; - example = model; - MakeLabel(example, "Modulate"); - example.modulate( 110, 110, 110 ); - images.push_back( example ); - - cout << " monochrome ..." << endl; - example = model; - MakeLabel(example, "Monochrome"); - example.quantizeColorSpace( GRAYColorspace ); - example.quantizeColors( 2 ); - example.quantizeDither( false ); - example.quantize( ); - images.push_back( example ); - - cout << " motion blur ..." << endl; - example = model; - MakeLabel(example, "Motion Blur"); - example.motionBlur( 0.0, 7.0,45 ); - images.push_back( example ); - - cout << " negate ..." << endl; - example = model; - MakeLabel(example, "Negate"); - example.negate( ); - images.push_back( example ); - - cout << " normalize ..." << endl; - example = model; - MakeLabel(example, "Normalize"); - example.normalize( ); - images.push_back( example ); - - cout << " oil paint ..." << endl; - example = model; - MakeLabel(example, "Oil Paint"); - example.oilPaint( ); - images.push_back( example ); - - cout << " ordered dither 2x2 ..." << endl; - example = model; - MakeLabel(example, "Ordered Dither\n(2x2)"); - example.randomThreshold(2,2); - images.push_back( example ); - - cout << " ordered dither 3x3..." << endl; - example = model; - MakeLabel(example, "Ordered Dither\n(3x3)"); - example.randomThreshold(3,3); - images.push_back( example ); - - cout << " ordered dither 4x4..." << endl; - example = model; - MakeLabel(example, "Ordered Dither\n(4x4)"); - example.randomThreshold(4,4); - images.push_back( example ); - - cout << " ordered dither red 4x4..." << endl; - example = model; - MakeLabel(example, "Ordered Dither\n(Red 4x4)"); - example.randomThresholdChannel(RedChannel,4,4); - images.push_back( example ); - - cout << " plasma ..." << endl; - Image plasma; - plasma.size( "130x194" ); - plasma.read( "plasma:fractal" ); - MakeLabel(plasma, "Plasma"); - images.push_back( plasma ); - - cout << " quantize ..." << endl; - example = model; - MakeLabel(example, "Quantize"); - example.quantize( ); - images.push_back( example ); - - cout << " quantum operator ..." << endl; - example = model; - MakeLabel(example, "Quantum Operator\nRed * 0.4"); - example.evaluate( RedChannel,MultiplyEvaluateOperator,0.40 ); - images.push_back( example ); - - cout << " raise ..." << endl; - example = model; - MakeLabel(example, "Raise"); - example.raise( ); - images.push_back( example ); - - cout << " reduce noise ..." << endl; - example = model; - MakeLabel(example, "Reduce Noise"); - example.reduceNoise( 1.0 ); - images.push_back( example ); - - cout << " resize ..." << endl; - example = model; - MakeLabel(example, "Resize"); - example.zoom( "50%" ); - images.push_back( example ); - - cout << " roll ..." << endl; - example = model; - MakeLabel(example, "Roll"); - example.roll( "+20+10" ); - images.push_back( example ); - - cout << " rotate ..." << endl; - example = model; - MakeLabel(example, "Rotate"); - example.rotate( 45 ); - example.transparent( "black" ); - images.push_back( example ); - - cout << " scale ..." << endl; - example = model; - MakeLabel(example, "Scale"); - example.scale( "60%" ); - images.push_back( example ); - - cout << " segment ..." << endl; - example = model; - MakeLabel(example, "Segment"); - example.segment( 0.5, 0.25 ); - images.push_back( example ); - - cout << " shade ..." << endl; - example = model; - MakeLabel(example, "Shade"); - example.shade( 30, 30, false ); - images.push_back( example ); - - cout << " sharpen ..." << endl; - example = model; - MakeLabel(example, "Sharpen"); - example.sharpen( 0.0, 1.0 ); - images.push_back( example ); - - cout << " shave ..." << endl; - example = model; - MakeLabel(example, "Shave"); - example.shave( Geometry( 10, 10) ); - images.push_back( example ); - - cout << " shear ..." << endl; - example = model; - MakeLabel(example, "Shear"); - example.shear( 45, 45 ); - example.transparent( "black" ); - images.push_back( example ); - - cout << " spread ..." << endl; - example = model; - MakeLabel(example, "Spread"); - example.spread( 3 ); - images.push_back( example ); - - cout << " solarize ..." << endl; - example = model; - MakeLabel(example, "Solarize"); - example.solarize( ); - images.push_back( example ); - - cout << " swirl ..." << endl; - example = model; - example.backgroundColor( "#000000FF" ); - MakeLabel(example, "Swirl"); - example.swirl( 90 ); - images.push_back( example ); - - cout << " threshold ..." << endl; - example = model; - MakeLabel(example, "Threshold"); - example.threshold( QuantumRange/2.0 ); - images.push_back( example ); - - cout << " threshold random ..." << endl; - example = model; - MakeLabel(example, "Random\nThreshold"); - example.randomThreshold( (0.3*QuantumRange), - (0.85*QuantumRange) ); - images.push_back( example ); - - cout << " unsharp mask ..." << endl; - example = model; - MakeLabel(example, "Unsharp Mask"); - // radius_, sigma_, amount_, threshold_ - example.unsharpmask( 0.0, 1.0, 1.0, 0.05); - images.push_back( example ); - - cout << " wave ..." << endl; - example = model; - MakeLabel(example, "Wave"); - example.alpha( true ); - example.backgroundColor( "#000000FF" ); - example.wave( 25, 150 ); - images.push_back( example ); - - // - // Create image montage. - // - cout << "Montage images..." << endl; - - for_each( images.begin(), images.end(), strokeColorImage( Color("#600") ) ); - - MontageFramed montageOpts; - montageOpts.geometry( "130x194+10+5>" ); - montageOpts.gravity( CenterGravity ); - montageOpts.borderColor( "green" ); - montageOpts.borderWidth( 1 ); - montageOpts.tile( "7x4" ); - montageOpts.backgroundColor( "#ffffff" ); - montageOpts.pointSize( 18 ); - montageOpts.font(MAGICK_FONT); - montageOpts.fillColor( "#600" ); - montageOpts.strokeColor( Color() ); - montageOpts.fileName( "Magick++ Demo" ); - montageImages( &montage, images.begin(), images.end(), montageOpts ); - } - - Image& montage_image = montage.front(); - { - // Create logo image - cout << "Adding logo image ..." << endl; - Image logo( "logo:" ); - logo.zoom( "45%" ); - - // Composite logo into montage image - Geometry placement(0,0,(montage_image.columns()/2)-(logo.columns()/2),0); - montage_image.composite( logo, placement, OverCompositeOp ); - } - - for_each( montage.begin(), montage.end(), depthImage(8) ); - for_each( montage.begin(), montage.end(), alphaImage( false ) ); - for_each( montage.begin(), montage.end(), compressTypeImage( RLECompression) ); - - cout << "Writing image \"demo_out.miff\" ..." << endl; - writeImages(montage.begin(),montage.end(),"demo_out_%d.miff"); - - // Uncomment following lines to display image to screen - // cout << "Display image..." << endl; - // montage_image.display(); - - } - catch( exception &error_ ) - { - cout << "Caught exception: " << error_.what() << endl; - return 1; - } - - return 0; -} diff --git a/Magick++/demo/demos.tap b/Magick++/demo/demos.tap deleted file mode 100755 index b4d679cd3..000000000 --- a/Magick++/demo/demos.tap +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# -# Copyright 2004 Bob Friesenhahn -# -# This file is part of Magick++, the C++ API for ImageMagick and -# ImageMagick. Please see the file "COPYING" included with Magick++ -# for usage and copying restrictions. -# -subdir=Magick++/demo -. ./common.shi -echo "1..24" - -SRCDIR=${top_srcdir}/${subdir}/ -export SRCDIR - -cd ${subdir} || exit 1 - -./analyze "$SRCDIR/model.miff" && echo "ok" || echo "not ok" - -for demo in button demo flip gravity piddle shapes -do - ./${demo} && echo "ok" || echo "not ok" -done - -for filter in bessel blackman box catrom cubic gaussian hamming hanning hermite lanczos mitchell point quadratic sample scale sinc triangle -do - ./zoom -filter $filter -geometry 600x600 ${SRCDIR}/model.miff zoom_${filter}_out.miff && echo "ok" || echo "not ok" -done -: diff --git a/Magick++/demo/detrans.cpp b/Magick++/demo/detrans.cpp deleted file mode 100644 index c983cdc3a..000000000 --- a/Magick++/demo/detrans.cpp +++ /dev/null @@ -1,60 +0,0 @@ -// -// Replace transparency in an image with a solid color using Magick++ -// -// Useful to see how a transparent image looks on a particular -// background color, or to create a similar looking effect without -// transparency. -// -// Copyright Bob Friesenhahn, 2000 -// -// Usage: detrans color file... -// - -#include -#include -using namespace std; -using namespace Magick; -int main(int argc,char **argv) -{ - if ( argc < 3 ) - { - cout << "Usage: " << argv[0] << " background_color file..." << endl; - exit( 1 ); - } - - // Initialize ImageMagick install location for Windows - InitializeMagick(*argv); - - { - Color color; - try { - color = Color(argv[1]); - } - catch ( Exception &error_ ) - { - cout << error_.what() << endl; - cout.flush(); - exit(1); - } - - char **arg = &argv[2]; - while ( *arg ) - { - string fname(*arg); - try { - Image overlay( fname ); - Image base( overlay.size(), color ); - base.composite( overlay, 0, 0, OverCompositeOp ); - base.alpha( false ); - base.write( fname ); - } - catch( Exception &error_ ) - { - cout << error_.what() << endl; - } - ++arg; - } - } - - return 0; -} diff --git a/Magick++/demo/flip.cpp b/Magick++/demo/flip.cpp deleted file mode 100644 index 61dae1968..000000000 --- a/Magick++/demo/flip.cpp +++ /dev/null @@ -1,60 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2003 -// -// Demonstration of unary function-object based operations -// -// Reads the multi-frame file "smile_anim.miff" and writes a -// flipped and morphed version to "flip_out.miff". -// - -#include -#include -#include -#include -#include - -using namespace std; - -using namespace Magick; - -int main( int /*argc*/, char ** argv) -{ - - // Initialize ImageMagick install location for Windows - InitializeMagick(*argv); - - - try { - - string srcdir(""); - if(getenv("SRCDIR") != 0) - srcdir = getenv("SRCDIR"); - - // Read images into STL list - list imageList; - readImages( &imageList, srcdir + "smile_anim.miff" ); - - // cout << "Total scenes: " << imageList.size() << endl; - - // Flip images - for_each( imageList.begin(), imageList.end(), flipImage() ); - - // Create a morphed version, adding three frames between each - // existing frame. - list morphed; - morphImages( &morphed, imageList.begin(), imageList.end(), 3 ); - - // Write out images - cout << "Writing image \"flip_out.miff\" ..." << endl; - writeImages( morphed.begin(), morphed.end(), "flip_out.miff" ); - - } - catch( exception &error_ ) - { - cout << "Caught exception: " << error_.what() << endl; - return 1; - } - - return 0; -} diff --git a/Magick++/demo/gravity.cpp b/Magick++/demo/gravity.cpp deleted file mode 100644 index cb18ef6ce..000000000 --- a/Magick++/demo/gravity.cpp +++ /dev/null @@ -1,83 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 2000, 2001, 2003 -// -// Demo of text annotation with gravity. Produces an animation showing -// the effect of rotated text assize_t with various gravity specifications. -// -// After running demo program, run 'animate gravity_out.miff' if you -// are using X-Windows to see an animated result. -// -// Concept and algorithms lifted from PerlMagick demo script written -// by John Christy. -// - -#include -#include -#include -#include - -using namespace std; - -using namespace Magick; - -int main( int /*argc*/, char ** argv) -{ - - // Initialize ImageMagick install location for Windows - InitializeMagick(*argv); - - try { - - string srcdir(""); - if(getenv("SRCDIR") != 0) - srcdir = getenv("SRCDIR"); - - int x = 100; - int y = 100; - - list animation; - - Image base( Geometry(600,600), Color("white") ); - base.depth(8); - base.strokeColor("#600"); - base.fillColor(Color()); - base.draw( DrawableLine( 300,100, 300,500 ) ); - base.draw( DrawableLine( 100,300, 500,300 ) ); - base.draw( DrawableRectangle( 100,100, 500,500 ) ); - base.density( Point(72,72) ); - base.strokeColor(Color()); - base.fillColor("#600"); - base.fontPointsize( 30 ); - base.boxColor( "red" ); - base.animationDelay( 20 ); - base.compressType( RLECompression ); - - for ( int angle = 0; angle < 360; angle += 30 ) - { - cout << "angle " << angle << endl; - Image pic = base; - pic.annotate( "NorthWest", Geometry(0,0,x,y), NorthWestGravity, angle ); - pic.annotate( "North", Geometry(0,0,0,y), NorthGravity, angle ); - pic.annotate( "NorthEast", Geometry(0,0,x,y), NorthEastGravity, angle ); - pic.annotate( "East", Geometry(0,0,x,0), EastGravity, angle ); - pic.annotate( "Center", Geometry(0,0,0,0), CenterGravity, angle ); - pic.annotate( "SouthEast", Geometry(0,0,x,y), SouthEastGravity, angle ); - pic.annotate( "South", Geometry(0,0,0,y), SouthGravity, angle ); - pic.annotate( "SouthWest", Geometry(0,0,x,y), SouthWestGravity, angle ); - pic.annotate( "West", Geometry(0,0,x,0), WestGravity, angle ); - animation.push_back( pic ); - } - cout << "Writing image \"gravity_out.miff\" ..." << endl; - writeImages( animation.begin(), animation.end(), "gravity_out.miff" ); - // system( "animate gravity_out.miff" ); - - } - catch( exception &error_ ) - { - cout << "Caught exception: " << error_.what() << endl; - return 1; - } - - return 0; -} diff --git a/Magick++/demo/model.miff b/Magick++/demo/model.miff deleted file mode 100644 index daa77871b..000000000 Binary files a/Magick++/demo/model.miff and /dev/null differ diff --git a/Magick++/demo/piddle.cpp b/Magick++/demo/piddle.cpp deleted file mode 100644 index 251d8f4dc..000000000 --- a/Magick++/demo/piddle.cpp +++ /dev/null @@ -1,184 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2002, 2003 -// -// PerlMagick "piddle" demo re-implemented using Magick++ methods. -// The PerlMagick "piddle" demo is written by Cristy -// - -#include -#include -#include - -using namespace std; - -using namespace Magick; - -int main( int /*argc*/, char ** argv) -{ - - // Initialize ImageMagick install location for Windows - InitializeMagick(*argv); - - try { - - string srcdir(""); - if(getenv("SRCDIR") != 0) - srcdir = getenv("SRCDIR"); - - // - // Create a 300x300 white canvas. - // - Image image( "300x300", "white" ); - - // Drawing list - std::vector drawList; - - // Start drawing by pushing a drawing context with specified - // viewbox size - drawList.push_back(DrawablePushGraphicContext()); - drawList.push_back(DrawableViewbox(0,0,image.columns(),image.rows())); - - // - // Draw blue grid - // - drawList.push_back(DrawableStrokeColor("#ccf")); - for ( int i=0; i < 300; i += 10 ) - { - drawList.push_back(DrawableLine(i,0, i,300)); - drawList.push_back(DrawableLine(0,i, 300,i)); - } - - // - // Draw rounded rectangle. - // - drawList.push_back(DrawableFillColor("blue")); - drawList.push_back(DrawableStrokeColor("red")); - drawList.push_back(DrawableRoundRectangle(15,15, 70,70, 10,10)); - - drawList.push_back(DrawableFillColor("blue")); - drawList.push_back(DrawableStrokeColor("maroon")); - drawList.push_back(DrawableStrokeWidth(4)); - drawList.push_back(DrawableRoundRectangle(15,15, 70,70, 10,10)); - - // - // Draw curve. - // - { - drawList.push_back(DrawableStrokeColor("black")); - drawList.push_back(DrawableStrokeWidth(4)); - drawList.push_back(DrawableFillColor(Color())); - - std::vector points; - points.push_back(Coordinate(20,20)); - points.push_back(Coordinate(100,50)); - points.push_back(Coordinate(50,100)); - points.push_back(Coordinate(160,160)); - drawList.push_back(DrawableBezier(points)); - } - - // - // Draw line - // - { - const double dash_array[] = {4.0, 3.0, 0.0}; - drawList.push_back(DrawableStrokeDashArray(dash_array)); - drawList.push_back(DrawableStrokeColor("red")); - drawList.push_back(DrawableStrokeWidth(1)); - drawList.push_back(DrawableLine(10,200, 54,182)); - drawList.push_back(DrawableStrokeDashArray((double *) 0)); - } - - // - // Draw arc within a circle. - // - drawList.push_back(DrawableStrokeColor("black")); - drawList.push_back(DrawableFillColor("yellow")); - drawList.push_back(DrawableStrokeWidth(4)); - drawList.push_back(DrawableCircle(160,70, 200,70)); - - drawList.push_back(DrawableStrokeColor("black")); - drawList.push_back(DrawableFillColor("blue")); - drawList.push_back(DrawableStrokeWidth(4)); - { - std::vector path; - path.push_back(PathMovetoAbs(Coordinate(160,70))); - path.push_back(PathLinetoVerticalRel(-40)); - path.push_back(PathArcRel(PathArcArgs(40,40, 0, 0, 0, -40,40))); - path.push_back(PathClosePath()); - drawList.push_back(DrawablePath(path)); - } - - // - // Draw pentogram. - // - { - drawList.push_back(DrawableStrokeColor("red")); - drawList.push_back(DrawableFillColor("LimeGreen")); - drawList.push_back(DrawableStrokeWidth(3)); - - std::vector points; - points.push_back(Coordinate(160,120)); - points.push_back(Coordinate(130,190)); - points.push_back(Coordinate(210,145)); - points.push_back(Coordinate(110,145)); - points.push_back(Coordinate(190,190)); - points.push_back(Coordinate(160,120)); - drawList.push_back(DrawablePolygon(points)); - } - - // - // Draw rectangle. - // - drawList.push_back(DrawableStrokeWidth(5)); - drawList.push_back(DrawableFillColor(Color())); // No fill - drawList.push_back(DrawableStrokeColor("yellow")); - drawList.push_back(DrawableLine(200,260, 200,200)); - drawList.push_back(DrawableLine(200,200, 260,200)); - drawList.push_back(DrawableStrokeColor("red")); - drawList.push_back(DrawableLine(260,200, 260,260)); - drawList.push_back(DrawableStrokeColor("green")); - drawList.push_back(DrawableLine(200,260, 260,260)); - - // - // Draw text. - // -#if MAGICKCORE_FREETYPE_DELEGATE - if (getenv("MAGICK_FONT") != 0) - drawList.push_back(DrawableFont(string(getenv("MAGICK_FONT")))); - drawList.push_back(DrawableFillColor("green")); - drawList.push_back(DrawableStrokeColor(Color())); // unset color - drawList.push_back(DrawablePointSize(24)); - drawList.push_back(DrawableTranslation(30,140)); - drawList.push_back(DrawableRotation(45.0)); - drawList.push_back(DrawableText(0,0,"This is a test!")); -#endif - - // Finish drawing by popping back to base context. - drawList.push_back(DrawablePopGraphicContext()); - - // Draw everything using completed drawing list - // image.debug(true); - image.draw(drawList); - - // image.write( "piddle.mvg" ); - - cout << "Writing image \"piddle_out.miff\" ..." << endl; - image.depth( 8 ); - image.compressType( RLECompression ); - image.write( "piddle_out.miff" ); - cout << "Writing MVG metafile \"piddle_out.mvg\" ..." << endl; - image.write( "piddle_out.mvg" ); - - // cout << "Display image..." << endl; - // image.display( ); - - } - catch( exception &error_ ) - { - cout << "Caught exception: " << error_.what() << endl; - return 1; - } - - return 0; -} diff --git a/Magick++/demo/shapes.cpp b/Magick++/demo/shapes.cpp deleted file mode 100644 index 806366d6d..000000000 --- a/Magick++/demo/shapes.cpp +++ /dev/null @@ -1,127 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2002, 2003 -// -// GD/PerlMagick example using Magick++ methods. -// -// Concept and algorithms lifted from PerlMagick demo script -// - -#include -#include -#include - -using namespace std; - -using namespace Magick; - -int main( int /*argc*/, char ** argv) -{ - - // Initialize ImageMagick install location for Windows - InitializeMagick(*argv); - - try { - - string srcdir(""); - if(getenv("SRCDIR") != 0) - srcdir = getenv("SRCDIR"); - - // - // Create a 300x300 white canvas. - // - Image image( "300x300", "white" ); - - // - // Draw texture-filled polygon - // - // Polygon list - std::vector poly_coord; - poly_coord.push_back( Coordinate(30,30) ); - poly_coord.push_back( Coordinate(100,10) ); - poly_coord.push_back( Coordinate(190,290) ); - poly_coord.push_back( Coordinate(30,290) ); - - Image texture( srcdir + "tile.miff" ); - image.fillPattern( texture ); - image.draw( DrawablePolygon( poly_coord ) ); - texture.isValid( false ); - image.fillPattern( texture ); // Unset texture - - // - // Draw filled ellipse with black border, and red fill color - // - image.strokeColor( "black" ); - image.fillColor( "red" ); - image.strokeWidth( 5 ); - image.draw( DrawableEllipse( 100,100, 50,75, 0,360 ) ); - image.fillColor( Color() ); // Clear out fill color - - // - // Draw ellipse, and polygon, with black stroke, strokeWidth of 5 - // - image.strokeColor( "black" ); - image.strokeWidth( 5 ); - vector drawlist; - - // Add polygon to list - poly_coord.clear(); - poly_coord.push_back( Coordinate(30,30) ); - poly_coord.push_back( Coordinate(100,10) ); - poly_coord.push_back( Coordinate(190,290) ); - poly_coord.push_back( Coordinate(30,290) ); - drawlist.push_back( DrawablePolygon( poly_coord ) ); - image.draw( drawlist ); - - // - // Floodfill object with blue - // - image.colorFuzz( 0.5*QuantumRange ); - image.floodFillColor( "+132+62", "blue" ); - - // - // Draw text - // - image.strokeColor(Color()); - image.fillColor( "red" ); - if (getenv("MAGICK_FONT") != 0) - image.font(string(getenv("MAGICK_FONT"))); - image.fontPointsize( 18 ); -#if MAGICKCORE_FREETYPE_DELEGATE - image.annotate( "Hello world!", "+150+20" ); -#endif - - image.fillColor( "blue" ); - image.fontPointsize( 14 ); -#if MAGICKCORE_FREETYPE_DELEGATE - image.annotate( "Goodbye cruel world!", "+150+38" ); -#endif - - image.fillColor( "black" ); - image.fontPointsize( 14 ); -#if MAGICKCORE_FREETYPE_DELEGATE - image.annotate( "I'm climbing the wall!", "+280+120", - NorthWestGravity, 90.0 ); -#endif - //image.display(); - // - // Write image. - // - - cout << "Writing image \"shapes_out.miff\" ..." << endl; - image.depth( 8 ); - image.compressType( RLECompression ); - image.write( "shapes_out.miff" ); - - // cout << "Display image..." << endl; - // image.display( ); - - } - catch( exception &error_ ) - { - cout << "Caught exception: " << error_.what() << endl; - return 1; - } - - return 0; -} diff --git a/Magick++/demo/smile.miff b/Magick++/demo/smile.miff deleted file mode 100644 index 0d7cb53b4..000000000 Binary files a/Magick++/demo/smile.miff and /dev/null differ diff --git a/Magick++/demo/smile_anim.miff b/Magick++/demo/smile_anim.miff deleted file mode 100644 index 281894d46..000000000 Binary files a/Magick++/demo/smile_anim.miff and /dev/null differ diff --git a/Magick++/demo/tile.miff b/Magick++/demo/tile.miff deleted file mode 100644 index 911451ace..000000000 Binary files a/Magick++/demo/tile.miff and /dev/null differ diff --git a/Magick++/demo/zoom.cpp b/Magick++/demo/zoom.cpp deleted file mode 100644 index 30a949fb2..000000000 --- a/Magick++/demo/zoom.cpp +++ /dev/null @@ -1,191 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 2001, 2002, 2003 -// -// Resize image using specified resize algorithm with Magick++ API -// -// Usage: zoom [-density resolution] [-filter algorithm] [-geometry geometry] -// [-resample resolution] input_file output_file -// - -#include -#include -#include -using namespace std; -using namespace Magick; - -static void Usage ( char **argv ) -{ - cout << "Usage: " << argv[0] - << " [-density resolution] [-filter algorithm] [-geometry geometry]" - << " [-resample resolution] input_file output_file" << endl - << " algorithm - bessel blackman box catrom cubic gaussian hamming hanning" << endl - << " hermite lanczos mitchell point quadratic sample scale sinc triangle" << endl; - exit(1); -} - -static void ParseError (int position, char **argv) -{ - cout << "Argument \"" << argv[position] << "\" at position" << position - << "incorrect" << endl; - Usage(argv); -} - -int main(int argc,char **argv) -{ - // Initialize ImageMagick install location for Windows - InitializeMagick(*argv); - - if ( argc < 2 ) - Usage(argv); - - enum ResizeAlgorithm - { - Zoom, - Scale, - Sample - }; - - { - Geometry geometry; - Magick::FilterType filter(LanczosFilter); - Point density; - Point resample; - ResizeAlgorithm resize_algorithm=Zoom; - - int argv_index=1; - while ((argv_index < argc - 2) && (*argv[argv_index] == '-')) - { - std::string command(argv[argv_index]); - if (command.compare("-density") == 0) - { - argv_index++; - try { - density=Geometry(argv[argv_index]); - } - catch( exception &/* error_ */) - { - ParseError(argv_index,argv); - } - argv_index++; - continue; - } - else if (command.compare("-filter") == 0) - { - argv_index++; - std::string algorithm(argv[argv_index]); - if (algorithm.compare("point") == 0) - filter=PointFilter; - else if (algorithm.compare("box") == 0) - filter=BoxFilter; - else if (algorithm.compare("triangle") == 0) - filter=TriangleFilter; - else if (algorithm.compare("hermite") == 0) - filter=HermiteFilter; - else if (algorithm.compare("hanning") == 0) - filter=HanningFilter; - else if (algorithm.compare("hamming") == 0) - filter=HammingFilter; - else if (algorithm.compare("blackman") == 0) - filter=BlackmanFilter; - else if (algorithm.compare("gaussian") == 0) - filter=GaussianFilter; - else if (algorithm.compare("quadratic") == 0) - filter=QuadraticFilter; - else if (algorithm.compare("cubic") == 0) - filter=CubicFilter; - else if (algorithm.compare("catrom") == 0) - filter=CatromFilter; - else if (algorithm.compare("mitchell") == 0) - filter=MitchellFilter; - else if (algorithm.compare("lanczos") == 0) - filter=LanczosFilter; - else if (algorithm.compare("bessel") == 0) - filter=BesselFilter; - else if (algorithm.compare("sinc") == 0) - filter=SincFilter; - else if (algorithm.compare("sample") == 0) - resize_algorithm=Sample; - else if (algorithm.compare("scale") == 0) - resize_algorithm=Scale; - else - ParseError(argv_index,argv); - argv_index++; - continue; - } - else if (command.compare("-geometry") == 0) - { - argv_index++; - try { - geometry=Geometry(argv[argv_index]); - } - catch( exception &/* error_ */) - { - ParseError(argv_index,argv); - } - argv_index++; - continue; - } - else if (command.compare("-resample") == 0) - { - argv_index++; - try { - resample=Geometry(argv[argv_index]); - } - catch( exception &/* error_ */) - { - ParseError(argv_index,argv); - } - argv_index++; - continue; - } - ParseError(argv_index,argv); - } - - if (argv_index>argc-1) - ParseError(argv_index,argv); - std::string input_file(argv[argv_index]); - argv_index++; - if (argv_index>argc) - ParseError(argv_index,argv); - std::string output_file(argv[argv_index]); - - try { - Image image(input_file); - if (density.isValid()) - image.density(density); - density=image.density(); - - if (resample.isValid()) - { - geometry = - Geometry(static_cast - (image.columns()*((double)resample.x()/density.x())+0.5), - static_cast - (image.rows()*((double)resample.y()/density.y())+0.5)); - image.density(resample); - } - switch (resize_algorithm) - { - case Sample: - image.sample(geometry); - break; - case Scale: - image.scale(geometry); - break; - case Zoom: - image.filterType(filter); - image.zoom(geometry); - break; - } - image.write(output_file); - } - catch( exception &error_ ) - { - cout << "Caught exception: " << error_.what() << endl; - return 1; - } - } - - return 0; -} diff --git a/Magick++/fuzz/build.sh b/Magick++/fuzz/build.sh deleted file mode 100644 index cf7f233a4..000000000 --- a/Magick++/fuzz/build.sh +++ /dev/null @@ -1,121 +0,0 @@ -#!/bin/bash -eu - -# build zlib -pushd "$SRC/zlib" -./configure --static --prefix="$WORK" -make -j$(nproc) CFLAGS="$CFLAGS -fPIC" -make install -popd - -# Build xz -pushd "$SRC/xz" -./autogen.sh -./configure --disable-xz --disable-xzdec --disable-lzmadec --disable-lzmainfo --disable-lzma-links --disable-scripts --disable-doc --disable-shared --with-pic=yes --prefix="$WORK" -make -j$(nproc) -make install -popd - -# Build png -pushd "$SRC/libpng" -cmake . -DCMAKE_INSTALL_PREFIX=$WORK -DPNG_SHARED=off -make -j$(nproc) -make install -popd - -# Build libjpeg-turbo -pushd "$SRC/libjpeg-turbo" -CFLAGS="$CFLAGS -fPIC" cmake . -DCMAKE_INSTALL_PREFIX=$WORK -DENABLE_STATIC=on -DENABLE_SHARED=off -make -j$(nproc) -make install -popd - -# Build libtiff -pushd "$SRC/libtiff" -autoreconf -fiv -./configure --prefix="$WORK" -make -j$(nproc) -make install -popd - -# Build liblcms2 -pushd "$SRC/Little-CMS" -autoreconf -fiv -./configure --disable-shared --prefix="$WORK" -make -j$(nproc) -make install -popd - -# build libraw -pushd "$SRC/libraw" -autoreconf -fiv -./configure --prefix="$WORK" --disable-shared --with-pic=yes --disable-examples PKG_CONFIG_PATH="$WORK/lib/pkgconfig" CXXFLAGS="$CXXFLAGS -DLIBRAW_USE_CALLOC_INSTEAD_OF_MALLOC=on" -make -j$(nproc) -make install -popd - -# Build freetype2 -pushd "$SRC/freetype2" -./autogen.sh -./configure --prefix="$WORK" --disable-shared PKG_CONFIG_PATH="$WORK/lib/pkgconfig" -make -j$(nproc) -make install -popd - -# Build libde265 -pushd "$SRC/libde265" -./autogen.sh -./configure --disable-shared --prefix="$WORK" -make -j$(nproc) -make install -popd - -# Build libheif -pushd "$SRC/libheif" -./autogen.sh -./configure --disable-shared --disable-go --prefix="$WORK" PKG_CONFIG_PATH="$WORK/lib/pkgconfig" -make -j$(nproc) -make install -popd - -# Build webp -pushd "$SRC/libwebp" -./autogen.sh -./configure --disable-shared --prefix="$WORK" -make -j$(nproc) -make install -popd - -# Build openjpg -pushd "$SRC/openjpeg" -cmake . -DCMAKE_INSTALL_PREFIX=$WORK -DBUILD_SHARED_LIBS=off -DBUILD_CODEC=off -DCMAKE_BUILD_TYPE=Release -make -j$(nproc) -make install -popd - - -# Build ImageMagick -./configure --prefix="$WORK" --disable-shared --disable-docs --with-utilities=no LDFLAGS="${LDFLAGS:-} -L$WORK/lib" CFLAGS="$CFLAGS -I$WORK/include" PKG_CONFIG_PATH="$WORK/lib/pkgconfig" -make "-j$(nproc)" -make install - -MAGICK_COMPILER=$CXX -MAGICK_COMPILER_FLAGS=$CXXFLAGS -MAGICK_INCLUDE="$WORK/include/ImageMagick-7" -MAGICK_SRC="$SRC/imagemagick/Magick++/fuzz" -MAGICK_LIBS_NO_FUZZ="$WORK/lib/libMagick++-7.Q16HDRI.a $WORK/lib/libMagickWand-7.Q16HDRI.a $WORK/lib/libMagickCore-7.Q16HDRI.a $WORK/lib/libpng.a $WORK/lib/libtiff.a $WORK/lib/libheif.a $WORK/lib/libde265.a $WORK/lib/libopenjp2.a $WORK/lib/libwebp.a $WORK/lib/libturbojpeg.a $WORK/lib/libjpeg.a $WORK/lib/libfreetype.a $WORK/lib/libraw.a $WORK/lib/liblzma.a $WORK/lib/liblcms2.a $WORK/lib/libz.a" -MAGICK_LIBS="$LIB_FUZZING_ENGINE $MAGICK_LIBS_NO_FUZZ" -MAGICK_OUTPUT=$OUT -MAGICK_FAST_BUILD=0 - -. $MAGICK_SRC/build_fuzzers.sh - -mkdir afl_testcases -(cd afl_testcases; tar xvf "$SRC/afl_testcases.tgz") -for format in gif jpg png bmp ico webp tif; do - mkdir $format - find afl_testcases -type f -name '*.'$format -exec mv -n {} $format/ \; - zip -rj $format.zip $format/ - cp $format.zip "$OUT/encoder_${format}_fuzzer_seed_corpus.zip" -done - -zip -rj "$OUT/encoder_heic_fuzzer_seed_corpus.zip" "$SRC/heic_corpus" diff --git a/Magick++/fuzz/build_fuzzers.sh b/Magick++/fuzz/build_fuzzers.sh deleted file mode 100644 index 29e5e3a28..000000000 --- a/Magick++/fuzz/build_fuzzers.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash -eu - -MAGICK_COMPILER_FLAGS="$MAGICK_COMPILER_FLAGS -fuse-ld=lld -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16" - -$MAGICK_COMPILER $MAGICK_COMPILER_FLAGS -std=c++11 -I$MAGICK_INCLUDE "$MAGICK_SRC/encoder_list.cc" \ - -o "$MAGICK_SRC/encoder_list" $MAGICK_LIBS_NO_FUZZ - -for f in $MAGICK_SRC/*_fuzzer.cc; do - fuzzer=$(basename "$f" _fuzzer.cc) - # encoder_fuzzer and ping_fuzzer are special - if [ "$fuzzer" == "encoder" ] || [ "$fuzzer" == "ping" ]; then - continue - fi - $MAGICK_COMPILER $MAGICK_COMPILER_FLAGS -std=c++11 -I$MAGICK_INCLUDE \ - "$f" -o "$MAGICK_OUTPUT/${fuzzer}_fuzzer" $MAGICK_LIBS - echo -e "[libfuzzer]\nclose_fd_mask=3" > "$MAGICK_OUTPUT/${fuzzer}_fuzzer.options" -done - -for item in $("$MAGICK_SRC/encoder_list"); do - info=${item:1} - encoder=${info%:*} - initializer=${info##*:} - encoder_flags="-DFUZZ_IMAGEMAGICK_ENCODER=$encoder" - if [ "$initializer" != "" ]; then - encoder_flags="$encoder_flags -DFUZZ_IMAGEMAGICK_ENCODER_INITIALIZER=$initializer" - fi - - $MAGICK_COMPILER $MAGICK_COMPILER_FLAGS -std=c++11 -I$MAGICK_INCLUDE \ - "$MAGICK_SRC/ping_fuzzer.cc" -o "$MAGICK_OUTPUT/ping_${encoder,,}_fuzzer" \ - $encoder_flags $MAGICK_LIBS - - echo -e "[libfuzzer]\nclose_fd_mask=3" > "$MAGICK_OUTPUT/ping_${encoder,,}_fuzzer.options" - - if [ "${item:0:1}" == "+" ]; then - encoder_flags="$encoder_flags -DFUZZ_IMAGEMAGICK_ENCODER_WRITE=1" - fi - - $MAGICK_COMPILER $MAGICK_COMPILER_FLAGS -std=c++11 -I$MAGICK_INCLUDE \ - "$MAGICK_SRC/encoder_fuzzer.cc" -o "$MAGICK_OUTPUT/encoder_${encoder,,}_fuzzer" \ - $encoder_flags $MAGICK_LIBS - - echo -e "[libfuzzer]\nclose_fd_mask=3" > "$MAGICK_OUTPUT/encoder_${encoder,,}_fuzzer.options" - - if [ -f "$MAGICK_SRC/dictionaries/${encoder,,}.dict" ]; then - cp "$MAGICK_SRC/dictionaries/${encoder,,}.dict" "$MAGICK_OUTPUT/ping_${encoder,,}_fuzzer.dict" - cp "$MAGICK_SRC/dictionaries/${encoder,,}.dict" "$MAGICK_OUTPUT/encoder_${encoder,,}_fuzzer.dict" - fi - - if [ $MAGICK_FAST_BUILD -eq 1 ]; then - break - fi -done diff --git a/Magick++/fuzz/crop_fuzzer.cc b/Magick++/fuzz/crop_fuzzer.cc deleted file mode 100644 index 88093eac0..000000000 --- a/Magick++/fuzz/crop_fuzzer.cc +++ /dev/null @@ -1,28 +0,0 @@ -#include - -#include -#include - -#include "utils.cc" - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - uint16_t Width; - uint16_t Height; - if (Size < (sizeof(Width) + sizeof(Height))) { - return 0; - } - Width = *reinterpret_cast(Data); - Height = *reinterpret_cast(Data + sizeof(Width)); - const Magick::Blob blob(Data + sizeof(Width) + sizeof(Height), - Size - (sizeof(Width) + sizeof(Height))); - Magick::Image image; - try { - image.read(blob); - image.crop(Magick::Geometry(Width, Height)); - } catch (Magick::Exception &e) { - return 0; - } - return 0; -} - -#include "travis.cc" diff --git a/Magick++/fuzz/dictionaries/mvg.dict b/Magick++/fuzz/dictionaries/mvg.dict deleted file mode 100644 index 61502fcf3..000000000 --- a/Magick++/fuzz/dictionaries/mvg.dict +++ /dev/null @@ -1,146 +0,0 @@ -"100" -"200" -"300" -"400" -"500" -"600" -"700" -"800" -"900" -"Center" -"East" -"North" -"NorthEast" -"NorthWest" -"South" -"SouthEast" -"SouthWest" -"West" -"add" -"affine" -"all" -"arc" -"bevel" -"bezier" -"black" -"bold" -"border-color" -"butt" -"change-mask" -"circle" -"clear" -"clip-path" -"clip-rule" -"clip-units" -"color" -"color-burn" -"color-dodge" -"condensed" -"darken" -"decorate" -"difference" -"dst" -"dst-atop" -"dst-in" -"dst-out" -"dst-over" -"ellipse" -"evenodd" -"exclusion" -"expanded" -"extra-condensed" -"extra-expanded" -"fill" -"fill-opacity" -"fill-rule" -"filltoborder" -"floodfill" -"font" -"font-family" -"font-size" -"font-stretch" -"font-style" -"font-weight" -"fuchsia" -"gradient-units" -"gravity" -"hard-light" -"image" -"interline-spacing" -"interword-spacing" -"italic" -"kerning" -"lighten" -"line" -"line-through" -"linear-light" -"matte" -"minus" -"miter" -"multiply" -"none" -"nonzero" -"normal" -"objectBoundingBox" -"oblique" -"offset" -"opacity" -"overlay" -"overline" -"path" -"plus" -"point" -"polygon" -"polyline" -"pop clip-path" -"pop defs" -"pop gradient" -"pop graphic-context" -"pop pattern" -"push clip-path" -"push defs" -"push gradient" -"push graphic-context" -"push pattern" -"rectangle" -"replace" -"reset" -"rotate" -"round" -"roundrectangle" -"scale" -"screen" -"semi-condensed" -"semi-expanded" -"skewX" -"skewY" -"soft-light" -"square" -"src" -"src-atop" -"src-in" -"src-out" -"src-over" -"stop-color" -"stroke" -"stroke-antialias" -"stroke-dasharray" -"stroke-dashoffset" -"stroke-linecap" -"stroke-linejoin" -"stroke-miterlimit" -"stroke-opacity" -"stroke-width" -"subtract" -"text" -"text-antialias" -"text-undercolor" -"translate" -"ultra-condensed" -"ultra-expanded" -"underline" -"userSpace" -"userSpaceOnUse" -"viewbox" -"xor" -"yellow" diff --git a/Magick++/fuzz/encoder_format.h b/Magick++/fuzz/encoder_format.h deleted file mode 100644 index c8ab98284..000000000 --- a/Magick++/fuzz/encoder_format.h +++ /dev/null @@ -1,28 +0,0 @@ -class EncoderFormat { -public: - std::string get() { return std::string(_format.begin(), _format.end()); } const - void set(const std::wstring fileName, const std::wstring extension) - { - if (fileName.find(L"clusterfuzz-testcase-") == -1) - { - if (extension.length() > 1) - _format = extension.substr(1, extension.size() - 1); - return; - } - - std::wstring format=fileName; - - size_t index = format.find(L"_", 0); - if (index == std::wstring::npos) - return; - - format=format.substr(index + 1); - index = format.find(L"_", 0); - if (index != std::wstring::npos) - _format=format.substr(0, index); - else if (extension.length() > 1) - _format=extension.substr(1, extension.size() - 1); - } -private: - std::wstring _format = L".notset"; -}; \ No newline at end of file diff --git a/Magick++/fuzz/encoder_fuzzer.cc b/Magick++/fuzz/encoder_fuzzer.cc deleted file mode 100644 index 8db93a1d3..000000000 --- a/Magick++/fuzz/encoder_fuzzer.cc +++ /dev/null @@ -1,68 +0,0 @@ -#include -#include - -#include -#include - -#include "utils.cc" - -#define FUZZ_ENCODER_STRING_LITERAL_X(name) FUZZ_ENCODER_STRING_LITERAL(name) -#define FUZZ_ENCODER_STRING_LITERAL(name) #name - -#ifndef FUZZ_ENCODER -#define FUZZ_ENCODER FUZZ_ENCODER_STRING_LITERAL_X(FUZZ_IMAGEMAGICK_ENCODER) -#endif - -#ifndef FUZZ_IMAGEMAGICK_INITIALIZER -#define FUZZ_IMAGEMAGICK_INITIALIZER "" -#endif -#define FUZZ_ENCODER_INITIALIZER FUZZ_ENCODER_STRING_LITERAL_X(FUZZ_IMAGEMAGICK_INITIALIZER) - -static ssize_t EncoderInitializer(const uint8_t *Data, const size_t Size, Magick::Image &image) -{ - if (strcmp(FUZZ_ENCODER_INITIALIZER, "interlace") == 0) { - Magick::InterlaceType interlace = (Magick::InterlaceType) *reinterpret_cast(Data); - if (interlace > Magick::PNGInterlace) - return -1; - image.interlaceType(interlace); - return 1; - } - if (strcmp(FUZZ_ENCODER_INITIALIZER, "png") == 0) { - image.defineValue("png", "ignore-crc", "1"); - } - - return 0; -} - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) -{ - if (Size < 1) - return 0; - Magick::Image image; - const ssize_t offset = EncoderInitializer(Data, Size, image); - if (offset < 0) - return 0; - std::string encoder = FUZZ_ENCODER; - image.magick(encoder); - image.fileName(std::string(encoder) + ":"); - const Magick::Blob blob(Data + offset, Size - offset); - try { - image.read(blob); - } - catch (Magick::Exception &e) { - return 0; - } - -#if FUZZ_IMAGEMAGICK_ENCODER_WRITE || BUILD_MAIN - - Magick::Blob outBlob; - try { - image.write(&outBlob, encoder); - } - catch (Magick::Exception &e) { - } -#endif - return 0; -} - -#include "travis.cc" diff --git a/Magick++/fuzz/encoder_gradient_fuzzer.cc b/Magick++/fuzz/encoder_gradient_fuzzer.cc deleted file mode 100644 index 5a4ae800d..000000000 --- a/Magick++/fuzz/encoder_gradient_fuzzer.cc +++ /dev/null @@ -1,13 +0,0 @@ -#include - -#include -#include - -#include "utils.cc" -#include "encoder_utils.cc" - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - return fuzzEncoderWithStringFilename("gradient", Data, Size); -} - -#include "travis.cc" diff --git a/Magick++/fuzz/encoder_label_fuzzer.cc b/Magick++/fuzz/encoder_label_fuzzer.cc deleted file mode 100644 index 6a8b7605b..000000000 --- a/Magick++/fuzz/encoder_label_fuzzer.cc +++ /dev/null @@ -1,22 +0,0 @@ -#include - -#include -#include - -#include "utils.cc" -#include "encoder_utils.cc" - -static bool validateFileName(const std::string &fileName) -{ - // Signature: this will most likely cause a timeout. - if (fileName.find("%#") != -1) - return false; - - return true; -} - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - return fuzzEncoderWithStringFilename("label", Data, Size, validateFileName); -} - -#include "travis.cc" diff --git a/Magick++/fuzz/encoder_list.cc b/Magick++/fuzz/encoder_list.cc deleted file mode 100644 index b3b42498d..000000000 --- a/Magick++/fuzz/encoder_list.cc +++ /dev/null @@ -1,65 +0,0 @@ -#include -#include -#include - -#include -#include - -static std::string getInitializer(const std::string magick_module) -{ - if ((magick_module == "BGR") || (magick_module == "CMYK") || (magick_module =="RGB") || (magick_module =="YUV")) - return "interlace"; - if (magick_module == "PNG") - return "png"; - return ""; -} - -int main() { - std::list coderList; - coderInfoList(&coderList, Magick::CoderInfo::TrueMatch, Magick::CoderInfo::AnyMatch, Magick::CoderInfo::AnyMatch); - - std::list allowedNames; - allowedNames.push_back("BGR"); - allowedNames.push_back("BMP"); - allowedNames.push_back("CMYK"); - allowedNames.push_back("DDS"); - allowedNames.push_back("EPT"); - allowedNames.push_back("FAX"); - allowedNames.push_back("HTML"); - allowedNames.push_back("JP2"); - allowedNames.push_back("JPEG"); - allowedNames.push_back("PCD"); - allowedNames.push_back("PCD"); - allowedNames.push_back("PDF"); - allowedNames.push_back("PNG"); - allowedNames.push_back("PS"); - allowedNames.push_back("PS2"); - allowedNames.push_back("PS3"); - allowedNames.push_back("RGB"); - allowedNames.push_back("SVG"); - allowedNames.push_back("TIFF"); - allowedNames.push_back("TXT"); - allowedNames.push_back("YCBCR"); - - std::list excludeList; - excludeList.push_back("GRADIENT"); - excludeList.push_back("LABEL"); - excludeList.push_back("NULL"); - excludeList.push_back("PATTERN"); - excludeList.push_back("PLASMA"); - excludeList.push_back("SCREENSHOT"); - excludeList.push_back("TXT"); - excludeList.push_back("XC"); - - for (std::list::iterator it = coderList.begin(); it != coderList.end(); it++) - { - std::string module=(*it).module(); - if (std::find(excludeList.begin(), excludeList.end(), module) != excludeList.end()) - continue; - - if ((*it).name() == module) - std::cout << ((*it).isWritable() ? "+" : "-") << module << ":" << getInitializer(module) << std::endl; - else if (std::find(allowedNames.begin(), allowedNames.end(), module) != allowedNames.end()) - std::cout << ((*it).isWritable() ? "+" : "-") << (*it).name() << ":" << getInitializer(module) << std::endl; - } -} diff --git a/Magick++/fuzz/encoder_pattern_fuzzer.cc b/Magick++/fuzz/encoder_pattern_fuzzer.cc deleted file mode 100644 index 1b666d35c..000000000 --- a/Magick++/fuzz/encoder_pattern_fuzzer.cc +++ /dev/null @@ -1,13 +0,0 @@ -#include - -#include -#include - -#include "utils.cc" -#include "encoder_utils.cc" - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - return fuzzEncoderWithStringFilename("pattern", Data, Size); -} - -#include "travis.cc" diff --git a/Magick++/fuzz/encoder_plasma_fuzzer.cc b/Magick++/fuzz/encoder_plasma_fuzzer.cc deleted file mode 100644 index 9d8772e5b..000000000 --- a/Magick++/fuzz/encoder_plasma_fuzzer.cc +++ /dev/null @@ -1,15 +0,0 @@ -#include - -#include -#include - -#define FUZZ_MAX_SIZE 128 - -#include "utils.cc" -#include "encoder_utils.cc" - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - return fuzzEncoderWithStringFilename("plasma", Data, Size); -} - -#include "travis.cc" diff --git a/Magick++/fuzz/encoder_radial-gradient_fuzzer.cc b/Magick++/fuzz/encoder_radial-gradient_fuzzer.cc deleted file mode 100644 index 7dc2a051b..000000000 --- a/Magick++/fuzz/encoder_radial-gradient_fuzzer.cc +++ /dev/null @@ -1,13 +0,0 @@ -#include - -#include -#include - -#include "utils.cc" -#include "encoder_utils.cc" - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - return fuzzEncoderWithStringFilename("radial-gradient", Data, Size); -} - -#include "travis.cc" diff --git a/Magick++/fuzz/encoder_utils.cc b/Magick++/fuzz/encoder_utils.cc deleted file mode 100644 index a533c010c..000000000 --- a/Magick++/fuzz/encoder_utils.cc +++ /dev/null @@ -1,20 +0,0 @@ -static int fuzzEncoderWithStringFilename(const std::string encoder, const uint8_t *Data, size_t Size, bool (*validate)(const std::string &) = NULL) -{ - // Allow a bit extra to make sure we do proper bounds checking in Magick++ - if (Size > MagickPathExtent) - return 0; - - std::string fileName(reinterpret_cast(Data), Size); - - // Can be used to deny specific file names - if ((validate != NULL) && (validate(fileName) == false)) - return 0; - - Magick::Image image; - try { - image.read(encoder + ":" + fileName); - } - catch (Magick::Exception &e) { - } - return 0; -} \ No newline at end of file diff --git a/Magick++/fuzz/encoder_xc_fuzzer.cc b/Magick++/fuzz/encoder_xc_fuzzer.cc deleted file mode 100644 index 5f74f10e4..000000000 --- a/Magick++/fuzz/encoder_xc_fuzzer.cc +++ /dev/null @@ -1,13 +0,0 @@ -#include - -#include -#include - -#include "utils.cc" -#include "encoder_utils.cc" - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - return fuzzEncoderWithStringFilename("xc", Data, Size); -} - -#include "travis.cc" diff --git a/Magick++/fuzz/enhance_fuzzer.cc b/Magick++/fuzz/enhance_fuzzer.cc deleted file mode 100644 index 9ef8a3961..000000000 --- a/Magick++/fuzz/enhance_fuzzer.cc +++ /dev/null @@ -1,20 +0,0 @@ -#include - -#include -#include - -#include "utils.cc" - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - const Magick::Blob blob(Data, Size); - Magick::Image image; - try { - image.read(blob); - image.enhance(); - } catch (Magick::Exception &e) { - return 0; - } - return 0; -} - -#include "travis.cc" diff --git a/Magick++/fuzz/huffman_decode_fuzzer.cc b/Magick++/fuzz/huffman_decode_fuzzer.cc deleted file mode 100644 index b53788895..000000000 --- a/Magick++/fuzz/huffman_decode_fuzzer.cc +++ /dev/null @@ -1,23 +0,0 @@ -#include - -#include - -#include "utils.cc" - -namespace MagickCore -{ - extern "C" void AttachBlob(BlobInfo *,const void *,const size_t); -} - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - Magick::Image image; - MagickCore::AttachBlob(image.image()->blob,(const void *) Data,Size); - - Magick::ExceptionInfo *exceptionInfo; - exceptionInfo=MagickCore::AcquireExceptionInfo(); - (void) HuffmanDecodeImage(image.image(), exceptionInfo); - (void) MagickCore::DestroyExceptionInfo(exceptionInfo); - return 0; -} - -#include "travis.cc" diff --git a/Magick++/fuzz/main.cc b/Magick++/fuzz/main.cc deleted file mode 100644 index 2f1f5238f..000000000 --- a/Magick++/fuzz/main.cc +++ /dev/null @@ -1,109 +0,0 @@ -#define WINVER 0x0501 -#define BUFSIZE 4096 -#pragma comment(lib, "Shlwapi.lib") - -#include -#include -#include -#include -#include -#include "encoder_format.h" -#include -using namespace std; - -extern EncoderFormat encoderFormat; -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size); - -class FuzzingDebugger -{ -public: - bool load(wstring fileName) - { - ifstream - file; - - streampos - size; - - file = ifstream(fileName, ios::in | ios::binary | ios::ate); - if (!file.is_open()) - return(false); - - size = file.tellg(); - if (size < 1) - return(false); - - _size = size; - _data = new char[_size]; - file.seekg(0, ios::beg); - file.read(_data, size); - file.close(); - - encoderFormat.set(fileName, wstring(PathFindExtension(fileName.c_str()))); - - return(true); - } - - void start() - { - const uint8_t - *data; - - data = reinterpret_cast(_data); - LLVMFuzzerTestOneInput(data, _size); - - delete _data; - } - - -private: - char * _data; - size_t _size; -}; - -int wmain(int argc, wchar_t *argv[]) -{ - FuzzingDebugger - debugger; - - int - debug; - - wstring - fileName; - - if (argc == 1) - { - wchar_t - fullPath[BUFSIZE], - **lppPart; - - lppPart = NULL; - GetFullPathName(argv[0], BUFSIZE, fullPath, lppPart); - PathRemoveExtension(fullPath); - fileName = wstring(fullPath) + L".input"; - } - else - fileName = wstring(argv[1]); - - debug=_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); - debug |= _CRTDBG_DELAY_FREE_MEM_DF; - debug |= _CRTDBG_LEAK_CHECK_DF; - (void) _CrtSetDbgFlag(debug); - - //_CrtSetBreakAlloc(42); - - { - if (!debugger.load(fileName)) - { - wcerr << L"Unable to load " << fileName; - cin.get(); - } - else - debugger.start(); - } - - Magick::TerminateMagick(); - - _CrtCheckMemory(); -} diff --git a/Magick++/fuzz/ping_fuzzer.cc b/Magick++/fuzz/ping_fuzzer.cc deleted file mode 100644 index 0b418d528..000000000 --- a/Magick++/fuzz/ping_fuzzer.cc +++ /dev/null @@ -1,52 +0,0 @@ -#include -#include - -#include -#include - -#include "utils.cc" - -#define FUZZ_ENCODER_STRING_LITERAL_X(name) FUZZ_ENCODER_STRING_LITERAL(name) -#define FUZZ_ENCODER_STRING_LITERAL(name) #name - -#ifndef FUZZ_ENCODER -#define FUZZ_ENCODER FUZZ_ENCODER_STRING_LITERAL_X(FUZZ_IMAGEMAGICK_ENCODER) -#endif - -#ifndef FUZZ_IMAGEMAGICK_INITIALIZER -#define FUZZ_IMAGEMAGICK_INITIALIZER "" -#endif -#define FUZZ_ENCODER_INITIALIZER FUZZ_ENCODER_STRING_LITERAL_X(FUZZ_IMAGEMAGICK_INITIALIZER) - -static ssize_t EncoderInitializer(const uint8_t *Data, const size_t Size, Magick::Image &image) -{ - if (strcmp(FUZZ_ENCODER_INITIALIZER, "interlace") == 0) { - Magick::InterlaceType interlace = (Magick::InterlaceType) *reinterpret_cast(Data); - if (interlace > Magick::PNGInterlace) - return -1; - image.interlaceType(interlace); - return 1; - } - - return 0; -} - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - Magick::Image image; - const ssize_t offset = EncoderInitializer(Data, Size, image); - if (offset < 0) - return 0; - std::string encoder = FUZZ_ENCODER; - image.magick(encoder); - image.fileName(std::string(encoder) + ":"); - const Magick::Blob blob(Data + offset, Size - offset); - try { - image.ping(blob); - } - catch (Magick::Exception &e) { - return 0; - } - return 0; -} - -#include "travis.cc" diff --git a/Magick++/fuzz/rotate_fuzzer.cc b/Magick++/fuzz/rotate_fuzzer.cc deleted file mode 100644 index 205f91a96..000000000 --- a/Magick++/fuzz/rotate_fuzzer.cc +++ /dev/null @@ -1,27 +0,0 @@ -#include - -#include -#include - -#include "utils.cc" - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - if (Size < sizeof(double)) { - return 0; - } - double Degrees = *reinterpret_cast(Data); - if (!isfinite(Degrees)) { - return 0; - } - const Magick::Blob blob(Data + sizeof(Degrees), Size - sizeof(Degrees)); - Magick::Image image; - try { - image.read(blob); - image.rotate(Degrees); - } catch (Magick::Exception &e) { - return 0; - } - return 0; -} - -#include "travis.cc" diff --git a/Magick++/fuzz/travis.cc b/Magick++/fuzz/travis.cc deleted file mode 100644 index 11ee54735..000000000 --- a/Magick++/fuzz/travis.cc +++ /dev/null @@ -1,6 +0,0 @@ -#if BUILD_TRAVIS -int main() -{ - return LLVMFuzzerTestOneInput(0, 0); -} -#endif // BUILD_TRAVIS diff --git a/Magick++/fuzz/utils.cc b/Magick++/fuzz/utils.cc deleted file mode 100644 index 95b9ba026..000000000 --- a/Magick++/fuzz/utils.cc +++ /dev/null @@ -1,36 +0,0 @@ -#include -#include -#include - -#ifndef FUZZ_MAX_SIZE -#define FUZZ_MAX_SIZE 2048 -#endif - -class FuzzingInitializer { -public: - FuzzingInitializer() { - - // Disable SIMD in jpeg turbo. - (void) putenv(const_cast("JSIMD_FORCENONE=1")); - - Magick::InitializeMagick((const char *) NULL); - Magick::SecurityPolicy::anonymousCacheMemoryMap(); - Magick::SecurityPolicy::anonymousSystemMemoryMap(); - Magick::SecurityPolicy::maxMemoryRequest(256000000); - Magick::ResourceLimits::memory(1000000000); - Magick::ResourceLimits::map(500000000); - Magick::ResourceLimits::width(FUZZ_MAX_SIZE); - Magick::ResourceLimits::height(FUZZ_MAX_SIZE); - Magick::ResourceLimits::listLength(16); - } -}; - -FuzzingInitializer fuzzingInitializer; - -#if BUILD_MAIN -#include "encoder_format.h" - -EncoderFormat encoderFormat; - -#define FUZZ_ENCODER encoderFormat.get() -#endif // BUILD_MAIN diff --git a/Magick++/lib/Blob.cpp b/Magick++/lib/Blob.cpp deleted file mode 100644 index b3b70a8b6..000000000 --- a/Magick++/lib/Blob.cpp +++ /dev/null @@ -1,132 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2004 -// Copyright Dirk Lemstra 2013-2017 -// -// Implementation of Blob -// - -#define MAGICKCORE_IMPLEMENTATION 1 -#define MAGICK_PLUSPLUS_IMPLEMENTATION 1 - -#include "Magick++/Include.h" -#include "Magick++/Blob.h" -#include "Magick++/BlobRef.h" -#include "Magick++/Exception.h" - -#include - -Magick::Blob::Blob(void) - : _blobRef(new Magick::BlobRef(0,0)) -{ -} - -Magick::Blob::Blob(const void* data_,const size_t length_) - : _blobRef(new Magick::BlobRef(data_, length_)) -{ -} - -Magick::Blob::Blob(const Magick::Blob& blob_) - : _blobRef(blob_._blobRef) -{ - // Increase reference count - _blobRef->increase(); -} - -Magick::Blob::~Blob() -{ - try - { - if (_blobRef->decrease() == 0) - delete _blobRef; - } - catch(Magick::Exception&) - { - } - - _blobRef=(Magick::BlobRef *) NULL; -} - -Magick::Blob& Magick::Blob::operator=(const Magick::Blob& blob_) -{ - if (this != &blob_) - { - blob_._blobRef->increase(); - if (_blobRef->decrease() == 0) - delete _blobRef; - - _blobRef=blob_._blobRef; - } - return(*this); -} - -void Magick::Blob::base64(const std::string base64_) -{ - size_t - length; - - unsigned char - *decoded; - - decoded=Base64Decode(base64_.c_str(),&length); - - if(decoded) - updateNoCopy(static_cast(decoded),length, - Magick::Blob::MallocAllocator); -} - -std::string Magick::Blob::base64(void) const -{ - size_t - encoded_length; - - char - *encoded; - - std::string - result; - - encoded_length=0; - encoded=Base64Encode(static_cast(data()),length(), - &encoded_length); - - if(encoded) - { - result=std::string(encoded,encoded_length); - encoded=(char *) RelinquishMagickMemory(encoded); - return result; - } - - return(std::string()); -} - -const void* Magick::Blob::data(void) const -{ - return(_blobRef->data); -} - -size_t Magick::Blob::length(void) const -{ - return(_blobRef->length); -} - -void Magick::Blob::update(const void* data_,size_t length_) -{ - if (_blobRef->decrease() == 0) - delete _blobRef; - - _blobRef=new Magick::BlobRef(data_,length_); -} - -void Magick::Blob::updateNoCopy(void* data_,size_t length_, - Magick::Blob::Allocator allocator_) -{ - if (_blobRef->decrease() == 0) - delete _blobRef; - - _blobRef=new Magick::BlobRef((const void*) NULL,0); - _blobRef->data=data_; - _blobRef->length=length_; - _blobRef->allocator=allocator_; -} - diff --git a/Magick++/lib/BlobRef.cpp b/Magick++/lib/BlobRef.cpp deleted file mode 100644 index e85728b0d..000000000 --- a/Magick++/lib/BlobRef.cpp +++ /dev/null @@ -1,67 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2004 -// Copyright Dirk Lemstra 2014-2015 -// -// Implementation of Blob -// - -#define MAGICKCORE_IMPLEMENTATION 1 -#define MAGICK_PLUSPLUS_IMPLEMENTATION 1 - -#include "Magick++/Include.h" -#include "Magick++/BlobRef.h" -#include "Magick++/Exception.h" -#include "Magick++/Thread.h" - -#include - -Magick::BlobRef::BlobRef(const void* data_,const size_t length_) - : allocator(Magick::Blob::NewAllocator), - length(length_), - data((void*) NULL), - _mutexLock(), - _refCount(1) -{ - if (data_ != (const void*) NULL) - { - data=new unsigned char[length_]; - memcpy(data,data_,length_); - } -} - -Magick::BlobRef::~BlobRef(void) -{ - if (allocator == Magick::Blob::NewAllocator) - { - delete[] static_cast(data); - data=(void *) NULL; - } - else if (allocator == Magick::Blob::MallocAllocator) - data=(void *) RelinquishMagickMemory(data); -} - -size_t Magick::BlobRef::decrease() -{ - size_t - count; - - _mutexLock.lock(); - if (_refCount == 0) - { - _mutexLock.unlock(); - throwExceptionExplicit(MagickCore::OptionError, - "Invalid call to decrease"); - return(0); - } - count=--_refCount; - _mutexLock.unlock(); - return(count); -} - -void Magick::BlobRef::increase() -{ - _mutexLock.lock(); - _refCount++; - _mutexLock.unlock(); -} diff --git a/Magick++/lib/CoderInfo.cpp b/Magick++/lib/CoderInfo.cpp deleted file mode 100644 index 425eb2907..000000000 --- a/Magick++/lib/CoderInfo.cpp +++ /dev/null @@ -1,153 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 2001, 2002 -// Copyright Dirk Lemstra 2013-2015 -// -// CoderInfo implementation -// - -#define MAGICKCORE_IMPLEMENTATION 1 -#define MAGICK_PLUSPLUS_IMPLEMENTATION 1 - -#include "Magick++/Include.h" -#include "Magick++/CoderInfo.h" -#include "Magick++/Exception.h" - -using namespace std; - -Magick::CoderInfo::CoderInfo(void) - : _decoderThreadSupport(false), - _description(), - _encoderThreadSupport(false), - _isMultiFrame(false), - _isReadable(false), - _isWritable(false), - _mimeType(), - _module(), - _name() -{ -} - -Magick::CoderInfo::CoderInfo(const Magick::CoderInfo &coder_) - : _decoderThreadSupport(coder_._decoderThreadSupport), - _description(coder_._description), - _encoderThreadSupport(coder_._encoderThreadSupport), - _isMultiFrame(coder_._isMultiFrame), - _isReadable(coder_._isReadable), - _isWritable(coder_._isWritable), - _mimeType(coder_._mimeType), - _module(coder_._module), - _name(coder_._name) -{ -} - -Magick::CoderInfo::CoderInfo(const std::string &name_) - : _decoderThreadSupport(false), - _description(), - _encoderThreadSupport(false), - _isMultiFrame(false), - _isReadable(false), - _isWritable(false), - _mimeType(), - _module(), - _name() -{ - const Magick::MagickInfo - *magickInfo; - - GetPPException; - magickInfo=GetMagickInfo(name_.c_str(),exceptionInfo); - ThrowPPException(false); - if (magickInfo == 0) - throwExceptionExplicit(MagickCore::OptionError,"Coder not found", - name_.c_str()); - else - { - _decoderThreadSupport=(GetMagickDecoderThreadSupport(magickInfo) == - MagickTrue) ? true : false; - _description=std::string(magickInfo->description); - _encoderThreadSupport=(GetMagickEncoderThreadSupport(magickInfo) == - MagickTrue) ? true : false; - _isMultiFrame=(GetMagickAdjoin(magickInfo) == MagickTrue) ? true : false; - _isReadable=((magickInfo->decoder == (MagickCore::DecodeImageHandler *) - NULL) ? false : true); - _isWritable=((magickInfo->encoder == (MagickCore::EncodeImageHandler *) - NULL) ? false : true); - _mimeType=std::string(magickInfo->mime_type != (char *) NULL ? - magickInfo->mime_type : ""); - _module=std::string(magickInfo->magick_module); - _name=std::string(magickInfo->name); - } -} - -Magick::CoderInfo::~CoderInfo(void) -{ -} - -Magick::CoderInfo& Magick::CoderInfo::operator=(const CoderInfo &coder_) -{ - // If not being set to ourself - if (this != &coder_) - { - _decoderThreadSupport=coder_._decoderThreadSupport; - _description=coder_._description; - _encoderThreadSupport=coder_._encoderThreadSupport; - _isMultiFrame=coder_._isMultiFrame; - _isReadable=coder_._isReadable; - _isWritable=coder_._isWritable; - _mimeType=coder_._mimeType; - _module=coder_._module; - _name=coder_._name; - } - return(*this); -} - -bool Magick::CoderInfo::canReadMultithreaded(void) const -{ - return(_decoderThreadSupport); -} - -bool Magick::CoderInfo::canWriteMultithreaded(void) const -{ - return(_encoderThreadSupport); -} - -std::string Magick::CoderInfo::description(void) const -{ - return(_description); -} - -bool Magick::CoderInfo::isReadable(void) const -{ - return(_isReadable); -} - -bool Magick::CoderInfo::isWritable(void) const -{ - return(_isWritable); -} - -bool Magick::CoderInfo::isMultiFrame(void) const -{ - return(_isMultiFrame); -} - -std::string Magick::CoderInfo::mimeType(void) const -{ - return(_mimeType); -} - -std::string Magick::CoderInfo::module(void) const -{ - return(_module); -} - -std::string Magick::CoderInfo::name(void) const -{ - return(_name); -} - -bool Magick::CoderInfo::unregister(void) const -{ - return(UnregisterMagickInfo(_name.c_str()) != MagickFalse); -} diff --git a/Magick++/lib/Color.cpp b/Magick++/lib/Color.cpp deleted file mode 100644 index f9d597234..000000000 --- a/Magick++/lib/Color.cpp +++ /dev/null @@ -1,930 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003 -// Copyright Dirk Lemstra 2013-2018 -// -// Color Implementation -// - -#define MAGICKCORE_IMPLEMENTATION -#define MAGICK_PLUSPLUS_IMPLEMENTATION 1 - -#include "Magick++/Include.h" -#include - -using namespace std; - -#include "Magick++/Color.h" -#include "Magick++/Exception.h" - -MagickPPExport int Magick::operator == (const Magick::Color &left_, - const Magick::Color &right_) -{ -#if defined(MAGICKCORE_HDRI_SUPPORT) - return((left_.isValid() == right_.isValid()) && - (fabs(left_.quantumRed()-right_.quantumRed()) < MagickEpsilon) && - (fabs(left_.quantumGreen()-right_.quantumGreen()) < MagickEpsilon) && - (fabs(left_.quantumBlue()-right_.quantumBlue()) < MagickEpsilon)); -#else - return((left_.isValid() == right_.isValid()) && - (left_.quantumRed() == right_.quantumRed()) && - (left_.quantumGreen() == right_.quantumGreen()) && - (left_.quantumBlue() == right_.quantumBlue())); -#endif -} - -MagickPPExport int Magick::operator != (const Magick::Color &left_, - const Magick::Color &right_) -{ - return(!(left_ == right_)); -} - -MagickPPExport int Magick::operator > (const Magick::Color &left_, - const Magick::Color &right_) -{ - return(!(left_ < right_ ) && (left_ != right_ )); -} - -MagickPPExport int Magick::operator < ( const Magick::Color &left_, - const Magick::Color &right_) -{ - if(left_.quantumRed() < right_.quantumRed()) - return(true); - if(left_.quantumRed() > right_.quantumRed()) - return(false); - if(left_.quantumGreen() < right_.quantumGreen()) - return(true); - if(left_.quantumGreen() > right_.quantumGreen()) - return(false); - if(left_.quantumBlue() < right_.quantumBlue()) - return(true); - return(false); -} - -MagickPPExport int Magick::operator >= (const Magick::Color &left_, - const Magick::Color &right_) -{ - return((left_ > right_) || (left_ == right_)); -} - -MagickPPExport int Magick::operator <= ( const Magick::Color &left_, - const Magick::Color &right_) -{ - return((left_ < right_) || (left_ == right_)); -} - -Magick::Color::Color(void) - : _pixel(new PixelInfo), - _isValid(false), - _pixelOwn(true), - _pixelType(RGBAPixel) -{ - initPixel(); - - setAlpha(TransparentAlpha); -} - -Magick::Color::Color(const Magick::Quantum red_,const Magick::Quantum green_, - const Quantum blue_) - : _pixel(new PixelInfo), - _isValid(true), - _pixelOwn(true), - _pixelType(RGBPixel) -{ - initPixel(); - - quantumAlpha(OpaqueAlpha); - quantumBlack(0); - quantumBlue(blue_); - quantumGreen(green_); - quantumRed(red_); -} - -Magick::Color::Color(const Magick::Quantum red_,const Magick::Quantum green_, - const Magick::Quantum blue_, const Magick::Quantum alpha_) - : _pixel(new PixelInfo), - _isValid(true), - _pixelOwn(true), - _pixelType(RGBPixel) -{ - initPixel(); - - quantumAlpha(alpha_); - quantumBlack(0); - quantumBlue(blue_); - quantumGreen(green_); - quantumRed(red_); - if (alpha_ != OpaqueAlpha) - _pixelType=RGBAPixel; -} - -Magick::Color::Color(const Magick::Quantum cyan_,const Magick::Quantum magenta_, - const Magick::Quantum yellow_,const Magick::Quantum black_, - const Magick::Quantum alpha_) - : _pixel(new PixelInfo), - _isValid(true), - _pixelOwn(true), - _pixelType(CMYKPixel) -{ - initPixel(); - - quantumAlpha(alpha_); - quantumBlack(black_); - quantumBlue(yellow_); - quantumGreen(magenta_); - quantumRed(cyan_); - if (alpha_ != OpaqueAlpha) - _pixelType=CMYKAPixel; -} - -Magick::Color::Color(const char *color_) - : _pixel(new PixelInfo), - _isValid(true), - _pixelOwn(true), - _pixelType(RGBPixel) -{ - initPixel(); - - // Use operator = implementation - *this=color_; -} - -Magick::Color::Color(const Magick::Color &color_) - : _pixel(new PixelInfo), - _isValid(color_._isValid), - _pixelOwn(true), - _pixelType(color_._pixelType) -{ - *_pixel=*color_._pixel; -} - -Magick::Color::Color(const PixelInfo &color_) - : _pixel(new PixelInfo), - _isValid(true), - _pixelOwn(true) -{ - *_pixel=color_; - setPixelType(color_); -} - -Magick::Color::Color(const std::string &color_) - : _pixel(new PixelInfo), - _isValid(true), - _pixelOwn(true), - _pixelType(RGBPixel) -{ - initPixel(); - - // Use operator = implementation - *this=color_; -} - -Magick::Color::~Color(void) -{ - if (_pixelOwn) - delete _pixel; - - _pixel=(PixelInfo *)NULL; -} - -Magick::Color& Magick::Color::operator=(const Magick::Color& color_) -{ - // If not being set to ourself - if (this != &color_) - { - // Copy pixel value - *_pixel=*color_._pixel; - - // Validity - _isValid=color_._isValid; - - // Copy pixel type - _pixelType=color_._pixelType; - } - return(*this); -} - -const Magick::Color& Magick::Color::operator=(const char *color_) -{ - *this=std::string(color_); - return(*this); -} - -const Magick::Color& Magick::Color::operator=(const MagickCore::PixelInfo &color_) -{ - *_pixel=color_; - setPixelType(color_); - - return(*this); -} - -const Magick::Color& Magick::Color::operator=(const std::string &color_) -{ - PixelInfo - target_color; - - initPixel(); - GetPPException; - if (QueryColorCompliance(color_.c_str(),AllCompliance,&target_color, - exceptionInfo)) - { - quantumAlpha(target_color.alpha); - quantumBlack(target_color.black); - quantumBlue(target_color.blue); - quantumGreen(target_color.green); - quantumRed(target_color.red); - - setPixelType(target_color); - } - else - _isValid = false; - ThrowPPException(false); - - return(*this); -} - -Magick::Color::operator MagickCore::PixelInfo() const -{ - return *_pixel; -} - -Magick::Color::operator std::string() const -{ - char - colorbuf[MagickPathExtent]; - - PixelInfo - pixel; - - if (!isValid()) - return std::string("none"); - - pixel.colorspace=(_pixelType == RGBPixel || _pixelType == RGBAPixel) ? - sRGBColorspace : CMYKColorspace; - pixel.alpha_trait=(_pixelType == RGBAPixel || _pixelType == CMYKAPixel) ? - BlendPixelTrait : UndefinedPixelTrait; - pixel.depth=MAGICKCORE_QUANTUM_DEPTH; - pixel.alpha=_pixel->alpha; - pixel.alpha_trait=_pixel->alpha_trait; - pixel.black=_pixel->black; - pixel.blue=_pixel->blue; - pixel.green=_pixel->green; - pixel.red=_pixel->red; - GetColorTuple(&pixel,MagickTrue,colorbuf); - - return(std::string(colorbuf)); -} - -bool Magick::Color::isFuzzyEquivalent(const Color &color_, const double fuzz_) const -{ - PixelInfo - p, - q; - - p=*_pixel; - p.fuzz=fuzz_; - q=*color_._pixel; - q.fuzz=fuzz_; - return (IsFuzzyEquivalencePixelInfo(&p, &q) != MagickFalse); -} - -bool Magick::Color::isValid(void) const -{ - return(_isValid); -} - -Magick::Color::PixelType Magick::Color::pixelType() const -{ - return(_pixelType); -} - -void Magick::Color::isValid(bool valid_) -{ - if (bool(valid_) == bool(isValid())) - return; - - if (!_pixelOwn) - { - _pixel=new PixelInfo; - _pixelOwn=true; - } - - _isValid=valid_; - - initPixel(); -} - -void Magick::Color::quantumAlpha(const Magick::Quantum alpha_) -{ - setAlpha(alpha_); - _isValid=true; -} - -Magick::Quantum Magick::Color::quantumAlpha(void) const -{ - return(_pixel->alpha); -} - -void Magick::Color::quantumBlack(const Magick::Quantum black_) -{ - _pixel->black=black_; - _isValid=true; -} - -Magick::Quantum Magick::Color::quantumBlack(void) const -{ - return(_pixel->black); -} - -void Magick::Color::quantumBlue(const Magick::Quantum blue_) -{ - _pixel->blue=blue_; - _isValid=true; -} - -Magick::Quantum Magick::Color::quantumBlue(void) const -{ - return(_pixel->blue); -} - -void Magick::Color::quantumGreen(const Magick::Quantum green_) -{ - _pixel->green=green_; - _isValid=true; -} - -Magick::Quantum Magick::Color::quantumGreen(void) const -{ - return(_pixel->green); -} - -void Magick::Color::quantumRed(const Magick::Quantum red_) -{ - _pixel->red=red_; - _isValid=true; -} - -Magick::Quantum Magick::Color::quantumRed(void) const -{ - return _pixel->red; -} - -Magick::Color::Color(PixelType pixelType_) - : _pixel(new PixelInfo), - _isValid(false), - _pixelOwn(true), - _pixelType(pixelType_) -{ - initPixel(); -} - -Magick::Color::Color(PixelInfo* rep_,PixelType pixelType_) - : _pixel(rep_), - _isValid(true), - _pixelOwn(false), - _pixelType(pixelType_) -{ -} - -void Magick::Color::pixel(PixelInfo *rep_,PixelType pixelType_) -{ - if (_pixelOwn) - delete _pixel; - - _pixel=rep_; - _pixelOwn=false; - _isValid=true; - _pixelType=pixelType_; -} - -Magick::Quantum Magick::Color::scaleDoubleToQuantum(const double double_) -{ - return(static_cast(double_*QuantumRange)); -} - -double Magick::Color::scaleQuantumToDouble(const Magick::Quantum quantum_) -{ -#if (MAGICKCORE_QUANTUM_DEPTH < 32) && (MAGICKCORE_SIZEOF_FLOAT_T != MAGICKCORE_SIZEOF_DOUBLE || !defined(MAGICKCORE_HDRI_SUPPORT)) - return(static_cast(QuantumScale*quantum_)); -#else - return(QuantumScale*quantum_); -#endif -} - -void Magick::Color::initPixel() -{ - MagickCore::GetPixelInfo((MagickCore::Image *) NULL, _pixel); - if (_pixelType == CMYKPixel || _pixelType == CMYKAPixel) - _pixel->colorspace=CMYKColorspace; -} - -void Magick::Color::setAlpha(const Magick::Quantum alpha_) -{ - _pixel->alpha=alpha_; - if (alpha_ == OpaqueAlpha) - { - _pixel->alpha_trait=UndefinedPixelTrait; - if (_pixelType == RGBAPixel) - _pixelType=RGBPixel; - else if (_pixelType == CMYKAPixel) - _pixelType=CMYKPixel; - } - else - { - _pixel->alpha_trait=BlendPixelTrait; - if (_pixelType == RGBPixel) - _pixelType=RGBAPixel; - else if (_pixelType == CMYKPixel) - _pixelType=CMYKAPixel; - } -} - -void Magick::Color::setPixelType(const PixelInfo &color_) -{ - if (color_.colorspace == CMYKColorspace) - _pixelType=color_.alpha_trait != UndefinedPixelTrait ? CMYKAPixel : - CMYKPixel; - else - _pixelType=color_.alpha_trait != UndefinedPixelTrait ? RGBAPixel : - RGBPixel; -} - -Magick::ColorCMYK::ColorCMYK(void) - : Color(CMYKPixel) -{ -} - -Magick::ColorCMYK::ColorCMYK(const Magick::Color &color_) - : Color(color_) -{ -} - -Magick::ColorCMYK::ColorCMYK(const double cyan_,const double magenta_, - const double yellow_,const double black_) - : Color(CMYKPixel) -{ - cyan(cyan_); - magenta(magenta_); - yellow(yellow_); - black(black_); -} - -Magick::ColorCMYK::ColorCMYK(const double cyan_,const double magenta_, - const double yellow_,const double black_,const double alpha_) - : Color(CMYKAPixel) -{ - cyan(cyan_); - magenta(magenta_); - yellow(yellow_); - black(black_); - alpha(alpha_); -} - -Magick::ColorCMYK::~ColorCMYK(void) -{ -} - -Magick::ColorCMYK& Magick::ColorCMYK::operator=(const Magick::Color& color_) -{ - *static_cast(this)=color_; - return(*this); -} - -void Magick::ColorCMYK::alpha(const double alpha_) -{ - quantumAlpha(scaleDoubleToQuantum(alpha_)); -} - -double Magick::ColorCMYK::alpha(void) const -{ - return(scaleQuantumToDouble(quantumAlpha())); -} - -void Magick::ColorCMYK::black(const double black_) -{ - quantumBlack(scaleDoubleToQuantum(black_)); -} - -double Magick::ColorCMYK::black(void) const -{ - return(scaleQuantumToDouble(quantumBlack())); -} - -void Magick::ColorCMYK::cyan(const double cyan_) -{ - quantumRed(scaleDoubleToQuantum(cyan_)); -} - -double Magick::ColorCMYK::cyan(void) const -{ - return(scaleQuantumToDouble(quantumRed())); -} - -void Magick::ColorCMYK::magenta(const double magenta_) -{ - quantumGreen(scaleDoubleToQuantum(magenta_)); -} - -double Magick::ColorCMYK::magenta(void) const -{ - return(scaleQuantumToDouble(quantumGreen())); -} - -void Magick::ColorCMYK::yellow(const double yellow_) -{ - quantumBlue(scaleDoubleToQuantum(yellow_)); -} - -double Magick::ColorCMYK::yellow(void) const -{ - return(scaleQuantumToDouble(quantumBlue())); -} - -Magick::ColorCMYK::ColorCMYK(PixelInfo *rep_,PixelType pixelType_) - : Color(rep_,pixelType_) -{ -} - -Magick::ColorGray::ColorGray(void) - : Color(RGBPixel) -{ -} - -Magick::ColorGray::ColorGray(const Magick::Color & color_) - : Color(color_) -{ -} - -Magick::ColorGray::ColorGray(double shade_) - : Color(scaleDoubleToQuantum(shade_),scaleDoubleToQuantum(shade_), - scaleDoubleToQuantum(shade_)) -{ -} - -Magick::ColorGray::~ColorGray() -{ -} - -void Magick::ColorGray::shade(double shade_) -{ - Quantum gray=scaleDoubleToQuantum(shade_); - quantumRed(gray); - quantumGreen(gray); - quantumBlue(gray); -} - -double Magick::ColorGray::shade(void) const -{ - return(scaleQuantumToDouble(quantumGreen())); -} - -Magick::ColorGray& Magick::ColorGray::operator=(const Magick::Color& color_) -{ - *static_cast(this)=color_; - return(*this); -} - -Magick::ColorGray::ColorGray(PixelInfo *rep_,PixelType pixelType_) -: Color(rep_,pixelType_) -{ -} - -Magick::ColorHSL::ColorHSL(void) - : Color(RGBPixel) -{ -} - -Magick::ColorHSL::ColorHSL(const Magick::Color &color_) - : Color(color_) -{ -} - -Magick::ColorHSL::ColorHSL(const double hue_,const double saturation_, - const double lightness_) - : Color(RGBPixel) -{ - double - blue, - green, - red; - - ConvertHSLToRGB(hue_,saturation_,lightness_,&red,&green,&blue); - - quantumRed(red); - quantumGreen(green); - quantumBlue(blue); -} - -Magick::ColorHSL::~ColorHSL() -{ -} - -Magick::ColorHSL& Magick::ColorHSL::operator=(const Magick::Color& color_) -{ - *static_cast(this) = color_; - return(*this); -} - -void Magick::ColorHSL::hue(const double hue_) -{ - double - hue, - lightness, - saturation; - - double - blue, - green, - red; - - ConvertRGBToHSL(quantumRed(),quantumGreen(),quantumBlue(),&hue,&saturation, - &lightness); - - hue=hue_; - - ConvertHSLToRGB(hue,saturation,lightness,&red,&green,&blue); - - quantumRed(ClampToQuantum(red)); - quantumGreen(ClampToQuantum(green)); - quantumBlue(ClampToQuantum(blue)); -} - -double Magick::ColorHSL::hue(void) const -{ - double - hue, - lightness, - saturation; - - ConvertRGBToHSL(quantumRed(),quantumGreen(),quantumBlue(),&hue,&saturation, - &lightness); - - return(hue); -} - -void Magick::ColorHSL::lightness (const double lightness_) -{ - double - hue, - lightness, - saturation; - - double - blue, - green, - red; - - ConvertRGBToHSL(quantumRed(),quantumGreen(),quantumBlue(),&hue,&saturation, - &lightness); - - lightness=lightness_; - - ConvertHSLToRGB(hue,saturation,lightness,&red,&green,&blue); - - quantumRed(ClampToQuantum(red)); - quantumGreen(ClampToQuantum(green)); - quantumBlue(ClampToQuantum(blue)); -} - -double Magick::ColorHSL::lightness (void) const -{ - double - hue, - lightness, - saturation; - - ConvertRGBToHSL(quantumRed(),quantumGreen(),quantumBlue(),&hue,&saturation, - &lightness); - - return(lightness); -} - -void Magick::ColorHSL::saturation(const double saturation_) -{ - double - hue, - lightness, - saturation; - - double - blue, - green, - red; - - ConvertRGBToHSL(quantumRed(),quantumGreen(),quantumBlue(),&hue,&saturation, - &lightness); - - saturation=saturation_; - - ConvertHSLToRGB(hue,saturation,lightness,&red,&green,&blue); - - quantumRed(ClampToQuantum(red)); - quantumGreen(ClampToQuantum(green)); - quantumBlue(ClampToQuantum(blue)); -} - -double Magick::ColorHSL::saturation(void) const -{ - double - hue, - lightness, - saturation; - - ConvertRGBToHSL(quantumRed(),quantumGreen(),quantumBlue(),&hue,&saturation, - &lightness); - - return(saturation); -} - -Magick::ColorMono::ColorMono(void) - : Color(RGBPixel) -{ -} - -Magick::ColorMono::ColorMono(const bool mono_) - : Color((mono_ ? QuantumRange : 0),(mono_ ? QuantumRange : 0), - (mono_ ? QuantumRange : 0)) -{ -} - -Magick::ColorMono::ColorMono(const Magick::Color &color_) - : Color(color_) -{ -} - -Magick::ColorMono::~ColorMono() -{ -} - -Magick::ColorMono& Magick::ColorMono::operator=(const Magick::Color& color_) -{ - *static_cast(this)=color_; - return(*this); -} - -void Magick::ColorMono::mono(bool mono_) -{ - quantumRed(mono_ ? QuantumRange : 0); - quantumGreen(mono_ ? QuantumRange : 0); - quantumBlue(mono_ ? QuantumRange : 0); -} - -bool Magick::ColorMono::mono(void) const -{ - return(quantumGreen() == 0); -} - -Magick::ColorMono::ColorMono(PixelInfo *rep_,PixelType pixelType_) - : Color(rep_,pixelType_) -{ -} - -Magick::ColorRGB::ColorRGB(void) - : Color(RGBPixel) -{ -} - -Magick::ColorRGB::ColorRGB(const Magick::Color &color_) - : Color(color_) -{ -} - -Magick::ColorRGB::ColorRGB(const double red_,const double green_, - const double blue_) - : Color(scaleDoubleToQuantum(red_),scaleDoubleToQuantum(green_), - scaleDoubleToQuantum(blue_)) -{ -} - -Magick::ColorRGB::ColorRGB(const double red_,const double green_, - const double blue_,const double alpha_) - : Color(scaleDoubleToQuantum(red_),scaleDoubleToQuantum(green_), - scaleDoubleToQuantum(blue_),scaleDoubleToQuantum(alpha_)) -{ -} - -Magick::ColorRGB::~ColorRGB(void) -{ -} - -Magick::ColorRGB& Magick::ColorRGB::operator=(const Magick::Color& color_) -{ - *static_cast(this)=color_; - return(*this); -} - -void Magick::ColorRGB::alpha(const double alpha_) -{ - quantumAlpha(scaleDoubleToQuantum(alpha_)); -} - -double Magick::ColorRGB::alpha(void) const -{ - return(scaleQuantumToDouble(quantumAlpha())); -} - -void Magick::ColorRGB::blue(const double blue_) -{ - quantumBlue(scaleDoubleToQuantum(blue_)); -} - -double Magick::ColorRGB::blue(void) const -{ - return(scaleQuantumToDouble(quantumBlue())); -} - -void Magick::ColorRGB::green(const double green_) -{ - quantumGreen(scaleDoubleToQuantum(green_)); -} - -double Magick::ColorRGB::green(void) const -{ - return(scaleQuantumToDouble(quantumGreen())); -} - -void Magick::ColorRGB::red(const double red_) -{ - quantumRed(scaleDoubleToQuantum(red_)); -} - -double Magick::ColorRGB::red(void) const -{ - return(scaleQuantumToDouble(quantumRed())); -} - -Magick::ColorRGB::ColorRGB(PixelInfo *rep_,PixelType pixelType_) - : Color(rep_,pixelType_) -{ -} - -Magick::ColorYUV::ColorYUV(void) - : Color(RGBPixel) -{ -} - -Magick::ColorYUV::ColorYUV(const Magick::Color &color_) - : Color(color_) -{ -} - -Magick::ColorYUV::ColorYUV(const double y_,const double u_,const double v_) - : Color(RGBPixel) -{ - convert(y_, u_, v_); -} - -Magick::ColorYUV::~ColorYUV(void) -{ -} - -Magick::ColorYUV& Magick::ColorYUV::operator=(const Magick::Color &color_) -{ - *static_cast(this)=color_; - return(*this); -} - -void Magick::ColorYUV::u(const double u_) -{ - convert(y(), u_, v()); -} - -double Magick::ColorYUV::u(void) const -{ - return(scaleQuantumToDouble((-0.14740 * quantumRed()) - (0.28950 * - quantumGreen()) + (0.43690 * quantumBlue()))); -} - -void Magick::ColorYUV::v(const double v_) -{ - convert(y(), u(), v_); -} - -double Magick::ColorYUV::v(void) const -{ - return(scaleQuantumToDouble((0.61500 * quantumRed()) - (0.51500 * - quantumGreen()) - (0.10000 * quantumBlue()))); -} - -void Magick::ColorYUV::y(const double y_) -{ - convert(y_, u(), v()); -} - -double Magick::ColorYUV::y ( void ) const -{ - return(scaleQuantumToDouble((0.29900 * quantumRed()) + (0.58700 * - quantumGreen()) + (0.11400 * quantumBlue()))); -} - -void Magick::ColorYUV::convert(const double y_,const double u_,const double v_) -{ - quantumRed(scaleDoubleToQuantum(y_ + 1.13980 * v_)); - quantumGreen(scaleDoubleToQuantum(y_ - (0.39380 * u_) - (0.58050 * v_))); - quantumBlue(scaleDoubleToQuantum(y_ + 2.02790 * u_)); -} - -Magick::ColorYUV::ColorYUV(PixelInfo *rep_,PixelType pixelType_) - : Color(rep_,pixelType_) -{ -} diff --git a/Magick++/lib/Drawable.cpp b/Magick++/lib/Drawable.cpp deleted file mode 100644 index 58a4fa13f..000000000 --- a/Magick++/lib/Drawable.cpp +++ /dev/null @@ -1,2500 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003 -// Copyright Dirk Lemstra 2014-2017 -// -// Implementation of Drawable (Graphic objects) -// - -#define MAGICKCORE_IMPLEMENTATION 1 -#define MAGICK_PLUSPLUS_IMPLEMENTATION 1 -#define MAGICK_DRAWABLE_IMPLEMENTATION - -#include "Magick++/Include.h" -#include -#include - -#include "Magick++/Drawable.h" -#include "Magick++/Image.h" - -using namespace std; - -MagickPPExport int Magick::operator == (const Magick::Coordinate& left_, - const Magick::Coordinate& right_) -{ - return((left_.x() == right_.x()) && (left_.y() == right_.y())); -} - -MagickPPExport int Magick::operator != (const Magick::Coordinate& left_, - const Magick::Coordinate& right_) -{ - return(!(left_ == right_)); -} - -MagickPPExport int Magick::operator > (const Magick::Coordinate& left_, - const Magick::Coordinate& right_) -{ - return (!(left_ < right_) && (left_ != right_)); -} - -MagickPPExport int Magick::operator < (const Magick::Coordinate& left_, - const Magick::Coordinate& right_) -{ - // Based on distance from origin - return((sqrt(left_.x()*left_.x() + left_.y()*left_.y())) < - (sqrt(right_.x()*right_.x() + right_.y()*right_.y()))); -} - -MagickPPExport int Magick::operator >= (const Magick::Coordinate& left_, - const Magick::Coordinate& right_) -{ - return((left_ > right_) || (left_ == right_)); -} - -MagickPPExport int Magick::operator <= (const Magick::Coordinate& left_, - const Magick::Coordinate& right_) -{ - return((left_ < right_) || (left_ == right_)); -} - -/* DrawableBase */ -Magick::DrawableBase::DrawableBase() -{ -} - -Magick::DrawableBase::~DrawableBase(void) -{ -} - -void Magick::DrawableBase::operator()(MagickCore::DrawingWand * context_) const -{ - (void) context_; -} - -Magick::DrawableBase* Magick::DrawableBase::copy() const -{ - return new DrawableBase(*this); -} - -/* Drawable */ -Magick::Drawable::Drawable(void) - : dp((Magick::DrawableBase *) NULL) -{ -} - -Magick::Drawable::Drawable(const Magick::DrawableBase& original_) - : dp(original_.copy()) -{ -} - -Magick::Drawable::~Drawable(void) -{ - delete dp; - dp=(Magick::DrawableBase *) NULL; -} - -Magick::Drawable::Drawable(const Magick::Drawable& original_) - : dp((original_.dp != (Magick::DrawableBase *) NULL ? original_.dp->copy() : - (Magick::DrawableBase *) NULL)) -{ -} - -Magick::Drawable& Magick::Drawable::operator= ( - const Magick::Drawable& original_) -{ - DrawableBase - *temp_dp; - - if (this != &original_) - { - temp_dp=(original_.dp != (Magick::DrawableBase *) NULL ? - original_.dp->copy() : (Magick::DrawableBase *) NULL); - delete dp; - dp=temp_dp; - } - return(*this); -} - -void Magick::Drawable::operator()(MagickCore::DrawingWand * context_) const -{ - if (dp != (Magick::DrawableBase *) NULL) - dp->operator()(context_); -} - -/*virtual*/ -Magick::VPathBase::~VPathBase ( void ) -{ -} - -// Constructor -Magick::VPath::VPath ( void ) - : dp(0) -{ -} - -// Construct from VPathBase -Magick::VPath::VPath ( const Magick::VPathBase& original_ ) - : dp(original_.copy()) -{ -} - -// Destructor -/* virtual */ Magick::VPath::~VPath ( void ) -{ - delete dp; - dp = 0; -} - -// Copy constructor -Magick::VPath::VPath ( const Magick::VPath& original_ ) - : dp(original_.dp? original_.dp->copy(): 0) -{ -} - -// Assignment operator -Magick::VPath& Magick::VPath::operator= (const Magick::VPath& original_ ) -{ - if (this != &original_) - { - VPathBase* temp_dp = (original_.dp ? original_.dp->copy() : 0); - delete dp; - dp = temp_dp; - } - return *this; -} - -// Operator to invoke contained object -void Magick::VPath::operator()( MagickCore::DrawingWand * context_ ) const -{ - if(dp) - dp->operator()( context_ ); -} - -// -// Drawable Objects -// - -// Affine (scaling, rotation, and translation) -Magick::DrawableAffine::DrawableAffine( double sx_, double sy_, - double rx_, double ry_, - double tx_, double ty_ ) -{ - _affine.sx = sx_; - _affine.rx = rx_; - _affine.ry = ry_; - _affine.sy = sy_; - _affine.tx = tx_; - _affine.ty = ty_; -} -Magick::DrawableAffine::DrawableAffine( void ) -{ - GetAffineMatrix(&_affine); -} -Magick::DrawableAffine::~DrawableAffine( void ) -{ -} -void Magick::DrawableAffine::operator()( MagickCore::DrawingWand * context_ ) const -{ - DrawAffine( context_, &_affine ); -} -Magick::DrawableBase* Magick::DrawableAffine::copy() const -{ - return new DrawableAffine(*this); -} - -Magick::DrawableAlpha::~DrawableAlpha(void) -{ -} - -void Magick::DrawableAlpha::operator()(MagickCore::DrawingWand * context_) const -{ - DrawAlpha(context_,_x,_y,_paintMethod); -} - -Magick::DrawableBase* Magick::DrawableAlpha::copy() const -{ - return new DrawableAlpha(*this); -} - -// Arc -Magick::DrawableArc::~DrawableArc( void ) -{ -} -void Magick::DrawableArc::operator()( MagickCore::DrawingWand * context_ ) const -{ - DrawArc( context_, _startX, _startY, _endX, _endY, _startDegrees, _endDegrees ); -} -Magick::DrawableBase* Magick::DrawableArc::copy() const -{ - return new DrawableArc(*this); -} - -// -// Bezier curve -// -// Construct from coordinates (Coordinate list must contain at least three members) -Magick::DrawableBezier::DrawableBezier ( const CoordinateList &coordinates_ ) - : _coordinates(coordinates_) -{ -} -// Copy constructor -Magick::DrawableBezier::DrawableBezier( const Magick::DrawableBezier& original_ ) - : DrawableBase (original_), - _coordinates(original_._coordinates) -{ -} -// Destructor -Magick::DrawableBezier::~DrawableBezier( void ) -{ -} -void Magick::DrawableBezier::operator()( MagickCore::DrawingWand * context_ ) const -{ - size_t num_coords = (size_t) _coordinates.size(); - PointInfo *coordinates = new PointInfo[num_coords]; - - PointInfo *q = coordinates; - CoordinateList::const_iterator p = _coordinates.begin(); - - while( p != _coordinates.end() ) - { - q->x = p->x(); - q->y = p->y(); - q++; - p++; - } - - DrawBezier( context_, num_coords, coordinates ); - delete [] coordinates; -} -Magick::DrawableBase* Magick::DrawableBezier::copy() const -{ - return new DrawableBezier(*this); -} - - -/* DrawableBorderColor */ -Magick::DrawableBorderColor::DrawableBorderColor(const Magick::Color &color_) - : _color(color_) -{ -} - -Magick::DrawableBorderColor::DrawableBorderColor - (const Magick::DrawableBorderColor &original_) - : DrawableBase(original_), - _color(original_._color) -{ -} - -Magick::DrawableBorderColor::~DrawableBorderColor(void) -{ -} - -void Magick::DrawableBorderColor::operator()( - MagickCore::DrawingWand *context_) const -{ - PixelInfo - color; - - PixelWand - *pixel_wand; - - color=static_cast(_color); - pixel_wand=NewPixelWand(); - PixelSetPixelColor(pixel_wand,&color); - DrawSetBorderColor(context_,pixel_wand); - pixel_wand=DestroyPixelWand(pixel_wand); -} - -void Magick::DrawableBorderColor::color(const Color &color_) -{ - _color=color_; -} - -Magick::Color Magick::DrawableBorderColor::color(void) const -{ - return(_color); -} - -Magick::DrawableBase* Magick::DrawableBorderColor::copy() const -{ - return(new DrawableBorderColor(*this)); -} - - -/* DrawableClipRule */ -Magick::DrawableClipRule::DrawableClipRule(const FillRule fillRule_) -{ - _fillRule=fillRule_; -} - -Magick::DrawableClipRule::~DrawableClipRule(void) -{ -} - -void Magick::DrawableClipRule::operator()( - MagickCore::DrawingWand * context_) const -{ - DrawSetClipRule(context_,_fillRule); -} - -void Magick::DrawableClipRule::fillRule(const FillRule fillRule_) -{ - _fillRule=fillRule_; -} - -Magick::FillRule Magick::DrawableClipRule::fillRule(void) const -{ - return(_fillRule); -} - -Magick::DrawableBase* Magick::DrawableClipRule::copy() const -{ - return(new DrawableClipRule(*this)); -} - - -/* DrawableClipUnits */ -Magick::DrawableClipUnits::DrawableClipUnits(const ClipPathUnits units_) -{ - _units = units_; -} - -Magick::DrawableClipUnits::~DrawableClipUnits(void) -{ -} - -void Magick::DrawableClipUnits::operator()( - MagickCore::DrawingWand * context_) const -{ - DrawSetClipUnits(context_, _units); -} - -void Magick::DrawableClipUnits::units(const ClipPathUnits units_) -{ - _units = units_; -} - -Magick::ClipPathUnits Magick::DrawableClipUnits::units(void) const -{ - return(_units); -} - -Magick::DrawableBase* Magick::DrawableClipUnits::copy() const -{ - return(new DrawableClipUnits(*this)); -} - - -// -//Clip Path -// - -// Pop (terminate) Clip path definition -Magick::DrawablePopClipPath::~DrawablePopClipPath ( void ) -{ -} -void Magick::DrawablePopClipPath::operator() ( MagickCore::DrawingWand * context_ ) const -{ - DrawPopClipPath( context_ ); - DrawPopDefs(context_); -} -Magick::DrawableBase* Magick::DrawablePopClipPath::copy() const -{ - return new DrawablePopClipPath(*this); -} - -// Push clip path definition -Magick::DrawablePushClipPath::DrawablePushClipPath( const std::string &id_) - : _id(id_.c_str()) //multithread safe const char* -{ -} -Magick::DrawablePushClipPath::DrawablePushClipPath -( const Magick::DrawablePushClipPath& original_ ) //multithread safe const char* - : DrawableBase (original_), - _id(original_._id.c_str()) -{ -} -Magick::DrawablePushClipPath::~DrawablePushClipPath( void ) -{ -} -void Magick::DrawablePushClipPath::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - DrawPushDefs(context_); - DrawPushClipPath( context_, _id.c_str()); -} -Magick::DrawableBase* Magick::DrawablePushClipPath::copy() const -{ - return new DrawablePushClipPath(*this); -} -// -// ClipPath -// -Magick::DrawableClipPath::DrawableClipPath( const std::string &id_ ) -:_id(id_.c_str()) -{ -} - -Magick::DrawableClipPath::DrawableClipPath ( const Magick::DrawableClipPath& original_ ) - : DrawableBase (original_), - _id(original_._id.c_str()) -{ -} -Magick::DrawableClipPath::~DrawableClipPath( void ) -{ -} -void Magick::DrawableClipPath::operator()( MagickCore::DrawingWand * context_ ) const -{ - (void) DrawSetClipPath( context_, _id.c_str()); -} -Magick::DrawableBase* Magick::DrawableClipPath::copy() const -{ - return new DrawableClipPath(*this); -} - -// Circle -Magick::DrawableCircle::~DrawableCircle ( void ) -{ -} -void Magick::DrawableCircle::operator()( MagickCore::DrawingWand * context_ ) const -{ - DrawCircle( context_, _originX, _originY, _perimX, _perimY ); -} -Magick::DrawableBase* Magick::DrawableCircle::copy() const -{ - return new DrawableCircle(*this); -} - -// Colorize at point using PaintMethod -Magick::DrawableColor::~DrawableColor( void ) -{ -} -void Magick::DrawableColor::operator()( MagickCore::DrawingWand * context_ ) const -{ - DrawColor( context_, _x, _y, _paintMethod ); -} -Magick::DrawableBase* Magick::DrawableColor::copy() const -{ - return new DrawableColor(*this); -} - -// Draw image at point -Magick::DrawableCompositeImage::DrawableCompositeImage -( double x_, double y_, - double width_, double height_, - const std::string &filename_, - Magick::CompositeOperator composition_ ) - : _composition(composition_), - _x(x_), - _y(y_), - _width(width_), - _height(height_), - _image(new Image(filename_)) -{ -} -Magick::DrawableCompositeImage::DrawableCompositeImage -( double x_, double y_, - double width_, double height_, - const Magick::Image &image_, - Magick::CompositeOperator composition_ ) - : _composition(composition_), - _x(x_), - _y(y_), - _width(width_), - _height(height_), - _image(new Image(image_)) -{ -} -Magick::DrawableCompositeImage::DrawableCompositeImage -( double x_, double y_, - double width_, double height_, - const std::string &filename_ ) - :_composition(CopyCompositeOp), - _x(x_), - _y(y_), - _width(width_), - _height(height_), - _image(new Image(filename_)) -{ -} -Magick::DrawableCompositeImage::DrawableCompositeImage -( double x_, double y_, - double width_, double height_, - const Magick::Image &image_ ) - :_composition(CopyCompositeOp), - _x(x_), - _y(y_), - _width(width_), - _height(height_), - _image(new Image(image_)) -{ -} -Magick::DrawableCompositeImage::DrawableCompositeImage -( double x_, double y_, - const std::string &filename_ ) - : _composition(CopyCompositeOp), - _x(x_), - _y(y_), - _width(0), - _height(0), - _image(new Image(filename_)) -{ - _width=_image->columns(); - _height=_image->rows(); -} -Magick::DrawableCompositeImage::DrawableCompositeImage -( double x_, double y_, - const Magick::Image &image_ ) - : _composition(CopyCompositeOp), - _x(x_), - _y(y_), - _width(0), - _height(0), - _image(new Image(image_)) -{ - _width=_image->columns(); - _height=_image->rows(); -} -// Copy constructor -Magick::DrawableCompositeImage::DrawableCompositeImage -( const Magick::DrawableCompositeImage& original_ ) - : Magick::DrawableBase(original_), - _composition(original_._composition), - _x(original_._x), - _y(original_._y), - _width(original_._width), - _height(original_._height), - _image(new Image(*original_._image)) -{ -} -Magick::DrawableCompositeImage::~DrawableCompositeImage( void ) -{ - delete _image; -} -// Assignment operator -Magick::DrawableCompositeImage& Magick::DrawableCompositeImage::operator= -(const Magick::DrawableCompositeImage& original_ ) -{ - // If not being set to ourself - if ( this != &original_ ) - { - _composition = original_._composition; - _x = original_._x; - _y = original_._y; - _width = original_._width; - _height = original_._height; - Image* temp_image = new Image(*original_._image); - delete _image; - _image = temp_image; - } - return *this; -} -void Magick::DrawableCompositeImage::filename( const std::string &filename_ ) -{ - Image* temp_image = new Image(filename_); - delete _image; - _image = temp_image; -} -std::string Magick::DrawableCompositeImage::filename( void ) const -{ - return _image->fileName(); -} - -void Magick::DrawableCompositeImage::image( const Magick::Image &image_ ) -{ - Image* temp_image = new Image(image_); - delete _image; - _image = temp_image; -} -Magick::Image Magick::DrawableCompositeImage::image( void ) const -{ - return *_image; -} - -// Specify image format used to output Base64 inlined image data. -void Magick::DrawableCompositeImage::magick( std::string magick_ ) -{ - _image->magick( magick_ ); -} -std::string Magick::DrawableCompositeImage::magick( void ) -{ - return _image->magick(); -} - -void Magick::DrawableCompositeImage::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - MagickWand - *magick_wand; - - magick_wand=NewMagickWandFromImage(_image->constImage()); - (void) DrawComposite( context_, _composition, _x, _y, _width, _height, - magick_wand ); - magick_wand=DestroyMagickWand(magick_wand); -} - -Magick::DrawableBase* Magick::DrawableCompositeImage::copy() const -{ - return new DrawableCompositeImage(*this); -} - -Magick::DrawableDensity::DrawableDensity(const Point &density_) - : _density(density_) -{ -} - -Magick::DrawableDensity::DrawableDensity(const std::string &density_) - : _density(density_) -{ -} - -Magick::DrawableDensity::~DrawableDensity(void) -{ -} - -void Magick::DrawableDensity::operator()( - MagickCore::DrawingWand *context_) const -{ - DrawSetDensity(context_,_density.c_str()); -} - -Magick::DrawableBase* Magick::DrawableDensity::copy() const -{ - return(new DrawableDensity(*this)); -} - -// Ellipse -Magick::DrawableEllipse::~DrawableEllipse( void ) -{ -} -void Magick::DrawableEllipse::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - DrawEllipse( context_, _originX, _originY, _radiusX, _radiusY, - _arcStart, _arcEnd ); -} -Magick::DrawableBase* Magick::DrawableEllipse::copy() const -{ - return new DrawableEllipse(*this); -} - -// Specify drawing fill color -Magick::DrawableFillColor::DrawableFillColor( const Magick::Color &color_ ) - : _color(color_) -{ -} -Magick::DrawableFillColor::DrawableFillColor -( const Magick::DrawableFillColor& original_ ) - : DrawableBase (original_), - _color(original_._color) -{ -} -Magick::DrawableFillColor::~DrawableFillColor( void ) -{ -} -void Magick::DrawableFillColor::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - PixelInfo color = static_cast(_color); - PixelWand *pixel_wand=NewPixelWand(); - PixelSetPixelColor(pixel_wand,&color); - DrawSetFillColor(context_,pixel_wand); - pixel_wand=DestroyPixelWand(pixel_wand); -} -Magick::DrawableBase* Magick::DrawableFillColor::copy() const -{ - return new DrawableFillColor(*this); -} - -/* DrawableFillPatternUrl */ -Magick::DrawableFillPatternUrl::DrawableFillPatternUrl(const std::string &url_) - : _url(url_) -{ -} - -Magick::DrawableFillPatternUrl::DrawableFillPatternUrl( - const Magick::DrawableFillPatternUrl& original_) - : DrawableBase(original_), - _url(original_._url) -{ -} - -Magick::DrawableFillPatternUrl::~DrawableFillPatternUrl(void) -{ -} - -void Magick::DrawableFillPatternUrl::operator()( - MagickCore::DrawingWand * context_) const -{ - DrawSetFillPatternURL(context_, _url.c_str()); -} - -void Magick::DrawableFillPatternUrl::url(const std::string &url_) -{ - _url = url_; -} - -std::string Magick::DrawableFillPatternUrl::url(void) const -{ - return(_url); -} - -Magick::DrawableBase* Magick::DrawableFillPatternUrl::copy() const -{ - return(new DrawableFillPatternUrl(*this)); -} - -// Specify drawing fill fule -Magick::DrawableFillRule::~DrawableFillRule ( void ) -{ -} -void Magick::DrawableFillRule::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - DrawSetFillRule( context_, _fillRule ); -} -Magick::DrawableBase* Magick::DrawableFillRule::copy() const -{ - return new DrawableFillRule(*this); -} - -Magick::DrawableFillOpacity::~DrawableFillOpacity(void) -{ -} - -void Magick::DrawableFillOpacity::operator() - (MagickCore::DrawingWand *context_) const -{ - DrawSetFillOpacity(context_,_opacity); -} - -Magick::DrawableBase* Magick::DrawableFillOpacity::copy() const -{ - return new DrawableFillOpacity(*this); -} - -// Specify text font -Magick::DrawableFont::DrawableFont ( const std::string &font_ ) - : _font(font_), - _family(), - _style(Magick::AnyStyle), - _weight(400), - _stretch(Magick::NormalStretch) -{ -} -Magick::DrawableFont::DrawableFont ( const std::string &family_, - Magick::StyleType style_, - const unsigned int weight_, - Magick::StretchType stretch_ ) - : _font(), - _family(family_), - _style(style_), - _weight(weight_), - _stretch(stretch_) -{ -} -Magick::DrawableFont::DrawableFont ( const Magick::DrawableFont& original_ ) - : DrawableBase (original_), - _font(original_._font), - _family(original_._family), - _style(original_._style), - _weight(original_._weight), - _stretch(original_._stretch) -{ -} -Magick::DrawableFont::~DrawableFont ( void ) -{ -} -void Magick::DrawableFont::operator()( MagickCore::DrawingWand * context_ ) const -{ - // font - if(_font.length()) - { - (void) DrawSetFont( context_, _font.c_str() ); - } - - if(_family.length()) - { - // font-family - (void) DrawSetFontFamily( context_, _family.c_str() ); - - // font-style - DrawSetFontStyle( context_, _style ); - - // font-weight - DrawSetFontWeight( context_, _weight ); - - // font-stretch - DrawSetFontStretch( context_, _stretch ); - } -} -Magick::DrawableBase* Magick::DrawableFont::copy() const -{ - return new DrawableFont(*this); -} - -// Specify text positioning gravity -Magick::DrawableGravity::~DrawableGravity ( void ) -{ -} -void Magick::DrawableGravity::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - DrawSetGravity( context_, _gravity ); -} -Magick::DrawableBase* Magick::DrawableGravity::copy() const -{ - return new DrawableGravity(*this); -} - -// Line -Magick::DrawableLine::~DrawableLine ( void ) -{ -} -void Magick::DrawableLine::operator()( MagickCore::DrawingWand * context_ ) const -{ - DrawLine( context_, _startX, _startY, _endX, _endY ); -} -Magick::DrawableBase* Magick::DrawableLine::copy() const -{ - return new DrawableLine(*this); -} - -// Drawable Path -Magick::DrawablePath::DrawablePath ( const VPathList &path_ ) - : _path(path_) -{ -} -Magick::DrawablePath::DrawablePath ( const Magick::DrawablePath& original_ ) - : DrawableBase (original_), - _path(original_._path) -{ -} -Magick::DrawablePath::~DrawablePath ( void ) -{ -} -void Magick::DrawablePath::operator()( MagickCore::DrawingWand * context_ ) const -{ - DrawPathStart( context_ ); - - for( VPathList::const_iterator p = _path.begin(); - p != _path.end(); p++ ) - p->operator()( context_ ); // FIXME, how to quit loop on error? - - DrawPathFinish( context_ ); -} -Magick::DrawableBase* Magick::DrawablePath::copy() const -{ - return new DrawablePath(*this); -} - -// Point -Magick::DrawablePoint::~DrawablePoint ( void ) -{ -} -void Magick::DrawablePoint::operator()( MagickCore::DrawingWand * context_ ) const -{ - DrawPoint( context_, _x, _y ); -} -Magick::DrawableBase* Magick::DrawablePoint::copy() const -{ - return new DrawablePoint(*this); -} - -// Text pointsize -Magick::DrawablePointSize::~DrawablePointSize ( void ) -{ -} -void Magick::DrawablePointSize::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - DrawSetFontSize( context_, _pointSize ); -} -Magick::DrawableBase* Magick::DrawablePointSize::copy() const -{ - return new DrawablePointSize(*this); -} - -// Polygon (Coordinate list must contain at least three members) -Magick::DrawablePolygon::DrawablePolygon ( const CoordinateList &coordinates_ ) - : _coordinates(coordinates_) -{ -} -Magick::DrawablePolygon::DrawablePolygon -( const Magick::DrawablePolygon& original_ ) - : DrawableBase (original_), - _coordinates(original_._coordinates) -{ -} -Magick::DrawablePolygon::~DrawablePolygon ( void ) -{ -} -void Magick::DrawablePolygon::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - size_t num_coords = (size_t) _coordinates.size(); - PointInfo *coordinates = new PointInfo[num_coords]; - - PointInfo *q = coordinates; - CoordinateList::const_iterator p = _coordinates.begin(); - - while( p != _coordinates.end() ) - { - q->x = p->x(); - q->y = p->y(); - q++; - p++; - } - - DrawPolygon( context_, num_coords, coordinates ); - delete [] coordinates; -} -Magick::DrawableBase* Magick::DrawablePolygon::copy() const -{ - return new DrawablePolygon(*this); -} - -// Polyline (Coordinate list must contain at least three members) -Magick::DrawablePolyline::DrawablePolyline -( const CoordinateList &coordinates_ ) - : _coordinates(coordinates_) -{ -} -Magick::DrawablePolyline::DrawablePolyline -( const Magick::DrawablePolyline& original_ ) - : DrawableBase (original_), - _coordinates(original_._coordinates) -{ -} -Magick::DrawablePolyline::~DrawablePolyline ( void ) -{ -} -void Magick::DrawablePolyline::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - size_t num_coords = (size_t) _coordinates.size(); - PointInfo *coordinates = new PointInfo[num_coords]; - - PointInfo *q = coordinates; - CoordinateList::const_iterator p = _coordinates.begin(); - - while( p != _coordinates.end() ) - { - q->x = p->x(); - q->y = p->y(); - q++; - p++; - } - - DrawPolyline( context_, num_coords, coordinates ); - delete [] coordinates; -} -Magick::DrawableBase* Magick::DrawablePolyline::copy() const -{ - return new DrawablePolyline(*this); -} - -// Pop Graphic Context -Magick::DrawablePopGraphicContext::~DrawablePopGraphicContext ( void ) -{ -} -void Magick::DrawablePopGraphicContext::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - PopDrawingWand( context_ ); -} -Magick::DrawableBase* Magick::DrawablePopGraphicContext::copy() const -{ - return new DrawablePopGraphicContext(*this); -} - -// Push Graphic Context -Magick::DrawablePushGraphicContext::~DrawablePushGraphicContext ( void ) -{ -} -void Magick::DrawablePushGraphicContext::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - PushDrawingWand( context_ ); -} -Magick::DrawableBase* Magick::DrawablePushGraphicContext::copy() const -{ - return new DrawablePushGraphicContext(*this); -} - -// Pop (terminate) Pattern definition -Magick::DrawablePopPattern::~DrawablePopPattern ( void ) -{ -} -void Magick::DrawablePopPattern::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - (void) DrawPopPattern( context_ ); -} -Magick::DrawableBase* Magick::DrawablePopPattern::copy() const -{ - return new DrawablePopPattern(*this); -} - -// Push Pattern definition -Magick::DrawablePushPattern::DrawablePushPattern -( const std::string &id_, ssize_t x_, ssize_t y_, - size_t width_, size_t height_ ) - : _id(id_), - _x(x_), - _y(y_), - _width(width_), - _height(height_) -{ -} -Magick::DrawablePushPattern::DrawablePushPattern -( const Magick::DrawablePushPattern& original_ ) - : DrawableBase (original_), - _id(original_._id), - _x(original_._x), - _y(original_._y), - _width(original_._width), - _height(original_._height) -{ -} -Magick::DrawablePushPattern::~DrawablePushPattern ( void ) -{ -} -void Magick::DrawablePushPattern::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - (void) DrawPushPattern( context_, _id.c_str(), _x, _y, _width, _height ); -} -Magick::DrawableBase* Magick::DrawablePushPattern::copy() const -{ - return new DrawablePushPattern(*this); -} - -// Rectangle -Magick::DrawableRectangle::~DrawableRectangle ( void ) -{ -} -void Magick::DrawableRectangle::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - DrawRectangle( context_, _upperLeftX, _upperLeftY, - _lowerRightX, _lowerRightY ); -} -Magick::DrawableBase* Magick::DrawableRectangle::copy() const -{ - return new DrawableRectangle(*this); -} - -// Apply Rotation -Magick::DrawableRotation::~DrawableRotation ( void ) -{ -} -void Magick::DrawableRotation::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - DrawRotate( context_, _angle ); -} -Magick::DrawableBase* Magick::DrawableRotation::copy() const -{ - return new DrawableRotation(*this); -} - -// Round Rectangle -Magick::DrawableRoundRectangle::~DrawableRoundRectangle ( void ) -{ -} -void Magick::DrawableRoundRectangle::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - DrawRoundRectangle(context_,_upperLeftX,_upperLeftY,_lowerRightX, - _lowerRightY,_cornerWidth, _cornerHeight); -} -Magick::DrawableBase* Magick::DrawableRoundRectangle::copy() const -{ - return new DrawableRoundRectangle(*this); -} - -// Apply Scaling -Magick::DrawableScaling::~DrawableScaling ( void ) -{ -} -void Magick::DrawableScaling::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - DrawScale( context_, _x, _y ); -} -Magick::DrawableBase* Magick::DrawableScaling::copy() const -{ - return new DrawableScaling(*this); -} - -// Apply Skew in the X direction -Magick::DrawableSkewX::~DrawableSkewX ( void ) -{ -} -void Magick::DrawableSkewX::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - DrawSkewX( context_, _angle ); -} -Magick::DrawableBase* Magick::DrawableSkewX::copy() const -{ - return new DrawableSkewX(*this); -} - -// Apply Skew in the Y direction -Magick::DrawableSkewY::~DrawableSkewY ( void ) -{ -} -void Magick::DrawableSkewY::operator()( MagickCore::DrawingWand * context_ ) const -{ - DrawSkewY( context_, _angle ); -} -Magick::DrawableBase* Magick::DrawableSkewY::copy() const -{ - return new DrawableSkewY(*this); -} - -/* DrawableStrokeDashArray */ -Magick::DrawableStrokeDashArray::DrawableStrokeDashArray(const double* dasharray_) - : _size(0), - _dasharray(0) -{ - dasharray(dasharray_); -} - -Magick::DrawableStrokeDashArray::DrawableStrokeDashArray( - const Magick::DrawableStrokeDashArray& original_) - : DrawableBase (original_), - _size(original_._size), - _dasharray(new double[_size+1]) -{ - // Copy elements - { - for (size_t i=0; i < _size; i++) - _dasharray[i]=original_._dasharray[i]; - _dasharray[_size]=0.0; - } -} - -Magick::DrawableStrokeDashArray::~DrawableStrokeDashArray(void) -{ - delete [] _dasharray; - _size=0; - _dasharray=(double *) NULL; -} - -Magick::DrawableStrokeDashArray& Magick::DrawableStrokeDashArray::operator=( - const Magick::DrawableStrokeDashArray &original_) -{ - if (this != &original_) - { - delete [] _dasharray; - _size=original_._size; - _dasharray = new double[_size+1]; - // Copy elements - { - for (size_t i=0; i < _size; i++) - _dasharray[i]=original_._dasharray[i]; - _dasharray[_size]=0.0; - } - } - return(*this); -} - -void Magick::DrawableStrokeDashArray::operator()( - MagickCore::DrawingWand *context_) const -{ - (void) DrawSetStrokeDashArray(context_,(const unsigned long) _size, - _dasharray); -} - -Magick::DrawableBase *Magick::DrawableStrokeDashArray::copy() const -{ - return(new DrawableStrokeDashArray(*this)); -} - -void Magick::DrawableStrokeDashArray::dasharray(const double* dasharray_) -{ - size_t - n; - - delete [] _dasharray; - _size=0; - _dasharray=0; - - if (dasharray_ != (const double *) NULL) - { - const double - *p; - - // Count elements in dash array - n=0; - { - p = dasharray_; - while(*p++ != 0.0) - n++; - } - _size=n; - - // Allocate elements - _dasharray=new double[_size+1]; - // Copy elements - { - for (size_t i=0; i < _size; i++) - _dasharray[i]=dasharray_[i]; - _dasharray[_size]=0.0; - } - } -} - -const double* Magick::DrawableStrokeDashArray::dasharray(void) const -{ - return(_dasharray); -} - -/* DrawableStrokeDashOffset */ -Magick::DrawableStrokeDashOffset::~DrawableStrokeDashOffset(void) -{ -} - -void Magick::DrawableStrokeDashOffset::operator() - ( MagickCore::DrawingWand * context_) const -{ - DrawSetStrokeDashOffset(context_,_offset); -} - -Magick::DrawableBase* Magick::DrawableStrokeDashOffset::copy() const -{ - return(new DrawableStrokeDashOffset(*this)); -} - -void Magick::DrawableStrokeDashOffset::offset(const double offset_) -{ - _offset=offset_; -} - -double Magick::DrawableStrokeDashOffset::offset(void) const -{ - return(_offset); -} - -// Stroke linecap -Magick::DrawableStrokeLineCap::~DrawableStrokeLineCap ( void ) -{ -} -void Magick::DrawableStrokeLineCap::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - DrawSetStrokeLineCap( context_, _linecap ); -} -Magick::DrawableBase* Magick::DrawableStrokeLineCap::copy() const -{ - return new DrawableStrokeLineCap(*this); -} - -// Stroke linejoin -Magick::DrawableStrokeLineJoin::~DrawableStrokeLineJoin ( void ) -{ -} -void Magick::DrawableStrokeLineJoin::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - DrawSetStrokeLineJoin( context_, _linejoin ); -} -Magick::DrawableBase* Magick::DrawableStrokeLineJoin::copy() const -{ - return new DrawableStrokeLineJoin(*this); -} - -// Stroke miterlimit -Magick::DrawableMiterLimit::~DrawableMiterLimit ( void ) -{ -} -void Magick::DrawableMiterLimit::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - DrawSetStrokeMiterLimit( context_, _miterlimit ); -} -Magick::DrawableBase* Magick::DrawableMiterLimit::copy() const -{ - return new DrawableMiterLimit(*this); -} - - -/* DrawableStrokePatternUrl */ -Magick::DrawableStrokePatternUrl::DrawableStrokePatternUrl( - const std::string &url_) - : _url(url_) -{ -} - -Magick::DrawableStrokePatternUrl::DrawableStrokePatternUrl( - const Magick::DrawableStrokePatternUrl& original_) - : DrawableBase(original_), - _url(original_._url) -{ -} - -Magick::DrawableStrokePatternUrl::~DrawableStrokePatternUrl(void) -{ -} - -void Magick::DrawableStrokePatternUrl::operator()( - MagickCore::DrawingWand * context_) const -{ - DrawSetStrokePatternURL(context_, _url.c_str()); -} - -void Magick::DrawableStrokePatternUrl::url(const std::string &url_) -{ - _url = url_; -} - -std::string Magick::DrawableStrokePatternUrl::url(void) const -{ - return(_url); -} - -Magick::DrawableBase* Magick::DrawableStrokePatternUrl::copy() const -{ - return(new DrawableStrokePatternUrl(*this)); -} - -// Stroke antialias -Magick::DrawableStrokeAntialias::~DrawableStrokeAntialias ( void ) -{ -} -void Magick::DrawableStrokeAntialias::operator() -( MagickCore::DrawingWand * context_ ) const -{ - DrawSetStrokeAntialias( context_, static_cast - (_flag ? MagickTrue : MagickFalse) ); -} -Magick::DrawableBase* Magick::DrawableStrokeAntialias::copy() const -{ - return new DrawableStrokeAntialias(*this); -} - -// Stroke color -Magick::DrawableStrokeColor::DrawableStrokeColor -( const Magick::Color &color_ ) - : _color(color_) -{ -} -Magick::DrawableStrokeColor::DrawableStrokeColor -( const Magick::DrawableStrokeColor& original_ ) - : DrawableBase (original_), - _color(original_._color) -{ -} -Magick::DrawableStrokeColor::~DrawableStrokeColor ( void ) -{ -} -void Magick::DrawableStrokeColor::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - PixelInfo color = static_cast(_color); - PixelWand *pixel_wand=NewPixelWand(); - PixelSetPixelColor(pixel_wand,&color); - DrawSetStrokeColor(context_,pixel_wand); - pixel_wand=DestroyPixelWand(pixel_wand); -} -Magick::DrawableBase* Magick::DrawableStrokeColor::copy() const -{ - return new DrawableStrokeColor(*this); -} - -Magick::DrawableStrokeOpacity::~DrawableStrokeOpacity(void) -{ -} - -void Magick::DrawableStrokeOpacity::operator() - (MagickCore::DrawingWand * context_) const -{ - DrawSetStrokeOpacity(context_,_opacity); -} - -Magick::DrawableBase* Magick::DrawableStrokeOpacity::copy() const -{ - return new DrawableStrokeOpacity(*this); -} - -// Stroke width -Magick::DrawableStrokeWidth::~DrawableStrokeWidth ( void ) -{ -} -void Magick::DrawableStrokeWidth::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - DrawSetStrokeWidth( context_, _width ); -} -Magick::DrawableBase* Magick::DrawableStrokeWidth::copy() const -{ - return new DrawableStrokeWidth(*this); -} - -// Draw text at point -Magick::DrawableText::DrawableText ( const double x_, const double y_, - const std::string &text_ ) - : _x(x_), - _y(y_), - _text(text_), - _encoding() -{ -} -Magick::DrawableText::DrawableText ( const double x_, const double y_, - const std::string &text_, const std::string &encoding_) - : _x(x_), - _y(y_), - _text(text_), - _encoding(encoding_) -{ -} -Magick::DrawableText::DrawableText( const Magick::DrawableText& original_ ) - : DrawableBase (original_), - _x(original_._x), - _y(original_._y), - _text(original_._text), - _encoding(original_._encoding) -{ -} -Magick::DrawableText::~DrawableText ( void ) -{ -} -void Magick::DrawableText::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - DrawSetTextEncoding( context_, _encoding.c_str() ); - DrawAnnotation( context_, _x, _y, - reinterpret_cast(_text.c_str()) ); -} -Magick::DrawableBase* Magick::DrawableText::copy() const -{ - return new DrawableText(*this); -} - -/* DrawableTextAlignment */ -Magick::DrawableTextAlignment::DrawableTextAlignment( - Magick::AlignType alignment_) - : _alignment(alignment_) -{ -} - -Magick::DrawableTextAlignment::DrawableTextAlignment -(const Magick::DrawableTextAlignment &original_) - : DrawableBase(original_), - _alignment(original_._alignment) -{ -} - -Magick::DrawableTextAlignment::~DrawableTextAlignment(void) -{ -} - -void Magick::DrawableTextAlignment::operator()( - MagickCore::DrawingWand * context_) const -{ - DrawSetTextAlignment(context_, _alignment); -} - -void Magick::DrawableTextAlignment::alignment(AlignType alignment_) -{ - _alignment=alignment_; -} - -Magick::AlignType Magick::DrawableTextAlignment::alignment(void) const -{ - return(_alignment); -} - -Magick::DrawableBase* Magick::DrawableTextAlignment::copy() const -{ - return new DrawableTextAlignment(*this); -} - -// Text antialias -Magick::DrawableTextAntialias::DrawableTextAntialias ( bool flag_ ) - : _flag(flag_) -{ -} -Magick::DrawableTextAntialias::DrawableTextAntialias( const Magick::DrawableTextAntialias &original_ ) - : DrawableBase (original_), - _flag(original_._flag) -{ -} -Magick::DrawableTextAntialias::~DrawableTextAntialias ( void ) -{ -} -void Magick::DrawableTextAntialias::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - DrawSetTextAntialias( context_, static_cast - (_flag ? MagickTrue : MagickFalse) ); -} -Magick::DrawableBase* Magick::DrawableTextAntialias::copy() const -{ - return new DrawableTextAntialias(*this); -} - - -// Decoration (text decoration) -Magick::DrawableTextDecoration::DrawableTextDecoration - ( Magick::DecorationType decoration_ ) - : _decoration(decoration_) -{ -} -Magick::DrawableTextDecoration::DrawableTextDecoration - ( const Magick::DrawableTextDecoration &original_ ) - : DrawableBase (original_), - _decoration(original_._decoration) -{ -} -Magick::DrawableTextDecoration::~DrawableTextDecoration( void ) -{ -} -void Magick::DrawableTextDecoration::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - DrawSetTextDecoration( context_, _decoration ); -} -Magick::DrawableBase* Magick::DrawableTextDecoration::copy() const -{ - return new DrawableTextDecoration(*this); -} - -// DrawableTextDirection -Magick::DrawableTextDirection::DrawableTextDirection( - DirectionType direction_) - : _direction(direction_) -{ -} - -Magick::DrawableTextDirection::~DrawableTextDirection(void) -{ -} - -void Magick::DrawableTextDirection::operator()( - MagickCore::DrawingWand *context_) const -{ - DrawSetTextDirection(context_,_direction); -} - -void Magick::DrawableTextDirection::direction(DirectionType direction_) -{ - _direction=direction_; -} - -Magick::DirectionType Magick::DrawableTextDirection::direction(void) const -{ - return(_direction); -} - -Magick::DrawableBase *Magick::DrawableTextDirection::copy() const -{ - return new DrawableTextDirection(*this); -} - -// DrawableTextInterlineSpacing -Magick::DrawableTextInterlineSpacing::DrawableTextInterlineSpacing( - double spacing_) - : _spacing(spacing_) -{ -} - -Magick::DrawableTextInterlineSpacing::~DrawableTextInterlineSpacing(void) -{ -} - -void Magick::DrawableTextInterlineSpacing::operator()( - MagickCore::DrawingWand *context_) const -{ - DrawSetTextInterlineSpacing(context_,_spacing); -} - -void Magick::DrawableTextInterlineSpacing::spacing(double spacing_) -{ - _spacing=spacing_; -} - -double Magick::DrawableTextInterlineSpacing::spacing(void) const -{ - return(_spacing); -} - -Magick::DrawableBase *Magick::DrawableTextInterlineSpacing::copy() const -{ - return new DrawableTextInterlineSpacing(*this); -} - -// DrawableTextInterwordSpacing -Magick::DrawableTextInterwordSpacing::DrawableTextInterwordSpacing( - double spacing_) - : _spacing(spacing_) -{ -} - -Magick::DrawableTextInterwordSpacing::~DrawableTextInterwordSpacing(void) -{ -} - -void Magick::DrawableTextInterwordSpacing::operator()( - MagickCore::DrawingWand *context_) const -{ - DrawSetTextInterwordSpacing(context_,_spacing); -} - -void Magick::DrawableTextInterwordSpacing::spacing(double spacing_) -{ - _spacing=spacing_; -} - -double Magick::DrawableTextInterwordSpacing::spacing(void) const -{ - return(_spacing); -} - -Magick::DrawableBase *Magick::DrawableTextInterwordSpacing::copy() const -{ - return new DrawableTextInterwordSpacing(*this); -} - -// DrawableTextKerning -Magick::DrawableTextKerning::DrawableTextKerning( - double kerning_) - : _kerning(kerning_) -{ -} - -Magick::DrawableTextKerning::~DrawableTextKerning(void) -{ -} - -void Magick::DrawableTextKerning::operator()( - MagickCore::DrawingWand *context_) const -{ - DrawSetTextKerning(context_,_kerning); -} - -void Magick::DrawableTextKerning::kerning(double kerning_) -{ - _kerning=kerning_; -} - -double Magick::DrawableTextKerning::kerning(void) const -{ - return(_kerning); -} - -Magick::DrawableBase *Magick::DrawableTextKerning::copy() const -{ - return new DrawableTextKerning(*this); -} - -// Set text undercolor -Magick::DrawableTextUnderColor::DrawableTextUnderColor -( const Magick::Color &color_ ) - : _color(color_) -{ -} -Magick::DrawableTextUnderColor::DrawableTextUnderColor -( const Magick::DrawableTextUnderColor& original_ ) - : DrawableBase (original_), - _color(original_._color) -{ -} -Magick::DrawableTextUnderColor::~DrawableTextUnderColor ( void ) -{ -} -void Magick::DrawableTextUnderColor::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - PixelInfo color = static_cast(_color); - PixelWand *pixel_wand=NewPixelWand(); - PixelSetPixelColor(pixel_wand,&color); - DrawSetTextUnderColor(context_,pixel_wand); - pixel_wand=DestroyPixelWand(pixel_wand); -} -Magick::DrawableBase* Magick::DrawableTextUnderColor::copy() const -{ - return new DrawableTextUnderColor(*this); -} - -// Apply Translation -Magick::DrawableTranslation::~DrawableTranslation ( void ) -{ -} -void Magick::DrawableTranslation::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - DrawTranslate( context_, _x, _y ); -} -Magick::DrawableBase* Magick::DrawableTranslation::copy() const -{ - return new DrawableTranslation(*this); -} - -// Set the size of the viewbox -Magick::DrawableViewbox::~DrawableViewbox ( void ) -{ -} -void Magick::DrawableViewbox::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - DrawSetViewbox( context_, _x1, _y1, _x2, _y2 ); -} -Magick::DrawableBase* Magick::DrawableViewbox::copy() const -{ - return new DrawableViewbox(*this); -} - -// -// Path Classes -// - -// -// PathArcArgs -// -MagickPPExport int Magick::operator == ( const Magick::PathArcArgs& /*left_*/, - const Magick::PathArcArgs& /*right_*/ ) -{ - return ( 1 ); -} -MagickPPExport int Magick::operator != ( const Magick::PathArcArgs& /*left_*/, - const Magick::PathArcArgs& /*right_*/ ) -{ - return ( 0 ); -} -MagickPPExport int Magick::operator > ( const Magick::PathArcArgs& /*left_*/, - const Magick::PathArcArgs& /*right_*/ ) -{ - return ( 0 ); -} -MagickPPExport int Magick::operator < ( const Magick::PathArcArgs& /*left_*/, - const Magick::PathArcArgs& /*right_*/ ) -{ - return ( false ); -} -MagickPPExport int Magick::operator >= ( const Magick::PathArcArgs& left_, - const Magick::PathArcArgs& right_ ) -{ - return ( ( left_ > right_ ) || ( left_ == right_ ) ); -} -MagickPPExport int Magick::operator <= ( const Magick::PathArcArgs& left_, - const Magick::PathArcArgs& right_ ) -{ - return ( ( left_ < right_ ) || ( left_ == right_ ) ); -} -// Default constructor -Magick::PathArcArgs::PathArcArgs( void ) - : _radiusX(0), - _radiusY(0), - _xAxisRotation(0), - _largeArcFlag(false), - _sweepFlag(false), - _x(0), - _y(0) -{ -} -// Normal constructor -Magick::PathArcArgs::PathArcArgs( double radiusX_, double radiusY_, - double xAxisRotation_, bool largeArcFlag_, - bool sweepFlag_, double x_, double y_ ) - : _radiusX(radiusX_), - _radiusY(radiusY_), - _xAxisRotation(xAxisRotation_), - _largeArcFlag(largeArcFlag_), - _sweepFlag(sweepFlag_), - _x(x_), - _y(y_) -{ -} -// Copy constructor -Magick::PathArcArgs::PathArcArgs( const Magick::PathArcArgs &original_ ) - : _radiusX(original_._radiusX), - _radiusY(original_._radiusY), - _xAxisRotation(original_._xAxisRotation), - _largeArcFlag(original_._largeArcFlag), - _sweepFlag(original_._sweepFlag), - _x(original_._x), - _y(original_._y) -{ -} -// Destructor -Magick::PathArcArgs::~PathArcArgs ( void ) -{ -} - -// Path Arc -Magick::PathArcAbs::PathArcAbs ( const Magick::PathArcArgs &coordinates_ ) - : _coordinates(1,coordinates_) -{ -} -Magick::PathArcAbs::PathArcAbs ( const PathArcArgsList &coordinates_ ) - : _coordinates(coordinates_) -{ -} -Magick::PathArcAbs::PathArcAbs ( const Magick::PathArcAbs& original_ ) - : VPathBase (original_), - _coordinates(original_._coordinates) -{ -} -Magick::PathArcAbs::~PathArcAbs ( void ) -{ -} -void Magick::PathArcAbs::operator()( MagickCore::DrawingWand * context_ ) const -{ - for( PathArcArgsList::const_iterator p = _coordinates.begin(); - p != _coordinates.end(); p++ ) - { - DrawPathEllipticArcAbsolute( context_, p->radiusX(), p->radiusY(), - p->xAxisRotation(), (MagickBooleanType) p->largeArcFlag(), - (MagickBooleanType) p->sweepFlag(), p->x(), p->y() ); - } -} -Magick::VPathBase* Magick::PathArcAbs::copy() const -{ - return new PathArcAbs(*this); -} - -Magick::PathArcRel::PathArcRel ( const Magick::PathArcArgs &coordinates_ ) - : _coordinates(1,coordinates_) -{ -} -Magick::PathArcRel::PathArcRel ( const PathArcArgsList &coordinates_ ) - : _coordinates(coordinates_) -{ -} -Magick::PathArcRel::PathArcRel ( const Magick::PathArcRel& original_ ) - : VPathBase (original_), - _coordinates(original_._coordinates) -{ -} -Magick::PathArcRel::~PathArcRel ( void ) -{ -} -void Magick::PathArcRel::operator()( MagickCore::DrawingWand * context_ ) const -{ - for( PathArcArgsList::const_iterator p = _coordinates.begin(); - p != _coordinates.end(); p++ ) - { - DrawPathEllipticArcRelative( context_, p->radiusX(), p->radiusY(), - p->xAxisRotation(), (MagickBooleanType) p->largeArcFlag(), - (MagickBooleanType) p->sweepFlag(), p->x(), p->y() ); - } -} -Magick::VPathBase* Magick::PathArcRel::copy() const -{ - return new PathArcRel(*this); -} - -// -// Path Closepath -// -Magick::PathClosePath::~PathClosePath ( void ) -{ -} -void Magick::PathClosePath::operator()( MagickCore::DrawingWand * context_ ) const -{ - DrawPathClose( context_ ); -} -Magick::VPathBase* Magick::PathClosePath::copy() const -{ - return new PathClosePath(*this); -} - -// -// Path Curveto (Cubic Bezier) -// -MagickPPExport int Magick::operator == ( const Magick::PathCurvetoArgs& /*left_*/, - const Magick::PathCurvetoArgs& /*right_*/ ) -{ - return ( 1 ); -} -MagickPPExport int Magick::operator != ( const Magick::PathCurvetoArgs& /*left_*/, - const Magick::PathCurvetoArgs& /*right_*/ ) -{ - return ( 0 ); -} -MagickPPExport int Magick::operator > ( const Magick::PathCurvetoArgs& /*left_*/, - const Magick::PathCurvetoArgs& /*right_*/ ) -{ - return ( 0 ); -} -MagickPPExport int Magick::operator < ( const Magick::PathCurvetoArgs& /*left_*/, - const Magick::PathCurvetoArgs& /*right_*/ ) -{ - return ( false ); -} -MagickPPExport int Magick::operator >= ( const Magick::PathCurvetoArgs& left_, - const Magick::PathCurvetoArgs& right_ ) -{ - return ( ( left_ > right_ ) || ( left_ == right_ ) ); -} -MagickPPExport int Magick::operator <= ( const Magick::PathCurvetoArgs& left_, - const Magick::PathCurvetoArgs& right_ ) -{ - return ( ( left_ < right_ ) || ( left_ == right_ ) ); -} -// Default constructor -Magick::PathCurvetoArgs::PathCurvetoArgs( void ) - : _x1(0), - _y1(0), - _x2(0), - _y2(0), - _x(0), - _y(0) -{ -} -// Normal constructor -Magick::PathCurvetoArgs::PathCurvetoArgs( double x1_, double y1_, - double x2_, double y2_, - double x_, double y_ ) - : _x1(x1_), - _y1(y1_), - _x2(x2_), - _y2(y2_), - _x(x_), - _y(y_) -{ -} -// Copy constructor -Magick::PathCurvetoArgs::PathCurvetoArgs( const PathCurvetoArgs &original_ ) - : _x1(original_._x1), - _y1(original_._y1), - _x2(original_._x2), - _y2(original_._y2), - _x(original_._x), - _y(original_._y) -{ -} -// Destructor -Magick::PathCurvetoArgs::~PathCurvetoArgs ( void ) -{ -} - -Magick::PathCurvetoAbs::PathCurvetoAbs ( const Magick::PathCurvetoArgs &args_ ) - : _args(1,args_) -{ -} -Magick::PathCurvetoAbs::PathCurvetoAbs ( const PathCurveToArgsList &args_ ) - : _args(args_) -{ -} -Magick::PathCurvetoAbs::PathCurvetoAbs - ( const Magick::PathCurvetoAbs& original_ ) - : VPathBase (original_), - _args(original_._args) -{ -} -Magick::PathCurvetoAbs::~PathCurvetoAbs ( void ) -{ -} -void Magick::PathCurvetoAbs::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - for( PathCurveToArgsList::const_iterator p = _args.begin(); - p != _args.end(); p++ ) - { - DrawPathCurveToAbsolute( context_, p->x1(), p->y1(), p->x2(), p->y2(), - p->x(), p->y() ); - } -} -Magick::VPathBase* Magick::PathCurvetoAbs::copy() const -{ - return new PathCurvetoAbs(*this); -} -Magick::PathCurvetoRel::PathCurvetoRel ( const Magick::PathCurvetoArgs &args_ ) - : _args(1,args_) -{ -} -Magick::PathCurvetoRel::PathCurvetoRel ( const PathCurveToArgsList &args_ ) - : _args(args_) -{ -} -Magick::PathCurvetoRel::PathCurvetoRel -( const Magick::PathCurvetoRel& original_ ) - : VPathBase (original_), - _args(original_._args) -{ -} -Magick::PathCurvetoRel::~PathCurvetoRel ( void ) -{ -} -void Magick::PathCurvetoRel::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - for( PathCurveToArgsList::const_iterator p = _args.begin(); - p != _args.end(); p++ ) - { - DrawPathCurveToRelative( context_, p->x1(), p->y1(), p->x2(), p->y2(), - p->x(), p->y() ); - } -} -Magick::VPathBase* Magick::PathCurvetoRel::copy() const -{ - return new PathCurvetoRel(*this); -} -Magick::PathSmoothCurvetoAbs::PathSmoothCurvetoAbs -( const Magick::Coordinate &coordinates_ ) - : _coordinates(1,coordinates_) -{ -} -Magick::PathSmoothCurvetoAbs::PathSmoothCurvetoAbs -( const CoordinateList &coordinates_ ) - : _coordinates(coordinates_) -{ -} -Magick::PathSmoothCurvetoAbs::PathSmoothCurvetoAbs -( const Magick::PathSmoothCurvetoAbs& original_ ) - : VPathBase (original_), - _coordinates(original_._coordinates) -{ -} -Magick::PathSmoothCurvetoAbs::~PathSmoothCurvetoAbs ( void ) -{ -} -void Magick::PathSmoothCurvetoAbs::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - for( CoordinateList::const_iterator p = _coordinates.begin(); - p != _coordinates.end(); p++ ) - { - double x2 = p->x(); - double y2 = p->y(); - p++; - if (p == _coordinates.end() ) - break; - DrawPathCurveToSmoothAbsolute( context_, x2, y2, p->x(), p->y() ); - } -} -Magick::VPathBase* Magick::PathSmoothCurvetoAbs::copy() const -{ - return new PathSmoothCurvetoAbs(*this); -} -Magick::PathSmoothCurvetoRel::PathSmoothCurvetoRel -( const Magick::Coordinate &coordinates_ ) - : _coordinates(1,coordinates_) -{ -} -Magick::PathSmoothCurvetoRel::PathSmoothCurvetoRel -( const CoordinateList &coordinates_ ) - : _coordinates(coordinates_) -{ -} -Magick::PathSmoothCurvetoRel::PathSmoothCurvetoRel -( const Magick::PathSmoothCurvetoRel& original_ ) - : VPathBase (original_), - _coordinates(original_._coordinates) -{ -} -Magick::PathSmoothCurvetoRel::~PathSmoothCurvetoRel ( void ) -{ -} -void Magick::PathSmoothCurvetoRel::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - for( CoordinateList::const_iterator p = _coordinates.begin(); - p != _coordinates.end(); p++ ) - { - double x2 = p->x(); - double y2 = p->y(); - p++; - if (p == _coordinates.end() ) - break; - DrawPathCurveToSmoothRelative( context_, x2, y2, p->x(), p->y() ); - } -} -Magick::VPathBase* Magick::PathSmoothCurvetoRel::copy() const -{ - return new PathSmoothCurvetoRel(*this); -} - -// -// Quadratic Curveto (Quadratic Bezier) -// -MagickPPExport int Magick::operator == -( const Magick::PathQuadraticCurvetoArgs& /*left_*/, - const Magick::PathQuadraticCurvetoArgs& /*right_*/ ) -{ - return ( 1 ); -} -MagickPPExport int Magick::operator != -( const Magick::PathQuadraticCurvetoArgs& /*left_*/, - const Magick::PathQuadraticCurvetoArgs& /*right_*/ ) -{ - return ( 0 ); -} -MagickPPExport int Magick::operator > -( const Magick::PathQuadraticCurvetoArgs& /*left_*/, - const Magick::PathQuadraticCurvetoArgs& /*right_*/ ) -{ - return ( 0 ); -} -MagickPPExport int Magick::operator < -( const Magick::PathQuadraticCurvetoArgs& /*left_*/, - const Magick::PathQuadraticCurvetoArgs& /*right_*/ ) -{ - return ( 0 ); -} -MagickPPExport int Magick::operator >= -( const Magick::PathQuadraticCurvetoArgs& left_, - const Magick::PathQuadraticCurvetoArgs& right_ ) -{ - return ( ( left_ > right_ ) || ( left_ == right_ ) ); -} -MagickPPExport int Magick::operator <= -( const Magick::PathQuadraticCurvetoArgs& left_, - const Magick::PathQuadraticCurvetoArgs& right_ ) -{ - return ( ( left_ < right_ ) || ( left_ == right_ ) ); -} -// Default Constructor -Magick::PathQuadraticCurvetoArgs::PathQuadraticCurvetoArgs( void ) - : _x1(0), - _y1(0), - _x(0), - _y(0) -{ -} -// Normal Constructor -Magick::PathQuadraticCurvetoArgs::PathQuadraticCurvetoArgs( double x1_, - double y1_, - double x_, - double y_ ) - : _x1(x1_), - _y1(y1_), - _x(x_), - _y(y_) -{ -} -// Copy Constructor -Magick::PathQuadraticCurvetoArgs::PathQuadraticCurvetoArgs( const PathQuadraticCurvetoArgs &original_ ) - : _x1(original_._x1), - _y1(original_._y1), - _x(original_._x), - _y(original_._y) -{ -} -// Destructor -Magick::PathQuadraticCurvetoArgs::~PathQuadraticCurvetoArgs ( void ) -{ -} - -Magick::PathQuadraticCurvetoAbs::PathQuadraticCurvetoAbs -( const Magick::PathQuadraticCurvetoArgs &args_ ) - : _args(1,args_) -{ -} -Magick::PathQuadraticCurvetoAbs::PathQuadraticCurvetoAbs -( const PathQuadraticCurvetoArgsList &args_ ) - : _args(args_) -{ -} -Magick::PathQuadraticCurvetoAbs::PathQuadraticCurvetoAbs -( const Magick::PathQuadraticCurvetoAbs& original_ ) - : VPathBase (original_), - _args(original_._args) -{ -} -Magick::PathQuadraticCurvetoAbs::~PathQuadraticCurvetoAbs ( void ) -{ -} -void Magick::PathQuadraticCurvetoAbs::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - for( PathQuadraticCurvetoArgsList::const_iterator p = _args.begin(); - p != _args.end(); p++ ) - { - DrawPathCurveToQuadraticBezierAbsolute( context_, p->x1(), p->y1(), - p->x(), p->y() ); - } -} -Magick::VPathBase* Magick::PathQuadraticCurvetoAbs::copy() const -{ - return new PathQuadraticCurvetoAbs(*this); -} -Magick::PathQuadraticCurvetoRel::PathQuadraticCurvetoRel -( const Magick::PathQuadraticCurvetoArgs &args_ ) - : _args(1,args_) -{ -} -Magick::PathQuadraticCurvetoRel::PathQuadraticCurvetoRel -( const PathQuadraticCurvetoArgsList &args_ ) - : _args(args_) -{ -} -Magick::PathQuadraticCurvetoRel::PathQuadraticCurvetoRel -( const Magick::PathQuadraticCurvetoRel& original_ ) - : VPathBase (original_), - _args(original_._args) -{ -} -Magick::PathQuadraticCurvetoRel::~PathQuadraticCurvetoRel ( void ) -{ -} -void Magick::PathQuadraticCurvetoRel::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - for( PathQuadraticCurvetoArgsList::const_iterator p = _args.begin(); - p != _args.end(); p++ ) - { - DrawPathCurveToQuadraticBezierRelative( context_, p->x1(), p->y1(), - p->x(), p->y() ); - } -} -Magick::VPathBase* Magick::PathQuadraticCurvetoRel::copy() const -{ - return new PathQuadraticCurvetoRel(*this); -} -Magick::PathSmoothQuadraticCurvetoAbs::PathSmoothQuadraticCurvetoAbs -( const Magick::Coordinate &coordinate_ ) - : _coordinates(1,coordinate_) -{ -} -Magick::PathSmoothQuadraticCurvetoAbs::PathSmoothQuadraticCurvetoAbs -( const CoordinateList &coordinates_ ) - : _coordinates(coordinates_) -{ -} -Magick::PathSmoothQuadraticCurvetoAbs::PathSmoothQuadraticCurvetoAbs -( const Magick::PathSmoothQuadraticCurvetoAbs& original_ ) - : VPathBase (original_), - _coordinates(original_._coordinates) -{ -} -Magick::PathSmoothQuadraticCurvetoAbs::~PathSmoothQuadraticCurvetoAbs ( void ) -{ -} -void Magick::PathSmoothQuadraticCurvetoAbs::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - for( CoordinateList::const_iterator p = _coordinates.begin(); - p != _coordinates.end(); p++ ) - { - DrawPathCurveToQuadraticBezierSmoothAbsolute( context_, p->x(), p->y() ); - } -} -Magick::VPathBase* Magick::PathSmoothQuadraticCurvetoAbs::copy() const -{ - return new PathSmoothQuadraticCurvetoAbs(*this); -} -Magick::PathSmoothQuadraticCurvetoRel::PathSmoothQuadraticCurvetoRel -( const Magick::Coordinate &coordinate_ ) - : _coordinates(1,coordinate_) -{ -} -Magick::PathSmoothQuadraticCurvetoRel::PathSmoothQuadraticCurvetoRel -( const CoordinateList &coordinates_ ) - : _coordinates(coordinates_) -{ -} -Magick::PathSmoothQuadraticCurvetoRel::PathSmoothQuadraticCurvetoRel -( const PathSmoothQuadraticCurvetoRel& original_ ) - : VPathBase (original_), - _coordinates(original_._coordinates) -{ -} -Magick::PathSmoothQuadraticCurvetoRel::~PathSmoothQuadraticCurvetoRel ( void ) -{ -} -void Magick::PathSmoothQuadraticCurvetoRel::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - for( CoordinateList::const_iterator p = _coordinates.begin(); - p != _coordinates.end(); p++ ) - { - DrawPathCurveToQuadraticBezierSmoothRelative( context_, p->x(), p->y() ); - } -} -Magick::VPathBase* Magick::PathSmoothQuadraticCurvetoRel::copy() const -{ - return new PathSmoothQuadraticCurvetoRel(*this); -} - -// -// Path Lineto -// -Magick::PathLinetoAbs::PathLinetoAbs ( const Magick::Coordinate& coordinate_ ) - : _coordinates(1,coordinate_) -{ -} -Magick::PathLinetoAbs::PathLinetoAbs ( const CoordinateList &coordinates_ ) - : _coordinates(coordinates_) -{ -} -Magick::PathLinetoAbs::PathLinetoAbs ( const Magick::PathLinetoAbs& original_ ) - : VPathBase (original_), - _coordinates(original_._coordinates) -{ -} -Magick::PathLinetoAbs::~PathLinetoAbs ( void ) -{ -} -void Magick::PathLinetoAbs::operator()( MagickCore::DrawingWand * context_ ) const -{ - for( CoordinateList::const_iterator p = _coordinates.begin(); - p != _coordinates.end(); p++ ) - { - DrawPathLineToAbsolute( context_, p->x(), p->y() ); - } -} -Magick::VPathBase* Magick::PathLinetoAbs::copy() const -{ - return new PathLinetoAbs(*this); -} -Magick::PathLinetoRel::PathLinetoRel ( const Magick::Coordinate& coordinate_ ) - : _coordinates(1,coordinate_) -{ -} -Magick::PathLinetoRel::PathLinetoRel ( const CoordinateList &coordinates_ ) - : _coordinates(coordinates_) -{ -} -Magick::PathLinetoRel::PathLinetoRel ( const Magick::PathLinetoRel& original_ ) - : VPathBase (original_), - _coordinates(original_._coordinates) -{ -} -Magick::PathLinetoRel::~PathLinetoRel ( void ) -{ -} -void Magick::PathLinetoRel::operator()( MagickCore::DrawingWand * context_ ) const -{ - for( CoordinateList::const_iterator p = _coordinates.begin(); - p != _coordinates.end(); p++ ) - { - DrawPathLineToRelative( context_, p->x(), p->y() ); - } -} -Magick::VPathBase* Magick::PathLinetoRel::copy() const -{ - return new PathLinetoRel(*this); -} - -// -// Path Horizontal Lineto -// - -Magick::PathLinetoHorizontalAbs::~PathLinetoHorizontalAbs ( void ) -{ -} -void Magick::PathLinetoHorizontalAbs::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - DrawPathLineToHorizontalAbsolute( context_, _x ); -} -Magick::VPathBase* Magick::PathLinetoHorizontalAbs::copy() const -{ - return new PathLinetoHorizontalAbs(*this); -} -Magick::PathLinetoHorizontalRel::~PathLinetoHorizontalRel ( void ) -{ -} -void Magick::PathLinetoHorizontalRel::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - DrawPathLineToHorizontalRelative( context_, _x ); -} -Magick::VPathBase* Magick::PathLinetoHorizontalRel::copy() const -{ - return new PathLinetoHorizontalRel(*this); -} - -// -// Path Vertical Lineto -// -Magick::PathLinetoVerticalAbs::~PathLinetoVerticalAbs ( void ) -{ -} -void Magick::PathLinetoVerticalAbs::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - DrawPathLineToVerticalAbsolute( context_, _y ); -} -Magick::VPathBase* Magick::PathLinetoVerticalAbs::copy() const -{ - return new PathLinetoVerticalAbs(*this); -} -Magick::PathLinetoVerticalRel::~PathLinetoVerticalRel ( void ) -{ -} -void Magick::PathLinetoVerticalRel::operator() - ( MagickCore::DrawingWand * context_ ) const -{ - DrawPathLineToVerticalRelative( context_, _y ); -} -Magick::VPathBase* Magick::PathLinetoVerticalRel::copy() const -{ - return new PathLinetoVerticalRel(*this); -} - -// -// Path Moveto -// - -Magick::PathMovetoAbs::PathMovetoAbs ( const Magick::Coordinate &coordinate_ ) - : _coordinates(1,coordinate_) -{ -} -Magick::PathMovetoAbs::PathMovetoAbs ( const CoordinateList &coordinates_ ) - : _coordinates(coordinates_) -{ -} -Magick::PathMovetoAbs::PathMovetoAbs ( const Magick::PathMovetoAbs& original_ ) - : VPathBase (original_), - _coordinates(original_._coordinates) -{ -} -Magick::PathMovetoAbs::~PathMovetoAbs ( void ) -{ -} -void Magick::PathMovetoAbs::operator()( MagickCore::DrawingWand * context_ ) const -{ - for( CoordinateList::const_iterator p = _coordinates.begin(); - p != _coordinates.end(); p++ ) - { - DrawPathMoveToAbsolute( context_, p->x(), p->y() ); - } -} -Magick::VPathBase* Magick::PathMovetoAbs::copy() const -{ - return new PathMovetoAbs(*this); -} -Magick::PathMovetoRel::PathMovetoRel ( const Magick::Coordinate &coordinate_ ) - : _coordinates(1,coordinate_) -{ -} -Magick::PathMovetoRel::PathMovetoRel ( const CoordinateList &coordinates_ ) - : _coordinates(coordinates_) -{ -} -Magick::PathMovetoRel::PathMovetoRel ( const Magick::PathMovetoRel& original_ ) - : VPathBase (original_), - _coordinates(original_._coordinates) -{ -} -Magick::PathMovetoRel::~PathMovetoRel ( void ) -{ -} -void Magick::PathMovetoRel::operator()( MagickCore::DrawingWand * context_ ) const -{ - for( CoordinateList::const_iterator p = _coordinates.begin(); - p != _coordinates.end(); p++ ) - { - DrawPathMoveToRelative( context_, p->x(), p->y() ); - } -} -Magick::VPathBase* Magick::PathMovetoRel::copy() const -{ - return new PathMovetoRel(*this); -} - -#if defined(EXPLICIT_TEMPLATE_INSTANTIATION) -// template class std::vector; -// template class std::vector; -// template class std::vector; -// template class std::vector; -// template class std::vector; -// template class std::vector; -#endif diff --git a/Magick++/lib/Exception.cpp b/Magick++/lib/Exception.cpp deleted file mode 100644 index f2f3ceba5..000000000 --- a/Magick++/lib/Exception.cpp +++ /dev/null @@ -1,987 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003 -// Copyright Dirk Lemstra 2014-2017 -// -// Implementation of Exception and derived classes -// - -#define MAGICKCORE_IMPLEMENTATION 1 -#define MAGICK_PLUSPLUS_IMPLEMENTATION 1 - -#include "Magick++/Include.h" -#include -#include -#include - -using namespace std; - -#include "Magick++/Exception.h" - -Magick::Exception::Exception(const std::string& what_) - : std::exception(), - _what(what_), - _nested((Exception *) NULL) -{ -} - -Magick::Exception::Exception(const std::string& what_, - Exception* nested_) - : std::exception(), - _what(what_), - _nested(nested_) -{ -} - -Magick::Exception::Exception(const Magick::Exception& original_) - : exception(original_), - _what(original_._what), - _nested((Exception *) NULL) -{ -} - -Magick::Exception::~Exception() throw() -{ - delete _nested; -} - -Magick::Exception& Magick::Exception::operator=( - const Magick::Exception& original_) -{ - if (this != &original_) - this->_what=original_._what; - return(*this); -} - -const char* Magick::Exception::what() const throw() -{ - return(_what.c_str()); -} - -const Magick::Exception* Magick::Exception::nested() const throw() -{ - return(_nested); -} - -void Magick::Exception::nested(Exception* nested_) throw() -{ - _nested=nested_; -} - -Magick::Error::Error(const std::string& what_) - : Exception(what_) -{ -} - -Magick::Error::Error(const std::string& what_,Exception *nested_) - : Exception(what_,nested_) -{ -} - -Magick::Error::~Error() throw() -{ -} - -Magick::ErrorBlob::ErrorBlob(const std::string& what_) - : Error(what_) -{ -} - -Magick::ErrorBlob::ErrorBlob(const std::string& what_,Exception *nested_) - : Error(what_,nested_) -{ -} - -Magick::ErrorBlob::~ErrorBlob() throw() -{ -} - -Magick::ErrorCache::ErrorCache(const std::string& what_) - : Error(what_) -{ -} - -Magick::ErrorCache::ErrorCache(const std::string& what_,Exception *nested_) - : Error(what_,nested_) -{ -} - -Magick::ErrorCache::~ErrorCache() throw() -{ -} - -Magick::ErrorCoder::ErrorCoder(const std::string& what_) - : Error(what_) -{ -} - -Magick::ErrorCoder::ErrorCoder(const std::string& what_,Exception *nested_) - : Error(what_,nested_) -{ -} - -Magick::ErrorCoder::~ErrorCoder() throw() -{ -} - -Magick::ErrorConfigure::ErrorConfigure(const std::string& what_) - : Error(what_) -{ -} - -Magick::ErrorConfigure::ErrorConfigure(const std::string& what_, - Exception *nested_) - : Error(what_,nested_) -{ -} - -Magick::ErrorConfigure::~ErrorConfigure() throw() -{ -} - -Magick::ErrorCorruptImage::ErrorCorruptImage(const std::string& what_) - : Error(what_) -{ -} - -Magick::ErrorCorruptImage::ErrorCorruptImage(const std::string& what_, - Exception *nested_) - : Error(what_,nested_) -{ -} - -Magick::ErrorCorruptImage::~ErrorCorruptImage() throw() -{ -} - -Magick::ErrorDelegate::ErrorDelegate(const std::string& what_) - : Error(what_) -{ -} - -Magick::ErrorDelegate::ErrorDelegate(const std::string& what_, - Exception *nested_) - : Error(what_,nested_) -{ -} - -Magick::ErrorDelegate::~ErrorDelegate()throw() -{ -} - -Magick::ErrorDraw::ErrorDraw(const std::string& what_) - : Error(what_) -{ -} - -Magick::ErrorDraw::ErrorDraw(const std::string& what_,Exception *nested_) - : Error(what_,nested_) -{ -} - -Magick::ErrorDraw::~ErrorDraw() throw() -{ -} - -Magick::ErrorFileOpen::ErrorFileOpen(const std::string& what_) - : Error(what_) -{ -} - -Magick::ErrorFileOpen::~ErrorFileOpen() throw() -{ -} - -Magick::ErrorFileOpen::ErrorFileOpen(const std::string& what_, - Exception *nested_) - : Error(what_,nested_) -{ -} - - -Magick::ErrorImage::ErrorImage(const std::string& what_) - : Error(what_) -{ -} - -Magick::ErrorImage::ErrorImage(const std::string& what_,Exception *nested_) - : Error(what_,nested_) -{ -} - -Magick::ErrorImage::~ErrorImage() throw() -{ -} - -Magick::ErrorMissingDelegate::ErrorMissingDelegate(const std::string& what_) - : Error(what_) -{ -} - -Magick::ErrorMissingDelegate::ErrorMissingDelegate(const std::string& what_, - Exception *nested_) - : Error(what_,nested_) -{ -} - -Magick::ErrorMissingDelegate::~ErrorMissingDelegate() throw () -{ -} - -Magick::ErrorModule::ErrorModule(const std::string& what_) - : Error(what_) -{ -} - -Magick::ErrorModule::ErrorModule(const std::string& what_,Exception *nested_) - : Error(what_,nested_) -{ -} - -Magick::ErrorModule::~ErrorModule() throw() -{ -} - -Magick::ErrorMonitor::ErrorMonitor(const std::string& what_) - : Error(what_) -{ -} - -Magick::ErrorMonitor::ErrorMonitor(const std::string& what_,Exception *nested_) - : Error(what_,nested_) -{ -} - -Magick::ErrorMonitor::~ErrorMonitor() throw() -{ -} - -Magick::ErrorOption::ErrorOption(const std::string& what_) - : Error(what_) -{ -} - -Magick::ErrorOption::ErrorOption(const std::string& what_,Exception *nested_) - : Error(what_,nested_) -{ -} - -Magick::ErrorOption::~ErrorOption() throw() -{ -} - -Magick::ErrorPolicy::ErrorPolicy(const std::string& what_) - : Error(what_) -{ -} - -Magick::ErrorPolicy::ErrorPolicy(const std::string& what_,Exception *nested_) - : Error(what_,nested_) -{ -} - -Magick::ErrorPolicy::~ErrorPolicy() throw() -{ -} - - -Magick::ErrorRegistry::ErrorRegistry(const std::string& what_) - : Error(what_) -{ -} - -Magick::ErrorRegistry::ErrorRegistry(const std::string& what_, - Exception *nested_) - : Error(what_,nested_) -{ -} - -Magick::ErrorRegistry::~ErrorRegistry() throw() -{ -} - -Magick::ErrorResourceLimit::ErrorResourceLimit(const std::string& what_) - : Error(what_) -{ -} - -Magick::ErrorResourceLimit::ErrorResourceLimit(const std::string& what_, - Exception *nested_) - : Error(what_,nested_) -{ -} - -Magick::ErrorResourceLimit::~ErrorResourceLimit() throw() -{ -} - -Magick::ErrorStream::ErrorStream(const std::string& what_) - : Error(what_) -{ -} - -Magick::ErrorStream::ErrorStream(const std::string& what_,Exception *nested_) - : Error(what_,nested_) -{ -} - -Magick::ErrorStream::~ErrorStream() throw() -{ -} - -Magick::ErrorType::ErrorType(const std::string& what_) - : Error(what_) -{ -} - -Magick::ErrorType::ErrorType(const std::string& what_,Exception *nested_) - : Error(what_,nested_) -{ -} - -Magick::ErrorType::~ErrorType() throw() -{ -} - -Magick::ErrorUndefined::ErrorUndefined(const std::string& what_) - : Error(what_) -{ -} - -Magick::ErrorUndefined::ErrorUndefined(const std::string& what_, - Exception *nested_) - : Error(what_,nested_) -{ -} - -Magick::ErrorUndefined::~ErrorUndefined() throw() -{ -} - -Magick::ErrorXServer::ErrorXServer(const std::string& what_) - : Error(what_) -{ -} - -Magick::ErrorXServer::ErrorXServer(const std::string& what_,Exception *nested_) - : Error(what_,nested_) -{ -} - -Magick::ErrorXServer::~ErrorXServer() throw () -{ -} - -Magick::Warning::Warning(const std::string& what_) - : Exception(what_) -{ -} - -Magick::Warning::Warning(const std::string& what_,Exception *nested_) - : Exception(what_,nested_) -{ -} - -Magick::Warning::~Warning() throw() -{ -} - -Magick::WarningBlob::WarningBlob(const std::string& what_) - : Warning(what_) -{ -} - -Magick::WarningBlob::WarningBlob(const std::string& what_,Exception *nested_) - : Warning(what_,nested_) -{ -} - -Magick::WarningBlob::~WarningBlob() throw() -{ -} - -Magick::WarningCache::WarningCache(const std::string& what_) - : Warning(what_) -{ -} - -Magick::WarningCache::WarningCache(const std::string& what_,Exception *nested_) - : Warning(what_,nested_) -{ -} - -Magick::WarningCache::~WarningCache() throw() -{ -} - -Magick::WarningCoder::WarningCoder(const std::string& what_) - : Warning(what_) -{ -} - -Magick::WarningCoder::WarningCoder(const std::string& what_,Exception *nested_) - : Warning(what_,nested_) -{ -} - -Magick::WarningCoder::~WarningCoder() throw() -{ -} - -Magick::WarningConfigure::WarningConfigure(const std::string& what_) - : Warning(what_) -{ -} - -Magick::WarningConfigure::WarningConfigure(const std::string& what_, - Exception *nested_) - : Warning(what_,nested_) -{ -} - -Magick::WarningConfigure::~WarningConfigure() throw() -{ -} - -Magick::WarningCorruptImage::WarningCorruptImage(const std::string& what_) - : Warning(what_) -{ -} - -Magick::WarningCorruptImage::WarningCorruptImage(const std::string& what_, - Exception *nested_) - : Warning(what_,nested_) -{ -} - -Magick::WarningCorruptImage::~WarningCorruptImage() throw() -{ -} - -Magick::WarningDelegate::WarningDelegate(const std::string& what_) - : Warning(what_) -{ -} - -Magick::WarningDelegate::WarningDelegate(const std::string& what_, - Exception *nested_) - : Warning(what_,nested_) -{ -} - -Magick::WarningDelegate::~WarningDelegate() throw() -{ -} - -Magick::WarningDraw::WarningDraw(const std::string& what_) - : Warning(what_) -{ -} - -Magick::WarningDraw::WarningDraw(const std::string& what_,Exception *nested_) - : Warning(what_,nested_) -{ -} - -Magick::WarningDraw::~WarningDraw() throw() -{ -} - -Magick::WarningFileOpen::WarningFileOpen(const std::string& what_) - : Warning(what_) -{ -} - -Magick::WarningFileOpen::WarningFileOpen(const std::string& what_, - Exception *nested_) - : Warning(what_,nested_) -{ -} - -Magick::WarningFileOpen::~WarningFileOpen() throw() -{ -} - -Magick::WarningImage::WarningImage(const std::string& what_) - : Warning(what_) -{ -} - -Magick::WarningImage::WarningImage(const std::string& what_,Exception *nested_) - : Warning(what_,nested_) -{ -} - -Magick::WarningImage::~WarningImage() throw() -{ -} - -Magick::WarningMissingDelegate::WarningMissingDelegate( - const std::string& what_) - : Warning(what_) -{ -} - -Magick::WarningMissingDelegate::WarningMissingDelegate( - const std::string& what_,Exception *nested_) - : Warning(what_,nested_) -{ -} - -Magick::WarningMissingDelegate::~WarningMissingDelegate() throw() -{ -} - -Magick::WarningModule::WarningModule(const std::string& what_) - : Warning(what_) -{ -} - -Magick::WarningModule::WarningModule(const std::string& what_, - Exception *nested_) - : Warning(what_,nested_) -{ -} - - -Magick::WarningModule::~WarningModule() throw() -{ -} - -Magick::WarningMonitor::WarningMonitor(const std::string& what_) - : Warning(what_) -{ -} - -Magick::WarningMonitor::WarningMonitor(const std::string& what_, - Exception *nested_) - : Warning(what_,nested_) -{ -} - -Magick::WarningMonitor::~WarningMonitor() throw() -{ -} - -Magick::WarningOption::WarningOption(const std::string& what_) - : Warning(what_) -{ -} - -Magick::WarningOption::WarningOption(const std::string& what_, - Exception *nested_) - : Warning(what_,nested_) -{ -} - -Magick::WarningOption::~WarningOption() throw() -{ -} - -Magick::WarningRegistry::WarningRegistry(const std::string& what_) - : Warning(what_) -{ -} - -Magick::WarningRegistry::WarningRegistry(const std::string& what_, - Exception *nested_) - : Warning(what_,nested_) -{ -} - -Magick::WarningRegistry::~WarningRegistry() throw() -{ -} - -Magick::WarningPolicy::WarningPolicy(const std::string& what_) - : Warning(what_) -{ -} - -Magick::WarningPolicy::WarningPolicy(const std::string& what_, - Exception *nested_) - : Warning(what_,nested_) -{ -} - -Magick::WarningPolicy::~WarningPolicy() throw() -{ -} - -Magick::WarningResourceLimit::WarningResourceLimit(const std::string& what_) - : Warning(what_) -{ -} - -Magick::WarningResourceLimit::WarningResourceLimit(const std::string& what_, - Exception *nested_) - : Warning(what_,nested_) -{ -} - -Magick::WarningResourceLimit::~WarningResourceLimit() throw() -{ -} - -Magick::WarningStream::WarningStream(const std::string& what_) - : Warning(what_) -{ -} - -Magick::WarningStream::WarningStream(const std::string& what_, - Exception *nested_) - : Warning(what_,nested_) -{ -} - -Magick::WarningStream::~WarningStream() throw() -{ -} - -Magick::WarningType::WarningType(const std::string& what_) - : Warning(what_) -{ -} - -Magick::WarningType::WarningType(const std::string& what_,Exception *nested_) - : Warning(what_,nested_) -{ -} - -Magick::WarningType::~WarningType() throw() -{ -} - -Magick::WarningUndefined::WarningUndefined(const std::string& what_) - : Warning(what_) -{ -} - -Magick::WarningUndefined::WarningUndefined(const std::string& what_, - Exception *nested_) - : Warning(what_,nested_) -{ -} - -Magick::WarningUndefined::~WarningUndefined() throw() -{ -} - -Magick::WarningXServer::WarningXServer(const std::string& what_) - : Warning(what_) -{ -} - -Magick::WarningXServer::WarningXServer(const std::string& what_, - Exception *nested_) - : Warning(what_,nested_) -{ -} - -Magick::WarningXServer::~WarningXServer() throw() -{ -} - -std::string Magick::formatExceptionMessage(const MagickCore::ExceptionInfo *exception_) -{ - // Format error message ImageMagick-style - std::string message=GetClientName(); - if (exception_->reason != (char *) NULL) - { - message+=std::string(": "); - message+=std::string(exception_->reason); - } - - if (exception_->description != (char *) NULL) - message += " (" + std::string(exception_->description) + ")"; - return(message); -} - -Magick::Exception* Magick::createException(const MagickCore::ExceptionInfo *exception_) -{ - std::string message=formatExceptionMessage(exception_); - switch (exception_->severity) - { - case MagickCore::BlobError: - case MagickCore::BlobFatalError: - return new ErrorBlob(message); - case MagickCore::BlobWarning: - return new WarningBlob(message); - case MagickCore::CacheError: - case MagickCore::CacheFatalError: - return new ErrorCache(message); - case MagickCore::CacheWarning: - return new WarningCache(message); - case MagickCore::CoderError: - case MagickCore::CoderFatalError: - return new ErrorCoder(message); - case MagickCore::CoderWarning: - return new WarningCoder(message); - case MagickCore::ConfigureError: - case MagickCore::ConfigureFatalError: - return new ErrorConfigure(message); - case MagickCore::ConfigureWarning: - return new WarningConfigure(message); - case MagickCore::CorruptImageError: - case MagickCore::CorruptImageFatalError: - return new ErrorCorruptImage(message); - case MagickCore::CorruptImageWarning: - return new WarningCorruptImage(message); - case MagickCore::DelegateError: - case MagickCore::DelegateFatalError: - return new ErrorDelegate(message); - case MagickCore::DelegateWarning: - return new WarningDelegate(message); - case MagickCore::DrawError: - case MagickCore::DrawFatalError: - return new ErrorDraw(message); - case MagickCore::DrawWarning: - return new WarningDraw(message); - case MagickCore::FileOpenError: - case MagickCore::FileOpenFatalError: - return new ErrorFileOpen(message); - case MagickCore::FileOpenWarning: - return new WarningFileOpen(message); - case MagickCore::ImageError: - case MagickCore::ImageFatalError: - return new ErrorImage(message); - case MagickCore::ImageWarning: - return new WarningImage(message); - case MagickCore::MissingDelegateError: - case MagickCore::MissingDelegateFatalError: - return new ErrorMissingDelegate(message); - case MagickCore::MissingDelegateWarning: - return new WarningMissingDelegate(message); - case MagickCore::ModuleError: - case MagickCore::ModuleFatalError: - return new ErrorModule(message); - case MagickCore::ModuleWarning: - return new WarningModule(message); - case MagickCore::MonitorError: - case MagickCore::MonitorFatalError: - return new ErrorMonitor(message); - case MagickCore::MonitorWarning: - return new WarningMonitor(message); - case MagickCore::OptionError: - case MagickCore::OptionFatalError: - return new ErrorOption(message); - case MagickCore::OptionWarning: - return new WarningOption(message); - case MagickCore::PolicyWarning: - return new WarningPolicy(message); - case MagickCore::PolicyError: - case MagickCore::PolicyFatalError: - return new ErrorPolicy(message); - case MagickCore::RegistryError: - case MagickCore::RegistryFatalError: - return new ErrorRegistry(message); - case MagickCore::RegistryWarning: - return new WarningRegistry(message); - case MagickCore::ResourceLimitError: - case MagickCore::ResourceLimitFatalError: - return new ErrorResourceLimit(message); - case MagickCore::ResourceLimitWarning: - return new WarningResourceLimit(message); - case MagickCore::StreamError: - case MagickCore::StreamFatalError: - return new ErrorStream(message); - case MagickCore::StreamWarning: - return new WarningStream(message); - case MagickCore::TypeError: - case MagickCore::TypeFatalError: - return new ErrorType(message); - case MagickCore::TypeWarning: - return new WarningType(message); - case MagickCore::UndefinedException: - default: - return new ErrorUndefined(message); - case MagickCore::XServerError: - case MagickCore::XServerFatalError: - return new ErrorXServer(message); - case MagickCore::XServerWarning: - return new WarningXServer(message); - } -} - -MagickPPExport void Magick::throwExceptionExplicit( - const MagickCore::ExceptionType severity_,const char* reason_, - const char* description_) -{ - // Just return if there is no reported error - if (severity_ == MagickCore::UndefinedException) - return; - - GetPPException; - ThrowException(exceptionInfo,severity_,reason_,description_); - ThrowPPException(false); -} - -MagickPPExport void Magick::throwException(ExceptionInfo *exception_, - const bool quiet_) -{ - const ExceptionInfo - *p; - - Exception - *nestedException, - *q; - - MagickCore::ExceptionType - severity; - - size_t - index; - - std::string - message; - - // Just return if there is no reported error - if (exception_->severity == MagickCore::UndefinedException) - return; - - message=formatExceptionMessage(exception_); - nestedException=(Exception *) NULL; - q=(Exception *) NULL; - LockSemaphoreInfo(exception_->semaphore); - if (exception_->exceptions != (void *) NULL) - { - index=GetNumberOfElementsInLinkedList((LinkedListInfo *) - exception_->exceptions); - while(index > 0) - { - p=(const ExceptionInfo *) GetValueFromLinkedList((LinkedListInfo *) - exception_->exceptions,--index); - if ((p->severity != exception_->severity) || (LocaleCompare(p->reason, - exception_->reason) != 0) || (LocaleCompare(p->description, - exception_->description) != 0)) - { - if (nestedException == (Exception *) NULL) - { - nestedException=createException(p); - q=nestedException; - } - else - { - Exception - *r; - - r=createException(p); - q->nested(r); - q=r; - } - } - } - } - severity=exception_->severity; - UnlockSemaphoreInfo(exception_->semaphore); - - if ((quiet_) && (severity < MagickCore::ErrorException)) - { - delete nestedException; - return; - } - - DestroyExceptionInfo(exception_); - - switch (severity) - { - case MagickCore::BlobError: - case MagickCore::BlobFatalError: - throw ErrorBlob(message,nestedException); - case MagickCore::BlobWarning: - throw WarningBlob(message,nestedException); - case MagickCore::CacheError: - case MagickCore::CacheFatalError: - throw ErrorCache(message,nestedException); - case MagickCore::CacheWarning: - throw WarningCache(message,nestedException); - case MagickCore::CoderError: - case MagickCore::CoderFatalError: - throw ErrorCoder(message,nestedException); - case MagickCore::CoderWarning: - throw WarningCoder(message,nestedException); - case MagickCore::ConfigureError: - case MagickCore::ConfigureFatalError: - throw ErrorConfigure(message,nestedException); - case MagickCore::ConfigureWarning: - throw WarningConfigure(message,nestedException); - case MagickCore::CorruptImageError: - case MagickCore::CorruptImageFatalError: - throw ErrorCorruptImage(message,nestedException); - case MagickCore::CorruptImageWarning: - throw WarningCorruptImage(message,nestedException); - case MagickCore::DelegateError: - case MagickCore::DelegateFatalError: - throw ErrorDelegate(message,nestedException); - case MagickCore::DelegateWarning: - throw WarningDelegate(message,nestedException); - case MagickCore::DrawError: - case MagickCore::DrawFatalError: - throw ErrorDraw(message,nestedException); - case MagickCore::DrawWarning: - throw WarningDraw(message,nestedException); - case MagickCore::FileOpenError: - case MagickCore::FileOpenFatalError: - throw ErrorFileOpen(message,nestedException); - case MagickCore::FileOpenWarning: - throw WarningFileOpen(message,nestedException); - case MagickCore::ImageError: - case MagickCore::ImageFatalError: - throw ErrorImage(message,nestedException); - case MagickCore::ImageWarning: - throw WarningImage(message,nestedException); - case MagickCore::MissingDelegateError: - case MagickCore::MissingDelegateFatalError: - throw ErrorMissingDelegate(message,nestedException); - case MagickCore::MissingDelegateWarning: - throw WarningMissingDelegate(message,nestedException); - case MagickCore::ModuleError: - case MagickCore::ModuleFatalError: - throw ErrorModule(message,nestedException); - case MagickCore::ModuleWarning: - throw WarningModule(message,nestedException); - case MagickCore::MonitorError: - case MagickCore::MonitorFatalError: - throw ErrorMonitor(message,nestedException); - case MagickCore::MonitorWarning: - throw WarningMonitor(message,nestedException); - case MagickCore::OptionError: - case MagickCore::OptionFatalError: - throw ErrorOption(message,nestedException); - case MagickCore::OptionWarning: - throw WarningOption(message,nestedException); - case MagickCore::PolicyWarning: - throw WarningPolicy(message,nestedException); - case MagickCore::PolicyError: - case MagickCore::PolicyFatalError: - throw ErrorPolicy(message,nestedException); - case MagickCore::RegistryError: - case MagickCore::RegistryFatalError: - throw ErrorRegistry(message,nestedException); - case MagickCore::RegistryWarning: - throw WarningRegistry(message,nestedException); - case MagickCore::ResourceLimitError: - case MagickCore::ResourceLimitFatalError: - throw ErrorResourceLimit(message,nestedException); - case MagickCore::ResourceLimitWarning: - throw WarningResourceLimit(message,nestedException); - case MagickCore::StreamError: - case MagickCore::StreamFatalError: - throw ErrorStream(message,nestedException); - case MagickCore::StreamWarning: - throw WarningStream(message,nestedException); - case MagickCore::TypeError: - case MagickCore::TypeFatalError: - throw ErrorType(message,nestedException); - case MagickCore::TypeWarning: - throw WarningType(message,nestedException); - case MagickCore::UndefinedException: - default: - throw ErrorUndefined(message,nestedException); - case MagickCore::XServerError: - case MagickCore::XServerFatalError: - throw ErrorXServer(message,nestedException); - case MagickCore::XServerWarning: - throw WarningXServer(message,nestedException); - } -} diff --git a/Magick++/lib/Functions.cpp b/Magick++/lib/Functions.cpp deleted file mode 100644 index 1867efce2..000000000 --- a/Magick++/lib/Functions.cpp +++ /dev/null @@ -1,74 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2002, 2003 -// Copyright Dirk Lemstra 2014-2017 -// -// Simple C++ function wrappers for ImageMagick equivalents -// - -#define MAGICKCORE_IMPLEMENTATION 1 -#define MAGICK_PLUSPLUS_IMPLEMENTATION 1 - -#include "Magick++/Include.h" -#include - -using namespace std; - -#include "Magick++/Functions.h" -#include "Magick++/Exception.h" - -static bool magick_initialized=false; - -// Clone C++ string as allocated C string, de-allocating any existing string -MagickPPExport void Magick::CloneString(char **destination_, - const std::string &source_) -{ - MagickCore::CloneString(destination_,source_.c_str()); -} - -MagickPPExport void Magick::DisableOpenCL(void) -{ - MagickCore::SetOpenCLEnabled(MagickFalse); -} - -MagickPPExport bool Magick::EnableOpenCL(void) -{ - bool - status; - - status=MagickCore::SetOpenCLEnabled(MagickTrue) != MagickFalse; - return(status); -} - -MagickPPExport void Magick::InitializeMagick(const char *path_) -{ - MagickCore::MagickCoreGenesis(path_,MagickFalse); - if (!magick_initialized) - magick_initialized=true; -} - -MagickPPExport void Magick::SetRandomSeed(const unsigned long seed) -{ - MagickCore::SetRandomSecretKey(seed); -} - -MagickPPExport bool Magick::SetSecurityPolicy(const std::string &policy_) -{ - bool - status; - - GetPPException; - status=MagickCore::SetMagickSecurityPolicy(policy_.c_str(), - exceptionInfo) != MagickFalse; - ThrowPPException(false); - return(status); -} - -MagickPPExport void Magick::TerminateMagick(void) -{ - if (magick_initialized) - { - magick_initialized=false; - MagickCore::MagickCoreTerminus(); - } -} \ No newline at end of file diff --git a/Magick++/lib/Geometry.cpp b/Magick++/lib/Geometry.cpp deleted file mode 100644 index 4db9bb0a3..000000000 --- a/Magick++/lib/Geometry.cpp +++ /dev/null @@ -1,709 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003 -// Copyright Dirk Lemstra 2014-2015 -// -// Geometry implementation -// - -#define MAGICKCORE_IMPLEMENTATION 1 -#define MAGICK_PLUSPLUS_IMPLEMENTATION 1 - -#include "Magick++/Include.h" -#include -#include // for isdigit -#if !defined(MAGICKCORE_WINDOWS_SUPPORT) -#include -#endif - -using namespace std; - -#include "Magick++/Geometry.h" -#include "Magick++/Exception.h" - -MagickPPExport int Magick::operator == (const Magick::Geometry& left_, - const Magick::Geometry& right_) -{ - return((left_.aspect() == right_.aspect()) && - (left_.fillArea() == right_.fillArea()) && - (left_.greater() == right_.greater()) && - (left_.height() == right_.height()) && - (left_.isValid() == right_.isValid()) && - (left_.less() == right_.less()) && - (left_.limitPixels() == right_.limitPixels()) && - (left_.percent() == right_.percent()) && - (left_.width() == right_.width()) && - (left_.xOff() == right_.xOff()) && - (left_.yOff() == right_.yOff())); -} - -MagickPPExport int Magick::operator != (const Magick::Geometry& left_, - const Magick::Geometry& right_) -{ - return(!(left_ == right_)); -} - -MagickPPExport int Magick::operator > (const Magick::Geometry& left_, - const Magick::Geometry& right_) -{ - return(!(left_ < right_) && (left_ != right_)); -} - -MagickPPExport int Magick::operator < (const Magick::Geometry& left_, - const Magick::Geometry& right_) -{ - return((left_.width()*left_.height()) < (right_.width()*right_.height())); -} - -MagickPPExport int Magick::operator >= (const Magick::Geometry& left_, - const Magick::Geometry& right_) -{ - return((left_ > right_) || (left_ == right_)); -} - -MagickPPExport int Magick::operator <= (const Magick::Geometry& left_, - const Magick::Geometry& right_ ) -{ - return((left_ < right_) || (left_ == right_)); -} - -Magick::Geometry::Geometry(void) - : _width(0), - _height(0), - _xOff(0), - _yOff(0), - _isValid(false), - _percent(false), - _aspect(false), - _greater(false), - _less(false), - _fillArea(false), - _limitPixels(false) -{ -} - -Magick::Geometry::Geometry(const char *geometry_) - : _width(0), - _height(0), - _xOff(0), - _yOff(0), - _isValid(false), - _percent(false), - _aspect(false), - _greater(false), - _less(false), - _fillArea(false), - _limitPixels(false) -{ - *this=geometry_; // Use assignment operator -} - -Magick::Geometry::Geometry(const Geometry &geometry_) - : _width(geometry_._width), - _height(geometry_._height), - _xOff(geometry_._xOff), - _yOff(geometry_._yOff), - _isValid(geometry_._isValid), - _percent(geometry_._percent), - _aspect(geometry_._aspect), - _greater(geometry_._greater), - _less(geometry_._less), - _fillArea(geometry_._fillArea), - _limitPixels(geometry_._limitPixels) -{ -} - -Magick::Geometry::Geometry(const std::string &geometry_) - : _width(0), - _height(0), - _xOff(0), - _yOff(0), - _isValid(false), - _percent(false), - _aspect(false), - _greater(false), - _less(false), - _fillArea(false), - _limitPixels(false) -{ - *this=geometry_; // Use assignment operator -} - -Magick::Geometry::Geometry(size_t width_,size_t height_,ssize_t xOff_, - ssize_t yOff_) - : _width(width_), - _height(height_), - _xOff(xOff_), - _yOff(yOff_), - _isValid(true), - _percent(false), - _aspect(false), - _greater(false), - _less(false), - _fillArea(false), - _limitPixels(false) -{ -} - -Magick::Geometry::~Geometry(void) -{ -} - -const Magick::Geometry& Magick::Geometry::operator=(const char *geometry_) -{ - *this=std::string(geometry_); - return(*this); -} - -Magick::Geometry& Magick::Geometry::operator=(const Geometry &geometry_) -{ - // If not being set to ourself - if (this != &geometry_) - { - _width=geometry_._width; - _height=geometry_._height; - _xOff=geometry_._xOff; - _yOff=geometry_._yOff; - _isValid=geometry_._isValid; - _percent=geometry_._percent; - _aspect=geometry_._aspect; - _greater=geometry_._greater; - _less=geometry_._less; - _fillArea=geometry_._fillArea; - _limitPixels=geometry_._limitPixels; - } - return(*this); -} - -const Magick::Geometry& Magick::Geometry::operator=( - const std::string &geometry_) -{ - char - geom[MagickPathExtent]; - - char - *pageptr; - - ssize_t - flags, - x = 0, - y = 0; - - size_t - height_val=0, - width_val=0; - - // If argument does not start with digit, presume that it is a - // page-size specification that needs to be converted to an - // equivalent geometry specification using PostscriptGeometry() - (void) CopyMagickString(geom,geometry_.c_str(),MagickPathExtent); - if (geom[0] != '-' && geom[0] != '+' && geom[0] != 'x' && - !isdigit(static_cast(geom[0]))) - { - pageptr=GetPageGeometry(geom); - if (pageptr != 0) - { - (void) CopyMagickString(geom,pageptr,MagickPathExtent); - pageptr=(char *) RelinquishMagickMemory(pageptr); - } - } - - flags=GetGeometry(geom,&x,&y,&width_val,&height_val); - - if (flags == NoValue) - { - // Total failure! - *this=Geometry(); - isValid(false); - return(*this); - } - - if ((flags & WidthValue) != 0) - { - _width=width_val; - isValid(true); - } - - if ((flags & HeightValue) != 0) - { - _height=height_val; - isValid(true); - } - - if ((flags & XValue) != 0) - { - _xOff=static_cast(x); - isValid(true); - } - - if ((flags & YValue) != 0) - { - _yOff=static_cast(y); - isValid(true); - } - - if ((flags & PercentValue) != 0) - _percent=true; - - if ((flags & AspectValue) != 0) - _aspect=true; - - if ((flags & LessValue) != 0) - _less=true; - - if ((flags & GreaterValue) != 0) - _greater=true; - - if ((flags & MinimumValue) != 0) - _fillArea=true; - - if ((flags & AreaValue) != 0) - _limitPixels=true; - - return(*this); -} - -Magick::Geometry::operator std::string() const -{ - char - buffer[MagickPathExtent]; - - std::string - geometry; - - if (!isValid()) - throwExceptionExplicit(MagickCore::OptionError, - "Invalid geometry argument"); - - if (_width) - { - FormatLocaleString(buffer,MagickPathExtent,"%.20g",(double) _width); - geometry+=buffer; - } - - if (_height) - { - FormatLocaleString(buffer,MagickPathExtent,"%.20g",(double) _height); - geometry+='x'; - geometry+=buffer; - } - - if (_xOff || _yOff) - { - if (_xOff >= 0) - geometry+='+'; - - FormatLocaleString(buffer,MagickPathExtent,"%.20g",(double) _xOff); - geometry+=buffer; - - if (_yOff >= 0) - geometry+='+'; - - FormatLocaleString(buffer,MagickPathExtent,"%.20g",(double) _yOff); - geometry+=buffer; - } - - if (_percent) - geometry+='%'; - - if (_aspect) - geometry+='!'; - - if (_greater) - geometry+='>'; - - if (_less) - geometry+='<'; - - if (_fillArea) - geometry+='^'; - - if (_limitPixels) - geometry+='@'; - - return(geometry); -} - -void Magick::Geometry::aspect(bool aspect_) -{ - _aspect=aspect_; -} - -bool Magick::Geometry::aspect(void) const -{ - return(_aspect); -} - -void Magick::Geometry::fillArea(bool fillArea_) -{ - _fillArea=fillArea_; -} - -bool Magick::Geometry::fillArea(void) const -{ - return(_fillArea); -} - -void Magick::Geometry::greater(bool greater_) -{ - _greater=greater_; -} - -bool Magick::Geometry::greater(void) const -{ - return(_greater); -} - -void Magick::Geometry::height(size_t height_) -{ - _height=height_; -} - -size_t Magick::Geometry::height(void) const -{ - return(_height); -} - -void Magick::Geometry::isValid(bool isValid_) -{ - _isValid=isValid_; -} - -bool Magick::Geometry::isValid(void) const -{ - return(_isValid); -} - -void Magick::Geometry::less(bool less_) -{ - _less=less_; -} - -bool Magick::Geometry::less(void) const -{ - return(_less); -} - -void Magick::Geometry::limitPixels(bool limitPixels_) -{ - _limitPixels=limitPixels_; -} - -bool Magick::Geometry::limitPixels(void) const -{ - return(_limitPixels); -} - -void Magick::Geometry::width(size_t width_) -{ - _width=width_; - isValid(true); -} - -void Magick::Geometry::percent(bool percent_) -{ - _percent = percent_; -} - -bool Magick::Geometry::percent(void) const -{ - return(_percent); -} - -size_t Magick::Geometry::width(void) const -{ - return(_width); -} - -void Magick::Geometry::xOff(::ssize_t xOff_) -{ - _xOff=xOff_; -} - -::ssize_t Magick::Geometry::xOff(void) const -{ - return(_xOff); -} - -void Magick::Geometry::yOff(::ssize_t yOff_) -{ - _yOff=yOff_; -} - -::ssize_t Magick::Geometry::yOff(void) const -{ - return(_yOff); -} - -Magick::Geometry::Geometry(const MagickCore::RectangleInfo &rectangle_) - : _width(static_cast(rectangle_.width)), - _height(static_cast(rectangle_.height)), - _xOff(static_cast(rectangle_.x)), - _yOff(static_cast(rectangle_.y)), - _isValid(true), - _percent(false), - _aspect(false), - _greater(false), - _less(false), - _fillArea(false), - _limitPixels(false) -{ -} - -const Magick::Geometry& Magick::Geometry::operator=( - const MagickCore::RectangleInfo &rectangle_) -{ - _width=static_cast(rectangle_.width), - _height=static_cast(rectangle_.height), - _xOff=static_cast(rectangle_.x), - _yOff=static_cast(rectangle_.y), - _isValid=true; - return(*this); -} - -Magick::Geometry::operator MagickCore::RectangleInfo() const -{ - RectangleInfo rectangle; - rectangle.width=_width; - rectangle.height=_height; - rectangle.x=_xOff; - rectangle.y=_yOff; - return(rectangle); -} - -MagickPPExport int Magick::operator == (const Magick::Offset& left_, - const Magick::Offset& right_) -{ - return((left_.x() == right_.x()) && - (left_.y() == right_.y())); -} - -MagickPPExport int Magick::operator != (const Magick::Offset& left_, - const Magick::Offset& right_) -{ - return(!(left_ == right_)); -} - -Magick::Offset::Offset(void) - : _x(0), - _y(0) -{ -} - -Magick::Offset::Offset(const char *offset_) - : _x(0), - _y(0) -{ - *this=offset_; // Use assignment operator -} - -Magick::Offset::Offset(const Offset &offset_) - : _x(offset_._x), - _y(offset_._y) -{ -} - -Magick::Offset::Offset(const std::string &offset_) - : _x(0), - _y(0) -{ - *this=offset_; // Use assignment operator -} - -Magick::Offset::Offset(ssize_t x_,ssize_t y_) - : _x(x_), - _y(y_) -{ -} - -Magick::Offset::~Offset(void) -{ -} - -const Magick::Offset& Magick::Offset::operator=(const char *offset_) -{ - MagickCore::GeometryInfo - geometry_info; - - MagickCore::MagickStatusType - flags; - - flags=ParseGeometry(offset_,&geometry_info); - _x=geometry_info.rho; - _y=geometry_info.sigma; - if ((flags & MagickCore::SigmaValue) == 0) - _y=_x; - return(*this); -} - -Magick::Offset& Magick::Offset::operator=(const Offset &offset_) -{ - // If not being set to ourself - if (this != &offset_) - { - _x=offset_._x; - _y=offset_._y; - } - return(*this); -} - -const Magick::Offset& Magick::Offset::operator=(const std::string &offset_) -{ - *this=offset_.c_str(); - return(*this); -} - -ssize_t Magick::Offset::x(void) const -{ - return(_x); -} - -ssize_t Magick::Offset::y(void) const -{ - return(_y); -} - -Magick::Offset::operator MagickCore::OffsetInfo() const -{ - OffsetInfo offset; - offset.x=_x; - offset.y=_y; - return(offset); -} - -MagickPPExport int Magick::operator == (const Magick::Point& left_, - const Magick::Point& right_) -{ - return((left_.x() == right_.x()) && - (left_.y() == right_.y())); -} - -MagickPPExport int Magick::operator != (const Magick::Point& left_, - const Magick::Point& right_) -{ - return(!(left_ == right_)); -} - -Magick::Point::Point(void) - : _x(0.0), - _y(0.0) -{ -} - -Magick::Point::Point(const char *point_) - : _x(0.0), - _y(0.0) -{ - *this=point_; // Use assignment operator -} - -Magick::Point::Point(const Point &point_) - : _x(point_._x), - _y(point_._y) -{ -} - -Magick::Point::Point(const std::string &point_) - : _x(0.0), - _y(0.0) -{ - *this=point_; // Use assignment operator -} - -Magick::Point::Point(double x_,double y_) - : _x(x_), - _y(y_) -{ -} - -Magick::Point::Point(double xy_) - : _x(xy_), - _y(xy_) -{ -} - -Magick::Point::~Point(void) -{ -} - -const Magick::Point& Magick::Point::operator=(const char *point_) -{ - MagickCore::GeometryInfo - geometry_info; - - MagickCore::MagickStatusType - flags; - - flags=ParseGeometry(point_,&geometry_info); - _x=geometry_info.rho; - _y=geometry_info.sigma; - if ((flags & MagickCore::SigmaValue) == 0) - _y=_x; - return(*this); -} - -const Magick::Point& Magick::Point::operator=(const double xy_) -{ - _x=xy_; - _y=xy_; - return(*this); -} - -Magick::Point& Magick::Point::operator=(const Point &point_) -{ - // If not being set to ourself - if (this != &point_) - { - _x=point_._x; - _y=point_._y; - } - return(*this); -} - -const Magick::Point& Magick::Point::operator=(const std::string &point_) -{ - *this=point_.c_str(); - return(*this); -} - -Magick::Point::operator std::string() const -{ - char - buffer[MagickPathExtent]; - - string - point; - - if (_x < 0.0) - point+="-"; - else - point+="+"; - - FormatLocaleString(buffer,MagickPathExtent,"%.20g",_x); - point+=buffer; - - if (_y < 0.0) - point+="x-"; - else - point+="x+"; - - FormatLocaleString(buffer,MagickPathExtent,"%.20g",(double) _y); - point+=buffer; - - return(point); -} - -bool Magick::Point::isValid(void) const -{ - return(_x > 0.0); -} - -double Magick::Point::x(void) const -{ - return(_x); -} - -double Magick::Point::y(void) const -{ - return(_y); -} \ No newline at end of file diff --git a/Magick++/lib/Image.cpp b/Magick++/lib/Image.cpp deleted file mode 100644 index a6dfcf0f3..000000000 --- a/Magick++/lib/Image.cpp +++ /dev/null @@ -1,5170 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003 -// Copyright Dirk Lemstra 2013-2017 -// -// Implementation of Image -// - -#define MAGICKCORE_IMPLEMENTATION 1 -#define MAGICK_PLUSPLUS_IMPLEMENTATION 1 - -#include "Magick++/Include.h" -#include -#include -#include -#include -#include - -using namespace std; - -#include "Magick++/Image.h" -#include "Magick++/Functions.h" -#include "Magick++/Pixels.h" -#include "Magick++/Options.h" -#include "Magick++/ImageRef.h" - -#define AbsoluteValue(x) ((x) < 0 ? -(x) : (x)) -#define MagickPI 3.14159265358979323846264338327950288419716939937510 -#define DegreesToRadians(x) (MagickPI*(x)/180.0) -#define ThrowImageException ThrowPPException(quiet()) - -MagickPPExport const char *Magick::borderGeometryDefault="6x6+0+0"; -MagickPPExport const char *Magick::frameGeometryDefault="25x25+6+6"; -MagickPPExport const char *Magick::raiseGeometryDefault="6x6+0+0"; - -MagickPPExport int Magick::operator == (const Magick::Image &left_, - const Magick::Image &right_) -{ - // If image pixels and signature are the same, then the image is identical - return((left_.rows() == right_.rows()) && - (left_.columns() == right_.columns()) && - (left_.signature() == right_.signature())); -} - -MagickPPExport int Magick::operator != (const Magick::Image &left_, - const Magick::Image &right_) -{ - return(!(left_ == right_)); -} - -MagickPPExport int Magick::operator > (const Magick::Image &left_, - const Magick::Image &right_) -{ - return(!(left_ < right_) && (left_ != right_)); -} - -MagickPPExport int Magick::operator < (const Magick::Image &left_, - const Magick::Image &right_) -{ - // If image pixels are less, then image is smaller - return((left_.rows() * left_.columns()) < - (right_.rows() * right_.columns())); -} - -MagickPPExport int Magick::operator >= (const Magick::Image &left_, - const Magick::Image &right_) -{ - return((left_ > right_) || (left_ == right_)); -} - -MagickPPExport int Magick::operator <= (const Magick::Image &left_, - const Magick::Image &right_) -{ - return((left_ < right_) || ( left_ == right_)); -} - -Magick::Image::Image(void) - : _imgRef(new ImageRef) -{ -} - -Magick::Image::Image(const Blob &blob_) - : _imgRef(new ImageRef) -{ - try - { - // Initialize, Allocate and Read images - quiet(true); - read(blob_); - quiet(false); - } - catch (const Error&) - { - // Release resources - delete _imgRef; - throw; - } -} - -Magick::Image::Image(const Blob &blob_,const Geometry &size_) - : _imgRef(new ImageRef) -{ - try - { - // Read from Blob - quiet(true); - read(blob_, size_); - quiet(false); - } - catch(const Error&) - { - // Release resources - delete _imgRef; - throw; - } -} - -Magick::Image::Image(const Blob &blob_,const Geometry &size_, - const size_t depth_) - : _imgRef(new ImageRef) -{ - try - { - // Read from Blob - quiet(true); - read(blob_,size_,depth_); - quiet(false); - } - catch(const Error&) - { - // Release resources - delete _imgRef; - throw; - } -} - -Magick::Image::Image(const Blob &blob_,const Geometry &size_, - const size_t depth_,const std::string &magick_) - : _imgRef(new ImageRef) -{ - try - { - // Read from Blob - quiet(true); - read(blob_,size_,depth_,magick_); - quiet(false); - } - catch(const Error&) - { - // Release resources - delete _imgRef; - throw; - } -} - -Magick::Image::Image(const Blob &blob_,const Geometry &size_, - const std::string &magick_) - : _imgRef(new ImageRef) -{ - try - { - // Read from Blob - quiet(true); - read(blob_,size_,magick_); - quiet(false); - } - catch(const Error&) - { - // Release resources - delete _imgRef; - throw; - } -} - -Magick::Image::Image(const Geometry &size_,const Color &color_) - : _imgRef(new ImageRef) -{ - // xc: prefix specifies an X11 color string - std::string imageSpec("xc:"); - imageSpec+=color_; - - try - { - quiet(true); - // Set image size - size(size_); - - // Initialize, Allocate and Read images - read(imageSpec); - quiet(false); - } - catch(const Error&) - { - // Release resources - delete _imgRef; - throw; - } -} - -Magick::Image::Image(const Image &image_) - : _imgRef(image_._imgRef) -{ - _imgRef->increase(); -} - -Magick::Image::Image(const Image &image_,const Geometry &geometry_) - : _imgRef(new ImageRef) -{ - const RectangleInfo - geometry=geometry_; - - OffsetInfo - offset; - - MagickCore::Image - *image; - - GetPPException; - image=CloneImage(image_.constImage(),geometry_.width(),geometry_.height(), - MagickTrue,exceptionInfo); - replaceImage(image); - _imgRef->options(new Options(*image_.constOptions())); - offset.x=0; - offset.y=0; - (void) CopyImagePixels(image,image_.constImage(),&geometry,&offset, - exceptionInfo); - ThrowImageException; -} - -Magick::Image::Image(const size_t width_,const size_t height_, - const std::string &map_,const StorageType type_,const void *pixels_) - : _imgRef(new ImageRef) -{ - try - { - quiet(true); - read(width_,height_,map_.c_str(),type_,pixels_); - quiet(false); - } - catch(const Error&) - { - // Release resources - delete _imgRef; - throw; - } -} - -Magick::Image::Image(const std::string &imageSpec_) - : _imgRef(new ImageRef) -{ - try - { - // Initialize, Allocate and Read images - quiet(true); - read(imageSpec_); - quiet(false); - } - catch(const Error&) - { - // Release resources - delete _imgRef; - throw; - } -} - -Magick::Image::~Image() -{ - try - { - if (_imgRef->decrease() == 0) - delete _imgRef; - } - catch(Magick::Exception&) - { - } - - _imgRef=(Magick::ImageRef *) NULL; -} - -Magick::Image& Magick::Image::operator=(const Magick::Image &image_) -{ - if (this != &image_) - { - image_._imgRef->increase(); - if (_imgRef->decrease() == 0) - delete _imgRef; - - // Use new image reference - _imgRef=image_._imgRef; - } - return(*this); -} - -void Magick::Image::adjoin(const bool flag_) -{ - modifyImage(); - options()->adjoin(flag_); -} - -bool Magick::Image::adjoin(void) const -{ - return(constOptions()->adjoin()); -} - -void Magick::Image::alpha(const bool alphaFlag_) -{ - modifyImage(); - - // If matte channel is requested, but image doesn't already have a - // matte channel, then create an opaque matte channel. Likewise, if - // the image already has a matte channel but a matte channel is not - // desired, then set the matte channel to opaque. - GetPPException; - if (bool(alphaFlag_) != bool(constImage()->alpha_trait)) - SetImageAlpha(image(),OpaqueAlpha,exceptionInfo); - ThrowImageException; - - image()->alpha_trait=alphaFlag_ ? BlendPixelTrait : UndefinedPixelTrait; -} - -bool Magick::Image::alpha(void) const -{ - if (constImage()->alpha_trait == BlendPixelTrait) - return(true); - else - return(false); -} - -void Magick::Image::matteColor(const Color &matteColor_) -{ - modifyImage(); - - if (matteColor_.isValid()) - { - image()->matte_color=matteColor_; - options()->matteColor(matteColor_); - } - else - { - // Set to default matte color - Color tmpColor("#BDBDBD"); - image()->matte_color=tmpColor; - options()->matteColor(tmpColor); - } -} - -Magick::Color Magick::Image::matteColor(void) const -{ - return(Color(constImage()->matte_color)); -} - -void Magick::Image::animationDelay(const size_t delay_) -{ - modifyImage(); - image()->delay=delay_; -} - -size_t Magick::Image::animationDelay(void) const -{ - return(constImage()->delay); -} - -void Magick::Image::animationIterations(const size_t iterations_) -{ - modifyImage(); - image()->iterations=iterations_; -} - -size_t Magick::Image::animationIterations(void) const -{ - return(constImage()->iterations); -} - -void Magick::Image::backgroundColor(const Color &backgroundColor_) -{ - modifyImage(); - - if (backgroundColor_.isValid()) - image()->background_color=backgroundColor_; - else - image()->background_color=Color(); - - options()->backgroundColor(backgroundColor_); -} - -Magick::Color Magick::Image::backgroundColor(void) const -{ - return(constOptions()->backgroundColor()); -} - -void Magick::Image::backgroundTexture(const std::string &backgroundTexture_) -{ - modifyImage(); - options()->backgroundTexture(backgroundTexture_); -} - -std::string Magick::Image::backgroundTexture(void) const -{ - return(constOptions()->backgroundTexture()); -} - -size_t Magick::Image::baseColumns(void) const -{ - return(constImage()->magick_columns); -} - -std::string Magick::Image::baseFilename(void) const -{ - return(std::string(constImage()->magick_filename)); -} - -size_t Magick::Image::baseRows(void) const -{ - return(constImage()->magick_rows); -} - -void Magick::Image::blackPointCompensation(const bool flag_) -{ - image()->black_point_compensation=(MagickBooleanType) flag_; -} - -bool Magick::Image::blackPointCompensation(void) const -{ - return(static_cast(constImage()->black_point_compensation)); -} - -void Magick::Image::borderColor(const Color &borderColor_) -{ - modifyImage(); - - if (borderColor_.isValid()) - image()->border_color=borderColor_; - else - image()->border_color=Color(); - - options()->borderColor(borderColor_); -} - -Magick::Color Magick::Image::borderColor(void) const -{ - return(constOptions()->borderColor()); -} - -Magick::Geometry Magick::Image::boundingBox(void) const -{ - RectangleInfo - bbox; - - GetPPException; - bbox=GetImageBoundingBox(constImage(),exceptionInfo); - ThrowImageException; - return(Geometry(bbox)); -} - -void Magick::Image::boxColor(const Color &boxColor_) -{ - modifyImage(); - options()->boxColor(boxColor_); -} - -Magick::Color Magick::Image::boxColor(void) const -{ - return(constOptions()->boxColor()); -} - -void Magick::Image::channelDepth(const ChannelType channel_, - const size_t depth_) -{ - modifyImage(); - GetPPException; - GetAndSetPPChannelMask(channel_); - SetImageDepth(image(),depth_,exceptionInfo); - RestorePPChannelMask; - ThrowImageException; -} - -size_t Magick::Image::channelDepth(const ChannelType channel_) -{ - size_t - channel_depth; - - GetPPException; - GetAndSetPPChannelMask(channel_); - channel_depth=GetImageDepth(constImage(),exceptionInfo); - RestorePPChannelMask; - ThrowImageException; - return(channel_depth); -} - -size_t Magick::Image::channels() const -{ - return(constImage()->number_channels); -} - -void Magick::Image::classType(const ClassType class_) -{ - if (classType() == PseudoClass && class_ == DirectClass) - { - // Use SyncImage to synchronize the DirectClass pixels with the - // color map and then set to DirectClass type. - modifyImage(); - GetPPException; - SyncImage(image(),exceptionInfo); - ThrowImageException; - image()->colormap=(PixelInfo *)RelinquishMagickMemory(image()->colormap); - image()->storage_class=static_cast(DirectClass); - return; - } - - if (classType() == DirectClass && class_ == PseudoClass) - { - // Quantize to create PseudoClass color map - modifyImage(); - quantizeColors(MaxColormapSize); - quantize(); - image()->storage_class=static_cast(PseudoClass); - } -} - -Magick::ClassType Magick::Image::classType(void) const -{ - return static_cast(constImage()->storage_class); -} - -void Magick::Image::colorFuzz(const double fuzz_) -{ - modifyImage(); - image()->fuzz=fuzz_; - options()->colorFuzz(fuzz_); -} - -double Magick::Image::colorFuzz(void) const -{ - return(constOptions()->colorFuzz()); -} - -void Magick::Image::colorMapSize(const size_t entries_) -{ - if (entries_ >MaxColormapSize) - throwExceptionExplicit(MagickCore::OptionError, - "Colormap entries must not exceed MaxColormapSize"); - - modifyImage(); - GetPPException; - (void) AcquireImageColormap(image(),entries_,exceptionInfo); - ThrowImageException; -} - -size_t Magick::Image::colorMapSize(void) const -{ - if (!constImage()->colormap) - throwExceptionExplicit(MagickCore::OptionError, - "Image does not contain a colormap"); - - return(constImage()->colors); -} - -void Magick::Image::colorSpace(const ColorspaceType colorSpace_) -{ - if (image()->colorspace == colorSpace_) - return; - - modifyImage(); - GetPPException; - TransformImageColorspace(image(),colorSpace_,exceptionInfo); - ThrowImageException; -} - -Magick::ColorspaceType Magick::Image::colorSpace(void) const -{ - return (constImage()->colorspace); -} - -void Magick::Image::colorSpaceType(const ColorspaceType colorSpace_) -{ - modifyImage(); - GetPPException; - SetImageColorspace(image(),colorSpace_,exceptionInfo); - ThrowImageException; - options()->colorspaceType(colorSpace_); -} - -Magick::ColorspaceType Magick::Image::colorSpaceType(void) const -{ - return(constOptions()->colorspaceType()); -} - -size_t Magick::Image::columns(void) const -{ - return(constImage()->columns); -} - -void Magick::Image::comment(const std::string &comment_) -{ - modifyImage(); - GetPPException; - SetImageProperty(image(),"Comment",NULL,exceptionInfo); - if (comment_.length() > 0) - SetImageProperty(image(),"Comment",comment_.c_str(),exceptionInfo); - ThrowImageException; -} - -std::string Magick::Image::comment(void) const -{ - const char - *value; - - GetPPException; - value=GetImageProperty(constImage(),"Comment",exceptionInfo); - ThrowImageException; - - if (value) - return(std::string(value)); - - return(std::string()); // Intentionally no exception -} - -void Magick::Image::compose(const CompositeOperator compose_) -{ - image()->compose=compose_; -} - -Magick::CompositeOperator Magick::Image::compose(void) const -{ - return(constImage()->compose); -} - -void Magick::Image::compressType(const CompressionType compressType_) -{ - modifyImage(); - image()->compression=compressType_; - options()->compressType(compressType_); -} - -Magick::CompressionType Magick::Image::compressType(void) const -{ - return(constImage()->compression); -} - -void Magick::Image::debug(const bool flag_) -{ - modifyImage(); - options()->debug(flag_); -} - -bool Magick::Image::debug(void) const -{ - return(constOptions()->debug()); -} - -void Magick::Image::density(const Point &density_) -{ - modifyImage(); - options()->density(density_); - if (density_.isValid()) - { - image()->resolution.x=density_.x(); - if (density_.y() != 0.0) - image()->resolution.y=density_.y(); - else - image()->resolution.y=density_.x(); - } - else - { - // Reset to default - image()->resolution.x=0.0; - image()->resolution.y=0.0; - } -} - -Magick::Point Magick::Image::density(void) const -{ - if (isValid()) - { - ssize_t - x_resolution=72, - y_resolution=72; - - if (constImage()->resolution.x > 0.0) - x_resolution=constImage()->resolution.x; - - if (constImage()->resolution.y > 0.0) - y_resolution=constImage()->resolution.y; - - return(Point(x_resolution,y_resolution)); - } - - return(constOptions()->density()); -} - -void Magick::Image::depth(const size_t depth_) -{ - modifyImage(); - image()->depth=depth_; - options()->depth(depth_); -} - -size_t Magick::Image::depth(void) const -{ - return(constImage()->depth); -} - -std::string Magick::Image::directory(void) const -{ - if (constImage()->directory) - return(std::string(constImage()->directory)); - - if (!quiet()) - throwExceptionExplicit(MagickCore::CorruptImageWarning, - "Image does not contain a directory"); - - return(std::string()); -} - -void Magick::Image::endian(const Magick::EndianType endian_) -{ - modifyImage(); - options()->endian(endian_); - image()->endian=endian_; -} - -Magick::EndianType Magick::Image::endian(void) const -{ - return(constImage()->endian); -} - -void Magick::Image::exifProfile(const Magick::Blob &exifProfile_) -{ - modifyImage(); - - if (exifProfile_.data() != 0) - { - StringInfo - *exif_profile; - - exif_profile=AcquireStringInfo(exifProfile_.length()); - SetStringInfoDatum(exif_profile,(unsigned char *) exifProfile_.data()); - GetPPException; - (void) SetImageProfile(image(),"exif",exif_profile,exceptionInfo); - exif_profile=DestroyStringInfo(exif_profile); - ThrowImageException; - } -} - -Magick::Blob Magick::Image::exifProfile(void) const -{ - const StringInfo - *exif_profile; - - exif_profile=GetImageProfile(constImage(),"exif"); - if (exif_profile == (StringInfo *) NULL) - return(Blob()); - return(Blob(GetStringInfoDatum(exif_profile), - GetStringInfoLength(exif_profile))); -} - -void Magick::Image::fileName(const std::string &fileName_) -{ - ssize_t - max_length; - - modifyImage(); - - max_length=sizeof(image()->filename)-1; - fileName_.copy(image()->filename,max_length); - if ((ssize_t) fileName_.length() > max_length) - image()->filename[max_length]=0; - else - image()->filename[fileName_.length()]=0; - - options()->fileName(fileName_); -} - -std::string Magick::Image::fileName(void) const -{ - return(constOptions()->fileName()); -} - -MagickCore::MagickSizeType Magick::Image::fileSize(void) const -{ - return(GetBlobSize(constImage())); -} - -void Magick::Image::fillColor(const Magick::Color &fillColor_) -{ - modifyImage(); - options()->fillColor(fillColor_); -} - -Magick::Color Magick::Image::fillColor(void) const -{ - return(constOptions()->fillColor()); -} - -void Magick::Image::fillRule(const Magick::FillRule &fillRule_) -{ - modifyImage(); - options()->fillRule(fillRule_); -} - -Magick::FillRule Magick::Image::fillRule(void) const -{ - return constOptions()->fillRule(); -} - -void Magick::Image::fillPattern(const Image &fillPattern_) -{ - modifyImage(); - if (fillPattern_.isValid()) - options()->fillPattern(fillPattern_.constImage()); - else - options()->fillPattern(static_cast(NULL)); -} - -Magick::Image Magick::Image::fillPattern(void) const -{ - // FIXME: This is inordinately innefficient - const MagickCore::Image - *tmpTexture; - - Image - texture; - - tmpTexture=constOptions()->fillPattern(); - - if (tmpTexture) - { - MagickCore::Image - *image; - - GetPPException; - image=CloneImage(tmpTexture,0,0,MagickTrue,exceptionInfo); - texture.replaceImage(image); - ThrowImageException; - } - return(texture); -} - -void Magick::Image::filterType(const Magick::FilterType filterType_) -{ - modifyImage(); - image()->filter=filterType_; -} - -Magick::FilterType Magick::Image::filterType(void) const -{ - return(constImage()->filter); -} - -void Magick::Image::font(const std::string &font_) -{ - modifyImage(); - options()->font(font_); -} - -std::string Magick::Image::font(void) const -{ - return(constOptions()->font()); -} - -void Magick::Image::fontFamily(const std::string &family_) -{ - modifyImage(); - options()->fontFamily(family_); -} - -std::string Magick::Image::fontFamily(void) const -{ - return(constOptions()->fontFamily()); -} - -void Magick::Image::fontPointsize(const double pointSize_) -{ - modifyImage(); - options()->fontPointsize(pointSize_); -} - -double Magick::Image::fontPointsize(void) const -{ - return(constOptions()->fontPointsize()); -} - -void Magick::Image::fontStyle(const StyleType pointSize_) -{ - modifyImage(); - options()->fontStyle(pointSize_); -} - -Magick::StyleType Magick::Image::fontStyle(void) const -{ - return(constOptions()->fontStyle()); -} - -void Magick::Image::fontWeight(const size_t weight_) -{ - modifyImage(); - options()->fontWeight(weight_); -} - -size_t Magick::Image::fontWeight(void) const -{ - return(constOptions()->fontWeight()); -} - -std::string Magick::Image::format(void) const -{ - const MagickInfo - *magick_info; - - GetPPException; - magick_info=GetMagickInfo(constImage()->magick,exceptionInfo); - ThrowImageException; - - if ((magick_info != 0) && (*magick_info->description != '\0')) - return(std::string(magick_info->description)); - - if (!quiet()) - throwExceptionExplicit(MagickCore::CorruptImageWarning, - "Unrecognized image magick type"); - - return(std::string()); -} - -std::string Magick::Image::formatExpression(const std::string expression) -{ - char - *text; - - std::string - text_string; - - GetPPException; - modifyImage(); - text=InterpretImageProperties(imageInfo(),image(),expression.c_str(), - exceptionInfo); - if (text != (char *) NULL) - { - text_string=std::string(text); - text=DestroyString(text); - } - ThrowImageException; - return(text_string); -} - -double Magick::Image::gamma(void) const -{ - return(constImage()->gamma); -} - -Magick::Geometry Magick::Image::geometry(void) const -{ - if (constImage()->geometry) - return Geometry(constImage()->geometry); - - if (!quiet()) - throwExceptionExplicit(MagickCore::OptionWarning, - "Image does not contain a geometry"); - - return(Geometry()); -} - -void Magick::Image::gifDisposeMethod( - const MagickCore::DisposeType disposeMethod_) -{ - modifyImage(); - image()->dispose=disposeMethod_; -} - -MagickCore::DisposeType Magick::Image::gifDisposeMethod(void) const -{ - return(constImage()->dispose); -} - -bool Magick::Image::hasChannel(const PixelChannel channel) const -{ - if (GetPixelChannelTraits(constImage(),channel) == UndefinedPixelTrait) - return(false); - - if (channel == GreenPixelChannel || channel == BluePixelChannel) - return (GetPixelChannelOffset(constImage(),channel) == (ssize_t)channel); - - return(true); -} - -void Magick::Image::highlightColor(const Color color_) -{ - std::string - value; - - value=color_; - artifact("compare:highlight-color",value); -} - -void Magick::Image::iccColorProfile(const Magick::Blob &colorProfile_) -{ - profile("icc",colorProfile_); -} - -Magick::Blob Magick::Image::iccColorProfile(void) const -{ - const StringInfo - *color_profile; - - color_profile=GetImageProfile(constImage(),"icc"); - if (color_profile == (StringInfo *) NULL) - return(Blob()); - return(Blob(GetStringInfoDatum(color_profile),GetStringInfoLength( - color_profile))); -} - -void Magick::Image::interlaceType(const Magick::InterlaceType interlace_) -{ - modifyImage(); - image()->interlace=interlace_; - options()->interlaceType(interlace_); -} - -Magick::InterlaceType Magick::Image::interlaceType(void) const -{ - return(constImage()->interlace); -} - -void Magick::Image::interpolate(const PixelInterpolateMethod interpolate_) -{ - modifyImage(); - image()->interpolate=interpolate_; -} - -Magick::PixelInterpolateMethod Magick::Image::interpolate(void) const -{ - return constImage()->interpolate; -} - -void Magick::Image::iptcProfile(const Magick::Blob &iptcProfile_) -{ - modifyImage(); - if (iptcProfile_.data() != 0) - { - StringInfo - *iptc_profile; - - iptc_profile=AcquireStringInfo(iptcProfile_.length()); - SetStringInfoDatum(iptc_profile,(unsigned char *) iptcProfile_.data()); - GetPPException; - (void) SetImageProfile(image(),"iptc",iptc_profile,exceptionInfo); - iptc_profile=DestroyStringInfo(iptc_profile); - ThrowImageException; - } -} - -Magick::Blob Magick::Image::iptcProfile(void) const -{ - const StringInfo - *iptc_profile; - - iptc_profile=GetImageProfile(constImage(),"iptc"); - if (iptc_profile == (StringInfo *) NULL) - return(Blob()); - return(Blob(GetStringInfoDatum(iptc_profile),GetStringInfoLength( - iptc_profile))); -} - -bool Magick::Image::isOpaque(void) const -{ - MagickBooleanType - result; - - GetPPException; - result=IsImageOpaque(constImage(),exceptionInfo); - ThrowImageException; - return(result != MagickFalse ? true : false); -} - -void Magick::Image::isValid(const bool isValid_) -{ - if (!isValid_) - { - delete _imgRef; - _imgRef=new ImageRef; - } - else if (!isValid()) - { - // Construct with single-pixel black image to make - // image valid. This is an obvious hack. - size(Geometry(1,1)); - read("xc:black"); - } -} - -bool Magick::Image::isValid(void) const -{ - return rows() && columns(); -} - -void Magick::Image::label(const std::string &label_) -{ - modifyImage(); - GetPPException; - (void) SetImageProperty(image(),"Label",NULL,exceptionInfo); - if (label_.length() > 0) - (void) SetImageProperty(image(),"Label",label_.c_str(),exceptionInfo); - ThrowImageException; -} - -std::string Magick::Image::label(void) const -{ - const char - *value; - - GetPPException; - value=GetImageProperty(constImage(),"Label",exceptionInfo); - ThrowImageException; - - if (value) - return(std::string(value)); - - return(std::string()); -} - -void Magick::Image::lowlightColor(const Color color_) -{ - std::string - value; - - value=color_; - artifact("compare:lowlight-color",value); -} - -void Magick::Image::magick(const std::string &magick_) -{ - size_t - length; - - modifyImage(); - - length=sizeof(image()->magick)-1; - if (magick_.length() < length) - length=magick_.length(); - - if (!magick_.empty()) - magick_.copy(image()->magick,length); - image()->magick[length]=0; - - options()->magick(magick_); -} - -std::string Magick::Image::magick(void) const -{ - if (*(constImage()->magick) != '\0') - return(std::string(constImage()->magick)); - - return(constOptions()->magick()); -} - -void Magick::Image::masklightColor(const Color color_) -{ - std::string - value; - - value=color_; - artifact("compare:masklight-color",value); -} - -double Magick::Image::meanErrorPerPixel(void) const -{ - return(constImage()->error.mean_error_per_pixel); -} - -void Magick::Image::modulusDepth(const size_t depth_) -{ - modifyImage(); - GetPPException; - SetImageDepth(image(),depth_,exceptionInfo); - ThrowImageException; - options()->depth(depth_); -} - -size_t Magick::Image::modulusDepth(void) const -{ - size_t - depth; - - GetPPException; - depth=GetImageDepth(constImage(),exceptionInfo); - ThrowImageException; - return(depth); -} - -void Magick::Image::monochrome(const bool monochromeFlag_) -{ - modifyImage(); - options()->monochrome(monochromeFlag_); -} - -bool Magick::Image::monochrome(void) const -{ - return(constOptions()->monochrome()); -} - -Magick::Geometry Magick::Image::montageGeometry(void) const -{ - if (constImage()->montage) - return Magick::Geometry(constImage()->montage); - - if (!quiet()) - throwExceptionExplicit(MagickCore::CorruptImageWarning, - "Image does not contain a montage"); - - return(Magick::Geometry()); -} - -double Magick::Image::normalizedMaxError(void) const -{ - return(constImage()->error.normalized_maximum_error); -} - -double Magick::Image::normalizedMeanError(void) const -{ - return(constImage()->error.normalized_mean_error); -} - -void Magick::Image::orientation(const Magick::OrientationType orientation_) -{ - modifyImage(); - image()->orientation=orientation_; -} - -Magick::OrientationType Magick::Image::orientation(void) const -{ - return(constImage()->orientation); -} - -void Magick::Image::page(const Magick::Geometry &pageSize_) -{ - modifyImage(); - options()->page(pageSize_); - image()->page=pageSize_; -} - -Magick::Geometry Magick::Image::page(void) const -{ - return(Geometry(constImage()->page.width,constImage()->page.height, - constImage()->page.x,constImage()->page.y)); -} - -void Magick::Image::quality(const size_t quality_) -{ - modifyImage(); - image()->quality=quality_; - options()->quality(quality_); -} - -size_t Magick::Image::quality(void) const -{ - return(constImage()->quality); -} - -void Magick::Image::quantizeColors(const size_t colors_) -{ - modifyImage(); - options()->quantizeColors(colors_); -} - -size_t Magick::Image::quantizeColors(void) const -{ - return(constOptions()->quantizeColors()); -} - -void Magick::Image::quantizeColorSpace( - const Magick::ColorspaceType colorSpace_) -{ - modifyImage(); - options()->quantizeColorSpace(colorSpace_); -} - -Magick::ColorspaceType Magick::Image::quantizeColorSpace(void) const -{ - return(constOptions()->quantizeColorSpace()); -} - -void Magick::Image::quantizeDither(const bool ditherFlag_) -{ - modifyImage(); - options()->quantizeDither(ditherFlag_); -} - -bool Magick::Image::quantizeDither(void) const -{ - return(constOptions()->quantizeDither()); -} - -void Magick::Image::quantizeDitherMethod(const DitherMethod ditherMethod_) -{ - modifyImage(); - options()->quantizeDitherMethod(ditherMethod_); -} - -MagickCore::DitherMethod Magick::Image::quantizeDitherMethod(void) const -{ - return(constOptions()->quantizeDitherMethod()); -} - -void Magick::Image::quantizeTreeDepth(const size_t treeDepth_) -{ - modifyImage(); - options()->quantizeTreeDepth(treeDepth_); -} - -size_t Magick::Image::quantizeTreeDepth() const -{ - return(constOptions()->quantizeTreeDepth()); -} - -void Magick::Image::quiet(const bool quiet_) -{ - modifyImage(); - options()->quiet(quiet_); -} - -bool Magick::Image::quiet(void) const -{ - return(constOptions()->quiet()); -} - -void Magick::Image::renderingIntent( - const Magick::RenderingIntent renderingIntent_) -{ - modifyImage(); - image()->rendering_intent=renderingIntent_; -} - -Magick::RenderingIntent Magick::Image::renderingIntent(void) const -{ - return(static_cast(constImage()->rendering_intent)); -} - -void Magick::Image::resolutionUnits( - const Magick::ResolutionType resolutionUnits_) -{ - modifyImage(); - image()->units=resolutionUnits_; - options()->resolutionUnits(resolutionUnits_); -} - -Magick::ResolutionType Magick::Image::resolutionUnits(void) const -{ - return(static_cast(constImage()->units)); -} - -size_t Magick::Image::rows(void) const -{ - return(constImage()->rows); -} - -void Magick::Image::scene(const size_t scene_) -{ - modifyImage(); - image()->scene=scene_; -} - -size_t Magick::Image::scene(void) const -{ - return(constImage()->scene); -} - -void Magick::Image::size(const Geometry &geometry_) -{ - modifyImage(); - options()->size(geometry_); - image()->rows=geometry_.height(); - image()->columns=geometry_.width(); -} - -Magick::Geometry Magick::Image::size(void) const -{ - return(Magick::Geometry(constImage()->columns,constImage()->rows)); -} - -void Magick::Image::strokeAntiAlias(const bool flag_) -{ - modifyImage(); - options()->strokeAntiAlias(flag_); -} - -bool Magick::Image::strokeAntiAlias(void) const -{ - return(constOptions()->strokeAntiAlias()); -} - -void Magick::Image::strokeColor(const Magick::Color &strokeColor_) -{ - std::string - value; - - modifyImage(); - options()->strokeColor(strokeColor_); - value=strokeColor_; - artifact("stroke",value); -} - -Magick::Color Magick::Image::strokeColor(void) const -{ - return(constOptions()->strokeColor()); -} - -void Magick::Image::strokeDashArray(const double *strokeDashArray_) -{ - modifyImage(); - options()->strokeDashArray(strokeDashArray_); -} - -const double* Magick::Image::strokeDashArray(void) const -{ - return(constOptions()->strokeDashArray()); -} - -void Magick::Image::strokeDashOffset(const double strokeDashOffset_) -{ - modifyImage(); - options()->strokeDashOffset(strokeDashOffset_); -} - -double Magick::Image::strokeDashOffset(void) const -{ - return(constOptions()->strokeDashOffset()); -} - -void Magick::Image::strokeLineCap(const Magick::LineCap lineCap_) -{ - modifyImage(); - options()->strokeLineCap(lineCap_); -} - -Magick::LineCap Magick::Image::strokeLineCap(void) const -{ - return(constOptions()->strokeLineCap()); -} - -void Magick::Image::strokeLineJoin(const Magick::LineJoin lineJoin_) -{ - modifyImage(); - options()->strokeLineJoin(lineJoin_); -} - -Magick::LineJoin Magick::Image::strokeLineJoin(void) const -{ - return(constOptions()->strokeLineJoin()); -} - -void Magick::Image::strokeMiterLimit(const size_t strokeMiterLimit_) -{ - modifyImage(); - options()->strokeMiterLimit(strokeMiterLimit_); -} - -size_t Magick::Image::strokeMiterLimit(void) const -{ - return(constOptions()->strokeMiterLimit()); -} - -void Magick::Image::strokePattern(const Image &strokePattern_) -{ - modifyImage(); - if(strokePattern_.isValid()) - options()->strokePattern(strokePattern_.constImage()); - else - options()->strokePattern(static_cast(NULL)); -} - -Magick::Image Magick::Image::strokePattern(void) const -{ - // FIXME: This is inordinately innefficient - const MagickCore::Image - *tmpTexture; - - Image - texture; - - tmpTexture=constOptions()->strokePattern(); - - if (tmpTexture) - { - MagickCore::Image - *image; - - GetPPException; - image=CloneImage(tmpTexture,0,0,MagickTrue,exceptionInfo); - texture.replaceImage(image); - ThrowImageException; - } - return(texture); -} - -void Magick::Image::strokeWidth(const double strokeWidth_) -{ - char - value[MagickPathExtent]; - - modifyImage(); - options()->strokeWidth(strokeWidth_); - FormatLocaleString(value,MagickPathExtent,"%.20g",strokeWidth_); - (void) SetImageArtifact(image(),"strokewidth",value); -} - -double Magick::Image::strokeWidth(void) const -{ - return(constOptions()->strokeWidth()); -} - -void Magick::Image::subImage(const size_t subImage_) -{ - modifyImage(); - options()->subImage(subImage_); -} - -size_t Magick::Image::subImage(void) const -{ - return(constOptions()->subImage()); -} - -void Magick::Image::subRange(const size_t subRange_) -{ - modifyImage(); - options()->subRange(subRange_); -} - -size_t Magick::Image::subRange(void) const -{ - return(constOptions()->subRange()); -} - -void Magick::Image::textAntiAlias(const bool flag_) -{ - modifyImage(); - options()->textAntiAlias(flag_); -} - -bool Magick::Image::textAntiAlias(void) const -{ - return(constOptions()->textAntiAlias()); -} - -void Magick::Image::textDirection(DirectionType direction_) -{ - modifyImage(); - options()->textDirection(direction_); -} - -Magick::DirectionType Magick::Image::textDirection(void) const -{ - return(constOptions()->textDirection()); -} - -void Magick::Image::textEncoding(const std::string &encoding_) -{ - modifyImage(); - options()->textEncoding(encoding_); -} - -std::string Magick::Image::textEncoding(void) const -{ - return(constOptions()->textEncoding()); -} - -void Magick::Image::textGravity(GravityType gravity_) -{ - modifyImage(); - options()->textGravity(gravity_); -} - -Magick::GravityType Magick::Image::textGravity(void) const -{ - return(constOptions()->textGravity()); -} - -void Magick::Image::textInterlineSpacing(double spacing_) -{ - modifyImage(); - options()->textInterlineSpacing(spacing_); -} - -double Magick::Image::textInterlineSpacing(void) const -{ - return(constOptions()->textInterlineSpacing()); -} - -void Magick::Image::textInterwordSpacing(double spacing_) -{ - modifyImage(); - options()->textInterwordSpacing(spacing_); -} - -double Magick::Image::textInterwordSpacing(void) const -{ - return(constOptions()->textInterwordSpacing()); -} - -void Magick::Image::textKerning(double kerning_) -{ - modifyImage(); - options()->textKerning(kerning_); -} - -double Magick::Image::textKerning(void) const -{ - return(constOptions()->textKerning()); -} - -void Magick::Image::textUnderColor(const Color &underColor_) -{ - modifyImage(); - options()->textUnderColor(underColor_); -} - -Magick::Color Magick::Image::textUnderColor(void) const -{ - return(constOptions()->textUnderColor()); -} - -size_t Magick::Image::totalColors(void) const -{ - size_t - colors; - - GetPPException; - colors=GetNumberColors(constImage(),(FILE *) NULL,exceptionInfo); - ThrowImageException; - return colors; -} - -void Magick::Image::transformRotation(const double angle_) -{ - modifyImage(); - options()->transformRotation(angle_); -} - -void Magick::Image::transformSkewX(const double skewx_) -{ - modifyImage(); - options()->transformSkewX(skewx_); -} - -void Magick::Image::transformSkewY(const double skewy_) -{ - modifyImage(); - options()->transformSkewY(skewy_); -} - -Magick::ImageType Magick::Image::type(void) const -{ - if (constOptions()->type() != UndefinedType) - return(constOptions()->type()); - return(GetImageType(constImage())); -} - -void Magick::Image::type(const Magick::ImageType type_) -{ - modifyImage(); - options()->type(type_); - GetPPException; - SetImageType(image(),type_,exceptionInfo); - ThrowImageException; -} - -void Magick::Image::verbose(const bool verboseFlag_) -{ - modifyImage(); - options()->verbose(verboseFlag_); -} - -bool Magick::Image::verbose(void) const -{ - return(constOptions()->verbose()); -} - -void Magick::Image::virtualPixelMethod( - const VirtualPixelMethod virtualPixelMethod_) -{ - modifyImage(); - GetPPException; - SetImageVirtualPixelMethod(image(),virtualPixelMethod_,exceptionInfo); - ThrowImageException; -} - -Magick::VirtualPixelMethod Magick::Image::virtualPixelMethod(void) const -{ - return(GetImageVirtualPixelMethod(constImage())); -} - -void Magick::Image::x11Display(const std::string &display_) -{ - modifyImage(); - options()->x11Display(display_); -} - -std::string Magick::Image::x11Display(void) const -{ - return(constOptions()->x11Display()); -} - -double Magick::Image::xResolution(void) const -{ - return(constImage()->resolution.x); -} - -double Magick::Image::yResolution(void) const -{ - return(constImage()->resolution.y); -} - -void Magick::Image::adaptiveBlur(const double radius_,const double sigma_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=AdaptiveBlurImage(constImage(),radius_,sigma_,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::adaptiveResize(const Geometry &geometry_) -{ - MagickCore::Image - *newImage; - - size_t - height=rows(), - width=columns(); - - ssize_t - x=0, - y=0; - - ParseMetaGeometry(static_cast(geometry_).c_str(),&x,&y,&width, - &height); - - GetPPException; - newImage=AdaptiveResizeImage(constImage(),width,height,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::adaptiveSharpen(const double radius_,const double sigma_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=AdaptiveSharpenImage(constImage(),radius_,sigma_,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::adaptiveSharpenChannel(const ChannelType channel_, - const double radius_,const double sigma_ ) -{ - MagickCore::Image - *newImage; - - GetPPException; - GetAndSetPPChannelMask(channel_); - newImage=AdaptiveSharpenImage(constImage(),radius_,sigma_,exceptionInfo); - RestorePPChannelMask; - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::adaptiveThreshold(const size_t width_,const size_t height_, - const double bias_) -{ - - MagickCore::Image - *newImage; - - GetPPException; - newImage=AdaptiveThresholdImage(constImage(),width_,height_,bias_, - exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::addNoise(const NoiseType noiseType_,const double attenuate_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=AddNoiseImage(constImage(),noiseType_,attenuate_,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::addNoiseChannel(const ChannelType channel_, - const NoiseType noiseType_,const double attenuate_) -{ - MagickCore::Image - *newImage; - - GetPPException; - GetAndSetPPChannelMask(channel_); - newImage=AddNoiseImage(constImage(),noiseType_,attenuate_,exceptionInfo); - RestorePPChannelMask; - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::affineTransform(const DrawableAffine &affine_) -{ - AffineMatrix - _affine; - - MagickCore::Image - *newImage; - - _affine.sx=affine_.sx(); - _affine.sy=affine_.sy(); - _affine.rx=affine_.rx(); - _affine.ry=affine_.ry(); - _affine.tx=affine_.tx(); - _affine.ty=affine_.ty(); - - GetPPException; - newImage=AffineTransformImage(constImage(),&_affine,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::alpha(const unsigned int alpha_) -{ - modifyImage(); - GetPPException; - SetImageAlpha(image(),alpha_,exceptionInfo); - ThrowImageException; -} - -void Magick::Image::alphaChannel(AlphaChannelOption alphaOption_) -{ - modifyImage(); - GetPPException; - SetImageAlphaChannel(image(),alphaOption_,exceptionInfo); - ThrowImageException; -} - -void Magick::Image::annotate(const std::string &text_, - const Geometry &location_) -{ - annotate(text_,location_,NorthWestGravity,0.0); -} - -void Magick::Image::annotate(const std::string &text_, - const Geometry &boundingArea_,const GravityType gravity_) -{ - annotate(text_,boundingArea_,gravity_,0.0); -} - -void Magick::Image::annotate(const std::string &text_, - const Geometry &boundingArea_,const GravityType gravity_, - const double degrees_) -{ - AffineMatrix - oaffine; - - char - boundingArea[MagickPathExtent]; - - DrawInfo - *drawInfo; - - modifyImage(); - - drawInfo=options()->drawInfo(); - drawInfo->text=DestroyString(drawInfo->text); - drawInfo->text=const_cast(text_.c_str()); - drawInfo->geometry=DestroyString(drawInfo->geometry); - - if (boundingArea_.isValid()) - { - if (boundingArea_.width() == 0 || boundingArea_.height() == 0) - { - FormatLocaleString(boundingArea,MagickPathExtent,"%+.20g%+.20g", - (double) boundingArea_.xOff(),(double) boundingArea_.yOff()); - } - else - { - (void) CopyMagickString(boundingArea, - std::string(boundingArea_).c_str(), MagickPathExtent); - } - drawInfo->geometry=boundingArea; - } - - drawInfo->gravity=gravity_; - - oaffine=drawInfo->affine; - if (degrees_ != 0.0) - { - AffineMatrix - affine, - current; - - affine.sx=1.0; - affine.rx=0.0; - affine.ry=0.0; - affine.sy=1.0; - affine.tx=0.0; - affine.ty=0.0; - - current=drawInfo->affine; - affine.sx=cos(DegreesToRadians(fmod(degrees_,360.0))); - affine.rx=sin(DegreesToRadians(fmod(degrees_,360.0))); - affine.ry=(-sin(DegreesToRadians(fmod(degrees_,360.0)))); - affine.sy=cos(DegreesToRadians(fmod(degrees_,360.0))); - - drawInfo->affine.sx=current.sx*affine.sx+current.ry*affine.rx; - drawInfo->affine.rx=current.rx*affine.sx+current.sy*affine.rx; - drawInfo->affine.ry=current.sx*affine.ry+current.ry*affine.sy; - drawInfo->affine.sy=current.rx*affine.ry+current.sy*affine.sy; - drawInfo->affine.tx=current.sx*affine.tx+current.ry*affine.ty - +current.tx; - } - - GetPPException; - AnnotateImage(image(),drawInfo,exceptionInfo); - - // Restore original values - drawInfo->affine=oaffine; - drawInfo->text=(char *) NULL; - drawInfo->geometry=(char *) NULL; - - ThrowImageException; -} - -void Magick::Image::annotate(const std::string &text_, - const GravityType gravity_) -{ - DrawInfo - *drawInfo; - - modifyImage(); - - drawInfo=options()->drawInfo(); - drawInfo->text=DestroyString(drawInfo->text); - drawInfo->text=const_cast(text_.c_str()); - drawInfo->gravity=gravity_; - - GetPPException; - AnnotateImage(image(),drawInfo,exceptionInfo); - - drawInfo->gravity=NorthWestGravity; - drawInfo->text=(char *) NULL; - - ThrowImageException; -} - -void Magick::Image::artifact(const std::string &name_,const std::string &value_) -{ - modifyImage(); - (void) SetImageArtifact(image(),name_.c_str(),value_.c_str()); -} - -std::string Magick::Image::artifact(const std::string &name_) const -{ - const char - *value; - - value=GetImageArtifact(constImage(),name_.c_str()); - if (value) - return(std::string(value)); - return(std::string()); -} - -void Magick::Image::attribute(const std::string name_,const char *value_) -{ - modifyImage(); - GetPPException; - SetImageProperty(image(),name_.c_str(),value_,exceptionInfo); - ThrowImageException; -} - -void Magick::Image::attribute(const std::string name_,const std::string value_) -{ - modifyImage(); - GetPPException; - SetImageProperty(image(),name_.c_str(),value_.c_str(),exceptionInfo); - ThrowImageException; -} - -std::string Magick::Image::attribute(const std::string name_) const -{ - const char - *value; - - GetPPException; - value=GetImageProperty(constImage(),name_.c_str(),exceptionInfo); - ThrowImageException; - - if (value) - return(std::string(value)); - - return(std::string()); // Intentionally no exception -} - -void Magick::Image::autoGamma(void) -{ - modifyImage(); - GetPPException; - (void) SyncImageSettings(imageInfo(),image(),exceptionInfo); - (void) AutoGammaImage(image(),exceptionInfo); - ThrowImageException; -} - -void Magick::Image::autoGammaChannel(const ChannelType channel_) -{ - modifyImage(); - GetPPException; - GetAndSetPPChannelMask(channel_); - (void) SyncImageSettings(imageInfo(),image(),exceptionInfo); - (void) AutoGammaImage(image(),exceptionInfo); - RestorePPChannelMask; - ThrowImageException; -} - -void Magick::Image::autoLevel(void) -{ - modifyImage(); - GetPPException; - (void) AutoLevelImage(image(),exceptionInfo); - ThrowImageException; -} - -void Magick::Image::autoLevelChannel(const ChannelType channel_) -{ - modifyImage(); - GetPPException; - GetAndSetPPChannelMask(channel_); - (void) AutoLevelImage(image(),exceptionInfo); - RestorePPChannelMask; - ThrowImageException; -} - -void Magick::Image::autoOrient(void) -{ - MagickCore::Image - *newImage; - - if (image()->orientation == UndefinedOrientation || - image()->orientation == TopLeftOrientation) - return; - - GetPPException; - newImage=AutoOrientImage(constImage(),image()->orientation,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::autoThreshold(const AutoThresholdMethod method_) -{ - modifyImage(); - GetPPException; - AutoThresholdImage(image(),method_, exceptionInfo); - ThrowImageException; -} - -void Magick::Image::blackThreshold(const std::string &threshold_) -{ - modifyImage(); - GetPPException; - BlackThresholdImage(image(),threshold_.c_str(),exceptionInfo); - ThrowImageException; -} - -void Magick::Image::blackThresholdChannel(const ChannelType channel_, - const std::string &threshold_) -{ - modifyImage(); - GetPPException; - GetAndSetPPChannelMask(channel_); - BlackThresholdImage(image(),threshold_.c_str(),exceptionInfo); - RestorePPChannelMask; - ThrowImageException; -} - -void Magick::Image::blueShift(const double factor_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=BlueShiftImage(constImage(),factor_,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::blur(const double radius_,const double sigma_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=BlurImage(constImage(),radius_,sigma_,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::blurChannel(const ChannelType channel_, - const double radius_,const double sigma_) -{ - MagickCore::Image - *newImage; - - GetPPException; - GetAndSetPPChannelMask(channel_); - newImage=BlurImage(constImage(),radius_,sigma_,exceptionInfo); - RestorePPChannelMask; - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::border(const Geometry &geometry_) -{ - MagickCore::Image - *newImage; - - RectangleInfo - borderInfo=geometry_; - - GetPPException; - newImage=BorderImage(constImage(),&borderInfo,image()->compose, - exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::brightnessContrast(const double brightness_, - const double contrast_) -{ - modifyImage(); - GetPPException; - BrightnessContrastImage(image(),brightness_,contrast_,exceptionInfo); - ThrowImageException; -} - -void Magick::Image::brightnessContrastChannel(const ChannelType channel_, - const double brightness_,const double contrast_) -{ - modifyImage(); - GetPPException; - GetAndSetPPChannelMask(channel_); - BrightnessContrastImage(image(),brightness_,contrast_,exceptionInfo); - RestorePPChannelMask; - ThrowImageException; -} - -void Magick::Image::cannyEdge(const double radius_,const double sigma_, - const double lowerPercent_,const double upperPercent_) -{ - MagickCore::Image - *newImage; - - modifyImage(); - GetPPException; - newImage=CannyEdgeImage(constImage(),radius_,sigma_,lowerPercent_, - upperPercent_,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::cdl(const std::string &cdl_) -{ - modifyImage(); - GetPPException; - (void) ColorDecisionListImage(image(),cdl_.c_str(),exceptionInfo); - ThrowImageException; -} - -void Magick::Image::channel(const ChannelType channel_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=SeparateImage(image(),channel_,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::charcoal(const double radius_,const double sigma_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=CharcoalImage(image(),radius_,sigma_,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::charcoalChannel(const ChannelType channel_, - const double radius_,const double sigma_) -{ - MagickCore::Image - *newImage; - - GetPPException; - GetAndSetPPChannelMask(channel_); - newImage=CharcoalImage(image(),radius_,sigma_,exceptionInfo); - RestorePPChannelMask; - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::chop(const Geometry &geometry_) -{ - MagickCore::Image - *newImage; - - RectangleInfo - chopInfo=geometry_; - - GetPPException; - newImage=ChopImage(image(),&chopInfo,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::chromaBluePrimary(const double x_,const double y_, - const double z_) -{ - modifyImage(); - image()->chromaticity.blue_primary.x=x_; - image()->chromaticity.blue_primary.y=y_; - image()->chromaticity.blue_primary.z=z_; -} - -void Magick::Image::chromaBluePrimary(double *x_,double *y_,double *z_) const -{ - *x_=constImage()->chromaticity.blue_primary.x; - *y_=constImage()->chromaticity.blue_primary.y; - *z_=constImage()->chromaticity.blue_primary.z; -} - -void Magick::Image::chromaGreenPrimary(const double x_,const double y_, - const double z_) -{ - modifyImage(); - image()->chromaticity.green_primary.x=x_; - image()->chromaticity.green_primary.y=y_; - image()->chromaticity.green_primary.z=z_; -} - -void Magick::Image::chromaGreenPrimary(double *x_,double *y_,double *z_) const -{ - *x_=constImage()->chromaticity.green_primary.x; - *y_=constImage()->chromaticity.green_primary.y; - *z_=constImage()->chromaticity.green_primary.z; -} - -void Magick::Image::chromaRedPrimary(const double x_,const double y_, - const double z_) -{ - modifyImage(); - image()->chromaticity.red_primary.x=x_; - image()->chromaticity.red_primary.y=y_; - image()->chromaticity.red_primary.z=z_; -} - -void Magick::Image::chromaRedPrimary(double *x_,double *y_,double *z_) const -{ - *x_=constImage()->chromaticity.red_primary.x; - *y_=constImage()->chromaticity.red_primary.y; - *z_=constImage()->chromaticity.red_primary.z; -} - -void Magick::Image::chromaWhitePoint(const double x_,const double y_, - const double z_) -{ - modifyImage(); - image()->chromaticity.white_point.x=x_; - image()->chromaticity.white_point.y=y_; - image()->chromaticity.white_point.z=z_; -} - -void Magick::Image::chromaWhitePoint(double *x_,double *y_,double *z_) const -{ - *x_=constImage()->chromaticity.white_point.x; - *y_=constImage()->chromaticity.white_point.y; - *z_=constImage()->chromaticity.white_point.z; -} - -void Magick::Image::clamp(void) -{ - modifyImage(); - GetPPException; - ClampImage(image(),exceptionInfo); - ThrowImageException; -} - -void Magick::Image::clampChannel(const ChannelType channel_) -{ - modifyImage(); - GetPPException; - GetAndSetPPChannelMask(channel_); - ClampImage(image(),exceptionInfo); - RestorePPChannelMask; - ThrowImageException; -} - -void Magick::Image::clip(void) -{ - modifyImage(); - GetPPException; - ClipImage(image(),exceptionInfo); - ThrowImageException; -} - -void Magick::Image::clipPath(const std::string pathname_,const bool inside_) -{ - modifyImage(); - GetPPException; - ClipImagePath(image(),pathname_.c_str(),(MagickBooleanType) inside_, - exceptionInfo); - ThrowImageException; -} - -void Magick::Image::clut(const Image &clutImage_, - const PixelInterpolateMethod method) -{ - modifyImage(); - GetPPException; - ClutImage(image(),clutImage_.constImage(),method,exceptionInfo); - ThrowImageException; -} - -void Magick::Image::clutChannel(const ChannelType channel_, - const Image &clutImage_,const PixelInterpolateMethod method) -{ - modifyImage(); - GetPPException; - GetAndSetPPChannelMask(channel_); - ClutImage(image(),clutImage_.constImage(),method,exceptionInfo); - RestorePPChannelMask; - ThrowImageException; -} - -void Magick::Image::colorize(const unsigned int alpha_,const Color &penColor_) -{ - colorize(alpha_,alpha_,alpha_,penColor_); -} - -void Magick::Image::colorize(const unsigned int alphaRed_, - const unsigned int alphaGreen_,const unsigned int alphaBlue_, - const Color &penColor_) -{ - char - blend[MagickPathExtent]; - - MagickCore::Image - *newImage; - - PixelInfo - target; - - if (!penColor_.isValid()) - throwExceptionExplicit(MagickCore::OptionError, - "Pen color argument is invalid"); - - FormatLocaleString(blend,MagickPathExtent,"%u/%u/%u",alphaRed_,alphaGreen_, - alphaBlue_); - - target=static_cast(penColor_); - GetPPException; - newImage=ColorizeImage(image(),blend,&target,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::colorMap(const size_t index_,const Color &color_) -{ - MagickCore::Image - *imageptr; - - imageptr=image(); - - if (index_ > (MaxColormapSize-1)) - throwExceptionExplicit(MagickCore::OptionError, - "Colormap index must be less than MaxColormapSize"); - - if (!color_.isValid()) - throwExceptionExplicit(MagickCore::OptionError, - "Color argument is invalid"); - - modifyImage(); - - // Ensure that colormap size is large enough - if (colorMapSize() < (index_+1)) - colorMapSize(index_+1); - - // Set color at index in colormap - (imageptr->colormap)[index_]=color_; -} - -Magick::Color Magick::Image::colorMap(const size_t index_) const -{ - if (!constImage()->colormap) - { - throwExceptionExplicit(MagickCore::OptionError, - "Image does not contain a colormap"); - return(Color()); - } - - if (index_ > constImage()->colors-1) - throwExceptionExplicit(MagickCore::OptionError,"Index out of range"); - - return(Magick::Color((constImage()->colormap)[index_])); -} - -void Magick::Image::colorMatrix(const size_t order_, - const double *color_matrix_) -{ - KernelInfo - *kernel_info; - - GetPPException; - kernel_info=AcquireKernelInfo((const char *) NULL,exceptionInfo); - if (kernel_info != (KernelInfo *) NULL) - { - kernel_info->width=order_; - kernel_info->height=order_; - kernel_info->values=(MagickRealType *) AcquireAlignedMemory(order_, - order_*sizeof(*kernel_info->values)); - if (kernel_info->values != (MagickRealType *) NULL) - { - MagickCore::Image - *newImage; - - for (ssize_t i=0; i < (ssize_t) (order_*order_); i++) - kernel_info->values[i]=color_matrix_[i]; - newImage=ColorMatrixImage(image(),kernel_info,exceptionInfo); - replaceImage(newImage); - } - kernel_info=DestroyKernelInfo(kernel_info); - } - ThrowImageException; -} - -bool Magick::Image::compare(const Image &reference_) const -{ - bool - status; - - Image - ref=reference_; - - GetPPException; - status=static_cast(IsImagesEqual(constImage(),ref.constImage(), - exceptionInfo)); - ThrowImageException; - return(status); -} - -double Magick::Image::compare(const Image &reference_,const MetricType metric_) -{ - double - distortion=0.0; - - GetPPException; - GetImageDistortion(image(),reference_.constImage(),metric_,&distortion, - exceptionInfo); - ThrowImageException; - return(distortion); -} - -double Magick::Image::compareChannel(const ChannelType channel_, - const Image &reference_,const MetricType metric_) -{ - double - distortion=0.0; - - GetPPException; - GetAndSetPPChannelMask(channel_); - GetImageDistortion(image(),reference_.constImage(),metric_,&distortion, - exceptionInfo); - RestorePPChannelMask; - ThrowImageException; - return(distortion); -} - -Magick::Image Magick::Image::compare(const Image &reference_, - const MetricType metric_,double *distortion) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=CompareImages(image(),reference_.constImage(),metric_,distortion, - exceptionInfo); - ThrowImageException; - if (newImage == (MagickCore::Image *) NULL) - return(Magick::Image()); - else - return(Magick::Image(newImage)); -} - -Magick::Image Magick::Image::compareChannel(const ChannelType channel_, - const Image &reference_,const MetricType metric_,double *distortion) -{ - MagickCore::Image - *newImage; - - GetPPException; - GetAndSetPPChannelMask(channel_); - newImage=CompareImages(image(),reference_.constImage(),metric_,distortion, - exceptionInfo); - RestorePPChannelMask; - ThrowImageException; - if (newImage == (MagickCore::Image *) NULL) - return(Magick::Image()); - else - return(Magick::Image(newImage)); -} - -void Magick::Image::composite(const Image &compositeImage_, - const Geometry &offset_,const CompositeOperator compose_) -{ - size_t - height=rows(), - width=columns(); - - ssize_t - x=offset_.xOff(), - y=offset_.yOff(); - - ParseMetaGeometry(static_cast(offset_).c_str(),&x,&y,&width, - &height); - - modifyImage(); - GetPPException; - CompositeImage(image(),compositeImage_.constImage(),compose_,MagickTrue, - x,y,exceptionInfo); - ThrowImageException; -} - -void Magick::Image::composite(const Image &compositeImage_, - const GravityType gravity_,const CompositeOperator compose_) -{ - RectangleInfo - geometry; - - modifyImage(); - SetGeometry(compositeImage_.constImage(),&geometry); - GravityAdjustGeometry(columns(),rows(),gravity_,&geometry); - - GetPPException; - CompositeImage(image(),compositeImage_.constImage(),compose_,MagickTrue, - geometry.x,geometry.y,exceptionInfo); - ThrowImageException; -} - -void Magick::Image::composite(const Image &compositeImage_, - const ssize_t xOffset_,const ssize_t yOffset_, - const CompositeOperator compose_) -{ - // Image supplied as compositeImage is composited with current image and - // results in updating current image. - modifyImage(); - GetPPException; - CompositeImage(image(),compositeImage_.constImage(),compose_,MagickTrue, - xOffset_,yOffset_,exceptionInfo); - ThrowImageException; -} - -void Magick::Image::connectedComponents(const size_t connectivity_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=ConnectedComponentsImage(constImage(),connectivity_, - (CCObjectInfo **) NULL,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::contrast(const bool sharpen_) -{ - modifyImage(); - GetPPException; - ContrastImage(image(),(MagickBooleanType) sharpen_,exceptionInfo); - ThrowImageException; -} - -void Magick::Image::contrastStretch(const double blackPoint_, - const double whitePoint_) -{ - modifyImage(); - GetPPException; - ContrastStretchImage(image(),blackPoint_,whitePoint_,exceptionInfo); - ThrowImageException; -} - -void Magick::Image::contrastStretchChannel(const ChannelType channel_, - const double blackPoint_,const double whitePoint_) -{ - modifyImage(); - GetPPException; - GetAndSetPPChannelMask(channel_); - ContrastStretchImage(image(),blackPoint_,whitePoint_,exceptionInfo); - RestorePPChannelMask; - ThrowImageException; -} - -void Magick::Image::convolve(const size_t order_,const double *kernel_) -{ - KernelInfo - *kernel_info; - - GetPPException; - kernel_info=AcquireKernelInfo((const char *) NULL,exceptionInfo); - kernel_info->width=order_; - kernel_info->height=order_; - kernel_info->x=(ssize_t) (order_-1)/2; - kernel_info->y=(ssize_t) (order_-1)/2; - kernel_info->values=(MagickRealType *) AcquireAlignedMemory(order_, - order_*sizeof(*kernel_info->values)); - if (kernel_info->values != (MagickRealType *) NULL) - { - MagickCore::Image - *newImage; - - for (ssize_t i=0; i < (ssize_t) (order_*order_); i++) - kernel_info->values[i]=kernel_[i]; - newImage=ConvolveImage(image(),kernel_info,exceptionInfo); - replaceImage(newImage); - } - kernel_info=DestroyKernelInfo(kernel_info); - ThrowImageException; -} - -void Magick::Image::copyPixels(const Image &source_,const Geometry &geometry_, - const Offset &offset_) -{ - const OffsetInfo - offset=offset_; - - const RectangleInfo - geometry=geometry_; - - GetPPException; - (void) CopyImagePixels(image(),source_.constImage(),&geometry,&offset, - exceptionInfo); - ThrowImageException; -} - -void Magick::Image::crop(const Geometry &geometry_) -{ - MagickCore::Image - *newImage; - - RectangleInfo - cropInfo=geometry_; - - GetPPException; - newImage=CropImage(constImage(),&cropInfo,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::cycleColormap(const ssize_t amount_) -{ - modifyImage(); - GetPPException; - CycleColormapImage(image(),amount_,exceptionInfo); - ThrowImageException; -} - -void Magick::Image::decipher(const std::string &passphrase_) -{ - modifyImage(); - GetPPException; - DecipherImage(image(),passphrase_.c_str(),exceptionInfo); - ThrowImageException; -} - -void Magick::Image::defineSet(const std::string &magick_, - const std::string &key_,bool flag_) -{ - std::string - definition; - - modifyImage(); - definition=magick_ + ":" + key_; - if (flag_) - (void) SetImageOption(imageInfo(),definition.c_str(),""); - else - DeleteImageOption(imageInfo(),definition.c_str()); -} - -bool Magick::Image::defineSet(const std::string &magick_, - const std::string &key_ ) const -{ - const char - *option; - - std::string - key; - - key=magick_ + ":" + key_; - option=GetImageOption(constImageInfo(),key.c_str()); - if (option) - return(true); - return(false); -} - -void Magick::Image::defineValue(const std::string &magick_, - const std::string &key_,const std::string &value_) -{ - std::string - format, - option; - - modifyImage(); - format=magick_ + ":" + key_; - option=value_; - (void) SetImageOption(imageInfo(),format.c_str(),option.c_str()); -} - -std::string Magick::Image::defineValue(const std::string &magick_, - const std::string &key_) const -{ - const char - *option; - - std::string - definition; - - definition=magick_ + ":" + key_; - option=GetImageOption(constImageInfo(),definition.c_str()); - if (option) - return(std::string(option)); - return(std::string()); -} - -void Magick::Image::deskew(const double threshold_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=DeskewImage(constImage(),threshold_,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::despeckle(void) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=DespeckleImage(constImage(),exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::display(void) -{ - GetPPException; - DisplayImages(imageInfo(),image(),exceptionInfo); - ThrowImageException; -} - -void Magick::Image::distort(const DistortMethod method_, - const size_t numberArguments_,const double *arguments_,const bool bestfit_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=DistortImage(constImage(), method_,numberArguments_,arguments_, - bestfit_ == true ? MagickTrue : MagickFalse,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::draw(const Magick::Drawable &drawable_) -{ - DrawingWand - *wand; - - modifyImage(); - - wand=AcquireDrawingWand(options()->drawInfo(),image()); - - if(wand) - { - drawable_.operator()(wand); - - DrawRender(wand); - - ClonePPDrawException(wand); - wand=DestroyDrawingWand(wand); - ThrowPPDrawException(quiet()); - } -} - -void Magick::Image::draw(const std::vector &drawable_) -{ - DrawingWand - *wand; - - modifyImage(); - - wand= AcquireDrawingWand(options()->drawInfo(),image()); - - if(wand) - { - for (std::vector::const_iterator p = drawable_.begin(); - p != drawable_.end(); p++ ) - { - p->operator()(wand); - if (DrawGetExceptionType(wand) != MagickCore::UndefinedException) - break; - } - - if (DrawGetExceptionType(wand) == MagickCore::UndefinedException) - DrawRender(wand); - - ClonePPDrawException(wand); - wand=DestroyDrawingWand(wand); - ThrowPPDrawException(quiet()); - } -} - -void Magick::Image::edge(const double radius_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=EdgeImage(constImage(),radius_,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::emboss(const double radius_,const double sigma_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=EmbossImage(constImage(),radius_,sigma_,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::encipher(const std::string &passphrase_) -{ - modifyImage(); - GetPPException; - EncipherImage(image(),passphrase_.c_str(),exceptionInfo); - ThrowImageException; -} - -void Magick::Image::enhance(void) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=EnhanceImage(constImage(),exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::equalize(void) -{ - modifyImage(); - GetPPException; - EqualizeImage(image(),exceptionInfo); - ThrowImageException; -} - -void Magick::Image::erase(void) -{ - modifyImage(); - GetPPException; - (void) SetImageBackgroundColor(image(),exceptionInfo); - ThrowImageException; -} - -void Magick::Image::evaluate(const ChannelType channel_, - const MagickEvaluateOperator operator_,double rvalue_) -{ - GetPPException; - GetAndSetPPChannelMask(channel_); - EvaluateImage(image(),operator_,rvalue_,exceptionInfo); - RestorePPChannelMask; - ThrowImageException; -} - -void Magick::Image::evaluate(const ChannelType channel_, - const MagickFunction function_,const size_t number_parameters_, - const double *parameters_) -{ - GetPPException; - GetAndSetPPChannelMask(channel_); - FunctionImage(image(),function_,number_parameters_,parameters_, - exceptionInfo); - RestorePPChannelMask; - ThrowImageException; -} - -void Magick::Image::evaluate(const ChannelType channel_,const ssize_t x_, - const ssize_t y_,const size_t columns_,const size_t rows_, - const MagickEvaluateOperator operator_,const double rvalue_) -{ - RectangleInfo - geometry; - - MagickCore::Image - *cropImage; - - geometry.width = columns_; - geometry.height = rows_; - geometry.x = x_; - geometry.y = y_; - - GetPPException; - cropImage=CropImage(image(),&geometry,exceptionInfo); - GetAndSetPPChannelMask(channel_); - EvaluateImage(cropImage,operator_,rvalue_,exceptionInfo); - RestorePPChannelMask; - (void) CompositeImage(image(),cropImage,image()->alpha_trait == - BlendPixelTrait ? OverCompositeOp : CopyCompositeOp,MagickFalse, - geometry.x,geometry.y,exceptionInfo ); - cropImage=DestroyImageList(cropImage); - ThrowImageException; -} - -void Magick::Image::extent(const Geometry &geometry_ ) -{ - MagickCore::Image - *newImage; - - RectangleInfo - extentInfo=geometry_; - - modifyImage(); - extentInfo.x=geometry_.xOff(); - extentInfo.y=geometry_.yOff(); - GetPPException; - newImage=ExtentImage(image(),&extentInfo,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::extent(const Geometry &geometry_, - const Color &backgroundColor_) -{ - backgroundColor(backgroundColor_); - extent(geometry_); -} - -void Magick::Image::extent(const Geometry &geometry_, - const Color &backgroundColor_,const GravityType gravity_) -{ - backgroundColor(backgroundColor_); - extent(geometry_,gravity_); -} - -void Magick::Image::extent(const Geometry &geometry_, - const GravityType gravity_) -{ - RectangleInfo - geometry; - - SetGeometry(image(),&geometry); - geometry.width=geometry_.width(); - geometry.height=geometry_.height(); - GravityAdjustGeometry(image()->columns,image()->rows,gravity_,&geometry); - extent(geometry); -} - -void Magick::Image::flip(void) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=FlipImage(constImage(),exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::floodFillAlpha(const ssize_t x_,const ssize_t y_, - const unsigned int alpha_,const bool invert_) -{ - PixelInfo - target; - - modifyImage(); - - target=static_cast(pixelColor(x_,y_)); - target.alpha=alpha_; - GetPPException; - GetAndSetPPChannelMask(AlphaChannel); - FloodfillPaintImage(image(),options()->drawInfo(),&target,x_,y_, - (MagickBooleanType)invert_,exceptionInfo); - RestorePPChannelMask; - ThrowImageException; -} - -void Magick::Image::floodFillAlpha(const ssize_t x_,const ssize_t y_, - const unsigned int alpha_,const Color &target_,const bool invert_) -{ - PixelInfo - target; - - modifyImage(); - - target=static_cast(target_); - target.alpha=alpha_; - GetPPException; - GetAndSetPPChannelMask(AlphaChannel); - FloodfillPaintImage(image(),options()->drawInfo(),&target,x_,y_, - (MagickBooleanType)invert_,exceptionInfo); - RestorePPChannelMask; - ThrowImageException; -} - -void Magick::Image::floodFillColor(const Geometry &point_, - const Magick::Color &fillColor_,const bool invert_) -{ - floodFillColor(point_.xOff(),point_.yOff(),fillColor_,invert_); -} - -void Magick::Image::floodFillColor(const ssize_t x_,const ssize_t y_, - const Magick::Color &fillColor_,const bool invert_) -{ - PixelInfo - pixel; - - modifyImage(); - - pixel=static_cast(pixelColor(x_,y_)); - floodFill(x_,y_,(Magick::Image *)NULL,fillColor_,&pixel,invert_); -} - -void Magick::Image::floodFillColor(const Geometry &point_, - const Magick::Color &fillColor_,const Magick::Color &borderColor_, - const bool invert_) -{ - floodFillColor(point_.xOff(),point_.yOff(),fillColor_,borderColor_,invert_); -} - -void Magick::Image::floodFillColor(const ssize_t x_,const ssize_t y_, - const Magick::Color &fillColor_,const Magick::Color &borderColor_, - const bool invert_) -{ - PixelInfo - pixel; - - modifyImage(); - - pixel=static_cast(borderColor_); - floodFill(x_,y_,(Magick::Image *)NULL,fillColor_,&pixel,invert_); -} - -void Magick::Image::floodFillTexture(const Magick::Geometry &point_, - const Magick::Image &texture_,const bool invert_) -{ - floodFillTexture(point_.xOff(),point_.yOff(),texture_,invert_); -} - -void Magick::Image::floodFillTexture(const ssize_t x_,const ssize_t y_, - const Magick::Image &texture_,const bool invert_) -{ - PixelInfo - pixel; - - modifyImage(); - - pixel=static_cast(pixelColor(x_,y_)); - floodFill(x_,y_,&texture_,Magick::Color(),&pixel,invert_); -} - -void Magick::Image::floodFillTexture(const Magick::Geometry &point_, - const Magick::Image &texture_,const Magick::Color &borderColor_, - const bool invert_) -{ - floodFillTexture(point_.xOff(),point_.yOff(),texture_,borderColor_,invert_); -} - -void Magick::Image::floodFillTexture(const ssize_t x_,const ssize_t y_, - const Magick::Image &texture_,const Magick::Color &borderColor_, - const bool invert_) -{ - PixelInfo - pixel; - - modifyImage(); - - pixel=static_cast(borderColor_); - floodFill(x_,y_,&texture_,Magick::Color(),&pixel,invert_); -} - -void Magick::Image::flop(void) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=FlopImage(constImage(),exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::fontTypeMetrics(const std::string &text_, - TypeMetric *metrics) -{ - DrawInfo - *drawInfo; - - drawInfo=options()->drawInfo(); - drawInfo->text=const_cast(text_.c_str()); - GetPPException; - GetTypeMetrics(image(),drawInfo,&(metrics->_typeMetric),exceptionInfo); - drawInfo->text=0; - ThrowImageException; -} - -void Magick::Image::fontTypeMetricsMultiline(const std::string &text_, - TypeMetric *metrics) -{ - DrawInfo - *drawInfo; - - drawInfo=options()->drawInfo(); - drawInfo->text=const_cast(text_.c_str()); - GetPPException; - GetMultilineTypeMetrics(image(),drawInfo,&(metrics->_typeMetric),exceptionInfo); - drawInfo->text=0; - ThrowImageException; -} - -void Magick::Image::frame(const Geometry &geometry_) -{ - FrameInfo - info; - - MagickCore::Image - *newImage; - - info.x=static_cast(geometry_.width()); - info.y=static_cast(geometry_.height()); - info.width=columns() + (static_cast(info.x) << 1); - info.height=rows() + (static_cast(info.y) << 1); - info.outer_bevel=geometry_.xOff(); - info.inner_bevel=geometry_.yOff(); - - GetPPException; - newImage=FrameImage(constImage(),&info,image()->compose,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::frame(const size_t width_,const size_t height_, - const ssize_t innerBevel_,const ssize_t outerBevel_) -{ - FrameInfo - info; - - MagickCore::Image - *newImage; - - info.x=static_cast(width_); - info.y=static_cast(height_); - info.width=columns() + (static_cast(info.x) << 1); - info.height=rows() + (static_cast(info.y) << 1); - info.outer_bevel=static_cast(outerBevel_); - info.inner_bevel=static_cast(innerBevel_); - - GetPPException; - newImage=FrameImage(constImage(),&info,image()->compose,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::fx(const std::string expression_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=FxImage(constImage(),expression_.c_str(),exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::fx(const std::string expression_, - const Magick::ChannelType channel_) -{ - MagickCore::Image - *newImage; - - GetPPException; - GetAndSetPPChannelMask(channel_); - newImage=FxImage(constImage(),expression_.c_str(),exceptionInfo); - RestorePPChannelMask; - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::gamma(const double gamma_) -{ - modifyImage(); - GetPPException; - GammaImage(image(),gamma_,exceptionInfo); - ThrowImageException; -} - -void Magick::Image::gamma(const double gammaRed_,const double gammaGreen_, - const double gammaBlue_) -{ - modifyImage(); - GetPPException; - GetAndSetPPChannelMask(RedChannel); - (void) GammaImage(image(),gammaRed_,exceptionInfo); - SetPPChannelMask(GreenChannel); - (void) GammaImage(image(),gammaGreen_,exceptionInfo); - SetPPChannelMask(BlueChannel); - (void) GammaImage(image(),gammaBlue_,exceptionInfo); - RestorePPChannelMask; - ThrowImageException; -} - -void Magick::Image::gaussianBlur(const double radius_,const double sigma_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=GaussianBlurImage(constImage(),radius_,sigma_,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::gaussianBlurChannel(const ChannelType channel_, - const double radius_,const double sigma_) -{ - MagickCore::Image - *newImage; - - GetPPException; - GetAndSetPPChannelMask(channel_); - newImage=GaussianBlurImage(constImage(),radius_,sigma_,exceptionInfo); - RestorePPChannelMask; - replaceImage(newImage); - ThrowImageException; -} - -const Magick::Quantum *Magick::Image::getConstPixels(const ssize_t x_, - const ssize_t y_,const size_t columns_,const size_t rows_) const -{ - const Quantum - *p; - - GetPPException; - p=GetVirtualPixels(constImage(),x_, y_,columns_, rows_,exceptionInfo); - ThrowImageException; - return(p); -} - -const void *Magick::Image::getConstMetacontent(void) const -{ - const void - *result; - - result=GetVirtualMetacontent(constImage()); - - if(!result) - throwExceptionExplicit(MagickCore::OptionError, - "Unable to retrieve meta content."); - - return(result); -} - -void *Magick::Image::getMetacontent(void ) -{ - void - *result; - - result=GetAuthenticMetacontent(image()); - - if(!result) - throwExceptionExplicit(MagickCore::OptionError, - "Unable to retrieve meta content."); - - return(result); -} - -Magick::Quantum *Magick::Image::getPixels(const ssize_t x_,const ssize_t y_, - const size_t columns_,const size_t rows_) -{ - Quantum - *result; - - modifyImage(); - GetPPException; - result=GetAuthenticPixels(image(),x_, y_,columns_,rows_,exceptionInfo); - ThrowImageException; - - return(result); -} - -void Magick::Image::grayscale(const PixelIntensityMethod method_) -{ - modifyImage(); - GetPPException; - (void) GrayscaleImage(image(),method_,exceptionInfo); - ThrowImageException; -} - -void Magick::Image::haldClut(const Image &clutImage_) -{ - modifyImage(); - GetPPException; - (void) HaldClutImage(image(),clutImage_.constImage(),exceptionInfo); - ThrowImageException; -} - -void Magick::Image::houghLine(const size_t width_,const size_t height_, - const size_t threshold_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=HoughLineImage(constImage(),width_,height_,threshold_, - exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -Magick::ImageType Magick::Image::identifyType(void) const -{ - ImageType - image_type; - - GetPPException; - image_type=IdentifyImageType(constImage(),exceptionInfo); - ThrowImageException; - return(image_type); -} - -void Magick::Image::implode(const double factor_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=ImplodeImage(constImage(),factor_,image()->interpolate, - exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::inverseFourierTransform(const Image &phase_) -{ - inverseFourierTransform(phase_,true); -} - -void Magick::Image::inverseFourierTransform(const Image &phase_, - const bool magnitude_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=InverseFourierTransformImage(constImage(),phase_.constImage(), - magnitude_ == true ? MagickTrue : MagickFalse,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::kuwahara(const double radius_,const double sigma_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=KuwaharaImage(constImage(),radius_,sigma_,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::kuwaharaChannel(const ChannelType channel_, - const double radius_,const double sigma_) -{ - MagickCore::Image - *newImage; - - GetPPException; - GetAndSetPPChannelMask(channel_); - newImage=KuwaharaImage(constImage(),radius_,sigma_,exceptionInfo); - replaceImage(newImage); - RestorePPChannelMask; - ThrowImageException; -} - -void Magick::Image::level(const double blackPoint_,const double whitePoint_, - const double gamma_) -{ - modifyImage(); - GetPPException; - (void) LevelImage(image(),blackPoint_,whitePoint_,gamma_,exceptionInfo); - ThrowImageException; -} - -void Magick::Image::levelChannel(const ChannelType channel_, - const double blackPoint_,const double whitePoint_,const double gamma_) -{ - modifyImage(); - GetPPException; - GetAndSetPPChannelMask(channel_); - (void) LevelImage(image(),blackPoint_,whitePoint_,gamma_,exceptionInfo); - RestorePPChannelMask; - ThrowImageException; -} - -void Magick::Image::levelColors(const Color &blackColor_, - const Color &whiteColor_,const bool invert_) -{ - PixelInfo - black, - white; - - modifyImage(); - - black=static_cast(blackColor_); - white=static_cast(whiteColor_); - GetPPException; - (void) LevelImageColors(image(),&black,&white,invert_ == true ? - MagickTrue : MagickFalse,exceptionInfo); - ThrowImageException; -} - -void Magick::Image::levelColorsChannel(const ChannelType channel_, - const Color &blackColor_,const Color &whiteColor_,const bool invert_) -{ - PixelInfo - black, - white; - - modifyImage(); - - black=static_cast(blackColor_); - white=static_cast(whiteColor_); - GetPPException; - GetAndSetPPChannelMask(channel_); - (void) LevelImageColors(image(),&black,&white,invert_ == true ? - MagickTrue : MagickFalse,exceptionInfo); - RestorePPChannelMask; - ThrowImageException; -} - -void Magick::Image::levelize(const double blackPoint_,const double whitePoint_, - const double gamma_) -{ - modifyImage(); - GetPPException; - (void) LevelizeImage(image(),blackPoint_,whitePoint_,gamma_,exceptionInfo); - ThrowImageException; -} - -void Magick::Image::levelizeChannel(const ChannelType channel_, - const double blackPoint_,const double whitePoint_,const double gamma_) -{ - modifyImage(); - GetPPException; - GetAndSetPPChannelMask(channel_); - (void) LevelizeImage(image(),blackPoint_,whitePoint_,gamma_,exceptionInfo); - RestorePPChannelMask; - ThrowImageException; -} - -void Magick::Image::linearStretch(const double blackPoint_, - const double whitePoint_) -{ - modifyImage(); - GetPPException; - LinearStretchImage(image(),blackPoint_,whitePoint_,exceptionInfo); - ThrowImageException; -} - -void Magick::Image::liquidRescale(const Geometry &geometry_) -{ - MagickCore::Image - *newImage; - - size_t - height=rows(), - width=columns(); - - ssize_t - x=0, - y=0; - - ParseMetaGeometry(static_cast(geometry_).c_str(),&x,&y,&width, - &height); - - GetPPException; - newImage=LiquidRescaleImage(image(),width,height,x,y,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::localContrast(const double radius_,const double strength_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=LocalContrastImage(constImage(),radius_,strength_,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::localContrastChannel(const ChannelType channel_, - const double radius_,const double strength_) -{ - MagickCore::Image - *newImage; - - GetPPException; - GetAndSetPPChannelMask(channel_); - newImage=LocalContrastImage(constImage(),radius_,strength_,exceptionInfo); - RestorePPChannelMask; - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::magnify(void) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=MagnifyImage(constImage(),exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::map(const Image &mapImage_,const bool dither_) -{ - modifyImage(); - GetPPException; - options()->quantizeDither(dither_); - RemapImage(options()->quantizeInfo(),image(),mapImage_.constImage(), - exceptionInfo); - ThrowImageException; -} - -void Magick::Image::meanShift(const size_t width_,const size_t height_, - const double color_distance_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=MeanShiftImage(constImage(),width_,height_,color_distance_, - exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::medianFilter(const double radius_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=StatisticImage(image(),MedianStatistic,(size_t) radius_, - (size_t) radius_,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::minify(void) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=MinifyImage(constImage(),exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::modulate(const double brightness_,const double saturation_, - const double hue_) -{ - char - modulate[MagickPathExtent + 1]; - - FormatLocaleString(modulate,MagickPathExtent,"%3.6f,%3.6f,%3.6f",brightness_, - saturation_,hue_); - - modifyImage(); - GetPPException; - ModulateImage(image(),modulate,exceptionInfo); - ThrowImageException; -} - -Magick::ImageMoments Magick::Image::moments(void) const -{ - return(ImageMoments(*this)); -} - -void Magick::Image::morphology(const MorphologyMethod method_, - const std::string kernel_,const ssize_t iterations_) -{ - KernelInfo - *kernel; - - MagickCore::Image - *newImage; - - GetPPException; - kernel=AcquireKernelInfo(kernel_.c_str(),exceptionInfo); - if (kernel == (KernelInfo *) NULL) - throwExceptionExplicit(MagickCore::OptionError,"Unable to parse kernel."); - newImage=MorphologyImage(constImage(),method_,iterations_,kernel, - exceptionInfo); - replaceImage(newImage); - kernel=DestroyKernelInfo(kernel); - ThrowImageException; -} - -void Magick::Image::morphology(const MorphologyMethod method_, - const KernelInfoType kernel_,const std::string arguments_, - const ssize_t iterations_) -{ - const char - *option; - - std::string - kernel; - - option=CommandOptionToMnemonic(MagickKernelOptions,kernel_); - if (option == (const char *)NULL) - { - throwExceptionExplicit(MagickCore::OptionError, - "Unable to determine kernel type."); - return; - } - kernel=std::string(option); - if (!arguments_.empty()) - kernel+=":"+arguments_; - - morphology(method_,kernel,iterations_); -} - -void Magick::Image::morphologyChannel(const ChannelType channel_, - const MorphologyMethod method_,const std::string kernel_, - const ssize_t iterations_) -{ - KernelInfo - *kernel; - - MagickCore::Image - *newImage; - - - GetPPException; - kernel=AcquireKernelInfo(kernel_.c_str(),exceptionInfo); - if (kernel == (KernelInfo *)NULL) - { - throwExceptionExplicit(MagickCore::OptionError, - "Unable to parse kernel."); - return; - } - GetAndSetPPChannelMask(channel_); - newImage=MorphologyImage(constImage(),method_,iterations_,kernel, - exceptionInfo); - RestorePPChannelMask; - replaceImage(newImage); - kernel=DestroyKernelInfo(kernel); - ThrowImageException; -} - -void Magick::Image::morphologyChannel(const ChannelType channel_, - const MorphologyMethod method_,const KernelInfoType kernel_, - const std::string arguments_,const ssize_t iterations_) -{ - const char - *option; - - std::string - kernel; - - option=CommandOptionToMnemonic(MagickKernelOptions,kernel_); - if (option == (const char *)NULL) - { - throwExceptionExplicit(MagickCore::OptionError, - "Unable to determine kernel type."); - return; - } - - kernel=std::string(option); - if (!arguments_.empty()) - kernel+=":"+arguments_; - - morphologyChannel(channel_,method_,kernel,iterations_); -} - -void Magick::Image::motionBlur(const double radius_,const double sigma_, - const double angle_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=MotionBlurImage(constImage(),radius_,sigma_,angle_,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::negate(const bool grayscale_) -{ - modifyImage(); - GetPPException; - NegateImage(image(),(MagickBooleanType) grayscale_,exceptionInfo); - ThrowImageException; -} - -void Magick::Image::negateChannel(const ChannelType channel_, - const bool grayscale_) -{ - modifyImage(); - GetPPException; - GetAndSetPPChannelMask(channel_); - NegateImage(image(),(MagickBooleanType) grayscale_,exceptionInfo); - RestorePPChannelMask; - ThrowImageException; -} - -void Magick::Image::normalize(void) -{ - modifyImage(); - GetPPException; - NormalizeImage(image(),exceptionInfo); - ThrowImageException; -} - -void Magick::Image::oilPaint(const double radius_,const double sigma_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=OilPaintImage(constImage(),radius_,sigma_,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::opaque(const Color &opaqueColor_,const Color &penColor_, - const bool invert_) -{ - std::string - opaqueColor, - penColor; - - PixelInfo - opaque, - pen; - - if (!opaqueColor_.isValid()) - throwExceptionExplicit(MagickCore::OptionError, - "Opaque color argument is invalid"); - - if (!penColor_.isValid()) - throwExceptionExplicit(MagickCore::OptionError, - "Pen color argument is invalid"); - - modifyImage(); - opaqueColor=opaqueColor_; - penColor=penColor_; - - GetPPException; - (void) QueryColorCompliance(opaqueColor.c_str(),AllCompliance,&opaque, - exceptionInfo); - (void) QueryColorCompliance(penColor.c_str(),AllCompliance,&pen, - exceptionInfo); - OpaquePaintImage(image(),&opaque,&pen,invert_ ? MagickTrue : MagickFalse, - exceptionInfo); - ThrowImageException; -} - -void Magick::Image::orderedDither(std::string thresholdMap_) -{ - modifyImage(); - GetPPException; - (void) OrderedDitherImage(image(),thresholdMap_.c_str(),exceptionInfo); - ThrowImageException; -} - -void Magick::Image::orderedDitherChannel(const ChannelType channel_, - std::string thresholdMap_) -{ - modifyImage(); - GetPPException; - GetAndSetPPChannelMask(channel_); - (void)OrderedDitherImage(image(),thresholdMap_.c_str(),exceptionInfo); - RestorePPChannelMask; - ThrowImageException; -} - -void Magick::Image::perceptible(const double epsilon_) -{ - modifyImage(); - GetPPException; - PerceptibleImage(image(),epsilon_,exceptionInfo); - ThrowImageException; -} - -void Magick::Image::perceptibleChannel(const ChannelType channel_, - const double epsilon_) -{ - modifyImage(); - GetPPException; - GetAndSetPPChannelMask(channel_); - PerceptibleImage(image(),epsilon_,exceptionInfo); - RestorePPChannelMask; - ThrowImageException; -} - - Magick::ImagePerceptualHash Magick::Image::perceptualHash() const -{ - return(ImagePerceptualHash(*this)); -} - -void Magick::Image::ping(const std::string &imageSpec_) -{ - MagickCore::Image - *newImage; - - GetPPException; - options()->fileName(imageSpec_); - newImage=PingImage(imageInfo(),exceptionInfo); - read(newImage,exceptionInfo); -} - -void Magick::Image::ping(const Blob& blob_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=PingBlob(imageInfo(),blob_.data(),blob_.length(),exceptionInfo); - read(newImage,exceptionInfo); -} - -void Magick::Image::pixelColor(const ssize_t x_,const ssize_t y_, - const Color &color_) -{ - PixelInfo - packet; - - Quantum - *pixel; - - // Test arguments to ensure they are within the image. - if (y_ > (ssize_t) rows() || x_ > (ssize_t) columns()) - throwExceptionExplicit(MagickCore::OptionError, - "Access outside of image boundary"); - - modifyImage(); - - // Set image to DirectClass - classType(DirectClass ); - - // Get pixel view - Pixels pixels(*this); - // Set pixel value - pixel=pixels.get(x_, y_, 1, 1 ); - packet=color_; - MagickCore::SetPixelViaPixelInfo(constImage(),&packet,pixel); - // Tell ImageMagick that pixels have been updated - pixels.sync(); -} - -Magick::Color Magick::Image::pixelColor(const ssize_t x_, - const ssize_t y_) const -{ - const Quantum - *pixel; - - pixel=getConstPixels(x_,y_,1,1); - if (pixel) - { - PixelInfo - packet; - - MagickCore::GetPixelInfoPixel(constImage(),pixel,&packet); - return(Color(packet)); - } - - return(Color()); // invalid -} - -void Magick::Image::polaroid(const std::string &caption_,const double angle_, - const PixelInterpolateMethod method_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=PolaroidImage(constImage(),options()->drawInfo(),caption_.c_str(), - angle_,method_,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::posterize(const size_t levels_,const DitherMethod method_) -{ - modifyImage(); - GetPPException; - PosterizeImage(image(),levels_,method_,exceptionInfo); - ThrowImageException; -} - -void Magick::Image::posterizeChannel(const ChannelType channel_, - const size_t levels_,const DitherMethod method_) -{ - modifyImage(); - GetPPException; - GetAndSetPPChannelMask(channel_); - PosterizeImage(image(),levels_,method_,exceptionInfo); - RestorePPChannelMask; - ThrowImageException; -} - -void Magick::Image::process(std::string name_,const ssize_t argc, - const char **argv) -{ - modifyImage(); - - GetPPException; - (void) InvokeDynamicImageFilter(name_.c_str(),&image(),argc,argv, - exceptionInfo); - ThrowImageException; -} - -void Magick::Image::profile(const std::string name_, - const Magick::Blob &profile_) -{ - modifyImage(); - GetPPException; - (void) ProfileImage(image(),name_.c_str(),(unsigned char *)profile_.data(), - profile_.length(),exceptionInfo); - ThrowImageException; -} - -Magick::Blob Magick::Image::profile(const std::string name_) const -{ - const StringInfo - *profile; - - profile=GetImageProfile(constImage(),name_.c_str()); - - if (profile == (StringInfo *) NULL) - return(Blob()); - return(Blob((void*) GetStringInfoDatum(profile),GetStringInfoLength( - profile))); -} - -void Magick::Image::quantize(const bool measureError_) -{ - modifyImage(); - - if (measureError_) - options()->quantizeInfo()->measure_error=MagickTrue; - else - options()->quantizeInfo()->measure_error=MagickFalse; - - GetPPException; - QuantizeImage(options()->quantizeInfo(),image(),exceptionInfo); - ThrowImageException; -} - -void Magick::Image::raise(const Geometry &geometry_,const bool raisedFlag_) -{ - RectangleInfo - raiseInfo=geometry_; - - GetPPException; - modifyImage(); - RaiseImage(image(),&raiseInfo,raisedFlag_ == true ? MagickTrue : MagickFalse, - exceptionInfo); - ThrowImageException; -} - -void Magick::Image::randomThreshold(const double low_,const double high_) -{ - GetPPException; - (void) RandomThresholdImage(image(),low_,high_,exceptionInfo); - ThrowImageException; -} - -void Magick::Image::randomThresholdChannel(const ChannelType channel_, - const double low_,const double high_) -{ - modifyImage(); - GetPPException; - GetAndSetPPChannelMask(channel_); - (void) RandomThresholdImage(image(),low_,high_,exceptionInfo); - RestorePPChannelMask; - ThrowImageException; -} - -void Magick::Image::read(const Blob &blob_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=BlobToImage(imageInfo(),static_cast(blob_.data()), - blob_.length(),exceptionInfo); - read(newImage,exceptionInfo); -} - -void Magick::Image::read(const Blob &blob_,const Geometry &size_) -{ - size(size_); - read(blob_); -} - -void Magick::Image::read(const Blob &blob_,const Geometry &size_, - const size_t depth_) -{ - size(size_); - depth(depth_); - read(blob_); -} - -void Magick::Image::read(const Blob &blob_,const Geometry &size_, - const size_t depth_,const std::string &magick_) -{ - size(size_); - depth(depth_); - magick(magick_); - // Set explicit image format - fileName(magick_ + ':'); - read(blob_); -} - -void Magick::Image::read(const Blob &blob_,const Geometry &size_, - const std::string &magick_) -{ - size(size_); - magick(magick_); - // Set explicit image format - fileName(magick_ + ':'); - read(blob_); -} - -void Magick::Image::read(const Geometry &size_,const std::string &imageSpec_) -{ - size(size_); - read(imageSpec_); -} - -void Magick::Image::read(const size_t width_,const size_t height_, - const std::string &map_,const StorageType type_,const void *pixels_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=ConstituteImage(width_,height_,map_.c_str(),type_, pixels_, - exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::read(const std::string &imageSpec_) -{ - MagickCore::Image - *newImage; - - GetPPException; - options()->fileName(imageSpec_); - newImage=ReadImage(imageInfo(),exceptionInfo); - read(newImage,exceptionInfo); -} - -void Magick::Image::readMask(const Magick::Image &mask_) -{ - mask(mask_,ReadPixelMask); -} - -Magick::Image Magick::Image::readMask(void) const -{ - return(mask(ReadPixelMask)); -} - -void Magick::Image::readPixels(const Magick::QuantumType quantum_, - const unsigned char *source_) -{ - QuantumInfo - *quantum_info; - - quantum_info=AcquireQuantumInfo(imageInfo(),image()); - GetPPException; - ImportQuantumPixels(image(),(MagickCore::CacheView *) NULL,quantum_info, - quantum_,source_,exceptionInfo); - quantum_info=DestroyQuantumInfo(quantum_info); - ThrowImageException; -} - -void Magick::Image::reduceNoise(void) -{ - reduceNoise(3); -} - -void Magick::Image::reduceNoise(const size_t order_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=StatisticImage(constImage(),NonpeakStatistic,order_, - order_,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::repage() -{ - modifyImage(); - options()->page(Geometry()); - image()->page.width = 0; - image()->page.height = 0; - image()->page.x = 0; - image()->page.y = 0; -} - -void Magick::Image::resample(const Point &density_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=ResampleImage(constImage(),density_.x(),density_.y(), - image()->filter,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::resize(const Geometry &geometry_) -{ - MagickCore::Image - *newImage; - - size_t - height=rows(), - width=columns(); - - ssize_t - x=0, - y=0; - - // Calculate new size. This code should be supported using binary arguments - // in the ImageMagick library. - ParseMetaGeometry(static_cast(geometry_).c_str(),&x,&y,&width, - &height); - - GetPPException; - newImage=ResizeImage(constImage(),width,height,image()->filter, - exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::roll(const Geometry &roll_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=RollImage(constImage(),roll_.xOff(),roll_.yOff(),exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::roll(const size_t columns_,const size_t rows_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=RollImage(constImage(),static_cast(columns_), - static_cast(rows_),exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::rotate(const double degrees_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=RotateImage(constImage(),degrees_,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::rotationalBlur(const double angle_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=RotationalBlurImage(constImage(),angle_,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::rotationalBlurChannel(const ChannelType channel_, - const double angle_) -{ - MagickCore::Image - *newImage; - - GetPPException; - GetAndSetPPChannelMask(channel_); - newImage=RotationalBlurImage(constImage(),angle_,exceptionInfo); - RestorePPChannelMask; - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::sample(const Geometry &geometry_) -{ - MagickCore::Image - *newImage; - - size_t - height=rows(), - width=columns(); - - ssize_t - x=0, - y=0; - - ParseMetaGeometry(static_cast(geometry_).c_str(),&x,&y,&width, - &height); - - GetPPException; - newImage=SampleImage(constImage(),width,height,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::scale(const Geometry &geometry_) -{ - MagickCore::Image - *newImage; - - size_t - height=rows(), - width=columns(); - - ssize_t - x=0, - y=0; - - ParseMetaGeometry(static_cast(geometry_).c_str(),&x,&y,&width, - &height); - - GetPPException; - newImage=ScaleImage(constImage(),width,height,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::segment(const double clusterThreshold_, - const double smoothingThreshold_) -{ - modifyImage(); - GetPPException; - SegmentImage(image(),options()->quantizeColorSpace(), - (MagickBooleanType) options()->verbose(),clusterThreshold_, - smoothingThreshold_,exceptionInfo); - SyncImage(image(),exceptionInfo); - ThrowImageException; -} - -void Magick::Image::selectiveBlur(const double radius_,const double sigma_, - const double threshold_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=SelectiveBlurImage(constImage(),radius_,sigma_,threshold_, - exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::selectiveBlurChannel(const ChannelType channel_, - const double radius_,const double sigma_,const double threshold_) -{ - MagickCore::Image - *newImage; - - GetPPException; - GetAndSetPPChannelMask(channel_); - newImage=SelectiveBlurImage(constImage(),radius_,sigma_,threshold_, - exceptionInfo); - RestorePPChannelMask; - replaceImage(newImage); - ThrowImageException; -} - -Magick::Image Magick::Image::separate(const ChannelType channel_) const -{ - MagickCore::Image - *image; - - GetPPException; - image=SeparateImage(constImage(),channel_,exceptionInfo); - ThrowImageException; - if (image == (MagickCore::Image *) NULL) - return(Magick::Image()); - else - return(Magick::Image(image)); -} - -void Magick::Image::sepiaTone(const double threshold_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=SepiaToneImage(constImage(),threshold_,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -bool Magick::Image::setColorMetric(const Image &reference_) -{ - bool - status; - - Image - ref=reference_; - - GetPPException; - modifyImage(); - status=static_cast(SetImageColorMetric(image(),ref.constImage(), - exceptionInfo)); - ThrowImageException; - return(status); -} - -Magick::Quantum *Magick::Image::setPixels(const ssize_t x_,const ssize_t y_, - const size_t columns_,const size_t rows_) -{ - Quantum - *result; - - modifyImage(); - GetPPException; - result=QueueAuthenticPixels(image(),x_,y_,columns_,rows_,exceptionInfo); - ThrowImageException; - return(result); -} - -void Magick::Image::shade(const double azimuth_,const double elevation_, - const bool colorShading_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=ShadeImage(constImage(),colorShading_ == true ? - MagickTrue : MagickFalse,azimuth_,elevation_,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::shadow(const double percent_opacity_,const double sigma_, - const ssize_t x_,const ssize_t y_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=ShadowImage(constImage(),percent_opacity_, sigma_,x_, y_, - exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::sharpen(const double radius_,const double sigma_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=SharpenImage(constImage(),radius_,sigma_,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::sharpenChannel(const ChannelType channel_, - const double radius_,const double sigma_) -{ - MagickCore::Image - *newImage; - - GetPPException; - GetAndSetPPChannelMask(channel_); - newImage=SharpenImage(constImage(),radius_,sigma_,exceptionInfo); - RestorePPChannelMask; - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::shave(const Geometry &geometry_) -{ - MagickCore::Image - *newImage; - - RectangleInfo - shaveInfo=geometry_; - - GetPPException; - newImage=ShaveImage(constImage(),&shaveInfo,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::shear(const double xShearAngle_,const double yShearAngle_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=ShearImage(constImage(),xShearAngle_,yShearAngle_,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::sigmoidalContrast(const bool sharpen_, - const double contrast,const double midpoint) -{ - modifyImage(); - GetPPException; - (void) SigmoidalContrastImage(image(),(MagickBooleanType) sharpen_,contrast, - midpoint,exceptionInfo); - ThrowImageException; -} - -std::string Magick::Image::signature(const bool force_) const -{ - return(_imgRef->signature(force_)); -} - -void Magick::Image::sketch(const double radius_,const double sigma_, - const double angle_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=SketchImage(constImage(),radius_,sigma_,angle_,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::solarize(const double factor_) -{ - modifyImage(); - GetPPException; - SolarizeImage(image(),factor_,exceptionInfo); - ThrowImageException; -} - -void Magick::Image::sparseColor(const ChannelType channel_, - const SparseColorMethod method_,const size_t numberArguments_, - const double *arguments_) -{ - MagickCore::Image - *newImage; - - GetPPException; - GetAndSetPPChannelMask(channel_); - newImage=SparseColorImage(constImage(),method_,numberArguments_,arguments_, - exceptionInfo); - RestorePPChannelMask; - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::splice(const Geometry &geometry_) -{ - MagickCore::Image - *newImage; - - RectangleInfo - spliceInfo=geometry_; - - GetPPException; - newImage=SpliceImage(constImage(),&spliceInfo,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::splice(const Geometry &geometry_, - const Color &backgroundColor_) -{ - backgroundColor(backgroundColor_); - splice(geometry_); -} - -void Magick::Image::splice(const Geometry &geometry_, - const Color &backgroundColor_,const GravityType gravity_) -{ - backgroundColor(backgroundColor_); - image()->gravity=gravity_; - splice(geometry_); -} - -void Magick::Image::spread(const double amount_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=SpreadImage(constImage(),image()->interpolate,amount_,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -Magick::ImageStatistics Magick::Image::statistics() const -{ - return(ImageStatistics(*this)); -} - -void Magick::Image::stegano(const Image &watermark_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=SteganoImage(constImage(),watermark_.constImage(),exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::stereo(const Image &rightImage_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=StereoImage(constImage(),rightImage_.constImage(),exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::strip(void) -{ - modifyImage(); - GetPPException; - StripImage(image(),exceptionInfo); - ThrowImageException; -} - -Magick::Image Magick::Image::subImageSearch(const Image &reference_, - const MetricType metric_,Geometry *offset_,double *similarityMetric_, - const double similarityThreshold) -{ - MagickCore::Image - *newImage; - - RectangleInfo - offset; - - GetPPException; - newImage=SimilarityImage(image(),reference_.constImage(),metric_, - similarityThreshold,&offset,similarityMetric_,exceptionInfo); - ThrowImageException; - if (offset_ != (Geometry *) NULL) - *offset_=offset; - if (newImage == (MagickCore::Image *) NULL) - return(Magick::Image()); - else - return(Magick::Image(newImage)); -} - -void Magick::Image::swirl(const double degrees_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=SwirlImage(constImage(),degrees_,image()->interpolate, - exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::syncPixels(void) -{ - GetPPException; - (void) SyncAuthenticPixels(image(),exceptionInfo); - ThrowImageException; -} - -void Magick::Image::texture(const Image &texture_) -{ - modifyImage(); - GetPPException; - TextureImage(image(),texture_.constImage(),exceptionInfo); - ThrowImageException; -} - -void Magick::Image::threshold(const double threshold_) -{ - modifyImage(); - GetPPException; - BilevelImage(image(),threshold_,exceptionInfo); - ThrowImageException; -} - -void Magick::Image::thumbnail(const Geometry &geometry_) -{ - MagickCore::Image - *newImage; - - size_t - height=rows(), - width=columns(); - - ssize_t - x=0, - y=0; - - ParseMetaGeometry(static_cast(geometry_).c_str(),&x,&y,&width, - &height); - - GetPPException; - newImage=ThumbnailImage(constImage(),width,height,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::tint(const std::string opacity_) -{ - MagickCore::Image - *newImage; - - PixelInfo - color; - - GetPPException; - color=static_cast(constOptions()->fillColor()); - newImage=TintImage(constImage(),opacity_.c_str(),&color,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::transformOrigin(const double x_,const double y_) -{ - modifyImage(); - options()->transformOrigin(x_,y_); -} - -void Magick::Image::transformReset(void) -{ - modifyImage(); - options()->transformReset(); -} - -void Magick::Image::transformScale(const double sx_,const double sy_) -{ - modifyImage(); - options()->transformScale(sx_,sy_); -} - -void Magick::Image::transparent(const Color &color_,const bool inverse_) -{ - PixelInfo - target; - - std::string - color; - - if (!color_.isValid()) - throwExceptionExplicit(MagickCore::OptionError, - "Color argument is invalid"); - - color=color_; - GetPPException; - (void) QueryColorCompliance(color.c_str(),AllCompliance,&target, - exceptionInfo); - modifyImage(); - TransparentPaintImage(image(),&target,TransparentAlpha, - inverse_ == true ? MagickTrue : MagickFalse,exceptionInfo); - ThrowImageException; -} - -void Magick::Image::transparentChroma(const Color &colorLow_, - const Color &colorHigh_) -{ - std::string - colorHigh, - colorLow; - - PixelInfo - targetHigh, - targetLow; - - if (!colorLow_.isValid() || !colorHigh_.isValid()) - throwExceptionExplicit(MagickCore::OptionError, - "Color argument is invalid"); - - colorLow=colorLow_; - colorHigh=colorHigh_; - - GetPPException; - (void) QueryColorCompliance(colorLow.c_str(),AllCompliance,&targetLow, - exceptionInfo); - (void) QueryColorCompliance(colorHigh.c_str(),AllCompliance,&targetHigh, - exceptionInfo); - modifyImage(); - TransparentPaintImageChroma(image(),&targetLow,&targetHigh,TransparentAlpha, - MagickFalse,exceptionInfo); - ThrowImageException; -} - -void Magick::Image::transpose(void) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=TransposeImage(constImage(),exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::transverse(void) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=TransverseImage(constImage(),exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::trim(void) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=TrimImage(constImage(),exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -Magick::Image Magick::Image::uniqueColors(void) const -{ - MagickCore::Image - *image; - - GetPPException; - image=UniqueImageColors(constImage(),exceptionInfo); - ThrowImageException; - if (image == (MagickCore::Image *) NULL) - return(Magick::Image()); - else - return(Magick::Image(image)); -} - -void Magick::Image::unsharpmask(const double radius_,const double sigma_, - const double amount_,const double threshold_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=UnsharpMaskImage(constImage(),radius_,sigma_,amount_,threshold_, - exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::unsharpmaskChannel(const ChannelType channel_, - const double radius_,const double sigma_,const double amount_, - const double threshold_) -{ - MagickCore::Image - *newImage; - - GetPPException; - GetAndSetPPChannelMask(channel_); - newImage=UnsharpMaskImage(constImage(),radius_,sigma_,amount_,threshold_, - exceptionInfo); - RestorePPChannelMask; - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::vignette(const double radius_,const double sigma_, - const ssize_t x_,const ssize_t y_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=VignetteImage(constImage(),radius_,sigma_,x_,y_,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::wave(const double amplitude_,const double wavelength_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=WaveImage(constImage(),amplitude_,wavelength_,image()->interpolate, - exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::waveletDenoise(const double threshold_, - const double softness_) -{ - MagickCore::Image - *newImage; - - GetPPException; - newImage=WaveletDenoiseImage(constImage(),threshold_,softness_, - exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -void Magick::Image::whiteThreshold(const std::string &threshold_) -{ - modifyImage(); - GetPPException; - WhiteThresholdImage(image(),threshold_.c_str(),exceptionInfo); - ThrowImageException; -} - -void Magick::Image::whiteThresholdChannel(const ChannelType channel_, - const std::string &threshold_) -{ - modifyImage(); - GetPPException; - GetAndSetPPChannelMask(channel_); - WhiteThresholdImage(image(),threshold_.c_str(),exceptionInfo); - RestorePPChannelMask; - ThrowImageException; -} - -void Magick::Image::write(Blob *blob_) -{ - size_t - length=0; - - void - *data; - - modifyImage(); - GetPPException; - data=ImagesToBlob(constImageInfo(),image(),&length,exceptionInfo); - if (length > 0) - blob_->updateNoCopy(data,length,Blob::MallocAllocator); - else - data=RelinquishMagickMemory(data); - ThrowImageException; -} - -void Magick::Image::write(Blob *blob_,const std::string &magick_) -{ - size_t - length=0; - - void - *data; - - modifyImage(); - magick(magick_); - GetPPException; - data=ImagesToBlob(constImageInfo(),image(),&length,exceptionInfo); - if (length > 0) - blob_->updateNoCopy(data,length,Blob::MallocAllocator); - else - data=RelinquishMagickMemory(data); - ThrowImageException; -} - -void Magick::Image::write(Blob *blob_,const std::string &magick_, - const size_t depth_) -{ - size_t - length=0; - - void - *data; - - modifyImage(); - magick(magick_); - depth(depth_); - GetPPException; - data=ImagesToBlob(constImageInfo(),image(),&length,exceptionInfo); - if (length > 0) - blob_->updateNoCopy(data,length,Blob::MallocAllocator); - else - data=RelinquishMagickMemory(data); - ThrowImageException; -} - -void Magick::Image::write(const ssize_t x_,const ssize_t y_, - const size_t columns_,const size_t rows_,const std::string &map_, - const StorageType type_,void *pixels_) -{ - GetPPException; - ExportImagePixels(image(),x_,y_,columns_,rows_,map_.c_str(),type_,pixels_, - exceptionInfo); - ThrowImageException; -} - -void Magick::Image::write(const std::string &imageSpec_) -{ - modifyImage(); - fileName(imageSpec_); - GetPPException; - WriteImage(constImageInfo(),image(),exceptionInfo); - ThrowImageException; -} - -void Magick::Image::writeMask(const Magick::Image &mask_) -{ - mask(mask_,WritePixelMask); -} - -Magick::Image Magick::Image::writeMask(void) const -{ - return(mask(WritePixelMask)); -} - -void Magick::Image::writePixels(const Magick::QuantumType quantum_, - unsigned char *destination_) -{ - QuantumInfo - *quantum_info; - - quantum_info=AcquireQuantumInfo(imageInfo(),image()); - GetPPException; - ExportQuantumPixels(image(),(MagickCore::CacheView *) NULL,quantum_info, - quantum_,destination_, exceptionInfo); - quantum_info=DestroyQuantumInfo(quantum_info); - ThrowImageException; -} - -void Magick::Image::zoom(const Geometry &geometry_) -{ - MagickCore::Image - *newImage; - - size_t - height=rows(), - width=columns(); - - ssize_t - x=0, - y=0; - - ParseMetaGeometry(static_cast(geometry_).c_str(),&x,&y,&width, - &height); - - GetPPException; - newImage=ResizeImage(constImage(),width,height,image()->filter,exceptionInfo); - replaceImage(newImage); - ThrowImageException; -} - -Magick::Image::Image(MagickCore::Image *image_) - : _imgRef(new ImageRef(image_)) -{ -} - -MagickCore::Image *&Magick::Image::image(void) -{ - return(_imgRef->image()); -} - -const MagickCore::Image *Magick::Image::constImage(void) const -{ - return(_imgRef->image()); -} - -MagickCore::ImageInfo *Magick::Image::imageInfo(void) -{ - return(_imgRef->options()->imageInfo()); -} - -const MagickCore::ImageInfo *Magick::Image::constImageInfo(void) const -{ - return(_imgRef->options()->imageInfo()); -} - -Magick::Options *Magick::Image::options(void) -{ - return(_imgRef->options()); -} - -const Magick::Options *Magick::Image::constOptions(void) const -{ - return(_imgRef->options()); -} - -MagickCore::QuantizeInfo *Magick::Image::quantizeInfo(void) -{ - return(_imgRef->options()->quantizeInfo()); -} - -const MagickCore::QuantizeInfo *Magick::Image::constQuantizeInfo(void) const -{ - return(_imgRef->options()->quantizeInfo()); -} - -void Magick::Image::modifyImage(void) -{ - if (!_imgRef->isShared()) - return; - - GetPPException; - replaceImage(CloneImage(image(),0,0,MagickTrue,exceptionInfo)); - ThrowImageException; -} - -MagickCore::Image *Magick::Image::replaceImage(MagickCore::Image *replacement_) -{ - MagickCore::Image - *image; - - if (replacement_) - image=replacement_; - else - { - GetPPException; - image=AcquireImage(constImageInfo(),exceptionInfo); - ThrowImageException; - } - - _imgRef=ImageRef::replaceImage(_imgRef,image); - return(image); -} - -void Magick::Image::read(MagickCore::Image *image, - MagickCore::ExceptionInfo *exceptionInfo) -{ - // Ensure that multiple image frames were not read. - if (image != (MagickCore::Image *) NULL && - image->next != (MagickCore::Image *) NULL) - { - MagickCore::Image - *next; - - // Destroy any extra image frames - next=image->next; - image->next=(MagickCore::Image *) NULL; - next->previous=(MagickCore::Image *) NULL; - DestroyImageList(next); - } - replaceImage(image); - if (exceptionInfo->severity == MagickCore::UndefinedException && - image == (MagickCore::Image *) NULL) - { - (void) MagickCore::DestroyExceptionInfo(exceptionInfo); - if (!quiet()) - throwExceptionExplicit(MagickCore::ImageWarning, - "No image was loaded."); - return; - } - ThrowImageException; -} - -void Magick::Image::floodFill(const ssize_t x_,const ssize_t y_, - const Magick::Image *fillPattern_,const Magick::Color &fill_, - const MagickCore::PixelInfo *target_,const bool invert_) -{ - Magick::Color - fillColor; - - MagickCore::Image - *fillPattern; - - // Set drawing fill pattern or fill color - fillColor=options()->fillColor(); - fillPattern=(MagickCore::Image *)NULL; - if (options()->fillPattern() != (MagickCore::Image *)NULL) - { - GetPPException; - fillPattern=CloneImage(options()->fillPattern(),0,0,MagickTrue, - exceptionInfo); - ThrowImageException; - } - - if (fillPattern_ == (Magick::Image *)NULL) - { - options()->fillPattern((MagickCore::Image *)NULL); - options()->fillColor(fill_); - } - else - options()->fillPattern(fillPattern_->constImage()); - - GetPPException; - (void) FloodfillPaintImage(image(),options()->drawInfo(), - target_,static_cast(x_),static_cast(y_), - (MagickBooleanType) invert_,exceptionInfo); - - options()->fillColor(fillColor); - options()->fillPattern(fillPattern); - ThrowImageException; -} - -void Magick::Image::mask(const Magick::Image &mask_,const PixelMask type) -{ - modifyImage(); - - GetPPException; - if (mask_.isValid()) - SetImageMask(image(),type,mask_.constImage(),exceptionInfo); - else - SetImageMask(image(),type,(MagickCore::Image *) NULL, - exceptionInfo); - ThrowImageException; -} - -Magick::Image Magick::Image::mask(const PixelMask type) const -{ - MagickCore::Image - *image; - - GetPPException; - image = GetImageMask(constImage(),type,exceptionInfo); - ThrowImageException; - - if (image == (MagickCore::Image *) NULL) - return(Magick::Image()); - else - return(Magick::Image(image)); -} diff --git a/Magick++/lib/ImageRef.cpp b/Magick++/lib/ImageRef.cpp deleted file mode 100644 index ef3f6c38e..000000000 --- a/Magick++/lib/ImageRef.cpp +++ /dev/null @@ -1,155 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002 -// Copyright Dirk Lemstra 2014-2015 -// -// Implementation of ImageRef -// -// This is an internal implementation class. -// - -#define MAGICKCORE_IMPLEMENTATION 1 -#define MAGICK_PLUSPLUS_IMPLEMENTATION 1 - -#include "Magick++/ImageRef.h" -#include "Magick++/Exception.h" -#include "Magick++/Options.h" - -Magick::ImageRef::ImageRef(void) - : _image(0), - _mutexLock(), - _options(new Options), - _refCount(1) -{ - GetPPException; - _image=AcquireImage(_options->imageInfo(),exceptionInfo); - ThrowPPException(false); -} - -Magick::ImageRef::ImageRef(MagickCore::Image *image_) - : _image(image_), - _mutexLock(), - _options(new Options), - _refCount(1) -{ -} - -Magick::ImageRef::~ImageRef(void) -{ - // Deallocate image - if (_image != (MagickCore::Image*) NULL) - _image=DestroyImageList(_image); - - // Deallocate image options - delete _options; - _options=(Options *) NULL; -} - -size_t Magick::ImageRef::decrease() -{ - size_t - count; - - _mutexLock.lock(); - if (_refCount == 0) - { - _mutexLock.unlock(); - throwExceptionExplicit(MagickCore::OptionError, - "Invalid call to decrease"); - return(0); - } - count=--_refCount; - _mutexLock.unlock(); - return(count); -} - -MagickCore::Image *&Magick::ImageRef::image(void) -{ - return(_image); -} - -void Magick::ImageRef::increase() -{ - _mutexLock.lock(); - _refCount++; - _mutexLock.unlock(); -} - -bool Magick::ImageRef::isShared() -{ - bool - isShared; - - _mutexLock.lock(); - isShared=(_refCount > 1); - _mutexLock.unlock(); - return(isShared); -} - -void Magick::ImageRef::options(Magick::Options *options_) -{ - delete _options; - _options=options_; -} - -Magick::Options *Magick::ImageRef::options(void) -{ - return(_options); -} - -Magick::ImageRef *Magick::ImageRef::replaceImage(ImageRef *imgRef, - MagickCore::Image *replacement_) -{ - Magick::ImageRef - *instance; - - imgRef->_mutexLock.lock(); - if (imgRef->_refCount == 1) - { - // We can replace the image if we own it. - instance=imgRef; - if (imgRef->_image != (MagickCore::Image*) NULL) - (void) DestroyImageList(imgRef->_image); - imgRef->_image=replacement_; - imgRef->_mutexLock.unlock(); - } - else - { - // We don't own the image, create a new ImageRef instance. - instance=new ImageRef(replacement_,imgRef->_options); - imgRef->_refCount--; - imgRef->_mutexLock.unlock(); - } - return(instance); -} - -std::string Magick::ImageRef::signature(const bool force_) -{ - const char - *property; - - // Re-calculate image signature if necessary - GetPPException; - _mutexLock.lock(); - property=(const char *) NULL; - if (!force_ && (_image->taint == MagickFalse)) - property=GetImageProperty(_image,"Signature",exceptionInfo); - if (property == (const char *) NULL) - { - (void) SignatureImage(_image,exceptionInfo); - property=GetImageProperty(_image,"Signature",exceptionInfo); - } - _mutexLock.unlock(); - ThrowPPException(true); - - return(std::string(property)); -} - -Magick::ImageRef::ImageRef(MagickCore::Image *image_,const Options *options_) - : _image(image_), - _mutexLock(), - _options(0), - _refCount(1) -{ - _options=new Options(*options_); -} \ No newline at end of file diff --git a/Magick++/lib/Magick++.h b/Magick++/lib/Magick++.h deleted file mode 100644 index 40f24db8d..000000000 --- a/Magick++/lib/Magick++.h +++ /dev/null @@ -1,23 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000 -// Copyright Dirk Lemstra 2014 -// -// Simplified includes for Magick++. -// Inclusion of this header is sufficient to use all Magick++ APIs. -// -#ifndef MagickPlusPlus_Header -#include -#include -#include -#include -#include -#include - -// Don't leak our definition of the 'restrict' keyword. 'restrict' is a valid -// identifier in C++, and leaking it could cause extraneous build failures. -#ifdef restrict -#undef restrict -#endif -#define MagickPlusPlus_Header -#endif // MagickPlusPlus_Header diff --git a/Magick++/lib/Magick++.pc.in b/Magick++/lib/Magick++.pc.in deleted file mode 100644 index 841a01db8..000000000 --- a/Magick++/lib/Magick++.pc.in +++ /dev/null @@ -1,14 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@/ImageMagick-@MAGICK_MAJOR_VERSION@ -includearchdir=@INCLUDEARCH_DIR@/ImageMagick-@MAGICK_MAJOR_VERSION@ -libname=Magick++-@MAGICK_MAJOR_VERSION@.@MAGICK_ABI_SUFFIX@ - -Name: Magick++ -Description: Magick++ - C++ API for ImageMagick (ABI @MAGICK_ABI_SUFFIX@) -Version: @PACKAGE_BASE_VERSION@ -Requires: MagickWand-@MAGICK_MAJOR_VERSION@.@MAGICK_ABI_SUFFIX@ -Libs: -L${libdir} -l${libname} -Libs.private: -L${libdir} -l${libname} @MATH_LIBS@ -Cflags: -I${includearchdir} -I${includedir} @MAGICK_PCFLAGS@ diff --git a/Magick++/lib/Magick++/Blob.h b/Magick++/lib/Magick++/Blob.h deleted file mode 100644 index 87abd6baf..000000000 --- a/Magick++/lib/Magick++/Blob.h +++ /dev/null @@ -1,80 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002 -// Copyright Dirk Lemstra 2015 -// -// Reference counted container class for Binary Large Objects (BLOBs) -// - -#if !defined(Magick_BlobRef_header) -#define Magick_BlobRef_header - -#include "Magick++/Include.h" -#include - -namespace Magick -{ - // Forward decl - class BlobRef; - - class MagickPPExport Blob - { - public: - - enum Allocator - { - MallocAllocator, - NewAllocator - }; - - // Default constructor - Blob(void); - - // Construct object with data, making a copy of the supplied data. - Blob(const void* data_,const size_t length_); - - // Copy constructor (reference counted) - Blob(const Blob& blob_); - - // Destructor (reference counted) - virtual ~Blob(); - - // Assignment operator (reference counted) - Blob& operator=(const Blob& blob_); - - // Update object contents from Base64-encoded string representation. - void base64(const std::string base64_); - // Return Base64-encoded string representation. - std::string base64(void) const; - - // Obtain pointer to data. The user should never try to modify or - // free this data since the Blob class manages its own data. The - // user must be finished with the data before allowing the Blob to - // be destroyed since the pointer is invalid once the Blob is - // destroyed. - const void* data(void) const; - - // Obtain data length. - size_t length(void) const; - - // Update object contents, making a copy of the supplied data. - // Any existing data in the object is deallocated. - void update(const void* data_,const size_t length_); - - // Update object contents, using supplied pointer directly (no - // copy). Any existing data in the object is deallocated. The user - // must ensure that the pointer supplied is not deleted or - // otherwise modified after it has been supplied to this method. - // Specify allocator_ as "MallocAllocator" if memory is allocated - // via the C language malloc() function, or "NewAllocator" if - // memory is allocated via C++ 'new'. - void updateNoCopy(void* data_,const size_t length_, - const Allocator allocator_=NewAllocator); - - private: - BlobRef *_blobRef; - }; - -} // namespace Magick - -#endif // Magick_BlobRef_header diff --git a/Magick++/lib/Magick++/BlobRef.h b/Magick++/lib/Magick++/BlobRef.h deleted file mode 100644 index 1da7e1c95..000000000 --- a/Magick++/lib/Magick++/BlobRef.h +++ /dev/null @@ -1,52 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002 -// Copyright Dirk Lemstra 2014-2015 -// -// Blob reference class -// -// This is an internal implementation class that should not be -// accessed by users. -// - -#if !defined(Magick_Blob_header) -#define Magick_Blob_header - -#include "Magick++/Include.h" -#include "Magick++/Thread.h" -#include "Magick++/Blob.h" - -namespace Magick -{ - class BlobRef - { - public: - - // Construct with data, making private copy of data - BlobRef(const void* data_,const size_t length_); - - // Destructor (actually destroys data) - ~BlobRef(void); - - // Decreases reference count and return the new count - size_t decrease(); - - // Increases reference count - void increase(); - - Blob::Allocator allocator; // Memory allocation system in use - size_t length; // Blob length - void* data; // Blob data - - private: - // Copy constructor and assignment are not supported - BlobRef(const BlobRef&); - BlobRef& operator=(const BlobRef&); - - MutexLock _mutexLock; // Mutex lock - size_t _refCount; // Reference count - }; - -} // namespace Magick - -#endif // Magick_Blob_header diff --git a/Magick++/lib/Magick++/CoderInfo.h b/Magick++/lib/Magick++/CoderInfo.h deleted file mode 100644 index f860020b6..000000000 --- a/Magick++/lib/Magick++/CoderInfo.h +++ /dev/null @@ -1,88 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 2001, 2002 -// Copyright Dirk Lemstra 2013-2015 -// -// CoderInfo Definition -// -// Container for image format support information. -// - -#if !defined (Magick_CoderInfo_header) -#define Magick_CoderInfo_header 1 - -#include "Magick++/Include.h" -#include - -namespace Magick -{ - class MagickPPExport CoderInfo - { - public: - - enum MatchType { - AnyMatch, // match any coder - TrueMatch, // match coder if true - FalseMatch // match coder if false - }; - - // Default constructor - CoderInfo(void); - - // Copy constructor - CoderInfo(const CoderInfo &coder_); - - // Construct with coder name - CoderInfo(const std::string &name_); - - // Destructor - ~CoderInfo(void); - - // Assignment operator - CoderInfo& operator=(const CoderInfo &coder_); - - // Format can read multi-threaded - bool canReadMultithreaded(void) const; - - // Format can write multi-threaded - bool canWriteMultithreaded(void) const; - - // Format description - std::string description(void) const; - - // Format supports multiple frames - bool isMultiFrame(void) const; - - // Format is readable - bool isReadable(void) const; - - // Format is writeable - bool isWritable(void) const; - - // Format mime type - std::string mimeType(void) const; - - // Name of the module - std::string module(void) const; - - // Format name - std::string name(void) const; - - // Unregisters this coder - bool unregister(void) const; - - private: - bool _decoderThreadSupport; - std::string _description; - bool _encoderThreadSupport; - bool _isMultiFrame; - bool _isReadable; - bool _isWritable; - std::string _mimeType; - std::string _module; - std::string _name; - }; - -} // namespace Magick - -#endif // Magick_CoderInfo_header diff --git a/Magick++/lib/Magick++/Color.h b/Magick++/lib/Magick++/Color.h deleted file mode 100644 index d9c73be9e..000000000 --- a/Magick++/lib/Magick++/Color.h +++ /dev/null @@ -1,444 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003, 2008 -// Copyright Dirk Lemstra 2013-2018 -// -// Color Implementation -// -#if !defined (Magick_Color_header) -#define Magick_Color_header - -#include "Magick++/Include.h" -#include - -namespace Magick -{ - class MagickPPExport Color; - - // Compare two Color objects regardless of LHS/RHS - MagickPPExport int operator == - (const Magick::Color& left_,const Magick::Color& right_); - MagickPPExport int operator != - (const Magick::Color& left_,const Magick::Color& right_); - MagickPPExport int operator > - (const Magick::Color& left_,const Magick::Color& right_); - MagickPPExport int operator < - (const Magick::Color& left_,const Magick::Color& right_); - MagickPPExport int operator >= - (const Magick::Color& left_,const Magick::Color& right_); - MagickPPExport int operator <= - (const Magick::Color& left_,const Magick::Color& right_); - - // Base color class stores RGBA components scaled to fit Quantum - // All double arguments have a valid range of 0.0 - 1.0. - class MagickPPExport Color - { - public: - - // PixelType specifies the interpretation of PixelInfo members - // CYMKPixel: - // Cyan = red - // Magenta = green - // Yellow = blue - // Black(K) = black - // CYMKPixel: - // Cyan = red - // Magenta = green - // Yellow = blue - // Black(K) = black - // Alpha = alpha - // RGBPixel: - // Red = red; - // Green = green; - // Blue = blue; - // RGBAPixel: - // Red = red; - // Green = green; - // Blue = blue; - // Alpha = alpha; - enum PixelType - { - CMYKPixel, - CMYKAPixel, - RGBPixel, - RGBAPixel - }; - - // Default constructor - Color(void); - - // Construct Color using the specified RGB values - Color(const Magick::Quantum red_,const Magick::Quantum green_, - const Magick::Quantum blue_); - - // Construct Color using the specified RGBA values - Color(const Magick::Quantum red_,const Magick::Quantum green_, - const Magick::Quantum blue_,const Magick::Quantum alpha_); - - // Construct Color using the specified CMYKA values - Color(const Magick::Quantum cyan_,const Magick::Quantum magenta_, - const Magick::Quantum yellow_,const Magick::Quantum black_, - const Magick::Quantum alpha_); - - // Construct Color using the specified color string - Color(const char *color_); - - // Copy constructor - Color(const Color &color_); - - // Construct color via ImageMagick PixelInfo - Color(const PixelInfo &color_); - - // Constructor Color using the specified color string - Color(const std::string &color_); - - // Destructor - virtual ~Color(void); - - // Assignment operator - Color& operator=(const Color &color_); - - // Set color via X11 color specification string - const Color& operator=(const char *color); - - // Set color via ImageMagick PixelInfo - const Color& operator=(const PixelInfo &color_); - - // Set color via color specification string - const Color& operator=(const std::string &color); - - // Return ImageMagick PixelInfo - operator PixelInfo() const; - - // Return color specification string - operator std::string() const; - - // Returns true if the distance between the other color is less than the - // specified distance in a linear three(or four) % dimensional color space. - bool isFuzzyEquivalent(const Color &color_,const double fuzz_) const; - - // Does object contain valid color? - void isValid(const bool valid_); - bool isValid(void) const; - - // Returns pixel type of the color - Magick::Color::PixelType pixelType(void) const; - - // Alpha level (range OpaqueAlpha=0 to TransparentAlpha=QuantumRange) - void quantumAlpha(const Quantum alpha_); - Quantum quantumAlpha(void) const; - - // Black color (range 0 to QuantumRange) - void quantumBlack(const Quantum black_); - Quantum quantumBlack(void) const; - - // Blue/Yellow color (range 0 to QuantumRange) - void quantumBlue(const Quantum blue_); - Quantum quantumBlue(void) const; - - // Green/Magenta color (range 0 to QuantumRange) - void quantumGreen(const Quantum green_); - Quantum quantumGreen(void) const; - - // Red/Cyan color (range 0 to QuantumRange) - void quantumRed(const Quantum red_); - Quantum quantumRed(void) const; - - protected: - - // Constructor to construct with PixelInfo* - // Used to point Color at a pixel in an image - Color(PixelInfo *rep_,PixelType pixelType_); - - // Constructor to construct with PixelType - Color(PixelType pixelType_); - - // Set pixel - // Used to point Color at a pixel in an image - void pixel(PixelInfo *rep_,PixelType pixelType_); - - // Scale a value expressed as a double (0-1) to Quantum range (0-QuantumRange) - static Quantum scaleDoubleToQuantum(const double double_); - - // Scale a value expressed as a Quantum (0-QuantumRange) to double range (0-1) - static double scaleQuantumToDouble(const Quantum quantum_); - - // PixelInfo represents a color pixel: - // red = red (range 0 to QuantumRange) - // green = green (range 0 to QuantumRange) - // blue = blue (range 0 to QuantumRange) - // alpha = alpha (range OpaqueAlpha=0 to TransparentAlpha=QuantumRange) - // index = PseudoColor colormap index - PixelInfo *_pixel; - - private: - - bool _isValid; // Set true if pixel is "valid" - bool _pixelOwn; // Set true if we allocated pixel - PixelType _pixelType; // Color type supported by _pixel - - // Common initializer for PixelInfo representation - void initPixel(); - - void setAlpha(const Magick::Quantum alpha_); - - // Sets the pixel type using the specified PixelInfo. - void setPixelType(const PixelInfo &color_); - }; - - class MagickPPExport ColorCMYK: public Color - { - public: - - // Default constructor - ColorCMYK(void); - - // Copy constructor - ColorCMYK(const Color &color_); - - // Construct ColorCMYK using the specified CMYK values - ColorCMYK(const double cyan_,const double magenta_,const double yellow_, - const double black_); - - // Construct ColorCMYK using the specified CMYKA values - ColorCMYK(const double cyan_,const double magenta_,const double yellow_, - const double black_,const double alpha_); - - // Destructor - ~ColorCMYK(void); - - // Assignment operator from base class - ColorCMYK& operator=(const Color& color_); - - // Alpha level (range 0 to 1.0) - void alpha(const double alpha_); - double alpha(void) const; - - // Black/Key color (range 0 to 1.0) - void black(const double black_); - double black(void) const; - - // Black/Key color (range 0.0 to 1.0) - void cyan(const double cyan_); - double cyan(void) const; - - // Magenta color (range 0 to 1.0) - void magenta(const double magenta_); - double magenta(void) const; - - // Yellow color (range 0 to 1.0) - void yellow(const double yellow_); - double yellow(void) const; - - protected: - - // Constructor to construct with PixelInfo* - ColorCMYK(PixelInfo *rep_,PixelType pixelType_); - }; - - // - // Grayscale RGB color - // - // Grayscale is simply RGB with equal parts of red, green, and blue - // All double arguments have a valid range of 0.0 - 1.0. - class MagickPPExport ColorGray: public Color - { - public: - - // Default constructor - ColorGray(void); - - // Copy constructor - ColorGray(const Color &color_); - - // Construct ColorGray using the specified shade - ColorGray(const double shade_); - - // Destructor - ~ColorGray(); - - // Shade - void shade(const double shade_); - double shade(void) const; - - // Assignment operator from base class - ColorGray& operator=(const Color& color_); - - protected: - - // Constructor to construct with PixelInfo* - ColorGray(PixelInfo *rep_,PixelType pixelType_); - }; - - // - // HSL Colorspace colors - // - // All double arguments have a valid range of 0.0 - 1.0. - class MagickPPExport ColorHSL: public Color - { - public: - - // Default constructor - ColorHSL(void); - - // Copy constructor - ColorHSL(const Color &color_); - - // Construct ColorHSL using the specified HSL values - ColorHSL(const double hue_,const double saturation_, - const double lightness_); - - // Destructor - ~ColorHSL(); - - // Assignment operator from base class - ColorHSL& operator=(const Color& color_); - - // Hue color - void hue(const double hue_); - double hue(void) const; - - // Lightness color - void lightness(const double lightness_); - double lightness(void) const; - - // Saturation color - void saturation(const double saturation_); - double saturation(void) const; - - protected: - - // Constructor to construct with PixelInfo* - ColorHSL(PixelInfo *rep_,PixelType pixelType_); - }; - - // - // Monochrome color - // - // Color arguments are constrained to 'false' (black pixel) and 'true' - // (white pixel) - class MagickPPExport ColorMono: public Color - { - public: - - // Default constructor - ColorMono(void); - - // Construct ColorMono (false=black, true=white) - ColorMono(const bool mono_); - - // Copy constructor - ColorMono(const Color &color_); - - // Destructor - ~ColorMono(); - - // Assignment operator from base class - ColorMono& operator=(const Color& color_); - - // Mono color - void mono(const bool mono_); - bool mono(void) const; - - protected: - - // Constructor to construct with PixelInfo* - ColorMono(PixelInfo* rep_,PixelType pixelType_); - }; - - class MagickPPExport ColorRGB: public Color - { - public: - - // Default constructor - ColorRGB(void); - - // Copy constructor - ColorRGB(const Color &color_); - - // Construct ColorRGB using the specified RGB values - ColorRGB(const double red_,const double green_,const double blue_); - - // Construct ColorRGB using the specified RGBA values - ColorRGB(const double red_,const double green_,const double blue_, - const double alpha_); - - // Destructor - ~ColorRGB(void); - - // Assignment operator from base class - ColorRGB& operator=(const Color& color_); - - // Alpha level (range 0 to 1.0) - void alpha(const double alpha_); - double alpha(void) const; - - // Blue color (range 0.0 to 1.0) - void blue(const double blue_); - double blue(void) const; - - // Green color (range 0 to 1.0) - void green(const double green_); - double green(void) const; - - // Red color (range 0 to 1.0) - void red(const double red_); - double red(void) const; - - protected: - - // Constructor to construct with PixelInfo* - ColorRGB(PixelInfo *rep_,PixelType pixelType_); - }; - - // - // YUV Colorspace color - // - // Argument ranges: - // Y: 0.0 through 1.0 - // U: -0.5 through 0.5 - // V: -0.5 through 0.5 - class MagickPPExport ColorYUV: public Color - { - public: - - // Default constructor - ColorYUV(void); - - // Copy constructor - ColorYUV(const Color &color_); - - // Construct ColorYUV using the specified YUV values - ColorYUV(const double y_,const double u_,const double v_); - - // Destructor - ~ColorYUV(void); - - // Assignment operator from base class - ColorYUV& operator=(const Color& color_); - - // Color U (0.0 through 1.0) - void u(const double u_); - double u(void) const; - - // Color V (-0.5 through 0.5) - void v(const double v_); - double v(void) const; - - // Color Y (-0.5 through 0.5) - void y(const double y_); - double y(void) const; - - protected: - - // Constructor to construct with PixelInfo* - ColorYUV(PixelInfo *rep_,PixelType pixelType_); - - private: - - void convert(const double y_,const double u_,const double v_); - - }; -} // namespace Magick - -#endif // Magick_Color_header diff --git a/Magick++/lib/Magick++/Drawable.h b/Magick++/lib/Magick++/Drawable.h deleted file mode 100644 index 34e80d6d2..000000000 --- a/Magick++/lib/Magick++/Drawable.h +++ /dev/null @@ -1,3138 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002 -// Copyright Dirk Lemstra 2014-2017 -// -// Definition of Drawable (Graphic objects) -// -// The technique used for instantiating classes which derive from STL -// templates is described in Microsoft MSDN Article ID: Q168958 -// "HOWTO: Exporting STL Components Inside & Outside of a Class". -// "http://support.microsoft.com/kb/168958" -// -// Note that version 3.0 of this article says that that only STL -// container template which supports DLL export is and we are -// not using as part of the Drawable implementation. -// - -#if !defined(Magick_Drawable_header) -#define Magick_Drawable_header - -#include "Magick++/Include.h" - -#include -#include -#include -#include -#include "Magick++/Color.h" -#include "Magick++/Geometry.h" - -#if defined(MagickDLLExplicitTemplate) -# if defined(MAGICK_PLUSPLUS_IMPLEMENTATION) -# define MagickDrawableExtern -# else -# pragma warning( disable: 4231 ) // Disable warning regarding using extern -# define MagickDrawableExtern extern -# endif // MAGICK_PLUSPLUS_IMPLEMENTATION -#else -# define MagickDrawableExtern -#endif // MagickDLLExplicitTemplate - -namespace Magick -{ - // - // Representation of an x,y coordinate - // - class MagickPPExport Coordinate - { - public: - - Coordinate(void) - : _x(0), - _y(0) {} - - Coordinate(double x_,double y_) - : _x(x_), - _y(y_) {} - - virtual ~Coordinate() {} - - void x(double x_) { _x=x_; } - double x(void) const { return _x; } - - void y(double y_) { _y=y_; } - double y(void) const { return _y; } - - private: - double _x; - double _y; - }; - - typedef std::vector CoordinateList; - -#if defined(MagickDLLExplicitTemplate) - - MagickDrawableExtern template class MagickPPExport - std::allocator; - -#endif // MagickDLLExplicitTemplate - - // Compare two Coordinate objects regardless of LHS/RHS - extern MagickPPExport int operator == - (const Coordinate& left_,const Coordinate& right_); - extern MagickPPExport int operator != - (const Coordinate& left_, const Coordinate& right_); - extern MagickPPExport int operator > - (const Coordinate& left_, const Coordinate& right_); - extern MagickPPExport int operator < - (const Coordinate& left_, const Coordinate& right_); - extern MagickPPExport int operator >= - (const Coordinate& left_, const Coordinate& right_); - extern MagickPPExport int operator <= - (const Coordinate& left_, const Coordinate& right_); - - // - // Base class for all drawable objects - // - class MagickPPExport DrawableBase - { - public: - - // Default constructor - DrawableBase(void); - - // Destructor - virtual ~DrawableBase(void); - - // Operator to invoke equivalent draw API call - virtual void operator()(MagickCore::DrawingWand *) const; - - // Return polymorphic copy of object - virtual DrawableBase* copy() const; - }; - - // - // Representation of a drawable surrogate object to manage drawable objects - // - #undef Drawable // Conflict with - class MagickPPExport Drawable - { - public: - - // Default constructor - Drawable(void); - - // Construct from DrawableBase - Drawable(const DrawableBase& original_); - - // Destructor - ~Drawable(void); - - // Copy constructor - Drawable(const Drawable& original_); - - // Assignment operator - Drawable& operator=(const Drawable& original_); - - // Operator to invoke contained object - void operator()(MagickCore::DrawingWand *) const; - - private: - DrawableBase* dp; - }; - - typedef std::vector DrawableList; - -#if defined(MagickDLLExplicitTemplate) - - MagickDrawableExtern template class MagickPPExport - std::allocator; - -#endif // MagickDLLExplicitTemplate - -// -// Base class for all drawable path elements for use with -// DrawablePath -// -class MagickPPExport VPathBase -{ -public: - // Constructor - VPathBase ( void ) - { } - - // Destructor - virtual ~VPathBase ( void ); - - // Assignment operator - // const VPathBase& operator= (const VPathBase& original_ ); - - // Operator to invoke equivalent draw API call - virtual void operator()( MagickCore::DrawingWand *context_ ) const = 0; - - // Return polymorphic copy of object - virtual VPathBase* copy() const = 0; -}; - -// -// Representation of a drawable path element surrogate object to -// manage drawable path elements so they may be passed as a list to -// DrawablePath. -// -class MagickPPExport VPath -{ -public: - // Constructor - VPath ( void ); - - // Construct from VPathBase - VPath ( const VPathBase& original_ ); - - // Destructor - virtual ~VPath ( void ); - - // Copy constructor - VPath ( const VPath& original_ ); - - // Assignment operator - VPath& operator= (const VPath& original_ ); - - // Operator to invoke contained object - void operator()( MagickCore::DrawingWand *context_ ) const; - -private: - VPathBase* dp; -}; - -typedef std::vector VPathList; - -#if defined(MagickDLLExplicitTemplate) - -MagickDrawableExtern template class MagickPPExport -std::allocator; - -// MagickDrawableExtern template class MagickPPExport -// std::vector >; - -#endif // MagickDLLExplicitTemplate - -// -// Drawable Objects -// - -// Affine (scaling, rotation, and translation) -class MagickPPExport DrawableAffine : public DrawableBase -{ -public: - DrawableAffine ( double sx_, double sy_, - double rx_, double ry_, - double tx_, double ty_ ); - - DrawableAffine ( void ); - - /*virtual*/ ~DrawableAffine( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ - DrawableBase* copy() const; - - void sx( const double sx_ ) - { - _affine.sx = sx_; - } - double sx( void ) const - { - return _affine.sx; - } - - void sy( const double sy_ ) - { - _affine.sy = sy_; - } - double sy( void ) const - { - return _affine.sy; - } - - void rx( const double rx_ ) - { - _affine.rx = rx_; - } - double rx( void ) const - { - return _affine.rx; - } - - void ry( const double ry_ ) - { - _affine.ry = ry_; - } - double ry( void ) const - { - return _affine.ry; - } - - void tx( const double tx_ ) - { - _affine.tx = tx_; - } - double tx( void ) const - { - return _affine.tx; - } - - void ty( const double ty_ ) - { - _affine.ty = ty_; - } - double ty( void ) const - { - return _affine.ty; - } - -private: - MagickCore::AffineMatrix _affine; -}; - -// Change pixel alpha value to transparent using PaintMethod -class MagickPPExport DrawableAlpha : public DrawableBase -{ -public: - - DrawableAlpha(double x_, double y_,PaintMethod paintMethod_) - : _x(x_), - _y(y_), - _paintMethod(paintMethod_) - { - } - - ~DrawableAlpha(void); - - // Operator to invoke equivalent draw API call - void operator()(MagickCore::DrawingWand *context_) const; - - // Return polymorphic copy of object - DrawableBase* copy() const; - - void x(double x_) - { - _x=x_; - } - - double x(void) const - { - return(_x); - } - - void y(double y_) - { - _y=y_; - } - - double y(void) const - { - return(_y); - } - - void paintMethod(PaintMethod paintMethod_) - { - _paintMethod=paintMethod_; - } - - PaintMethod paintMethod(void) const - { - return(_paintMethod); - } - - private: - - double _x; - double _y; - PaintMethod _paintMethod; -}; - -// Arc -class MagickPPExport DrawableArc : public DrawableBase -{ -public: - DrawableArc ( double startX_, double startY_, - double endX_, double endY_, - double startDegrees_, double endDegrees_ ) - : _startX(startX_), - _startY(startY_), - _endX(endX_), - _endY(endY_), - _startDegrees(startDegrees_), - _endDegrees(endDegrees_) - { } - - /*virtual*/ ~DrawableArc( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - - void startX( double startX_ ) - { - _startX = startX_; - } - double startX( void ) const - { - return _startX; - } - - void startY( double startY_ ) - { - _startY = startY_; - } - double startY( void ) const - { - return _startY; - } - - void endX( double endX_ ) - { - _endX = endX_; - } - double endX( void ) const - { - return _endX; - } - - void endY( double endY_ ) - { - _endY = endY_; - } - double endY( void ) const - { - return _endY; - } - - void startDegrees( double startDegrees_ ) - { - _startDegrees = startDegrees_; - } - double startDegrees( void ) const - { - return _startDegrees; - } - - void endDegrees( double endDegrees_ ) - { - _endDegrees = endDegrees_; - } - double endDegrees( void ) const - { - return _endDegrees; - } - -private: - double _startX; - double _startY; - double _endX; - double _endY; - double _startDegrees; - double _endDegrees; -}; - -// Bezier curve (Coordinate list must contain at least three members) -class MagickPPExport DrawableBezier : public DrawableBase -{ -public: - // Construct from coordinates - DrawableBezier ( const CoordinateList &coordinates_ ); - - // Copy constructor - DrawableBezier ( const DrawableBezier& original_ ); - - // Destructor - /*virtual*/ ~DrawableBezier ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - -private: - CoordinateList _coordinates; -}; - - // Sets the border color to be used for drawing bordered objects. - class MagickPPExport DrawableBorderColor : public DrawableBase - { - public: - - DrawableBorderColor(const Color &color_); - - DrawableBorderColor(const DrawableBorderColor &original_); - - ~DrawableBorderColor(void); - - // Operator to invoke equivalent draw API call - void operator()(MagickCore::DrawingWand *context_) const; - - void color(const Color &color_); - Color color(void) const; - - // Return polymorphic copy of object - DrawableBase* copy() const; - - private: - Color _color; - }; - - // Sets the polygon fill rule to be used by the clipping path. - class MagickPPExport DrawableClipRule : public DrawableBase - { - public: - - DrawableClipRule(const FillRule fillRule_); - - ~DrawableClipRule(void); - - // Operator to invoke equivalent draw API call - void operator()(MagickCore::DrawingWand *context_) const; - - void fillRule(const FillRule fillRule_); - FillRule fillRule(void) const; - - // Return polymorphic copy of object - DrawableBase* copy() const; - - private: - FillRule _fillRule; - }; - - // Sets the interpretation of clip path units. - class MagickPPExport DrawableClipUnits : public DrawableBase - { - public: - - DrawableClipUnits(const ClipPathUnits units_); - - ~DrawableClipUnits(void); - - // Operator to invoke equivalent draw API call - void operator()(MagickCore::DrawingWand *context_) const; - - void units(const ClipPathUnits units_); - ClipPathUnits units(void) const; - - // Return polymorphic copy of object - DrawableBase* copy() const; - - private: - ClipPathUnits _units; - }; - -// Pop (terminate) clip path definition -class MagickPPExport DrawablePopClipPath : public DrawableBase -{ -public: - DrawablePopClipPath ( void ) - : _dummy(0) - { - } - - /*virtual*/ ~DrawablePopClipPath ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - -private: - ::ssize_t _dummy; -}; - -// Push (create) Clip path definition -class MagickPPExport DrawablePushClipPath : public DrawableBase -{ -public: - DrawablePushClipPath ( const std::string &id_); - - DrawablePushClipPath ( const DrawablePushClipPath& original_ ); - - /*virtual*/ ~DrawablePushClipPath ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - -private: - std::string _id; -}; - -// Named Clip Path -class MagickPPExport DrawableClipPath : public DrawableBase -{ -public: - DrawableClipPath ( const std::string &id_ ); - DrawableClipPath ( const DrawableClipPath& original_ ); - - /*virtual*/ ~DrawableClipPath ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - - void clip_path( const std::string &id_ ) - { - _id = id_.c_str(); //multithread safe - } - std::string clip_path( void ) const - { - return _id; - } - -private: - std::string _id; -}; - -// Circle -class MagickPPExport DrawableCircle : public DrawableBase -{ -public: - DrawableCircle ( double originX_, double originY_, - double perimX_, double perimY_ ) - : _originX(originX_), - _originY(originY_), - _perimX(perimX_), - _perimY(perimY_) - { - } - - /*virtual*/ ~DrawableCircle ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - - void originX( double originX_ ) - { - _originX = originX_; - } - double originX( void ) const - { - return _originX; - } - - void originY( double originY_ ) - { - _originY = originY_; - } - double originY( void ) const - { - return _originY; - } - - void perimX( double perimX_ ) - { - _perimX = perimX_; - } - double perimX( void ) const - { - return _perimX; - } - - void perimY( double perimY_ ) - { - _perimY = perimY_; - } - double perimY( void ) const - { - return _perimY; - } - -private: - double _originX; - double _originY; - double _perimX; - double _perimY; -}; - -// Colorize at point using PaintMethod -class MagickPPExport DrawableColor : public DrawableBase -{ -public: - DrawableColor ( double x_, double y_, - PaintMethod paintMethod_ ) - : _x(x_), - _y(y_), - _paintMethod(paintMethod_) - { } - - /*virtual*/ ~DrawableColor ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - - void x( double x_ ) - { - _x = x_; - } - double x( void ) const - { - return _x; - } - - void y( double y_ ) - { - _y = y_; - } - double y( void ) const - { - return _y; - } - - void paintMethod( PaintMethod paintMethod_ ) - { - _paintMethod = paintMethod_; - } - PaintMethod paintMethod( void ) const - { - return _paintMethod; - } - -private: - double _x; - double _y; - PaintMethod _paintMethod; -}; - -// Draw image at point, scaled to size specified by width and height -class MagickPPExport Image; -class MagickPPExport DrawableCompositeImage : public DrawableBase -{ -public: - DrawableCompositeImage ( double x_, double y_, - const std::string &filename_ ); - - DrawableCompositeImage ( double x_, double y_, - const Image &image_ ); - - DrawableCompositeImage ( double x_, double y_, - double width_, double height_, - const std::string &filename_ ); - - DrawableCompositeImage ( double x_, double y_, - double width_, double height_, - const Image &image_ ); - - DrawableCompositeImage ( double x_, double y_, - double width_, double height_, - const std::string &filename_, - CompositeOperator composition_ ); - - DrawableCompositeImage ( double x_, double y_, - double width_, double height_, - const Image &image_, - CompositeOperator composition_ ); - - // Copy constructor - DrawableCompositeImage ( const DrawableCompositeImage& original_ ); - - // Destructor - /*virtual*/ ~DrawableCompositeImage( void ); - - // Assignment operator - DrawableCompositeImage& operator= - (const DrawableCompositeImage& original_ ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - - void composition( CompositeOperator composition_ ) - { - _composition = composition_; - } - CompositeOperator composition( void ) const - { - return _composition; - } - - void filename( const std::string &image_ ); - std::string filename( void ) const; - - void x( double x_ ) - { - _x = x_; - } - double x( void ) const - { - return _x; - } - - void y( double y_ ) - { - _y = y_; - } - double y( void ) const - { - return _y; - } - - void width( double width_ ) - { - _width = width_; - } - double width( void ) const - { - return _width; - } - - void height( double height_ ) - { - _height = height_; - } - double height( void ) const - { - return _height; - } - - void image( const Image &image_ ); - Magick::Image image( void ) const; - - // Specify image format used to output Base64 inlined image data. - void magick( std::string magick_ ); - std::string magick( void ); - -private: - CompositeOperator _composition; - double _x; - double _y; - double _width; - double _height; - Image* _image; -}; - -// Density -class MagickPPExport DrawableDensity : public DrawableBase -{ -public: - - DrawableDensity(const Point &density_); - - DrawableDensity(const std::string &density_); - - ~DrawableDensity(void); - - void operator()(MagickCore::DrawingWand *context_) const; - - DrawableBase* copy() const; - -private: - std::string _density; -}; - -// Ellipse -class MagickPPExport DrawableEllipse : public DrawableBase -{ -public: - DrawableEllipse ( double originX_, double originY_, - double radiusX_, double radiusY_, - double arcStart_, double arcEnd_ ) - : _originX(originX_), - _originY(originY_), - _radiusX(radiusX_), - _radiusY(radiusY_), - _arcStart(arcStart_), - _arcEnd(arcEnd_) - { } - - /*virtual*/ ~DrawableEllipse( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - - void originX( double originX_ ) - { - _originX = originX_; - } - double originX( void ) const - { - return _originX; - } - - void originY( double originY_ ) - { - _originY = originY_; - } - double originY( void ) const - { - return _originY; - } - - void radiusX( double radiusX_ ) - { - _radiusX = radiusX_; - } - double radiusX( void ) const - { - return _radiusX; - } - - void radiusY( double radiusY_ ) - { - _radiusY = radiusY_; - } - double radiusY( void ) const - { - return _radiusY; - } - - void arcStart( double arcStart_ ) - { - _arcStart = arcStart_; - } - double arcStart( void ) const - { - return _arcStart; - } - - void arcEnd( double arcEnd_ ) - { - _arcEnd = arcEnd_; - } - double arcEnd( void ) const - { - return _arcEnd; - } - -private: - double _originX; - double _originY; - double _radiusX; - double _radiusY; - double _arcStart; - double _arcEnd; -}; - -// Specify drawing fill color -class MagickPPExport DrawableFillColor : public DrawableBase -{ -public: - DrawableFillColor ( const Color &color_ ); - - DrawableFillColor ( const DrawableFillColor& original_ ); - - /*virtual*/ ~DrawableFillColor( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - - void color( const Color &color_ ) - { - _color = color_; - } - Color color( void ) const - { - return _color; - } - -private: - Color _color; -}; - - // Sets the URL to use as a fill pattern for filling objects. Only local - // URLs("#identifier") are supported at this time. These local URLs are - // normally created by defining a named fill pattern with - // DrawablePushPattern/DrawablePopPattern. - class MagickPPExport DrawableFillPatternUrl : public DrawableBase - { - public: - - DrawableFillPatternUrl(const std::string &url_); - - ~DrawableFillPatternUrl(void); - - DrawableFillPatternUrl(const DrawableFillPatternUrl& original_); - - // Operator to invoke equivalent draw API call - void operator()(MagickCore::DrawingWand *context_) const; - - void url(const std::string &url_); - std::string url(void) const; - - // Return polymorphic copy of object - DrawableBase* copy() const; - - private: - std::string _url; - }; - -// Specify fill rule (fill-rule) -class MagickPPExport DrawableFillRule : public DrawableBase -{ -public: - DrawableFillRule ( const FillRule fillRule_ ) - : _fillRule(fillRule_) - { - } - - /*virtual*/ ~DrawableFillRule ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - - void fillRule( const FillRule fillRule_ ) - { - _fillRule = fillRule_; - } - FillRule fillRule( void ) const - { - return _fillRule; - } - -private: - FillRule _fillRule; -}; - -// Specify drawing fill alpha -class MagickPPExport DrawableFillOpacity : public DrawableBase -{ -public: - - DrawableFillOpacity(double opacity_) - : _opacity(opacity_) - { - } - - ~DrawableFillOpacity ( void ); - - // Operator to invoke equivalent draw API call - void operator()(MagickCore::DrawingWand *context_) const; - - // Return polymorphic copy of object - DrawableBase* copy() const; - - void opacity(double opacity_) - { - _opacity=opacity_; - } - - double opacity(void) const - { - return(_opacity); - } - -private: - double _opacity; -}; - -// Specify text font -class MagickPPExport DrawableFont : public DrawableBase -{ -public: - DrawableFont ( const std::string &font_ ); - - DrawableFont ( const std::string &family_, - StyleType style_, - const unsigned int weight_, - StretchType stretch_ ); - DrawableFont ( const DrawableFont& original_ ); - - /*virtual*/ ~DrawableFont ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - - void font( const std::string &font_ ) - { - _font = font_; - } - std::string font( void ) const - { - return _font; - } - -private: - std::string _font; - std::string _family; - StyleType _style; - unsigned int _weight; - StretchType _stretch; -}; - -// Specify text positioning gravity -class MagickPPExport DrawableGravity : public DrawableBase -{ -public: - DrawableGravity ( GravityType gravity_ ) - : _gravity(gravity_) - { - } - - /*virtual*/ ~DrawableGravity ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - - void gravity( GravityType gravity_ ) - { - _gravity = gravity_; - } - GravityType gravity( void ) const - { - return _gravity; - } - -private: - GravityType _gravity; -}; - -// Line -class MagickPPExport DrawableLine : public DrawableBase -{ -public: - DrawableLine ( double startX_, double startY_, - double endX_, double endY_ ) - : _startX(startX_), - _startY(startY_), - _endX(endX_), - _endY(endY_) - { } - - /*virtual*/ ~DrawableLine ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - - void startX( double startX_ ) - { - _startX = startX_; - } - double startX( void ) const - { - return _startX; - } - - void startY( double startY_ ) - { - _startY = startY_; - } - double startY( void ) const - { - return _startY; - } - - void endX( double endX_ ) - { - _endX = endX_; - } - double endX( void ) const - { - return _endX; - } - - void endY( double endY_ ) - { - _endY = endY_; - } - double endY( void ) const - { - return _endY; - } - -private: - double _startX; - double _startY; - double _endX; - double _endY; -}; - -// Drawable Path -class MagickPPExport DrawablePath : public DrawableBase -{ -public: - DrawablePath ( const VPathList &path_ ); - - DrawablePath ( const DrawablePath& original_ ); - - /*virtual*/ ~DrawablePath ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - -private: - VPathList _path; -}; - -// Point -class MagickPPExport DrawablePoint : public DrawableBase -{ -public: - DrawablePoint ( double x_, double y_ ) - : _x(x_), - _y(y_) - { } - - /*virtual*/ ~DrawablePoint ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - - void x( double x_ ) - { - _x = x_; - } - double x( void ) const - { - return _x; - } - - void y( double y_ ) - { - _y = y_; - } - double y( void ) const - { - return _y; - } - -private: - double _x; - double _y; -}; - -// Text pointsize -class MagickPPExport DrawablePointSize : public DrawableBase -{ -public: - DrawablePointSize ( double pointSize_ ) - : _pointSize(pointSize_) - { } - - /*virtual*/ ~DrawablePointSize ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - - void pointSize( double pointSize_ ) - { - _pointSize = pointSize_; - } - double pointSize( void ) const - { - return _pointSize; - } - -private: - double _pointSize; -}; - -// Polygon (Coordinate list must contain at least three members) -class MagickPPExport DrawablePolygon : public DrawableBase -{ -public: - DrawablePolygon ( const CoordinateList &coordinates_ ); - - DrawablePolygon ( const DrawablePolygon& original_ ); - - /*virtual*/ ~DrawablePolygon ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - -private: - CoordinateList _coordinates; -}; - -// Polyline (Coordinate list must contain at least three members) -class MagickPPExport DrawablePolyline : public DrawableBase -{ -public: - DrawablePolyline ( const CoordinateList &coordinates_ ); - - DrawablePolyline ( const DrawablePolyline& original_ ); - - /*virtual*/ ~DrawablePolyline ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - -private: - CoordinateList _coordinates; -}; - -// Pop Graphic Context -class MagickPPExport DrawablePopGraphicContext : public DrawableBase -{ -public: - DrawablePopGraphicContext ( void ) - : _dummy(0) - { - } - - /*virtual*/ ~DrawablePopGraphicContext ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - -private: - ::ssize_t _dummy; -}; - -// Push Graphic Context -class MagickPPExport DrawablePushGraphicContext : public DrawableBase -{ -public: - DrawablePushGraphicContext ( void ) - : _dummy(0) - { - } - - /*virtual*/ ~DrawablePushGraphicContext ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - -private: - ::ssize_t _dummy; -}; - -// Pop (terminate) Pattern definition -class MagickPPExport DrawablePopPattern : public DrawableBase -{ -public: - DrawablePopPattern ( void ) - : _dummy(0) - { - } - - /*virtual*/ ~DrawablePopPattern ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - -private: - ::ssize_t _dummy; -}; - -// Push (create) Pattern definition -class MagickPPExport DrawablePushPattern : public DrawableBase -{ -public: - DrawablePushPattern ( const std::string &id_, ::ssize_t x_, ::ssize_t y_, - size_t width_, size_t height_ ); - - DrawablePushPattern ( const DrawablePushPattern& original_ ); - - /*virtual*/ ~DrawablePushPattern ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - -private: - std::string _id; - ::ssize_t _x; - ::ssize_t _y; - size_t _width; - size_t _height; -}; - -// Rectangle -class MagickPPExport DrawableRectangle : public DrawableBase -{ -public: - DrawableRectangle ( double upperLeftX_, double upperLeftY_, - double lowerRightX_, double lowerRightY_ ) - : _upperLeftX(upperLeftX_), - _upperLeftY(upperLeftY_), - _lowerRightX(lowerRightX_), - _lowerRightY(lowerRightY_) - { } - - /*virtual*/ ~DrawableRectangle ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - - void upperLeftX( double upperLeftX_ ) - { - _upperLeftX = upperLeftX_; - } - double upperLeftX( void ) const - { - return _upperLeftX; - } - - void upperLeftY( double upperLeftY_ ) - { - _upperLeftY = upperLeftY_; - } - double upperLeftY( void ) const - { - return _upperLeftY; - } - - void lowerRightX( double lowerRightX_ ) - { - _lowerRightX = lowerRightX_; - } - double lowerRightX( void ) const - { - return _lowerRightX; - } - - void lowerRightY( double lowerRightY_ ) - { - _lowerRightY = lowerRightY_; - } - double lowerRightY( void ) const - { - return _lowerRightY; - } - -private: - double _upperLeftX; - double _upperLeftY; - double _lowerRightX; - double _lowerRightY; -}; - -// Apply Rotation -class MagickPPExport DrawableRotation : public DrawableBase -{ -public: - DrawableRotation ( double angle_ ) - : _angle( angle_ ) - { } - - /*virtual*/ ~DrawableRotation ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - - void angle( double angle_ ) - { - _angle = angle_; - } - double angle( void ) const - { - return _angle; - } - -private: - double _angle; -}; - -// Round Rectangle -class MagickPPExport DrawableRoundRectangle : public DrawableBase -{ -public: - DrawableRoundRectangle ( double upperLeftX_, double upperLeftY_, - double lowerRightX_, double lowerRightY_, - double cornerWidth_, double cornerHeight_ ) - : _upperLeftX(upperLeftX_), - _upperLeftY(upperLeftY_), - _lowerRightX(lowerRightX_), - _lowerRightY(lowerRightY_), - _cornerWidth(cornerWidth_), - _cornerHeight(cornerHeight_) - { } - - /*virtual*/ ~DrawableRoundRectangle ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - -#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) - - void centerX( double centerX_ ) - { - _upperLeftX = centerX_; - } - double centerX( void ) const - { - return _upperLeftX; - } - - void centerY( double centerY_ ) - { - _upperLeftY = centerY_; - } - double centerY( void ) const - { - return _upperLeftY; - } - - void width( double width_ ) - { - _lowerRightX = width_; - } - double width( void ) const - { - return _lowerRightX; - } - - void hight( double hight_ ) - { - _lowerRightY = hight_; - } - double hight( void ) const - { - return _lowerRightY; - } - -#endif - - void upperLeftX( double upperLeftX_ ) - { - _upperLeftX = upperLeftX_; - } - double upperLeftX( void ) const - { - return _upperLeftX; - } - - void upperLeftY( double upperLeftY_ ) - { - _upperLeftY = upperLeftY_; - } - double upperLeftY( void ) const - { - return _upperLeftY; - } - - void lowerRightX( double lowerRightX_ ) - { - _lowerRightX = lowerRightX_; - } - double lowerRightX( void ) const - { - return _lowerRightX; - } - - void lowerRightY( double lowerRightY_ ) - { - _lowerRightY = lowerRightY_; - } - double lowerRightY( void ) const - { - return _lowerRightY; - } - - void cornerWidth( double cornerWidth_ ) - { - _cornerWidth = cornerWidth_; - } - double cornerWidth( void ) const - { - return _cornerWidth; - } - - void cornerHeight( double cornerHeight_ ) - { - _cornerHeight = cornerHeight_; - } - double cornerHeight( void ) const - { - return _cornerHeight; - } - -private: - double _upperLeftX; - double _upperLeftY; - double _lowerRightX; - double _lowerRightY; - double _cornerWidth; - double _cornerHeight; -}; - -// Apply Scaling -class MagickPPExport DrawableScaling : public DrawableBase -{ -public: - DrawableScaling ( double x_, double y_ ) - : _x(x_), - _y(y_) - { } - - /*virtual*/ ~DrawableScaling ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - - void x( double x_ ) - { - _x = x_; - } - double x( void ) const - { - return _x; - } - - void y( double y_ ) - { - _y = y_; - } - double y( void ) const - { - return _y; - } - -private: - double _x; - double _y; -}; - -// Apply Skew in X direction -class MagickPPExport DrawableSkewX : public DrawableBase -{ -public: - DrawableSkewX ( double angle_ ) - : _angle(angle_) - { } - - /*virtual*/ ~DrawableSkewX ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - - void angle( double angle_ ) - { - _angle = angle_; - } - double angle( void ) const - { - return _angle; - } - -private: - double _angle; -}; - -// Apply Skew in Y direction -class MagickPPExport DrawableSkewY : public DrawableBase -{ -public: - DrawableSkewY ( double angle_ ) - : _angle(angle_) - { } - - /*virtual*/ ~DrawableSkewY ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - - void angle( double angle_ ) - { - _angle = angle_; - } - double angle( void ) const - { - return _angle; - } - -private: - double _angle; -}; - - // Stroke dasharray - // - // dasharray_ is an allocated array terminated by value 0.0 or 0. - // The array is copied so the original does not need to be preserved. - // Pass a null pointer to clear an existing dash array setting. - class MagickPPExport DrawableStrokeDashArray : public DrawableBase - { - public: - - DrawableStrokeDashArray(const double* dasharray_); - - DrawableStrokeDashArray(const Magick::DrawableStrokeDashArray &original_); - - ~DrawableStrokeDashArray(void); - - // Operator to invoke equivalent draw API call - void operator()(MagickCore::DrawingWand *context_) const; - - // Return polymorphic copy of object - DrawableBase* copy() const; - - void dasharray(const double* dasharray_); - const double* dasharray(void) const; - - DrawableStrokeDashArray& operator=( - const Magick::DrawableStrokeDashArray &original_); - - private: - size_t _size; - double *_dasharray; - }; - - // Stroke dashoffset - class MagickPPExport DrawableStrokeDashOffset : public DrawableBase - { - public: - DrawableStrokeDashOffset(const double offset_) - : _offset(offset_) - { } - - ~DrawableStrokeDashOffset(void); - - // Operator to invoke equivalent draw API call - void operator()(MagickCore::DrawingWand *context_) const; - - // Return polymorphic copy of object - DrawableBase* copy() const; - - void offset(const double offset_); - double offset(void) const; - - private: - double _offset; - }; - -// Stroke linecap -class MagickPPExport DrawableStrokeLineCap : public DrawableBase -{ -public: - DrawableStrokeLineCap ( LineCap linecap_ ) - : _linecap(linecap_) - { } - - /*virtual*/ ~DrawableStrokeLineCap ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - - void linecap( LineCap linecap_ ) - { - _linecap = linecap_; - } - LineCap linecap( void ) const - { - return _linecap; - } - -private: - LineCap _linecap; -}; - -// Stroke linejoin -class MagickPPExport DrawableStrokeLineJoin : public DrawableBase -{ -public: - DrawableStrokeLineJoin ( LineJoin linejoin_ ) - : _linejoin(linejoin_) - { } - - /*virtual*/ ~DrawableStrokeLineJoin ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - - void linejoin( LineJoin linejoin_ ) - { - _linejoin = linejoin_; - } - LineJoin linejoin( void ) const - { - return _linejoin; - } - -private: - LineJoin _linejoin; -}; - -// Stroke miterlimit -class MagickPPExport DrawableMiterLimit : public DrawableBase -{ -public: - DrawableMiterLimit ( size_t miterlimit_ ) - : _miterlimit(miterlimit_) - { } - - /*virtual*/ ~DrawableMiterLimit ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - - void miterlimit( size_t miterlimit_ ) - { - _miterlimit = miterlimit_; - } - size_t miterlimit( void ) const - { - return _miterlimit; - } - -private: - size_t _miterlimit; -}; - -// Sets the pattern used for stroking object outlines. -class MagickPPExport DrawableStrokePatternUrl : public DrawableBase -{ -public: - - DrawableStrokePatternUrl(const std::string &url_); - - ~DrawableStrokePatternUrl(void); - - DrawableStrokePatternUrl(const DrawableStrokePatternUrl& original_); - - // Operator to invoke equivalent draw API call - void operator()(MagickCore::DrawingWand *context_) const; - - void url(const std::string &url_); - std::string url(void) const; - - // Return polymorphic copy of object - DrawableBase* copy() const; - -private: - std::string _url; -}; - -// Stroke antialias -class MagickPPExport DrawableStrokeAntialias : public DrawableBase -{ -public: - DrawableStrokeAntialias ( bool flag_ ) - : _flag(flag_) - { } - - /*virtual*/ ~DrawableStrokeAntialias ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - - void flag( bool flag_ ) - { - _flag = flag_; - } - bool flag( void ) const - { - return _flag; - } - -private: - bool _flag; -}; - -// Stroke color -class MagickPPExport DrawableStrokeColor : public DrawableBase -{ -public: - DrawableStrokeColor ( const Color &color_ ); - - DrawableStrokeColor ( const DrawableStrokeColor& original_ ); - - /*virtual*/ ~DrawableStrokeColor ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - - void color( const Color& color_ ) - { - _color = color_; - } - Color color( void ) const - { - return _color; - } - -private: - Color _color; -}; - -// Stroke opacity -class MagickPPExport DrawableStrokeOpacity : public DrawableBase -{ -public: - - DrawableStrokeOpacity(double opacity_) - : _opacity(opacity_) - { - } - - ~DrawableStrokeOpacity(void); - - // Operator to invoke equivalent draw API call - void operator()(MagickCore::DrawingWand *context_) const; - - // Return polymorphic copy of object - DrawableBase* copy() const; - - void opacity(double opacity_) - { - _opacity=opacity_; - } - - double opacity(void) const - { - return(_opacity); - } - -private: - double _opacity; -}; - -// Stroke width -class MagickPPExport DrawableStrokeWidth : public DrawableBase -{ -public: - DrawableStrokeWidth ( double width_ ) - : _width(width_) - { } - - /*virtual*/ ~DrawableStrokeWidth ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - - void width( double width_ ) - { - _width = width_; - } - double width( void ) const - { - return _width; - } - -private: - double _width; -}; - -// Draw text at point -class MagickPPExport DrawableText : public DrawableBase -{ -public: - DrawableText ( const double x_, const double y_, - const std::string &text_ ); - DrawableText ( const double x_, const double y_, - const std::string &text_, const std::string &encoding_); - - DrawableText ( const DrawableText& original_ ); - - /*virtual*/ ~DrawableText ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - - void encoding(const std::string &encoding_) - { - _encoding = encoding_; - } - - void x( double x_ ) - { - _x = x_; - } - double x( void ) const - { - return _x; - } - - void y( double y_ ) - { - _y = y_; - } - double y( void ) const - { - return _y; - } - - void text( const std::string &text_ ) - { - _text = text_; - } - std::string text( void ) const - { - return _text; - } - -private: - double _x; - double _y; - std::string _text; - std::string _encoding; -}; - -// Text alignment -class MagickPPExport DrawableTextAlignment : public DrawableBase -{ -public: - - DrawableTextAlignment(AlignType alignment_); - - DrawableTextAlignment(const DrawableTextAlignment& original_); - - ~DrawableTextAlignment(void); - - // Operator to invoke equivalent draw API call - void operator()(MagickCore::DrawingWand *context_) const; - - void alignment(AlignType alignment_); - AlignType alignment(void) const; - - // Return polymorphic copy of object - DrawableBase* copy() const; - -private: - AlignType _alignment; -}; - -// Text antialias -class MagickPPExport DrawableTextAntialias : public DrawableBase -{ -public: - DrawableTextAntialias ( bool flag_ ); - - DrawableTextAntialias( const DrawableTextAntialias &original_ ); - - /*virtual*/ ~DrawableTextAntialias ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - - void flag( bool flag_ ) - { - _flag = flag_; - } - bool flag( void ) const - { - return _flag; - } - -private: - bool _flag; -}; - -// Decoration (text decoration) -class MagickPPExport DrawableTextDecoration : public DrawableBase -{ -public: - DrawableTextDecoration ( DecorationType decoration_ ); - - DrawableTextDecoration ( const DrawableTextDecoration& original_ ); - - /*virtual*/ ~DrawableTextDecoration( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - - void decoration( DecorationType decoration_ ) - { - _decoration = decoration_; - } - DecorationType decoration( void ) const - { - return _decoration; - } - -private: - DecorationType _decoration; -}; - - // Render text right-to-left or left-to-right. - class MagickPPExport DrawableTextDirection : public DrawableBase - { - public: - - DrawableTextDirection(DirectionType direction_); - - ~DrawableTextDirection(void); - - void operator()(MagickCore::DrawingWand *context_) const; - - void direction(DirectionType direction_); - DirectionType direction(void) const; - - DrawableBase* copy() const; - - private: - DirectionType _direction; - }; - - // Specify text inter-line spacing - class MagickPPExport DrawableTextInterlineSpacing : public DrawableBase - { - public: - - DrawableTextInterlineSpacing(double spacing_); - - ~DrawableTextInterlineSpacing(void); - - void operator()(MagickCore::DrawingWand *context_) const; - - void spacing(double spacing_); - double spacing(void) const; - - DrawableBase* copy() const; - - private: - double _spacing; - }; - - // Specify text inter-word spacing - class MagickPPExport DrawableTextInterwordSpacing : public DrawableBase - { - public: - - DrawableTextInterwordSpacing(double spacing_); - - ~DrawableTextInterwordSpacing(void); - - void operator()(MagickCore::DrawingWand *context_) const; - - void spacing(double spacing_); - double spacing(void) const; - - DrawableBase *copy() const; - - private: - double _spacing; - }; - - // Specify text kerning - class MagickPPExport DrawableTextKerning : public DrawableBase - { - public: - - DrawableTextKerning(double kerning_); - - ~DrawableTextKerning(void); - - void operator()(MagickCore::DrawingWand *context_) const; - - void kerning(double kerning_); - double kerning(void) const; - - DrawableBase *copy() const; - - private: - double _kerning; - }; - -// Text undercolor box -class MagickPPExport DrawableTextUnderColor : public DrawableBase -{ -public: - DrawableTextUnderColor ( const Color &color_ ); - - DrawableTextUnderColor ( const DrawableTextUnderColor& original_ ); - - /*virtual*/ ~DrawableTextUnderColor ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - - void color( const Color& color_ ) - { - _color = color_; - } - Color color( void ) const - { - return _color; - } - -private: - Color _color; -}; - -// Apply Translation -class MagickPPExport DrawableTranslation : public DrawableBase -{ -public: - DrawableTranslation ( double x_, double y_ ) - : _x(x_), - _y(y_) - { } - - /*virtual*/ ~DrawableTranslation ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ DrawableBase* copy() const; - - void x( double x_ ) - { - _x = x_; - } - double x( void ) const - { - return _x; - } - - void y( double y_ ) - { - _y = y_; - } - double y( void ) const - { - return _y; - } - -private: - double _x; - double _y; -}; - -// Set the size of the viewbox -class MagickPPExport DrawableViewbox : public DrawableBase -{ -public: - DrawableViewbox(::ssize_t x1_, ::ssize_t y1_, - ::ssize_t x2_, ::ssize_t y2_) - : _x1(x1_), - _y1(y1_), - _x2(x2_), - _y2(y2_) { } - - /*virtual*/ ~DrawableViewbox ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ - DrawableBase* copy() const; - - void x1( ::ssize_t x1_ ) - { - _x1 = x1_; - } - ::ssize_t x1( void ) const - { - return _x1; - } - - void y1( ::ssize_t y1_ ) - { - _y1 = y1_; - } - ::ssize_t y1( void ) const - { - return _y1; - } - - void x2( ::ssize_t x2_ ) - { - _x2 = x2_; - } - ::ssize_t x2( void ) const - { - return _x2; - } - - void y2( ::ssize_t y2_ ) - { - _y2 = y2_; - } - ::ssize_t y2( void ) const - { - return _y2; - } - -private: - ::ssize_t _x1; - ::ssize_t _y1; - ::ssize_t _x2; - ::ssize_t _y2; -}; - -// -// Path Element Classes To Support DrawablePath -// -class MagickPPExport PathArcArgs -{ -public: - PathArcArgs( void ); - - PathArcArgs( double radiusX_, double radiusY_, - double xAxisRotation_, bool largeArcFlag_, - bool sweepFlag_, double x_, double y_ ); - - PathArcArgs( const PathArcArgs &original_ ); - - ~PathArcArgs ( void ); - - void radiusX( double radiusX_ ) - { - _radiusX = radiusX_; - } - double radiusX( void ) const - { - return _radiusX; - } - - void radiusY( double radiusY_ ) - { - _radiusY = radiusY_; - } - double radiusY( void ) const - { - return _radiusY; - } - - void xAxisRotation( double xAxisRotation_ ) - { - _xAxisRotation = xAxisRotation_; - } - double xAxisRotation( void ) const - { - return _xAxisRotation; - } - - void largeArcFlag( bool largeArcFlag_ ) - { - _largeArcFlag = largeArcFlag_; - } - bool largeArcFlag( void ) const - { - return _largeArcFlag; - } - - void sweepFlag( bool sweepFlag_ ) - { - _sweepFlag = sweepFlag_; - } - bool sweepFlag( void ) const - { - return _sweepFlag; - } - - void x( double x_ ) - { - _x = x_; - } - double x( void ) const - { - return _x; - } - - void y( double y_ ) - { - _y = y_; - } - double y( void ) const - { - return _y; - } - -private: - double _radiusX; // X radius - double _radiusY; // Y radius - double _xAxisRotation; // Rotation relative to X axis - bool _largeArcFlag; // Draw longer of the two matching arcs - bool _sweepFlag; // Draw arc matching clock-wise rotation - double _x; // End-point X - double _y; // End-point Y -}; - -// Compare two PathArcArgs objects regardless of LHS/RHS -extern MagickPPExport int operator == ( const PathArcArgs& left_, - const PathArcArgs& right_ ); -extern MagickPPExport int operator != ( const PathArcArgs& left_, - const PathArcArgs& right_ ); -extern MagickPPExport int operator > ( const PathArcArgs& left_, - const PathArcArgs& right_ ); -extern MagickPPExport int operator < ( const PathArcArgs& left_, - const PathArcArgs& right_ ); -extern MagickPPExport int operator >= ( const PathArcArgs& left_, - const PathArcArgs& right_ ); -extern MagickPPExport int operator <= ( const PathArcArgs& left_, - const PathArcArgs& right_ ); - -typedef std::vector PathArcArgsList; - -#if defined(MagickDLLExplicitTemplate) - -MagickDrawableExtern template class MagickPPExport -std::allocator; - -// MagickDrawableExtern template class MagickPPExport -// std::vector >; - -#endif // MagickDLLExplicitTemplate - -// Path Arc (Elliptical Arc) -class MagickPPExport PathArcAbs : public VPathBase -{ -public: - // Draw a single arc segment - PathArcAbs ( const PathArcArgs &coordinates_ ); - - // Draw multiple arc segments - PathArcAbs ( const PathArcArgsList &coordinates_ ); - - // Copy constructor - PathArcAbs ( const PathArcAbs& original_ ); - - // Destructor - /*virtual*/ ~PathArcAbs ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ VPathBase* copy() const; - -private: - PathArcArgsList _coordinates; -}; -class MagickPPExport PathArcRel : public VPathBase -{ -public: - // Draw a single arc segment - PathArcRel ( const PathArcArgs &coordinates_ ); - - // Draw multiple arc segments - PathArcRel ( const PathArcArgsList &coordinates_ ); - - PathArcRel ( const PathArcRel& original_ ); - - /*virtual*/ ~PathArcRel ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ VPathBase* copy() const; - -private: - PathArcArgsList _coordinates; -}; - -// Path Closepath -class MagickPPExport PathClosePath : public VPathBase -{ -public: - PathClosePath ( void ) - : _dummy(0) - { - } - - /*virtual*/ ~PathClosePath ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ VPathBase* copy() const; - -private: - ::ssize_t _dummy; -}; - -// -// Curveto (Cubic Bezier) -// -class MagickPPExport PathCurvetoArgs -{ -public: - PathCurvetoArgs( void ); - - PathCurvetoArgs( double x1_, double y1_, - double x2_, double y2_, - double x_, double y_ ); - - PathCurvetoArgs( const PathCurvetoArgs &original_ ); - - ~PathCurvetoArgs ( void ); - - void x1( double x1_ ) - { - _x1 = x1_; - } -double x1( void ) const -{ - return _x1; -} - -void y1( double y1_ ) -{ - _y1 = y1_; -} -double y1( void ) const -{ - return _y1; -} - -void x2( double x2_ ) -{ - _x2 = x2_; -} -double x2( void ) const -{ - return _x2; -} - -void y2( double y2_ ) -{ - _y2 = y2_; -} -double y2( void ) const -{ - return _y2; -} - -void x( double x_ ) -{ - _x = x_; -} -double x( void ) const -{ - return _x; -} - -void y( double y_ ) -{ - _y = y_; -} -double y( void ) const -{ - return _y; -} - -private: -double _x1; -double _y1; -double _x2; -double _y2; -double _x; -double _y; -}; - -// Compare two PathCurvetoArgs objects regardless of LHS/RHS -extern MagickPPExport int operator == ( const PathCurvetoArgs& left_, - const PathCurvetoArgs& right_ ); -extern MagickPPExport int operator != ( const PathCurvetoArgs& left_, - const PathCurvetoArgs& right_ ); -extern MagickPPExport int operator > ( const PathCurvetoArgs& left_, - const PathCurvetoArgs& right_ ); -extern MagickPPExport int operator < ( const PathCurvetoArgs& left_, - const PathCurvetoArgs& right_ ); -extern MagickPPExport int operator >= ( const PathCurvetoArgs& left_, - const PathCurvetoArgs& right_ ); -extern MagickPPExport int operator <= ( const PathCurvetoArgs& left_, - const PathCurvetoArgs& right_ ); - -typedef std::vector PathCurveToArgsList; - -#if defined(MagickDLLExplicitTemplate) - -MagickDrawableExtern template class MagickPPExport -std::allocator; - -// MagickDrawableExtern template class MagickPPExport -// std::vector >; - -#endif // MagickDLLExplicitTemplate - -class MagickPPExport PathCurvetoAbs : public VPathBase -{ -public: - // Draw a single curve - PathCurvetoAbs ( const PathCurvetoArgs &args_ ); - - // Draw multiple curves - PathCurvetoAbs ( const PathCurveToArgsList &args_ ); - - // Copy constructor - PathCurvetoAbs ( const PathCurvetoAbs& original_ ); - - // Destructor - /*virtual*/ ~PathCurvetoAbs ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ VPathBase* copy() const; - -private: - PathCurveToArgsList _args; -}; -class MagickPPExport PathCurvetoRel : public VPathBase -{ -public: - // Draw a single curve - PathCurvetoRel ( const PathCurvetoArgs &args_ ); - - // Draw multiple curves - PathCurvetoRel ( const PathCurveToArgsList &args_ ); - - // Copy constructor - PathCurvetoRel ( const PathCurvetoRel& original_ ); - - /*virtual*/ ~PathCurvetoRel ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ VPathBase* copy() const; - -private: - PathCurveToArgsList _args; -}; -class MagickPPExport PathSmoothCurvetoAbs : public VPathBase -{ -public: - // Draw a single curve - PathSmoothCurvetoAbs ( const Magick::Coordinate &coordinates_ ); - - // Draw multiple curves - PathSmoothCurvetoAbs ( const CoordinateList &coordinates_ ); - - // Copy constructor - PathSmoothCurvetoAbs ( const PathSmoothCurvetoAbs& original_ ); - - /*virtual*/ ~PathSmoothCurvetoAbs ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ - VPathBase* copy() const; - -private: - CoordinateList _coordinates; -}; -class MagickPPExport PathSmoothCurvetoRel : public VPathBase -{ -public: - // Draw a single curve - PathSmoothCurvetoRel ( const Coordinate &coordinates_ ); - - // Draw multiple curves - PathSmoothCurvetoRel ( const CoordinateList &coordinates_ ); - - // Copy constructor - PathSmoothCurvetoRel ( const PathSmoothCurvetoRel& original_ ); - - // Destructor - /*virtual*/ ~PathSmoothCurvetoRel ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ - VPathBase* copy() const; - -private: - CoordinateList _coordinates; -}; - -// -// Quadratic Curveto (Quadratic Bezier) -// -class MagickPPExport PathQuadraticCurvetoArgs -{ -public: - PathQuadraticCurvetoArgs( void ); - - PathQuadraticCurvetoArgs( double x1_, double y1_, - double x_, double y_ ); - - PathQuadraticCurvetoArgs( const PathQuadraticCurvetoArgs &original_ ); - - ~PathQuadraticCurvetoArgs ( void ); - - void x1( double x1_ ) - { - _x1 = x1_; - } - double x1( void ) const - { - return _x1; - } - - void y1( double y1_ ) - { - _y1 = y1_; - } - double y1( void ) const - { - return _y1; - } - - void x( double x_ ) - { - _x = x_; - } - double x( void ) const - { - return _x; - } - - void y( double y_ ) - { - _y = y_; - } - double y( void ) const - { - return _y; - } - -private: - double _x1; - double _y1; - double _x; - double _y; -}; - -// Compare two PathQuadraticCurvetoArgs objects regardless of LHS/RHS -extern MagickPPExport int operator == ( const PathQuadraticCurvetoArgs& left_, - const PathQuadraticCurvetoArgs& right_ ); -extern MagickPPExport int operator != ( const PathQuadraticCurvetoArgs& left_, - const PathQuadraticCurvetoArgs& right_); -extern MagickPPExport int operator > ( const PathQuadraticCurvetoArgs& left_, - const PathQuadraticCurvetoArgs& right_); -extern MagickPPExport int operator < ( const PathQuadraticCurvetoArgs& left_, - const PathQuadraticCurvetoArgs& right_); -extern MagickPPExport int operator >= ( const PathQuadraticCurvetoArgs& left_, - const PathQuadraticCurvetoArgs& right_ ); -extern MagickPPExport int operator <= ( const PathQuadraticCurvetoArgs& left_, - const PathQuadraticCurvetoArgs& right_ ); - -typedef std::vector PathQuadraticCurvetoArgsList; - -#if defined(MagickDLLExplicitTemplate) - -MagickDrawableExtern template class MagickPPExport -std::allocator; - -// MagickDrawableExtern template class MagickPPExport -// std::vector >; - -#endif // MagickDLLExplicitTemplate - -class MagickPPExport PathQuadraticCurvetoAbs : public VPathBase -{ -public: - // Draw a single curve - PathQuadraticCurvetoAbs ( const Magick::PathQuadraticCurvetoArgs &args_ ); - - // Draw multiple curves - PathQuadraticCurvetoAbs ( const PathQuadraticCurvetoArgsList &args_ ); - - // Copy constructor - PathQuadraticCurvetoAbs ( const PathQuadraticCurvetoAbs& original_ ); - - // Destructor - /*virtual*/ ~PathQuadraticCurvetoAbs ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ VPathBase* copy() const; - -private: - PathQuadraticCurvetoArgsList _args; -}; -class MagickPPExport PathQuadraticCurvetoRel : public VPathBase -{ -public: - // Draw a single curve - PathQuadraticCurvetoRel ( const Magick::PathQuadraticCurvetoArgs &args_ ); - - // Draw multiple curves - PathQuadraticCurvetoRel ( const PathQuadraticCurvetoArgsList &args_ ); - - // Copy constructor - PathQuadraticCurvetoRel ( const PathQuadraticCurvetoRel& original_ ); - - // Destructor - /*virtual*/ ~PathQuadraticCurvetoRel ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ VPathBase* copy() const; - -private: - PathQuadraticCurvetoArgsList _args; -}; -class MagickPPExport PathSmoothQuadraticCurvetoAbs : public VPathBase -{ -public: - // Draw a single curve - PathSmoothQuadraticCurvetoAbs ( const Magick::Coordinate &coordinate_ ); - - // Draw multiple curves - PathSmoothQuadraticCurvetoAbs ( const CoordinateList &coordinates_ ); - - // Copy constructor - PathSmoothQuadraticCurvetoAbs ( const PathSmoothQuadraticCurvetoAbs& original_ ); - - // Destructor - /*virtual*/ ~PathSmoothQuadraticCurvetoAbs ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ VPathBase* copy() const; - -private: - CoordinateList _coordinates; -}; -class MagickPPExport PathSmoothQuadraticCurvetoRel : public VPathBase -{ -public: - // Draw a single curve - PathSmoothQuadraticCurvetoRel ( const Magick::Coordinate &coordinate_ ); - - // Draw multiple curves - PathSmoothQuadraticCurvetoRel ( const CoordinateList &coordinates_ ); - - // Copy constructor - PathSmoothQuadraticCurvetoRel ( const PathSmoothQuadraticCurvetoRel& original_ ); - - // Destructor - /*virtual*/ ~PathSmoothQuadraticCurvetoRel ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ VPathBase* copy() const; - -private: - CoordinateList _coordinates; -}; - -// -// Path Lineto -// -class MagickPPExport PathLinetoAbs : public VPathBase -{ -public: - // Draw to a single point - PathLinetoAbs ( const Magick::Coordinate& coordinate_ ); - - // Draw to multiple points - PathLinetoAbs ( const CoordinateList &coordinates_ ); - - // Copy constructor - PathLinetoAbs ( const PathLinetoAbs& original_ ); - - // Destructor - /*virtual*/ ~PathLinetoAbs ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ VPathBase* copy() const; - -private: - CoordinateList _coordinates; -}; -class MagickPPExport PathLinetoRel : public VPathBase -{ -public: - // Draw to a single point - PathLinetoRel ( const Magick::Coordinate& coordinate_ ); - - // Draw to multiple points - PathLinetoRel ( const CoordinateList &coordinates_ ); - - // Copy constructor - PathLinetoRel ( const PathLinetoRel& original_ ); - - // Destructor - /*virtual*/ ~PathLinetoRel ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ VPathBase* copy() const; - -private: - CoordinateList _coordinates; -}; - -// Path Horizontal Lineto -class MagickPPExport PathLinetoHorizontalAbs : public VPathBase -{ -public: - PathLinetoHorizontalAbs ( double x_ ) - : _x(x_) - { - } - - /*virtual*/ ~PathLinetoHorizontalAbs ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ VPathBase* copy() const; - - void x( double x_ ) - { - _x = x_; - } - double x( void ) const - { - return _x; - } - -private: - double _x; -}; -class MagickPPExport PathLinetoHorizontalRel : public VPathBase -{ -public: - PathLinetoHorizontalRel ( double x_ ) - : _x(x_) - { - } - - /*virtual*/ ~PathLinetoHorizontalRel ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ VPathBase* copy() const; - - void x( double x_ ) - { - _x = x_; - } - double x( void ) const - { - return _x; - } - -private: - double _x; -}; - -// Path Vertical Lineto -class MagickPPExport PathLinetoVerticalAbs : public VPathBase -{ -public: - PathLinetoVerticalAbs ( double y_ ) - : _y(y_) - { - } - - /*virtual*/ ~PathLinetoVerticalAbs ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ VPathBase* copy() const; - - void y( double y_ ) - { - _y = y_; - } - double y( void ) const - { - return _y; - } - -private: - double _y; -}; -class MagickPPExport PathLinetoVerticalRel : public VPathBase -{ -public: - PathLinetoVerticalRel ( double y_ ) - : _y(y_) - { - } - - /*virtual*/ ~PathLinetoVerticalRel ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ VPathBase* copy() const; - - void y( double y_ ) - { - _y = y_; - } - double y( void ) const - { - return _y; - } - -private: - double _y; -}; - -// Path Moveto -class MagickPPExport PathMovetoAbs : public VPathBase -{ -public: - // Simple moveto - PathMovetoAbs ( const Magick::Coordinate &coordinate_ ); - - // Moveto followed by implicit linetos - PathMovetoAbs ( const CoordinateList &coordinates_ ); - - // Copy constructor - PathMovetoAbs ( const PathMovetoAbs& original_ ); - - // Destructor - /*virtual*/ ~PathMovetoAbs ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ VPathBase* copy() const; - -private: - CoordinateList _coordinates; -}; -class MagickPPExport PathMovetoRel : public VPathBase -{ -public: - // Simple moveto - PathMovetoRel ( const Magick::Coordinate &coordinate_ ); - - // Moveto followed by implicit linetos - PathMovetoRel ( const CoordinateList &coordinates_ ); - - // Copy constructor - PathMovetoRel ( const PathMovetoRel& original_ ); - - // Destructor - /*virtual*/ ~PathMovetoRel ( void ); - - // Operator to invoke equivalent draw API call - /*virtual*/ void operator()( MagickCore::DrawingWand *context_ ) const; - - // Return polymorphic copy of object - /*virtual*/ VPathBase* copy() const; - -private: - CoordinateList _coordinates; -}; - -} // namespace Magick - -#endif // Magick_Drawable_header diff --git a/Magick++/lib/Magick++/Exception.h b/Magick++/lib/Magick++/Exception.h deleted file mode 100644 index eb77f40e9..000000000 --- a/Magick++/lib/Magick++/Exception.h +++ /dev/null @@ -1,425 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003 -// Copyright Dirk Lemstra 2014-2015 -// -// Definition of Magick::Exception and derived classes -// Magick::Warning* and Magick::Error*. Derived from C++ STD -// 'exception' class for convenience. -// -// These classes form part of the Magick++ user interface. -// - -#if !defined(Magick_Exception_header) -#define Magick_Exception_header - -#include "Magick++/Include.h" -#include -#include - -namespace Magick -{ - class MagickPPExport Exception: public std::exception - { - public: - - // Construct with message string - Exception(const std::string& what_); - - // Construct with message string and nested exception - Exception(const std::string& what_, Exception* nested_); - - // Copy constructor - Exception(const Exception& original_); - - // Destructor - virtual ~Exception() throw(); - - // Assignment operator - Exception& operator=(const Exception& original_); - - // Get string identifying exception - virtual const char* what() const throw(); - - // Get nested exception - const Exception* nested() const throw(); - - ////////////////////////////////////////////////////////////////////// - // - // No user-serviceable parts beyond this point - // - ////////////////////////////////////////////////////////////////////// - - void nested(Exception* nested_) throw(); - - private: - std::string _what; - Exception* _nested; - }; - - // - // Error exceptions - // - - class MagickPPExport Error: public Exception - { - public: - explicit Error(const std::string& what_); - explicit Error(const std::string& what_,Exception *nested_); - ~Error() throw(); - }; - - class MagickPPExport ErrorBlob: public Error - { - public: - explicit ErrorBlob(const std::string& what_); - explicit ErrorBlob(const std::string& what_,Exception *nested_); - ~ErrorBlob() throw(); - }; - - class MagickPPExport ErrorCache: public Error - { - public: - explicit ErrorCache(const std::string& what_); - explicit ErrorCache(const std::string& what_,Exception *nested_); - ~ErrorCache() throw(); - }; - - class MagickPPExport ErrorCoder: public Error - { - public: - explicit ErrorCoder(const std::string& what_); - explicit ErrorCoder(const std::string& what_,Exception *nested_); - ~ErrorCoder() throw(); - }; - - class MagickPPExport ErrorConfigure: public Error - { - public: - explicit ErrorConfigure(const std::string& what_); - explicit ErrorConfigure(const std::string& what_,Exception *nested_); - ~ErrorConfigure() throw(); - }; - - class MagickPPExport ErrorCorruptImage: public Error - { - public: - explicit ErrorCorruptImage(const std::string& what_); - explicit ErrorCorruptImage(const std::string& what_,Exception *nested_); - ~ErrorCorruptImage() throw(); - }; - - class MagickPPExport ErrorDelegate: public Error - { - public: - explicit ErrorDelegate(const std::string& what_); - explicit ErrorDelegate(const std::string& what_,Exception *nested_); - ~ErrorDelegate() throw(); - }; - - class MagickPPExport ErrorDraw: public Error - { - public: - explicit ErrorDraw(const std::string& what_); - explicit ErrorDraw(const std::string& what_,Exception *nested_); - ~ErrorDraw() throw(); - }; - - class MagickPPExport ErrorFileOpen: public Error - { - public: - explicit ErrorFileOpen(const std::string& what_); - explicit ErrorFileOpen(const std::string& what_,Exception *nested_); - ~ErrorFileOpen() throw(); - }; - - class MagickPPExport ErrorImage: public Error - { - public: - explicit ErrorImage(const std::string& what_); - explicit ErrorImage(const std::string& what_,Exception *nested_); - ~ErrorImage() throw(); - }; - - class MagickPPExport ErrorMissingDelegate: public Error - { - public: - explicit ErrorMissingDelegate(const std::string& what_); - explicit ErrorMissingDelegate(const std::string& what_,Exception *nested_); - ~ErrorMissingDelegate() throw(); - }; - - class MagickPPExport ErrorModule: public Error - { - public: - explicit ErrorModule(const std::string& what_); - explicit ErrorModule(const std::string& what_,Exception *nested_); - ~ErrorModule() throw(); - }; - - class MagickPPExport ErrorMonitor: public Error - { - public: - explicit ErrorMonitor(const std::string& what_); - explicit ErrorMonitor(const std::string& what_,Exception *nested_); - ~ErrorMonitor() throw(); - }; - - class MagickPPExport ErrorOption: public Error - { - public: - explicit ErrorOption(const std::string& what_); - explicit ErrorOption(const std::string& what_,Exception *nested_); - ~ErrorOption() throw(); - }; - - class MagickPPExport ErrorPolicy: public Error - { - public: - explicit ErrorPolicy(const std::string& what_); - explicit ErrorPolicy(const std::string& what_,Exception *nested_); - ~ErrorPolicy() throw(); - }; - - class MagickPPExport ErrorRegistry: public Error - { - public: - explicit ErrorRegistry(const std::string& what_); - explicit ErrorRegistry(const std::string& what_,Exception *nested_); - ~ErrorRegistry() throw(); - }; - - class MagickPPExport ErrorResourceLimit: public Error - { - public: - explicit ErrorResourceLimit(const std::string& what_); - explicit ErrorResourceLimit(const std::string& what_,Exception *nested_); - ~ErrorResourceLimit() throw(); - }; - - class MagickPPExport ErrorStream: public Error - { - public: - explicit ErrorStream(const std::string& what_); - explicit ErrorStream(const std::string& what_,Exception *nested_); - ~ErrorStream() throw(); - }; - - class MagickPPExport ErrorType: public Error - { - public: - explicit ErrorType(const std::string& what_); - explicit ErrorType(const std::string& what_,Exception *nested_); - ~ErrorType() throw(); - }; - - class MagickPPExport ErrorUndefined: public Error - { - public: - explicit ErrorUndefined(const std::string& what_); - explicit ErrorUndefined(const std::string& what_,Exception *nested_); - ~ErrorUndefined() throw(); - }; - - class MagickPPExport ErrorXServer: public Error - { - public: - explicit ErrorXServer(const std::string& what_); - explicit ErrorXServer(const std::string& what_,Exception *nested_); - ~ErrorXServer() throw(); - }; - - // - // Warnings - // - - class MagickPPExport Warning: public Exception - { - public: - explicit Warning(const std::string& what_); - explicit Warning(const std::string& what_,Exception *nested_); - ~Warning() throw(); - }; - - class MagickPPExport WarningBlob: public Warning - { - public: - explicit WarningBlob(const std::string& what_); - explicit WarningBlob(const std::string& what_,Exception *nested_); - ~WarningBlob() throw(); - }; - - class MagickPPExport WarningCache: public Warning - { - public: - explicit WarningCache(const std::string& what_); - explicit WarningCache(const std::string& what_,Exception *nested_); - ~WarningCache() throw(); - }; - - class MagickPPExport WarningCoder: public Warning - { - public: - explicit WarningCoder(const std::string& what_); - explicit WarningCoder(const std::string& what_,Exception *nested_); - ~WarningCoder() throw(); - }; - - class MagickPPExport WarningConfigure: public Warning - { - public: - explicit WarningConfigure(const std::string& what_); - explicit WarningConfigure(const std::string& what_,Exception *nested_); - ~WarningConfigure() throw(); - }; - - class MagickPPExport WarningCorruptImage: public Warning - { - public: - explicit WarningCorruptImage(const std::string& what_); - explicit WarningCorruptImage(const std::string& what_,Exception *nested_); - ~WarningCorruptImage() throw(); - }; - - class MagickPPExport WarningDelegate: public Warning - { - public: - explicit WarningDelegate(const std::string& what_); - explicit WarningDelegate(const std::string& what_,Exception *nested_); - ~WarningDelegate() throw(); - }; - - class MagickPPExport WarningDraw : public Warning - { - public: - explicit WarningDraw(const std::string& what_); - explicit WarningDraw(const std::string& what_,Exception *nested_); - ~WarningDraw() throw(); - }; - - class MagickPPExport WarningFileOpen: public Warning - { - public: - explicit WarningFileOpen(const std::string& what_); - explicit WarningFileOpen(const std::string& what_,Exception *nested_); - ~WarningFileOpen() throw(); - }; - - class MagickPPExport WarningImage: public Warning - { - public: - explicit WarningImage(const std::string& what_); - explicit WarningImage(const std::string& what_,Exception *nested_); - ~WarningImage() throw(); - }; - - class MagickPPExport WarningMissingDelegate: public Warning - { - public: - explicit WarningMissingDelegate(const std::string& what_); - explicit WarningMissingDelegate(const std::string& what_, - Exception *nested_); - ~WarningMissingDelegate() throw(); - }; - - class MagickPPExport WarningModule: public Warning - { - public: - explicit WarningModule(const std::string& what_); - explicit WarningModule(const std::string& what_,Exception *nested_); - ~WarningModule() throw(); - }; - - class MagickPPExport WarningMonitor: public Warning - { - public: - explicit WarningMonitor(const std::string& what_); - explicit WarningMonitor(const std::string& what_,Exception *nested_); - ~WarningMonitor() throw(); - }; - - class MagickPPExport WarningOption: public Warning - { - public: - explicit WarningOption(const std::string& what_); - explicit WarningOption(const std::string& what_,Exception *nested_); - ~WarningOption() throw(); - }; - - class MagickPPExport WarningPolicy: public Warning - { - public: - explicit WarningPolicy(const std::string& what_); - explicit WarningPolicy(const std::string& what_,Exception *nested_); - ~WarningPolicy() throw(); - }; - - class MagickPPExport WarningRegistry: public Warning - { - public: - explicit WarningRegistry(const std::string& what_); - explicit WarningRegistry(const std::string& what_,Exception *nested_); - ~WarningRegistry() throw(); - }; - - class MagickPPExport WarningResourceLimit: public Warning - { - public: - explicit WarningResourceLimit(const std::string& what_); - explicit WarningResourceLimit(const std::string& what_,Exception *nested_); - ~WarningResourceLimit() throw(); - }; - - class MagickPPExport WarningStream: public Warning - { - public: - explicit WarningStream(const std::string& what_); - explicit WarningStream(const std::string& what_,Exception *nested_); - ~WarningStream() throw(); - }; - - class MagickPPExport WarningType: public Warning - { - public: - explicit WarningType(const std::string& what_); - explicit WarningType(const std::string& what_,Exception *nested_); - ~WarningType() throw(); - }; - - class MagickPPExport WarningUndefined: public Warning - { - public: - explicit WarningUndefined(const std::string& what_); - explicit WarningUndefined(const std::string& what_,Exception *nested_); - ~WarningUndefined() throw(); - }; - - class MagickPPExport WarningXServer: public Warning - { - public: - explicit WarningXServer(const std::string& what_); - explicit WarningXServer(const std::string& what_,Exception *nested_); - ~WarningXServer() throw(); - }; - - // - // No user-serviceable components beyond this point. - // - - std::string formatExceptionMessage( - const MagickCore::ExceptionInfo *exception_); - - Exception* createException(const MagickCore::ExceptionInfo *exception_); - - // Throw exception based on raw data - extern MagickPPExport void throwExceptionExplicit( - const MagickCore::ExceptionType severity_,const char* reason_, - const char* description_=(char *) NULL); - - // Thow exception based on ImageMagick's ExceptionInfo - extern MagickPPExport void throwException( - MagickCore::ExceptionInfo *exception_,const bool quiet_=false); - -} // namespace Magick - -#endif // Magick_Exception_header diff --git a/Magick++/lib/Magick++/Functions.h b/Magick++/lib/Magick++/Functions.h deleted file mode 100644 index 68c52fda5..000000000 --- a/Magick++/lib/Magick++/Functions.h +++ /dev/null @@ -1,40 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2003 -// Copyright Dirk Lemstra 2014-2017 -// -// Simple C++ function wrappers for often used or otherwise -// inconvenient ImageMagick equivalents -// - -#if !defined(Magick_Functions_header) -#define Magick_Functions_header - -#include "Magick++/Include.h" -#include - -namespace Magick -{ - // Clone C++ string as allocated C string, de-allocating any existing string - MagickPPExport void CloneString(char **destination_, - const std::string &source_); - - // Disable OpenCL acceleration (only works when build with OpenCL support) - MagickPPExport void DisableOpenCL(void); - - // Enable OpenCL acceleration (only works when build with OpenCL support) - MagickPPExport bool EnableOpenCL(void); - - // C library initialization routine - MagickPPExport void InitializeMagick(const char *path_); - - // Seed a new sequence of pseudo-random numbers - MagickPPExport void SetRandomSeed(const unsigned long seed); - - // Set the ImageMagick security policy. - MagickPPExport bool SetSecurityPolicy(const std::string &policy_); - - // C library initialization routine - MagickPPExport void TerminateMagick(); -} -#endif // Magick_Functions_header diff --git a/Magick++/lib/Magick++/Geometry.h b/Magick++/lib/Magick++/Geometry.h deleted file mode 100644 index 6fa31cf75..000000000 --- a/Magick++/lib/Magick++/Geometry.h +++ /dev/null @@ -1,261 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002 -// Copyright Dirk Lemstra 2014 -// -// Geometry Definition -// -// Representation of an ImageMagick geometry specification -// X11 geometry specification plus hints - -#if !defined (Magick_Geometry_header) -#define Magick_Geometry_header - -#include "Magick++/Include.h" -#include - -namespace Magick -{ - class MagickPPExport Geometry; - - // Compare two Geometry objects regardless of LHS/RHS - MagickPPExport int operator == - (const Magick::Geometry& left_,const Magick::Geometry& right_); - MagickPPExport int operator != - (const Magick::Geometry& left_,const Magick::Geometry& right_); - MagickPPExport int operator > - (const Magick::Geometry& left_,const Magick::Geometry& right_); - MagickPPExport int operator < - (const Magick::Geometry& left_,const Magick::Geometry& right_); - MagickPPExport int operator >= - (const Magick::Geometry& left_,const Magick::Geometry& right_); - MagickPPExport int operator <= - (const Magick::Geometry& left_,const Magick::Geometry& right_); - - class MagickPPExport Geometry - { - public: - - // Default constructor - Geometry(); - - // Construct Geometry from specified string - Geometry(const char *geometry_); - - // Copy constructor - Geometry(const Geometry &geometry_); - - // Construct Geometry from specified string - Geometry(const std::string &geometry_); - - // Construct Geometry from specified dimensions - Geometry(size_t width_,size_t height_,::ssize_t xOff_=0, - ::ssize_t yOff_=0); - - // Destructor - ~Geometry(void); - - // Set via geometry string - const Geometry& operator=(const char *geometry_); - - // Assignment operator - Geometry& operator=(const Geometry& Geometry_); - - // Set via geometry string - const Geometry& operator=(const std::string &geometry_); - - // Return geometry string - operator std::string() const; - - // Resize without preserving aspect ratio (!) - void aspect(bool aspect_); - bool aspect(void) const; - - // Resize the image based on the smallest fitting dimension (^) - void fillArea(bool fillArea_); - bool fillArea(void) const; - - // Resize if image is greater than size (>) - void greater(bool greater_); - bool greater(void) const; - - // Height - void height(size_t height_); - size_t height(void) const; - - // Does object contain valid geometry? - void isValid(bool isValid_); - bool isValid(void) const; - - // Resize if image is less than size (<) - void less(bool less_); - bool less(void) const; - - // Resize using a pixel area count limit (@) - void limitPixels(bool limitPixels_); - bool limitPixels(void) const; - - // Width and height are expressed as percentages - void percent(bool percent_); - bool percent(void) const; - - // Width - void width(size_t width_); - size_t width(void) const; - - // X offset from origin - void xOff(::ssize_t xOff_); - ::ssize_t xOff(void) const; - - // Y offset from origin - void yOff(::ssize_t yOff_); - ::ssize_t yOff(void) const; - - // - // Public methods below this point are for Magick++ use only. - // - - // Construct from RectangleInfo - Geometry(const MagickCore::RectangleInfo &rectangle_); - - // Set via RectangleInfo - const Geometry& operator=(const MagickCore::RectangleInfo &rectangle_); - - // Return an ImageMagick RectangleInfo struct - operator MagickCore::RectangleInfo() const; - - private: - size_t _width; - size_t _height; - ::ssize_t _xOff; - ::ssize_t _yOff; - bool _isValid; - bool _percent; // Interpret width & height as percentages (%) - bool _aspect; // Force exact size (!) - bool _greater; // Resize only if larger than geometry (>) - bool _less; // Resize only if smaller than geometry (<) - bool _fillArea; // Resize the image based on the smallest fitting dimension (^) - bool _limitPixels; // Resize using a pixel area count limit (@) - }; - - class MagickPPExport Offset; - - // Compare two Offset objects - MagickPPExport int operator == - (const Magick::Offset& left_,const Magick::Offset& right_); - MagickPPExport int operator != - (const Magick::Offset& left_,const Magick::Offset& right_); - - class MagickPPExport Offset - { - public: - - // Default constructor - Offset(); - - // Construct Offset from specified string - Offset(const char *offset_); - - // Copy constructor - Offset(const Offset &offset_); - - // Construct Offset from specified string - Offset(const std::string &offset_); - - // Construct Offset from specified x and y - Offset(ssize_t x_,ssize_t y_); - - // Destructor - ~Offset(void); - - // Set via offset string - const Offset& operator=(const char *offset_); - - // Assignment operator - Offset& operator=(const Offset& offset_); - - // Set via offset string - const Offset& operator=(const std::string &offset_); - - // X offset from origin - ssize_t x(void) const; - - // Y offset from origin - ssize_t y(void) const; - - // - // Public methods below this point are for Magick++ use only. - // - - // Return an ImageMagick OffsetInfo struct - operator MagickCore::OffsetInfo() const; - - private: - ssize_t _x; - ssize_t _y; - }; - - class MagickPPExport Point; - - // Compare two Point objects - MagickPPExport int operator == - (const Magick::Point& left_,const Magick::Point& right_); - MagickPPExport int operator != - (const Magick::Point& left_,const Magick::Point& right_); - - class MagickPPExport Point - { - public: - - // Default constructor - Point(); - - // Construct Point from specified string - Point(const char *point_); - - // Copy constructor - Point(const Point &point_); - - // Construct Point from specified string - Point(const std::string &point_); - - // Construct Point from specified x and y - Point(double x_,double y_); - - // Construct Point from specified x y - Point(double xy_); - - // Destructor - ~Point(void); - - // Set via point string - const Point& operator=(const char *point_); - - // Set via double value - const Point& operator=(double xy_); - - // Assignment operator - Point& operator=(const Point& point_); - - // Set via point string - const Point& operator=(const std::string &point_); - - // Return point string - operator std::string() const; - - // Does object contain valid point? - bool isValid() const; - - // X offset from origin - double x(void) const; - - // Y offset from origin - double y(void) const; - - private: - double _x; - double _y; - }; -} // namespace Magick - -#endif // Magick_Geometry_header diff --git a/Magick++/lib/Magick++/Image.h b/Magick++/lib/Magick++/Image.h deleted file mode 100644 index 14b097572..000000000 --- a/Magick++/lib/Magick++/Image.h +++ /dev/null @@ -1,1554 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003 -// Copyright Dirk Lemstra 2013-2017 -// -// Definition of Image, the representation of a single image in Magick++ -// - -#if !defined(Magick_Image_header) -#define Magick_Image_header - -#include "Magick++/Include.h" -#include -#include -#include "Magick++/Blob.h" -#include "Magick++/Color.h" -#include "Magick++/Drawable.h" -#include "Magick++/Exception.h" -#include "Magick++/Geometry.h" -#include "Magick++/Statistic.h" -#include "Magick++/TypeMetric.h" - -namespace Magick -{ - // Forward declarations - class Options; - class ImageRef; - - extern MagickPPExport const char *borderGeometryDefault; - extern MagickPPExport const char *frameGeometryDefault; - extern MagickPPExport const char *raiseGeometryDefault; - - // Compare two Image objects regardless of LHS/RHS - // Image sizes and signatures are used as basis of comparison - MagickPPExport int operator == - (const Magick::Image &left_,const Magick::Image &right_); - MagickPPExport int operator != - (const Magick::Image &left_,const Magick::Image &right_); - MagickPPExport int operator > - (const Magick::Image &left_,const Magick::Image &right_); - MagickPPExport int operator < - (const Magick::Image &left_,const Magick::Image &right_); - MagickPPExport int operator >= - (const Magick::Image &left_,const Magick::Image &right_); - MagickPPExport int operator <= - (const Magick::Image &left_,const Magick::Image &right_); - - // - // Image is the representation of an image. In reality, it actually - // a handle object which contains a pointer to a shared reference - // object (ImageRef). As such, this object is extremely space efficient. - // - class MagickPPExport Image - { - public: - - // Default constructor - Image(void); - - // Construct Image from in-memory BLOB - Image(const Blob &blob_); - - // Construct Image of specified size from in-memory BLOB - Image(const Blob &blob_,const Geometry &size_); - - // Construct Image of specified size and depth from in-memory BLOB - Image(const Blob &blob_,const Geometry &size_,const size_t depth_); - - // Construct Image of specified size, depth, and format from - // in-memory BLOB - Image(const Blob &blob_,const Geometry &size_,const size_t depth_, - const std::string &magick_); - - // Construct Image of specified size, and format from in-memory BLOB - Image(const Blob &blob_,const Geometry &size_,const std::string &magick_); - - // Construct a blank image canvas of specified size and color - Image(const Geometry &size_,const Color &color_); - - // Copy constructor - Image(const Image &image_); - - // Copy constructor to copy part of the image - Image(const Image &image_,const Geometry &geometry_); - - // Construct an image based on an array of raw pixels, of - // specified type and mapping, in memory - Image(const size_t width_,const size_t height_,const std::string &map_, - const StorageType type_,const void *pixels_); - - // Construct from image file or image specification - Image(const std::string &imageSpec_); - - // Destructor - virtual ~Image(); - - // Assignment operator - Image& operator=(const Image &image_); - - // Join images into a single multi-image file - void adjoin(const bool flag_); - bool adjoin(void) const; - - // Image supports transparency (alpha channel) - void alpha(const bool alphaFlag_); - bool alpha(void) const; - - // Transparent color - void matteColor(const Color &matteColor_); - Color matteColor(void) const; - - // Time in 1/100ths of a second which must expire before - // displaying the next image in an animated sequence. - void animationDelay(const size_t delay_); - size_t animationDelay(void) const; - - // Number of iterations to loop an animation (e.g. Netscape loop - // extension) for. - void animationIterations(const size_t iterations_); - size_t animationIterations(void) const; - - // Image background color - void backgroundColor(const Color &color_); - Color backgroundColor(void) const; - - // Name of texture image to tile onto the image background - void backgroundTexture(const std::string &backgroundTexture_); - std::string backgroundTexture(void) const; - - // Base image width (before transformations) - size_t baseColumns(void) const; - - // Base image filename (before transformations) - std::string baseFilename(void) const; - - // Base image height (before transformations) - size_t baseRows(void) const; - - // Use black point compensation. - void blackPointCompensation(const bool flag_); - bool blackPointCompensation(void) const; - - // Image border color - void borderColor(const Color &color_); - Color borderColor(void) const; - - // Return smallest bounding box enclosing non-border pixels. The - // current fuzz value is used when discriminating between pixels. - // This is the crop bounding box used by crop(Geometry(0,0)); - Geometry boundingBox(void) const; - - // Text bounding-box base color (default none) - void boxColor(const Color &boxColor_); - Color boxColor(void) const; - - // Set or obtain modulus channel depth - void channelDepth(const ChannelType channel_,const size_t depth_); - size_t channelDepth(const ChannelType channel_); - - // Returns the number of channels in this image. - size_t channels() const; - - // Image class (DirectClass or PseudoClass) - // NOTE: setting a DirectClass image to PseudoClass will result in - // the loss of color information if the number of colors in the - // image is greater than the maximum palette size (either 256 or - // 65536 entries depending on the value of MAGICKCORE_QUANTUM_DEPTH when - // ImageMagick was built). - void classType(const ClassType class_); - ClassType classType(void) const; - - // Colors within this distance are considered equal - void colorFuzz(const double fuzz_); - double colorFuzz(void) const; - - // Colormap size (number of colormap entries) - void colorMapSize(const size_t entries_); - size_t colorMapSize(void) const; - - // Image Color Space - void colorSpace(const ColorspaceType colorSpace_); - ColorspaceType colorSpace(void) const; - - void colorSpaceType(const ColorspaceType colorSpace_); - ColorspaceType colorSpaceType(void) const; - - // Image width - size_t columns(void) const; - - // Comment image (add comment string to image) - void comment(const std::string &comment_); - std::string comment(void) const; - - // Composition operator to be used when composition is implicitly - // used (such as for image flattening). - void compose(const CompositeOperator compose_); - CompositeOperator compose(void) const; - - // Compression type - void compressType(const CompressionType compressType_); - CompressionType compressType(void) const; - - // Enable printing of debug messages from ImageMagick - void debug(const bool flag_); - bool debug(void) const; - - // Vertical and horizontal resolution in pixels of the image - void density(const Point &density_); - Point density(void) const; - - // Image depth (bits allocated to red/green/blue components) - void depth(const size_t depth_); - size_t depth(void) const; - - // Tile names from within an image montage - std::string directory(void) const; - - // Endianness (little like Intel or big like SPARC) for image - // formats which support endian-specific options. - void endian(const EndianType endian_); - EndianType endian(void) const; - - // Exif profile (BLOB) - void exifProfile(const Blob &exifProfile_); - Blob exifProfile(void) const; - - // Image file name - void fileName(const std::string &fileName_); - std::string fileName(void) const; - - // Number of bytes of the image on disk - MagickSizeType fileSize(void) const; - - // Color to use when filling drawn objects - void fillColor(const Color &fillColor_); - Color fillColor(void) const; - - // Rule to use when filling drawn objects - void fillRule(const FillRule &fillRule_); - FillRule fillRule(void) const; - - // Pattern to use while filling drawn objects. - void fillPattern(const Image &fillPattern_); - Image fillPattern(void) const; - - // Filter to use when resizing image - void filterType(const FilterType filterType_); - FilterType filterType(void) const; - - // Text rendering font - void font(const std::string &font_); - std::string font(void) const; - - // Font family - void fontFamily(const std::string &family_); - std::string fontFamily(void) const; - - // Font point size - void fontPointsize(const double pointSize_); - double fontPointsize(void) const; - - // Font style - void fontStyle(const StyleType style_); - StyleType fontStyle(void) const; - - // Font weight - void fontWeight(const size_t weight_); - size_t fontWeight(void) const; - - // Long image format description - std::string format(void) const; - - // Formats the specified expression - // More info here: https://imagemagick.org/script/escape.php - std::string formatExpression(const std::string expression); - - // Gamma level of the image - double gamma(void) const; - - // Preferred size of the image when encoding - Geometry geometry(void) const; - - // GIF disposal method - void gifDisposeMethod(const DisposeType disposeMethod_); - DisposeType gifDisposeMethod(void) const; - - bool hasChannel(const PixelChannel channel) const; - - // When comparing images, emphasize pixel differences with this color. - void highlightColor(const Color color_); - - // ICC color profile (BLOB) - void iccColorProfile(const Blob &colorProfile_); - Blob iccColorProfile(void) const; - - // Type of interlacing to use - void interlaceType(const InterlaceType interlace_); - InterlaceType interlaceType(void) const; - - // Pixel color interpolation method to use - void interpolate(const PixelInterpolateMethod interpolate_); - PixelInterpolateMethod interpolate(void) const; - - // IPTC profile (BLOB) - void iptcProfile(const Blob &iptcProfile_); - Blob iptcProfile(void) const; - - // Returns true if none of the pixels in the image have an alpha value - // other than OpaqueAlpha (QuantumRange). - bool isOpaque(void) const; - - // Does object contain valid image? - void isValid(const bool isValid_); - bool isValid(void) const; - - // Image label - void label(const std::string &label_); - std::string label(void) const; - - // When comparing images, de-emphasize pixel differences with this color. - void lowlightColor(const Color color_); - - // File type magick identifier (.e.g "GIF") - void magick(const std::string &magick_); - std::string magick(void) const; - - // When comparing images, set pixels with a read mask to this color. - void masklightColor(const Color color_); - - // The mean error per pixel computed when an image is color reduced - double meanErrorPerPixel(void) const; - - // Image modulus depth (minimum number of bits required to support - // red/green/blue components without loss of accuracy) - void modulusDepth(const size_t modulusDepth_); - size_t modulusDepth(void) const; - - // Transform image to black and white - void monochrome(const bool monochromeFlag_); - bool monochrome(void) const; - - // Tile size and offset within an image montage - Geometry montageGeometry(void) const; - - // The normalized max error per pixel computed when an image is - // color reduced. - double normalizedMaxError(void) const; - - // The normalized mean error per pixel computed when an image is - // color reduced. - double normalizedMeanError(void) const; - - // Image orientation - void orientation(const OrientationType orientation_); - OrientationType orientation(void) const; - - // Preferred size and location of an image canvas. - void page(const Geometry &pageSize_); - Geometry page(void) const; - - // JPEG/MIFF/PNG compression level (default 75). - void quality(const size_t quality_); - size_t quality(void) const; - - // Maximum number of colors to quantize to - void quantizeColors(const size_t colors_); - size_t quantizeColors(void) const; - - // Colorspace to quantize in. - void quantizeColorSpace(const ColorspaceType colorSpace_); - ColorspaceType quantizeColorSpace(void) const; - - // Dither image during quantization (default true). - void quantizeDither(const bool ditherFlag_); - bool quantizeDither(void) const; - - // Dither method - void quantizeDitherMethod(const DitherMethod ditherMethod_); - DitherMethod quantizeDitherMethod(void) const; - - // Quantization tree-depth - void quantizeTreeDepth(const size_t treeDepth_); - size_t quantizeTreeDepth(void) const; - - // Suppress all warning messages. Error messages are still reported. - void quiet(const bool quiet_); - bool quiet(void) const; - - // The type of rendering intent - void renderingIntent(const RenderingIntent renderingIntent_); - RenderingIntent renderingIntent(void) const; - - // Units of image resolution - void resolutionUnits(const ResolutionType resolutionUnits_); - ResolutionType resolutionUnits(void) const; - - // The number of pixel rows in the image - size_t rows(void) const; - - // Image scene number - void scene(const size_t scene_); - size_t scene(void) const; - - // Width and height of a raw image - void size(const Geometry &geometry_); - Geometry size(void) const; - - // enabled/disable stroke anti-aliasing - void strokeAntiAlias(const bool flag_); - bool strokeAntiAlias(void) const; - - // Color to use when drawing object outlines - void strokeColor(const Color &strokeColor_); - Color strokeColor(void) const; - - // Specify the pattern of dashes and gaps used to stroke - // paths. The strokeDashArray represents a zero-terminated array - // of numbers that specify the lengths of alternating dashes and - // gaps in pixels. If an odd number of values is provided, then - // the list of values is repeated to yield an even number of - // values. A typical strokeDashArray_ array might contain the - // members 5 3 2 0, where the zero value indicates the end of the - // pattern array. - void strokeDashArray(const double *strokeDashArray_); - const double *strokeDashArray(void) const; - - // While drawing using a dash pattern, specify distance into the - // dash pattern to start the dash (default 0). - void strokeDashOffset(const double strokeDashOffset_); - double strokeDashOffset(void) const; - - // Specify the shape to be used at the end of open subpaths when - // they are stroked. Values of LineCap are UndefinedCap, ButtCap, - // RoundCap, and SquareCap. - void strokeLineCap(const LineCap lineCap_); - LineCap strokeLineCap(void) const; - - // Specify the shape to be used at the corners of paths (or other - // vector shapes) when they are stroked. Values of LineJoin are - // UndefinedJoin, MiterJoin, RoundJoin, and BevelJoin. - void strokeLineJoin(const LineJoin lineJoin_); - LineJoin strokeLineJoin(void) const; - - // Specify miter limit. When two line segments meet at a sharp - // angle and miter joins have been specified for 'lineJoin', it is - // possible for the miter to extend far beyond the thickness of - // the line stroking the path. The miterLimit' imposes a limit on - // the ratio of the miter length to the 'lineWidth'. The default - // value of this parameter is 4. - void strokeMiterLimit(const size_t miterLimit_); - size_t strokeMiterLimit(void) const; - - // Pattern image to use while stroking object outlines. - void strokePattern(const Image &strokePattern_); - Image strokePattern(void) const; - - // Stroke width for drawing vector objects (default one) - void strokeWidth(const double strokeWidth_); - double strokeWidth(void) const; - - // Subimage of an image sequence - void subImage(const size_t subImage_); - size_t subImage(void) const; - - // Number of images relative to the base image - void subRange(const size_t subRange_); - size_t subRange(void) const; - - // Anti-alias Postscript and TrueType fonts (default true) - void textAntiAlias(const bool flag_); - bool textAntiAlias(void) const; - - // Render text right-to-left or left-to-right. - void textDirection(DirectionType direction_); - DirectionType textDirection() const; - - // Annotation text encoding (e.g. "UTF-16") - void textEncoding(const std::string &encoding_); - std::string textEncoding(void) const; - - // Text gravity. - void textGravity(GravityType gravity_); - GravityType textGravity() const; - - // Text inter-line spacing - void textInterlineSpacing(double spacing_); - double textInterlineSpacing(void) const; - - // Text inter-word spacing - void textInterwordSpacing(double spacing_); - double textInterwordSpacing(void) const; - - // Text inter-character kerning - void textKerning(double kerning_); - double textKerning(void) const; - - // Text undercolor box - void textUnderColor(const Color &underColor_); - Color textUnderColor(void) const; - - // Number of colors in the image - size_t totalColors(void) const; - - // Rotation to use when annotating with text or drawing - void transformRotation(const double angle_); - - // Skew to use in X axis when annotating with text or drawing - void transformSkewX(const double skewx_); - - // Skew to use in Y axis when annotating with text or drawing - void transformSkewY(const double skewy_); - - // Image representation type (also see type operation) - // Available types: - // Bilevel Grayscale GrayscaleMatte - // Palette PaletteMatte TrueColor - // TrueColorMatte ColorSeparation ColorSeparationMatte - void type(const ImageType type_); - ImageType type(void) const; - - // Print detailed information about the image - void verbose(const bool verboseFlag_); - bool verbose(void) const; - - // Virtual pixel method - void virtualPixelMethod(const VirtualPixelMethod virtualPixelMethod_); - VirtualPixelMethod virtualPixelMethod(void) const; - - // X11 display to display to, obtain fonts from, or to capture - // image from - void x11Display(const std::string &display_); - std::string x11Display(void) const; - - // x resolution of the image - double xResolution(void) const; - - // y resolution of the image - double yResolution(void) const; - - // Adaptive-blur image with specified blur factor - // The radius_ parameter specifies the radius of the Gaussian, in - // pixels, not counting the center pixel. The sigma_ parameter - // specifies the standard deviation of the Laplacian, in pixels. - void adaptiveBlur(const double radius_=0.0,const double sigma_=1.0); - - // This is shortcut function for a fast interpolative resize using mesh - // interpolation. It works well for small resizes of less than +/- 50% - // of the original image size. For larger resizing on images a full - // filtered and slower resize function should be used instead. - void adaptiveResize(const Geometry &geometry_); - - // Adaptively sharpens the image by sharpening more intensely near image - // edges and less intensely far from edges. We sharpen the image with a - // Gaussian operator of the given radius and standard deviation (sigma). - // For reasonable results, radius should be larger than sigma. - void adaptiveSharpen(const double radius_=0.0,const double sigma_=1.0); - void adaptiveSharpenChannel(const ChannelType channel_, - const double radius_=0.0,const double sigma_=1.0); - - // Local adaptive threshold image - // http://www.dai.ed.ac.uk/HIPR2/adpthrsh.htm - // Width x height define the size of the pixel neighborhood - // bias = constant to subtract from pixel neighborhood mean - void adaptiveThreshold(const size_t width_,const size_t height_, - const double bias_=0.0); - - // Add noise to image with specified noise type - void addNoise(const NoiseType noiseType_,const double attenuate_=1.0); - void addNoiseChannel(const ChannelType channel_, - const NoiseType noiseType_,const double attenuate_=1.0); - - // Transform image by specified affine (or free transform) matrix. - void affineTransform(const DrawableAffine &affine); - - // Set or attenuate the alpha channel in the image. If the image - // pixels are opaque then they are set to the specified alpha - // value, otherwise they are blended with the supplied alpha - // value. The value of alpha_ ranges from 0 (completely opaque) - // to QuantumRange. The defines OpaqueAlpha and TransparentAlpha are - // available to specify completely opaque or completely - // transparent, respectively. - void alpha(const unsigned int alpha_); - - // AlphaChannel() activates, deactivates, resets, or sets the alpha - // channel. - void alphaChannel(AlphaChannelOption alphaOption_); - - // - // Annotate image (draw text on image) - // - // Gravity effects text placement in bounding area according to rules: - // NorthWestGravity text bottom-left corner placed at top-left - // NorthGravity text bottom-center placed at top-center - // NorthEastGravity text bottom-right corner placed at top-right - // WestGravity text left-center placed at left-center - // CenterGravity text center placed at center - // EastGravity text right-center placed at right-center - // SouthWestGravity text top-left placed at bottom-left - // SouthGravity text top-center placed at bottom-center - // SouthEastGravity text top-right placed at bottom-right - - // Annotate using specified text, and placement location - void annotate(const std::string &text_,const Geometry &location_); - - // Annotate using specified text, bounding area, and placement - // gravity - void annotate(const std::string &text_,const Geometry &boundingArea_, - const GravityType gravity_); - - // Annotate with text using specified text, bounding area, - // placement gravity, and rotation. - void annotate(const std::string &text_,const Geometry &boundingArea_, - const GravityType gravity_,const double degrees_); - - // Annotate with text (bounding area is entire image) and placement - // gravity. - void annotate(const std::string &text_,const GravityType gravity_); - - // Inserts the artifact with the specified name and value into - // the artifact tree of the image. - void artifact(const std::string &name_,const std::string &value_); - - // Returns the value of the artifact with the specified name. - std::string artifact(const std::string &name_) const; - - // Access/Update a named image attribute - void attribute(const std::string name_,const char *value_); - void attribute(const std::string name_,const std::string value_); - std::string attribute(const std::string name_) const; - - // Extracts the 'mean' from the image and adjust the image to try - // make set its gamma appropriatally. - void autoGamma(void); - void autoGammaChannel(const ChannelType channel_); - - // Adjusts the levels of a particular image channel by scaling the - // minimum and maximum values to the full quantum range. - void autoLevel(void); - void autoLevelChannel(const ChannelType channel_); - - // Adjusts an image so that its orientation is suitable for viewing. - void autoOrient(void); - - // Automatically selects a threshold and replaces each pixel in the image - // with a black pixel if the image intentsity is less than the selected - // threshold otherwise white. - void autoThreshold(const AutoThresholdMethod method_); - - // Forces all pixels below the threshold into black while leaving all - // pixels at or above the threshold unchanged. - void blackThreshold(const std::string &threshold_); - void blackThresholdChannel(const ChannelType channel_, - const std::string &threshold_); - - // Simulate a scene at nighttime in the moonlight. - void blueShift(const double factor_=1.5); - - // Blur image with specified blur factor - // The radius_ parameter specifies the radius of the Gaussian, in - // pixels, not counting the center pixel. The sigma_ parameter - // specifies the standard deviation of the Laplacian, in pixels. - void blur(const double radius_=0.0,const double sigma_=1.0); - void blurChannel(const ChannelType channel_,const double radius_=0.0, - const double sigma_=1.0); - - // Border image (add border to image) - void border(const Geometry &geometry_=borderGeometryDefault); - - // Changes the brightness and/or contrast of an image. It converts the - // brightness and contrast parameters into slope and intercept and calls - // a polynomical function to apply to the image. - void brightnessContrast(const double brightness_=0.0, - const double contrast_=0.0); - void brightnessContrastChannel(const ChannelType channel_, - const double brightness_=0.0,const double contrast_=0.0); - - // Uses a multi-stage algorithm to detect a wide range of edges in images. - void cannyEdge(const double radius_=0.0,const double sigma_=1.0, - const double lowerPercent_=0.1,const double upperPercent_=0.3); - - // Accepts a lightweight Color Correction Collection - // (CCC) file which solely contains one or more color corrections and - // applies the correction to the image. - void cdl(const std::string &cdl_); - - // Extract channel from image - void channel(const ChannelType channel_); - - // Charcoal effect image (looks like charcoal sketch) - // The radius_ parameter specifies the radius of the Gaussian, in - // pixels, not counting the center pixel. The sigma_ parameter - // specifies the standard deviation of the Laplacian, in pixels. - void charcoal(const double radius_=0.0,const double sigma_=1.0); - void charcoalChannel(const ChannelType channel_,const double radius_=0.0, - const double sigma_=1.0); - - // Chop image (remove vertical or horizontal subregion of image) - // FIXME: describe how geometry argument is used to select either - // horizontal or vertical subregion of image. - void chop(const Geometry &geometry_); - - // Chromaticity blue primary point. - void chromaBluePrimary(const double x_,const double y_,const double z_); - void chromaBluePrimary(double *x_,double *y_,double *z_) const; - - // Chromaticity green primary point. - void chromaGreenPrimary(const double x_,const double y_,const double z_); - void chromaGreenPrimary(double *x_,double *y_,double *z_) const; - - // Chromaticity red primary point. - void chromaRedPrimary(const double x_,const double y_,const double z_); - void chromaRedPrimary(double *x_,double *y_,double *z_) const; - - // Chromaticity white point. - void chromaWhitePoint(const double x_,const double y_,const double z_); - void chromaWhitePoint(double *x_,double *y_,double *z_) const; - - // Set each pixel whose value is below zero to zero and any the - // pixel whose value is above the quantum range to the quantum range (e.g. - // 65535) otherwise the pixel value remains unchanged. - void clamp(void); - void clampChannel(const ChannelType channel_); - - // Sets the image clip mask based on any clipping path information - // if it exists. - void clip(void); - void clipPath(const std::string pathname_,const bool inside_); - - // Apply a color lookup table (CLUT) to the image. - void clut(const Image &clutImage_,const PixelInterpolateMethod method); - void clutChannel(const ChannelType channel_,const Image &clutImage_, - const PixelInterpolateMethod method); - - // Colorize image with pen color, using specified percent alpha. - void colorize(const unsigned int alpha_,const Color &penColor_); - - // Colorize image with pen color, using specified percent alpha - // for red, green, and blue quantums - void colorize(const unsigned int alphaRed_,const unsigned int alphaGreen_, - const unsigned int alphaBlue_,const Color &penColor_); - - // Color at colormap position index_ - void colorMap(const size_t index_,const Color &color_); - Color colorMap(const size_t index_) const; - - // Apply a color matrix to the image channels. The user supplied - // matrix may be of order 1 to 5 (1x1 through 5x5). - void colorMatrix(const size_t order_,const double *color_matrix_); - - // Compare current image with another image - // False is returned if the images are not identical. - bool compare(const Image &reference_) const; - - // Compare current image with another image - // Returns the distortion based on the specified metric. - double compare(const Image &reference_,const MetricType metric_); - double compareChannel(const ChannelType channel_, - const Image &reference_, - const MetricType metric_ ); - - // Compare current image with another image - // Sets the distortion and returns the difference image. - Image compare(const Image &reference_,const MetricType metric_, - double *distortion); - Image compareChannel(const ChannelType channel_,const Image &reference_, - const MetricType metric_,double *distortion); - - // Compose an image onto another at specified offset and using - // specified algorithm - void composite(const Image &compositeImage_,const Geometry &offset_, - const CompositeOperator compose_=InCompositeOp); - void composite(const Image &compositeImage_,const GravityType gravity_, - const CompositeOperator compose_=InCompositeOp); - void composite(const Image &compositeImage_,const ::ssize_t xOffset_, - const ::ssize_t yOffset_,const CompositeOperator compose_=InCompositeOp); - - // Determines the connected-components of the image - void connectedComponents(const size_t connectivity_); - - // Contrast image (enhance intensity differences in image) - void contrast(const bool sharpen_); - - // A simple image enhancement technique that attempts to improve the - // contrast in an image by 'stretching' the range of intensity values - // it contains to span a desired range of values. It differs from the - // more sophisticated histogram equalization in that it can only apply a - // linear scaling function to the image pixel values. As a result the - // 'enhancement' is less harsh. - void contrastStretch(const double blackPoint_,const double whitePoint_); - void contrastStretchChannel(const ChannelType channel_, - const double blackPoint_,const double whitePoint_); - - // Convolve image. Applies a user-specified convolution to the image. - // order_ represents the number of columns and rows in the filter kernel. - // kernel_ is an array of doubles representing the convolution kernel. - void convolve(const size_t order_,const double *kernel_); - - // Copies pixels from the source image as defined by the geometry the - // destination image at the specified offset. - void copyPixels(const Image &source_,const Geometry &geometry_, - const Offset &offset_); - - // Crop image (subregion of original image) - void crop(const Geometry &geometry_); - - // Cycle image colormap - void cycleColormap(const ::ssize_t amount_); - - // Converts cipher pixels to plain pixels. - void decipher(const std::string &passphrase_); - - // Tagged image format define. Similar to the defineValue() method - // except that passing the flag_ value 'true' creates a value-less - // define with that format and key. Passing the flag_ value 'false' - // removes any existing matching definition. The method returns 'true' - // if a matching key exists, and 'false' if no matching key exists. - void defineSet(const std::string &magick_,const std::string &key_, - bool flag_); - bool defineSet(const std::string &magick_,const std::string &key_) const; - - // Tagged image format define (set/access coder-specific option) The - // magick_ option specifies the coder the define applies to. The key_ - // option provides the key specific to that coder. The value_ option - // provides the value to set (if any). See the defineSet() method if the - // key must be removed entirely. - void defineValue(const std::string &magick_,const std::string &key_, - const std::string &value_); - std::string defineValue(const std::string &magick_, - const std::string &key_) const; - - // Removes skew from the image. Skew is an artifact that occurs in scanned - // images because of the camera being misaligned, imperfections in the - // scanning or surface, or simply because the paper was not placed - // completely flat when scanned. The value of threshold_ ranges from 0 - // to QuantumRange. - void deskew(const double threshold_); - - // Despeckle image (reduce speckle noise) - void despeckle(void); - - // Display image on screen - void display(void); - - // Distort image. distorts an image using various distortion methods, by - // mapping color lookups of the source image to a new destination image - // usally of the same size as the source image, unless 'bestfit' is set to - // true. - void distort(const DistortMethod method_, - const size_t numberArguments_,const double *arguments_, - const bool bestfit_=false); - - // Draw on image using a single drawable - void draw(const Drawable &drawable_); - - // Draw on image using a drawable list - void draw(const std::vector &drawable_); - - // Edge image (hilight edges in image) - void edge(const double radius_=0.0); - - // Emboss image (hilight edges with 3D effect) - // The radius_ parameter specifies the radius of the Gaussian, in - // pixels, not counting the center pixel. The sigma_ parameter - // specifies the standard deviation of the Laplacian, in pixels. - void emboss(const double radius_=0.0,const double sigma_=1.0); - - // Converts pixels to cipher-pixels. - void encipher(const std::string &passphrase_); - - // Enhance image (minimize noise) - void enhance(void); - - // Equalize image (histogram equalization) - void equalize(void); - - // Erase image to current "background color" - void erase(void); - - // Apply a value with an arithmetic, relational, or logical operator. - void evaluate(const ChannelType channel_, - const MagickEvaluateOperator operator_,double rvalue_); - - // Apply a value with an arithmetic, relational, or logical operator. - void evaluate(const ChannelType channel_,const MagickFunction function_, - const size_t number_parameters_,const double *parameters_); - - // Apply a value with an arithmetic, relational, or logical operator. - void evaluate(const ChannelType channel_,const ::ssize_t x_, - const ::ssize_t y_,const size_t columns_,const size_t rows_, - const MagickEvaluateOperator operator_,const double rvalue_); - - // Extend the image as defined by the geometry. - void extent(const Geometry &geometry_); - void extent(const Geometry &geometry_,const Color &backgroundColor); - void extent(const Geometry &geometry_,const Color &backgroundColor, - const GravityType gravity_); - void extent(const Geometry &geometry_,const GravityType gravity_); - - // Flip image (reflect each scanline in the vertical direction) - void flip(void); - - // Floodfill pixels matching color (within fuzz factor) of target - // pixel(x,y) with replacement alpha value. - void floodFillAlpha(const ::ssize_t x_,const ::ssize_t y_, - const unsigned int alpha_,const bool invert_=false); - - // Floodfill designated area with replacement alpha value - void floodFillAlpha(const ssize_t x_,const ssize_t y_, - const unsigned int alpha_,const Color &target_,const bool invert_=false); - - // Flood-fill color across pixels that match the color of the - // target pixel and are neighbors of the target pixel. - // Uses current fuzz setting when determining color match. - void floodFillColor(const Geometry &point_,const Color &fillColor_, - const bool invert_=false); - void floodFillColor(const ::ssize_t x_,const ::ssize_t y_, - const Color &fillColor_,const bool invert_=false); - - // Flood-fill color across pixels starting at target-pixel and - // stopping at pixels matching specified border color. - // Uses current fuzz setting when determining color match. - void floodFillColor(const Geometry &point_,const Color &fillColor_, - const Color &borderColor_,const bool invert_=false); - void floodFillColor(const ::ssize_t x_,const ::ssize_t y_, - const Color &fillColor_,const Color &borderColor_, - const bool invert_=false); - - // Flood-fill texture across pixels that match the color of the - // target pixel and are neighbors of the target pixel. - // Uses current fuzz setting when determining color match. - void floodFillTexture(const Geometry &point_,const Image &texture_, - const bool invert_=false); - void floodFillTexture(const ::ssize_t x_,const ::ssize_t y_, - const Image &texture_,const bool invert_=false); - - // Flood-fill texture across pixels starting at target-pixel and - // stopping at pixels matching specified border color. - // Uses current fuzz setting when determining color match. - void floodFillTexture(const Geometry &point_,const Image &texture_, - const Color &borderColor_,const bool invert_=false); - void floodFillTexture(const ::ssize_t x_,const ::ssize_t y_, - const Image &texture_,const Color &borderColor_, - const bool invert_=false); - - // Flop image (reflect each scanline in the horizontal direction) - void flop(void); - - // Obtain font metrics for text string given current font, - // pointsize, and density settings. - void fontTypeMetrics(const std::string &text_,TypeMetric *metrics); - - // Obtain multi line font metrics for text string given current font, - // pointsize, and density settings. - void fontTypeMetricsMultiline(const std::string &text_, - TypeMetric *metrics); - - // Frame image - void frame(const Geometry &geometry_=frameGeometryDefault); - void frame(const size_t width_,const size_t height_, - const ::ssize_t innerBevel_=6,const ::ssize_t outerBevel_=6); - - // Applies a mathematical expression to the image. - void fx(const std::string expression_); - void fx(const std::string expression_,const Magick::ChannelType channel_); - - // Gamma correct image - void gamma(const double gamma_); - void gamma(const double gammaRed_,const double gammaGreen_, - const double gammaBlue_); - - // Gaussian blur image - // The number of neighbor pixels to be included in the convolution - // mask is specified by 'radius_'. The standard deviation of the - // gaussian bell curve is specified by 'sigma_'. - void gaussianBlur(const double radius_,const double sigma_); - void gaussianBlurChannel(const ChannelType channel_,const double radius_, - const double sigma_); - - // Transfers read-only pixels from the image to the pixel cache as - // defined by the specified region - const Quantum *getConstPixels(const ::ssize_t x_, const ::ssize_t y_, - const size_t columns_,const size_t rows_) const; - - // Obtain immutable image pixel metacontent (valid for PseudoClass images) - const void *getConstMetacontent(void) const; - - // Obtain mutable image pixel metacontent (valid for PseudoClass images) - void *getMetacontent(void); - - // Transfers pixels from the image to the pixel cache as defined - // by the specified region. Modified pixels may be subsequently - // transferred back to the image via syncPixels. This method is - // valid for DirectClass images. - Quantum *getPixels(const ::ssize_t x_,const ::ssize_t y_, - const size_t columns_,const size_t rows_); - - // Converts the colors in the image to gray. - void grayscale(const PixelIntensityMethod method_); - - // Apply a color lookup table (Hald CLUT) to the image. - void haldClut(const Image &clutImage_); - - // Identifies lines in the image. - void houghLine(const size_t width_,const size_t height_, - const size_t threshold_=40); - - // Identifies the potential color type of the image. This method can be - // used to detect if the type can be changed to GrayScale. - ImageType identifyType(void) const; - - // Implode image (special effect) - void implode(const double factor_); - - // Implements the inverse discrete Fourier transform (DFT) of the image - // either as a magnitude / phase or real / imaginary image pair. - void inverseFourierTransform(const Image &phase_); - void inverseFourierTransform(const Image &phase_,const bool magnitude_); - - // An edge preserving noise reduction filter. - void kuwahara(const double radius_=0.0,const double sigma_=1.0); - void kuwaharaChannel(const ChannelType channel_,const double radius_=0.0, - const double sigma_=1.0); - - // Level image. Adjust the levels of the image by scaling the - // colors falling between specified white and black points to the - // full available quantum range. The parameters provided represent - // the black, mid (gamma), and white points. The black point - // specifies the darkest color in the image. Colors darker than - // the black point are set to zero. Mid point (gamma) specifies a - // gamma correction to apply to the image. White point specifies - // the lightest color in the image. Colors brighter than the - // white point are set to the maximum quantum value. The black and - // white point have the valid range 0 to QuantumRange while mid (gamma) - // has a useful range of 0 to ten. - void level(const double blackPoint_,const double whitePoint_, - const double gamma_=1.0); - void levelChannel(const ChannelType channel_,const double blackPoint_, - const double whitePoint_,const double gamma_=1.0); - - // Maps the given color to "black" and "white" values, linearly spreading - // out the colors, and level values on a channel by channel bases, as - // per level(). The given colors allows you to specify different level - // ranges for each of the color channels separately. - void levelColors(const Color &blackColor_,const Color &whiteColor_, - const bool invert_=true); - void levelColorsChannel(const ChannelType channel_, - const Color &blackColor_,const Color &whiteColor_, - const bool invert_=true); - - // Levelize applies the reversed level operation to just the specific - // channels specified.It compresses the full range of color values, so - // that they lie between the given black and white points. Gamma is - // applied before the values are mapped. - void levelize(const double blackPoint_,const double whitePoint_, - const double gamma_=1.0); - void levelizeChannel(const ChannelType channel_,const double blackPoint_, - const double whitePoint_,const double gamma_=1.0); - - // Discards any pixels below the black point and above the white point and - // levels the remaining pixels. - void linearStretch(const double blackPoint_,const double whitePoint_); - - // Rescales image with seam carving. - void liquidRescale(const Geometry &geometry_); - - // Local contrast enhancement - void localContrast(const double radius_,const double strength_); - void localContrastChannel(const ChannelType channel_,const double radius_, - const double strength_); - - // Magnify image by integral size - void magnify(void); - - // Remap image colors with closest color from reference image - void map(const Image &mapImage_,const bool dither_=false); - - // Delineate arbitrarily shaped clusters in the image. - void meanShift(const size_t width_,const size_t height_, - const double color_distance_); - - // Filter image by replacing each pixel component with the median - // color in a circular neighborhood - void medianFilter(const double radius_=0.0); - - // Reduce image by integral size - void minify(void); - - // Modulate percent hue, saturation, and brightness of an image - void modulate(const double brightness_,const double saturation_, - const double hue_); - - // Returns the normalized moments of one or more image channels. - ImageMoments moments(void) const; - - // Applies a kernel to the image according to the given mophology method. - void morphology(const MorphologyMethod method_,const std::string kernel_, - const ssize_t iterations_=1); - void morphology(const MorphologyMethod method_, - const KernelInfoType kernel_,const std::string arguments_, - const ssize_t iterations_=1); - void morphologyChannel(const ChannelType channel_, - const MorphologyMethod method_,const std::string kernel_, - const ssize_t iterations_=1); - void morphologyChannel(const ChannelType channel_, - const MorphologyMethod method_,const KernelInfoType kernel_, - const std::string arguments_,const ssize_t iterations_=1); - - // Motion blur image with specified blur factor - // The radius_ parameter specifies the radius of the Gaussian, in - // pixels, not counting the center pixel. The sigma_ parameter - // specifies the standard deviation of the Laplacian, in pixels. - // The angle_ parameter specifies the angle the object appears - // to be comming from (zero degrees is from the right). - void motionBlur(const double radius_,const double sigma_, - const double angle_); - - // Negate colors in image. Set grayscale to only negate grayscale - // values in image. - void negate(const bool grayscale_=false); - void negateChannel(const ChannelType channel_,const bool grayscale_=false); - - // Normalize image (increase contrast by normalizing the pixel - // values to span the full range of color values) - void normalize(void); - - // Oilpaint image (image looks like oil painting) - void oilPaint(const double radius_=0.0,const double sigma=1.0); - - // Change color of opaque pixel to specified pen color. - void opaque(const Color &opaqueColor_,const Color &penColor_, - const bool invert_=false); - - // Perform a ordered dither based on a number of pre-defined dithering - // threshold maps, but over multiple intensity levels. - void orderedDither(std::string thresholdMap_); - void orderedDitherChannel(const ChannelType channel_, - std::string thresholdMap_); - - // Set each pixel whose value is less than epsilon to epsilon or - // -epsilon (whichever is closer) otherwise the pixel value remains - // unchanged. - void perceptible(const double epsilon_); - void perceptibleChannel(const ChannelType channel_,const double epsilon_); - - // Returns the perceptual hash for this image. - Magick::ImagePerceptualHash perceptualHash() const; - - // Ping is similar to read except only enough of the image is read - // to determine the image columns, rows, and filesize. Access the - // columns(), rows(), and fileSize() attributes after invoking - // ping. The image data is not valid after calling ping. - void ping(const std::string &imageSpec_); - - // Ping is similar to read except only enough of the image is read - // to determine the image columns, rows, and filesize. Access the - // columns(), rows(), and fileSize() attributes after invoking - // ping. The image data is not valid after calling ping. - void ping(const Blob &blob_); - - // Get/set pixel color at location x & y. - void pixelColor(const ::ssize_t x_,const ::ssize_t y_,const Color &color_); - Color pixelColor(const ::ssize_t x_,const ::ssize_t y_ ) const; - - // Simulates a Polaroid picture. - void polaroid(const std::string &caption_,const double angle_, - const PixelInterpolateMethod method_); - - // Reduces the image to a limited number of colors for a "poster" effect. - void posterize(const size_t levels_,const DitherMethod method_); - void posterizeChannel(const ChannelType channel_,const size_t levels_, - const DitherMethod method_); - - // Execute a named process module using an argc/argv syntax similar to - // that accepted by a C 'main' routine. An exception is thrown if the - // requested process module doesn't exist, fails to load, or fails during - // execution. - void process(std::string name_,const ::ssize_t argc_,const char **argv_); - - // Add or remove a named profile to/from the image. Remove the - // profile by passing an empty Blob (e.g. Blob()). Valid names are - // "*", "8BIM", "ICM", "IPTC", or a user/format-defined profile name. - void profile(const std::string name_,const Blob &colorProfile_); - - // Retrieve a named profile from the image. Valid names are: - // "8BIM", "8BIMTEXT", "APP1", "APP1JPEG", "ICC", "ICM", & "IPTC" - // or an existing user/format-defined profile name. - Blob profile(const std::string name_) const; - - // Quantize image (reduce number of colors) - void quantize(const bool measureError_=false); - - // Raise image (lighten or darken the edges of an image to give a - // 3-D raised or lowered effect) - void raise(const Geometry &geometry_=raiseGeometryDefault, - const bool raisedFlag_=false); - - // Random threshold image. - // - // Changes the value of individual pixels based on the intensity - // of each pixel compared to a random threshold. The result is a - // low-contrast, two color image. - void randomThreshold(const double low_,const double high_); - void randomThresholdChannel(const ChannelType channel_,const double low_, - const double high_); - - // Read single image frame from in-memory BLOB - void read(const Blob &blob_); - - // Read single image frame of specified size from in-memory BLOB - void read(const Blob &blob_,const Geometry &size_); - - // Read single image frame of specified size and depth from - // in-memory BLOB - void read(const Blob &blob_,const Geometry &size_,const size_t depth_); - - // Read single image frame of specified size, depth, and format - // from in-memory BLOB - void read(const Blob &blob_,const Geometry &size_,const size_t depth_, - const std::string &magick_); - - // Read single image frame of specified size, and format from - // in-memory BLOB - void read(const Blob &blob_,const Geometry &size_, - const std::string &magick_); - - // Read single image frame of specified size into current object - void read(const Geometry &size_,const std::string &imageSpec_); - - // Read single image frame from an array of raw pixels, with - // specified storage type (ConstituteImage), e.g. - // image.read( 640, 480, "RGB", 0, pixels ); - void read(const size_t width_,const size_t height_,const std::string &map_, - const StorageType type_,const void *pixels_); - - // Read single image frame into current object - void read(const std::string &imageSpec_); - - // Associate a mask with the image. The mask must be the same dimensions - // as the image. Pass an invalid image to unset an existing mask. - void readMask(const Image &mask_); - Image readMask(void) const; - - // Transfers one or more pixel components from a buffer or file - // into the image pixel cache of an image. - // Used to support image decoders. - void readPixels(const QuantumType quantum_,const unsigned char *source_); - - // Reduce noise in image using a noise peak elimination filter - void reduceNoise(void); - void reduceNoise(const size_t order_); - - // Resets the image page canvas and position. - void repage(); - - // Resize image in terms of its pixel size. - void resample(const Point &density_); - - // Resize image to specified size. - void resize(const Geometry &geometry_); - - // Roll image (rolls image vertically and horizontally) by specified - // number of columnms and rows) - void roll(const Geometry &roll_); - void roll(const size_t columns_,const size_t rows_); - - // Rotate image clockwise by specified number of degrees. Specify a - // negative number for degrees to rotate counter-clockwise. - void rotate(const double degrees_); - - // Rotational blur image. - void rotationalBlur(const double angle_); - void rotationalBlurChannel(const ChannelType channel_,const double angle_); - - // Resize image by using pixel sampling algorithm - void sample(const Geometry &geometry_); - - // Resize image by using simple ratio algorithm - void scale(const Geometry &geometry_); - - // Segment (coalesce similar image components) by analyzing the - // histograms of the color components and identifying units that - // are homogeneous with the fuzzy c-means technique. Also uses - // QuantizeColorSpace and Verbose image attributes - void segment(const double clusterThreshold_=1.0, - const double smoothingThreshold_=1.5); - - // Selectively blur pixels within a contrast threshold. It is similar to - // the unsharpen mask that sharpens everything with contrast above a - // certain threshold. - void selectiveBlur(const double radius_,const double sigma_, - const double threshold_); - void selectiveBlurChannel(const ChannelType channel_,const double radius_, - const double sigma_,const double threshold_); - - // Separates a channel from the image and returns it as a grayscale image. - Image separate(const ChannelType channel_) const; - - // Applies a special effect to the image, similar to the effect achieved in - // a photo darkroom by sepia toning. Threshold ranges from 0 to - // QuantumRange and is a measure of the extent of the sepia toning. - // A threshold of 80% is a good starting point for a reasonable tone. - void sepiaTone(const double threshold_); - - // Sets meanErrorPerPixel, normalizedMaxError, and normalizedMeanError - // in the current image. False is returned if the images are not identical. - bool setColorMetric(const Image &reference_); - - // Allocates a pixel cache region to store image pixels as defined - // by the region rectangle. This area is subsequently transferred - // from the pixel cache to the image via syncPixels. - Quantum *setPixels(const ::ssize_t x_, const ::ssize_t y_, - const size_t columns_,const size_t rows_); - - // Shade image using distant light source - void shade(const double azimuth_=30,const double elevation_=30, - const bool colorShading_=false); - - // Simulate an image shadow - void shadow(const double percentAlpha_=80.0,const double sigma_=0.5, - const ssize_t x_=5,const ssize_t y_=5); - - // Sharpen pixels in image - // The radius_ parameter specifies the radius of the Gaussian, in - // pixels, not counting the center pixel. The sigma_ parameter - // specifies the standard deviation of the Laplacian, in pixels. - void sharpen(const double radius_=0.0,const double sigma_=1.0); - void sharpenChannel(const ChannelType channel_,const double radius_=0.0, - const double sigma_=1.0); - - // Shave pixels from image edges. - void shave(const Geometry &geometry_); - - // Shear image (create parallelogram by sliding image by X or Y axis) - void shear(const double xShearAngle_,const double yShearAngle_); - - // adjust the image contrast with a non-linear sigmoidal contrast algorithm - void sigmoidalContrast(const bool sharpen_,const double contrast, - const double midpoint=QuantumRange/2.0); - - // Image signature. Set force_ to true in order to re-calculate - // the signature regardless of whether the image data has been - // modified. - std::string signature(const bool force_=false) const; - - // Simulates a pencil sketch. We convolve the image with a Gaussian - // operator of the given radius and standard deviation (sigma). For - // reasonable results, radius should be larger than sigma. Use a - // radius of 0 and SketchImage() selects a suitable radius for you. - void sketch(const double radius_=0.0,const double sigma_=1.0, - const double angle_=0.0); - - // Solarize image (similar to effect seen when exposing a - // photographic film to light during the development process) - void solarize(const double factor_=50.0); - - // Sparse color image, given a set of coordinates, interpolates the colors - // found at those coordinates, across the whole image, using various - // methods. - void sparseColor(const ChannelType channel_, - const SparseColorMethod method_,const size_t numberArguments_, - const double *arguments_); - - // Splice the background color into the image. - void splice(const Geometry &geometry_); - void splice(const Geometry &geometry_,const Color &backgroundColor_); - void splice(const Geometry &geometry_,const Color &backgroundColor_, - const GravityType gravity_); - - // Spread pixels randomly within image by specified ammount - void spread(const double amount_=3.0); - - // Returns the statistics for this image. - Magick::ImageStatistics statistics() const; - - // Add a digital watermark to the image (based on second image) - void stegano(const Image &watermark_); - - // Create an image which appears in stereo when viewed with - // red-blue glasses (Red image on left, blue on right) - void stereo(const Image &rightImage_); - - // Strip strips an image of all profiles and comments. - void strip(void); - - // Search for the specified image at EVERY possible location in this image. - // This is slow! very very slow.. It returns a similarity image such that - // an exact match location is completely white and if none of the pixels - // match, black, otherwise some gray level in-between. - Image subImageSearch(const Image &reference_,const MetricType metric_, - Geometry *offset_,double *similarityMetric_, - const double similarityThreshold=(-1.0)); - - // Swirl image (image pixels are rotated by degrees) - void swirl(const double degrees_); - - // Transfers the image cache pixels to the image. - void syncPixels(void); - - // Channel a texture on image background - void texture(const Image &texture_); - - // Threshold image - void threshold(const double threshold_); - - // Resize image to thumbnail size - void thumbnail(const Geometry &geometry_); - - // Applies a color vector to each pixel in the image. The length of the - // vector is 0 for black and white and at its maximum for the midtones. - // The vector weighting function is f(x)=(1-(4.0*((x-0.5)*(x-0.5)))) - void tint(const std::string opacity_); - - // Origin of coordinate system to use when annotating with text or drawing - void transformOrigin(const double x_,const double y_); - - // Reset transformation parameters to default - void transformReset(void); - - // Scale to use when annotating with text or drawing - void transformScale(const double sx_,const double sy_); - - // Add matte image to image, setting pixels matching color to - // transparent - void transparent(const Color &color_,const bool inverse_=false); - - // Add matte image to image, for all the pixels that lies in between - // the given two color - void transparentChroma(const Color &colorLow_,const Color &colorHigh_); - - // Creates a horizontal mirror image by reflecting the pixels around the - // central y-axis while rotating them by 90 degrees. - void transpose(void); - - // Creates a vertical mirror image by reflecting the pixels around the - // central x-axis while rotating them by 270 degrees. - void transverse(void); - - // Trim edges that are the background color from the image - void trim(void); - - // Returns the unique colors of an image. - Image uniqueColors(void) const; - - // Replace image with a sharpened version of the original image - // using the unsharp mask algorithm. - // radius_ - // the radius of the Gaussian, in pixels, not counting the - // center pixel. - // sigma_ - // the standard deviation of the Gaussian, in pixels. - // amount_ - // the percentage of the difference between the original and - // the blur image that is added back into the original. - // threshold_ - // the threshold in pixels needed to apply the diffence amount. - void unsharpmask(const double radius_,const double sigma_, - const double amount_,const double threshold_); - void unsharpmaskChannel(const ChannelType channel_,const double radius_, - const double sigma_,const double amount_,const double threshold_); - - // Softens the edges of the image in vignette style. - void vignette(const double radius_=0.0,const double sigma_=1.0, - const ssize_t x_=0,const ssize_t y_=0); - - // Map image pixels to a sine wave - void wave(const double amplitude_=25.0,const double wavelength_=150.0); - - // Removes noise from the image using a wavelet transform. - void waveletDenoise(const double threshold_,const double softness_); - - // Forces all pixels above the threshold into white while leaving all - // pixels at or below the threshold unchanged. - void whiteThreshold(const std::string &threshold_); - void whiteThresholdChannel(const ChannelType channel_, - const std::string &threshold_); - - // Write single image frame to in-memory BLOB, with optional - // format and adjoin parameters. - void write(Blob *blob_); - void write(Blob *blob_,const std::string &magick_); - void write(Blob *blob_,const std::string &magick_,const size_t depth_); - - // Write single image frame to an array of pixels with storage - // type specified by user (DispatchImage), e.g. - // image.write( 0, 0, 640, 1, "RGB", 0, pixels ); - void write(const ::ssize_t x_,const ::ssize_t y_,const size_t columns_, - const size_t rows_,const std::string &map_,const StorageType type_, - void *pixels_); - - // Write single image frame to a file - void write(const std::string &imageSpec_); - - // Associate a mask with the image. The mask must be the same dimensions - // as the image. Pass an invalid image to unset an existing mask. - void writeMask(const Image &mask_); - Image writeMask(void) const; - - // Transfers one or more pixel components from the image pixel - // cache to a buffer or file. - // Used to support image encoders. - void writePixels(const QuantumType quantum_,unsigned char *destination_); - - // Zoom image to specified size. - void zoom(const Geometry &geometry_); - - ////////////////////////////////////////////////////////////////////// - // - // No user-serviceable parts beyond this point - // - ////////////////////////////////////////////////////////////////////// - - // Construct with MagickCore::Image and default options - Image(MagickCore::Image *image_); - - // Retrieve Image* - MagickCore::Image *&image(void); - const MagickCore::Image *constImage(void) const; - - // Retrieve ImageInfo* - MagickCore::ImageInfo *imageInfo(void); - const MagickCore::ImageInfo *constImageInfo(void) const; - - // Retrieve Options* - Options *options(void); - const Options *constOptions(void) const; - - // Retrieve QuantizeInfo* - MagickCore::QuantizeInfo *quantizeInfo(void); - const MagickCore::QuantizeInfo *constQuantizeInfo(void) const; - - // Prepare to update image (copy if reference > 1) - void modifyImage(void); - - // Replace current image (reference counted) - MagickCore::Image *replaceImage(MagickCore::Image *replacement_); - - private: - - void floodFill(const ssize_t x_,const ssize_t y_, - const Magick::Image *fillPattern_,const Color &fill_, - const PixelInfo *target,const bool invert_); - - void mask(const Image &mask_,const PixelMask); - Image mask(const PixelMask) const; - - void read(MagickCore::Image *image, - MagickCore::ExceptionInfo *exceptionInfo); - - ImageRef *_imgRef; - }; - -} // end of namespace Magick - -#endif // Magick_Image_header diff --git a/Magick++/lib/Magick++/ImageRef.h b/Magick++/lib/Magick++/ImageRef.h deleted file mode 100644 index 8868b7d54..000000000 --- a/Magick++/lib/Magick++/ImageRef.h +++ /dev/null @@ -1,83 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002 -// Copyright Dirk Lemstra 2014-2015 -// -// Definition of an Image reference -// -// This is a private implementation class which should never be -// referenced by any user code. -// - -#if !defined(Magick_ImageRef_header) -#define Magick_ImageRef_header - -#include -#include "Magick++/Include.h" -#include "Magick++/Thread.h" - -namespace Magick -{ - class Options; - - // - // Reference counted access to Image * - // - class MagickPPExport ImageRef - { - public: - - // Construct with null image and default options - ImageRef(void); - - // Construct with an image pointer and default options - ImageRef(MagickCore::Image *image_); - - // Destroy image and options - ~ImageRef(void); - - // Decreases reference count and return the new count - size_t decrease(); - - // Retrieve image from reference - MagickCore::Image *&image(void); - - // Increases reference count - void increase(); - - // Returns true if the reference count is more than one - bool isShared(); - - // Retrieve Options from reference - void options(Options *options_); - Options *options(void); - - // Tries to replaces the images with the specified image, returns - // a new instance when the current image is shared. - static ImageRef *replaceImage(ImageRef *imgRef, - MagickCore::Image *replacement_); - - // Image signature. Set force_ to true in order to re-calculate - // the signature regardless of whether the image data has been - // modified. - std::string signature(const bool force_=false); - - private: - - // Construct with an image pointer and options - ImageRef(MagickCore::Image *image_,const Options *options_); - - // Copy constructor and assignment are not supported - ImageRef(const ImageRef&); - - ImageRef& operator=(const ImageRef&); - - MagickCore::Image *_image; // ImageMagick Image - MutexLock _mutexLock; // Mutex lock - Options *_options; // User-specified options - ::ssize_t _refCount; // Reference count - }; - -} // end of namespace Magick - -#endif // Magick_ImageRef_header \ No newline at end of file diff --git a/Magick++/lib/Magick++/Include.h b/Magick++/lib/Magick++/Include.h deleted file mode 100644 index f11316882..000000000 --- a/Magick++/lib/Magick++/Include.h +++ /dev/null @@ -1,1575 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002 -// Copyright Dirk Lemstra 2013-2017 -// -// Inclusion of ImageMagick headers (with namespace magic) - -#ifndef Magick_Include_header -#define Magick_Include_header - -#if !defined(_MAGICK_CONFIG_H) -# define _MAGICK_CONFIG_H -# if !defined(vms) && !defined(macintosh) -# include "MagickCore/magick-config.h" -# else -# include "magick-config.h" -# endif -# undef inline // Remove possible definition from config.h -# undef class -#endif - -// Needed for stdio FILE -#include -#include -#include -#include -#include -#include - -#include -#include - -#if defined(__BORLANDC__) -# include /* Borland C++ Builder 4.0 requirement */ -#endif // defined(__BORLANDC__) - -// -// Include ImageMagick headers into namespace "MagickCore". If -// MAGICKCORE_IMPLEMENTATION is defined, include ImageMagick development -// headers. This scheme minimizes the possibility of conflict with -// user code. -// -namespace MagickCore -{ -#include -#include -#undef inline // Remove possible definition from config.h - -#undef class -} - -// -// Provide appropriate DLL imports/exports for Visual C++, -// Borland C++Builder and MinGW builds. -// -#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__) -# define MagickCplusPlusDLLSupported -#endif -#if defined(MagickCplusPlusDLLSupported) -# if defined(_MT) && defined(_DLL) && !defined(_LIB) && !defined(STATIC_MAGICK) -// -// In a native Windows build, the following defines are used: -// -// _MT = Multithreaded -// _DLL = Using code is part of a DLL -// _LIB = Using code is being built as a library. -// _MAGICKMOD_ = Build uses loadable modules (Magick++ does not care about this) -// -// In the case where ImageMagick is built as a static library but the -// using code is dynamic, STATIC_MAGICK may be defined in the project to -// override triggering dynamic library behavior. -// -# if defined(_VISUALC_) -# define MagickDLLExplicitTemplate -# pragma warning( disable: 4275 ) -# pragma warning( disable: 4273 ) /* Disable the stupid dll linkage warnings */ -# pragma warning( disable: 4251 ) -# endif -# if !defined(MAGICKCORE_IMPLEMENTATION) -# if defined(__GNUC__) -# define MagickPPExport __attribute__ ((dllimport)) -# else -# define MagickPPExport __declspec(dllimport) -# endif -# define MagickPPPrivate extern __declspec(dllimport) -# else -# if defined(__BORLANDC__) || defined(__MINGW32__) -# define MagickPPExport __declspec(dllexport) -# define MagickPPPrivate __declspec(dllexport) -# else -# if defined(__GNUC__) -# define MagickPPExport __attribute__ ((dllexport)) -# else -# define MagickPPExport __declspec(dllexport) -# endif -# define MagickPPPrivate extern __declspec(dllexport) -# endif -# endif -# else -# define MagickPPExport -# define MagickPPPrivate -# if defined(_MSC_VER) && defined(STATIC_MAGICK) && !defined(NOAUTOLINK_MAGICK) -# if defined(_DEBUG) -# if defined(MAGICKCORE_BZLIB_DELEGATE) -# pragma comment(lib, "CORE_DB_bzlib_.lib") -# endif -# if defined(MAGICKCORE_CAIRO_DELEGATE) -# pragma comment(lib, "CORE_DB_cairo_.lib") -# endif -# if defined(MAGICKCORE_OPENEXR_DELEGATE) -# pragma comment(lib, "CORE_DB_exr_.lib") -# endif -# if defined(MAGICKCORE_FLIF_DELEGATE) -# pragma comment(lib, "CORE_DB_flif_.lib") -# endif -# if defined(MAGICKCORE_FREETYPE_DELEGATE) -# pragma comment(lib, "CORE_DB_freetype_.lib") -# endif -# if defined(MAGICKCORE_JBIG_DELEGATE) -# pragma comment(lib, "CORE_DB_jbig_.lib") -# endif -# if defined(MAGICKCORE_JP2_DELEGATE) -# pragma comment(lib, "CORE_DB_jp2_.lib") -# endif -# if defined(MAGICKCORE_JPEG_DELEGATE) -# pragma comment(lib, "CORE_DB_jpeg-turbo_.lib") -# endif -# if defined(MAGICKCORE_JXL_DELEGATE) -# pragma comment(lib, "CORE_DB_highway_.lib") -# pragma comment(lib, "CORE_DB_brotli_.lib") -# pragma comment(lib, "CORE_DB_jpeg-xl_.lib") -# endif -# if defined(MAGICKCORE_LCMS_DELEGATE) -# pragma comment(lib, "CORE_DB_lcms_.lib") -# endif -# if defined(MAGICKCORE_HEIC_DELEGATE) -# pragma comment(lib, "CORE_DB_aom_.lib") -# pragma comment(lib, "CORE_DB_libde265_.lib") -# pragma comment(lib, "CORE_DB_libheif_.lib") -# endif -# if defined(MAGICKCORE_LZMA_DELEGATE) -# pragma comment(lib, "CORE_DB_liblzma_.lib") -# endif -# if defined(MAGICKCORE_RAW_R_DELEGATE) -# pragma comment(lib, "CORE_DB_libraw_.lib") -# endif -# if defined(MAGICKCORE_RSVG_DELEGATE) -# pragma comment(lib, "CORE_DB_croco_.lib") -# pragma comment(lib, "CORE_DB_librsvg_.lib") -# endif -# if defined(MAGICKCORE_XML_DELEGATE) -# pragma comment(lib, "CORE_DB_libxml_.lib") -# endif -# if defined(MAGICKCORE_ZIP_DELEGATE) -# pragma comment(lib, "CORE_DB_libzip_.lib") -# endif -# if defined(MAGICKCORE_LQR_DELEGATE) -# pragma comment(lib, "CORE_DB_ffi_.lib") -# pragma comment(lib, "CORE_DB_glib_.lib") -# pragma comment(lib, "CORE_DB_lqr_.lib") -# pragma comment(lib, "winmm.lib") -# endif -# if defined(MAGICKCORE_LIBOPENJP2_DELEGATE) -# pragma comment(lib, "CORE_DB_openjpeg_.lib") -# endif -# if defined(MAGICKCORE_PANGOCAIRO_DELEGATE) -# pragma comment(lib, "CORE_DB_fribidi_.lib") -# pragma comment(lib, "CORE_DB_harfbuzz_.lib") -# pragma comment(lib, "CORE_DB_pango_.lib") -# pragma comment(lib, "CORE_DB_pixman_.lib") -# endif -# if defined(MAGICKCORE_PNG_DELEGATE) -# pragma comment(lib, "CORE_DB_png_.lib") -# endif -# if defined(MAGICKCORE_TIFF_DELEGATE) -# pragma comment(lib, "CORE_DB_tiff_.lib") -# endif -# if defined(MAGICKCORE_WEBP_DELEGATE) -# pragma comment(lib, "CORE_DB_webp_.lib") -# endif -# if defined(MAGICKCORE_ZLIB_DELEGATE) -# pragma comment(lib, "CORE_DB_zlib_.lib") -# endif -# pragma comment(lib, "CORE_DB_coders_.lib") -# pragma comment(lib, "CORE_DB_filters_.lib") -# pragma comment(lib, "CORE_DB_Magick++_.lib") -# pragma comment(lib, "CORE_DB_MagickCore_.lib") -# pragma comment(lib, "CORE_DB_MagickWand_.lib") -# else -# if defined(MAGICKCORE_BZLIB_DELEGATE) -# pragma comment(lib, "CORE_RL_bzlib_.lib") -# endif -# if defined(MAGICKCORE_CAIRO_DELEGATE) -# pragma comment(lib, "CORE_RL_cairo_.lib") -# endif -# if defined(MAGICKCORE_OPENEXR_DELEGATE) -# pragma comment(lib, "CORE_RL_exr_.lib") -# endif -# if defined(MAGICKCORE_FLIF_DELEGATE) -# pragma comment(lib, "CORE_RL_flif_.lib") -# endif -# if defined(MAGICKCORE_FREETYPE_DELEGATE) -# pragma comment(lib, "CORE_RL_freetype_.lib") -# endif -# if defined(MAGICKCORE_JBIG_DELEGATE) -# pragma comment(lib, "CORE_RL_jbig_.lib") -# endif -# if defined(MAGICKCORE_JP2_DELEGATE) -# pragma comment(lib, "CORE_RL_jp2_.lib") -# endif -# if defined(MAGICKCORE_JPEG_DELEGATE) -# pragma comment(lib, "CORE_RL_jpeg-turbo_.lib") -# endif -# if defined(MAGICKCORE_JXL_DELEGATE) -# pragma comment(lib, "CORE_RL_highway_.lib") -# pragma comment(lib, "CORE_RL_brotli_.lib") -# pragma comment(lib, "CORE_RL_jpeg-xl_.lib") -# endif -# if defined(MAGICKCORE_LCMS_DELEGATE) -# pragma comment(lib, "CORE_RL_lcms_.lib") -# endif -# if defined(MAGICKCORE_HEIC_DELEGATE) -# pragma comment(lib, "CORE_RL_aom_.lib") -# pragma comment(lib, "CORE_RL_libde265_.lib") -# pragma comment(lib, "CORE_RL_libheif_.lib") -# endif -# if defined(MAGICKCORE_LZMA_DELEGATE) -# pragma comment(lib, "CORE_RL_liblzma_.lib") -# endif -# if defined(MAGICKCORE_RAW_R_DELEGATE) -# pragma comment(lib, "CORE_RL_libraw_.lib") -# endif -# if defined(MAGICKCORE_RSVG_DELEGATE) -# pragma comment(lib, "CORE_RL_croco_.lib") -# pragma comment(lib, "CORE_RL_librsvg_.lib") -# endif -# if defined(MAGICKCORE_XML_DELEGATE) -# pragma comment(lib, "CORE_RL_libxml_.lib") -# endif -# if defined(MAGICKCORE_ZIP_DELEGATE) -# pragma comment(lib, "CORE_RL_libzip_.lib") -# endif -# if defined(MAGICKCORE_LQR_DELEGATE) -# pragma comment(lib, "CORE_RL_ffi_.lib") -# pragma comment(lib, "CORE_RL_glib_.lib") -# pragma comment(lib, "CORE_RL_lqr_.lib") -# pragma comment(lib, "winmm.lib") -# endif -# if defined(MAGICKCORE_LIBOPENJP2_DELEGATE) -# pragma comment(lib, "CORE_RL_openjpeg_.lib") -# endif -# if defined(MAGICKCORE_PANGOCAIRO_DELEGATE) -# pragma comment(lib, "CORE_RL_fribidi_.lib") -# pragma comment(lib, "CORE_RL_harfbuzz_.lib") -# pragma comment(lib, "CORE_RL_pango_.lib") -# pragma comment(lib, "CORE_RL_pixman_.lib") -# endif -# if defined(MAGICKCORE_PNG_DELEGATE) -# pragma comment(lib, "CORE_RL_png_.lib") -# endif -# if defined(MAGICKCORE_TIFF_DELEGATE) -# pragma comment(lib, "CORE_RL_tiff_.lib") -# endif -# if defined(MAGICKCORE_WEBP_DELEGATE) -# pragma comment(lib, "CORE_RL_webp_.lib") -# endif -# if defined(MAGICKCORE_ZLIB_DELEGATE) -# pragma comment(lib, "CORE_RL_zlib_.lib") -# endif -# pragma comment(lib, "CORE_RL_coders_.lib") -# pragma comment(lib, "CORE_RL_filters_.lib") -# pragma comment(lib, "CORE_RL_Magick++_.lib") -# pragma comment(lib, "CORE_RL_MagickCore_.lib") -# pragma comment(lib, "CORE_RL_MagickWand_.lib") -# endif -# if defined(_WIN32_WCE) -# pragma comment(lib, "wsock32.lib") -# else -# pragma comment(lib, "ws2_32.lib") -# endif -# pragma comment(lib, "urlmon.lib") -# endif -# endif -#else -# if __GNUC__ >= 4 -# define MagickPPExport __attribute__ ((visibility ("default"))) -# define MagickPPPrivate __attribute__ ((visibility ("hidden"))) -# else -# define MagickPPExport -# define MagickPPPrivate -# endif -#endif - -#if (defined(WIN32) || defined(WIN64)) && defined(_VISUALC_) -# pragma warning(disable : 4996) /* function deprecation warnings */ -#endif - -// -// Import ImageMagick symbols and types which are used as part of the -// Magick++ API definition into namespace "Magick". -// -namespace Magick -{ - // The datatype for an RGB component - using MagickCore::Quantum; - using MagickCore::MagickRealType; - using MagickCore::MagickSizeType; - using MagickCore::MagickStatusType; - - // Structures - using MagickCore::AffineMatrix; - using MagickCore::CacheView; - using MagickCore::CCObjectInfo; - using MagickCore::DrawInfo; - using MagickCore::DrawingWand; - using MagickCore::ExceptionInfo; - using MagickCore::FrameInfo; - using MagickCore::ImageInfo; - using MagickCore::KernelInfo; - using MagickCore::LinkedListInfo; - using MagickCore::MagickInfo; - using MagickCore::MagickWand; - using MagickCore::MontageInfo; - using MagickCore::OffsetInfo; - using MagickCore::PixelInfo; - using MagickCore::PixelWand; - using MagickCore::PointInfo; - using MagickCore::ProfileInfo; - using MagickCore::QuantizeInfo; - using MagickCore::QuantumInfo; - using MagickCore::RectangleInfo; - using MagickCore::StringInfo; - - // Alignment types. - using MagickCore::AlignType; - using MagickCore::UndefinedAlign; - using MagickCore::LeftAlign; - using MagickCore::CenterAlign; - using MagickCore::RightAlign; - - // Alpha channel options - using MagickCore::AlphaChannelOption; - using MagickCore::UndefinedAlphaChannel; - using MagickCore::ActivateAlphaChannel; - using MagickCore::AssociateAlphaChannel; - using MagickCore::BackgroundAlphaChannel; - using MagickCore::CopyAlphaChannel; - using MagickCore::DeactivateAlphaChannel; - using MagickCore::DiscreteAlphaChannel; - using MagickCore::DisassociateAlphaChannel; - using MagickCore::ExtractAlphaChannel; - using MagickCore::OffAlphaChannel; - using MagickCore::OnAlphaChannel; - using MagickCore::OpaqueAlphaChannel; - using MagickCore::RemoveAlphaChannel; - using MagickCore::SetAlphaChannel; - using MagickCore::ShapeAlphaChannel; - using MagickCore::TransparentAlphaChannel; - - // Auto threshold methods - using MagickCore::AutoThresholdMethod; - using MagickCore::UndefinedThresholdMethod; - using MagickCore::KapurThresholdMethod; - using MagickCore::OTSUThresholdMethod; - using MagickCore::TriangleThresholdMethod; - - // Channel types - using MagickCore::ChannelType; - using MagickCore::UndefinedChannel; - using MagickCore::RedChannel; - using MagickCore::GrayChannel; - using MagickCore::CyanChannel; - using MagickCore::GreenChannel; - using MagickCore::MagentaChannel; - using MagickCore::BlueChannel; - using MagickCore::YellowChannel; - using MagickCore::BlackChannel; - using MagickCore::AlphaChannel; - using MagickCore::OpacityChannel; - using MagickCore::IndexChannel; - using MagickCore::ReadMaskChannel; - using MagickCore::WriteMaskChannel; - using MagickCore::MetaChannel; - using MagickCore::CompositeChannels; - using MagickCore::AllChannels; - using MagickCore::TrueAlphaChannel; - using MagickCore::RGBChannels; - using MagickCore::GrayChannels; - using MagickCore::SyncChannels; - using MagickCore::DefaultChannels; - - // Image class types - using MagickCore::ClassType; - using MagickCore::UndefinedClass; - using MagickCore::DirectClass; - using MagickCore::PseudoClass; - - // Clip path units - using MagickCore::ClipPathUnits; - using MagickCore::UndefinedPathUnits; - using MagickCore::UserSpace; - using MagickCore::UserSpaceOnUse; - using MagickCore::ObjectBoundingBox; - - // Color-space types - using MagickCore::ColorspaceType; - using MagickCore::UndefinedColorspace; - using MagickCore::CMYColorspace; - using MagickCore::CMYKColorspace; - using MagickCore::GRAYColorspace; - using MagickCore::HCLColorspace; - using MagickCore::HCLpColorspace; - using MagickCore::HSBColorspace; - using MagickCore::HSIColorspace; - using MagickCore::HSLColorspace; - using MagickCore::HSVColorspace; - using MagickCore::HWBColorspace; - using MagickCore::LabColorspace; - using MagickCore::LCHColorspace; - using MagickCore::LCHabColorspace; - using MagickCore::LCHuvColorspace; - using MagickCore::LogColorspace; - using MagickCore::LMSColorspace; - using MagickCore::LuvColorspace; - using MagickCore::OHTAColorspace; - using MagickCore::Rec601YCbCrColorspace; - using MagickCore::Rec709YCbCrColorspace; - using MagickCore::RGBColorspace; - using MagickCore::scRGBColorspace; - using MagickCore::sRGBColorspace; - using MagickCore::TransparentColorspace; - using MagickCore::xyYColorspace; - using MagickCore::XYZColorspace; - using MagickCore::YCbCrColorspace; - using MagickCore::YCCColorspace; - using MagickCore::YDbDrColorspace; - using MagickCore::YIQColorspace; - using MagickCore::YPbPrColorspace; - using MagickCore::YUVColorspace; - using MagickCore::LinearGRAYColorspace; - - // Command options - using MagickCore::CommandOption; - using MagickCore::MagickDirectionOptions; - using MagickCore::MagickGravityOptions; - using MagickCore::MagickKernelOptions; - using MagickCore::MagickStyleOptions; - - // Compliance types - using MagickCore::ComplianceType; - using MagickCore::AllCompliance; - - // Composition operations - using MagickCore::CompositeOperator; - using MagickCore::AlphaCompositeOp; - using MagickCore::AtopCompositeOp; - using MagickCore::BlendCompositeOp; - using MagickCore::BlurCompositeOp; - using MagickCore::BumpmapCompositeOp; - using MagickCore::ChangeMaskCompositeOp; - using MagickCore::ClearCompositeOp; - using MagickCore::ColorBurnCompositeOp; - using MagickCore::ColorDodgeCompositeOp; - using MagickCore::ColorizeCompositeOp; - using MagickCore::CopyBlackCompositeOp; - using MagickCore::CopyBlueCompositeOp; - using MagickCore::CopyCompositeOp; - using MagickCore::CopyCyanCompositeOp; - using MagickCore::CopyGreenCompositeOp; - using MagickCore::CopyMagentaCompositeOp; - using MagickCore::CopyAlphaCompositeOp; - using MagickCore::CopyRedCompositeOp; - using MagickCore::CopyYellowCompositeOp; - using MagickCore::DarkenCompositeOp; - using MagickCore::DarkenIntensityCompositeOp; - using MagickCore::DifferenceCompositeOp; - using MagickCore::DisplaceCompositeOp; - using MagickCore::DissolveCompositeOp; - using MagickCore::DistortCompositeOp; - using MagickCore::DivideDstCompositeOp; - using MagickCore::DivideSrcCompositeOp; - using MagickCore::DstAtopCompositeOp; - using MagickCore::DstCompositeOp; - using MagickCore::DstInCompositeOp; - using MagickCore::DstOutCompositeOp; - using MagickCore::DstOverCompositeOp; - using MagickCore::ExclusionCompositeOp; - using MagickCore::HardLightCompositeOp; - using MagickCore::HardMixCompositeOp; - using MagickCore::HueCompositeOp; - using MagickCore::InCompositeOp; - using MagickCore::IntensityCompositeOp; - using MagickCore::LightenCompositeOp; - using MagickCore::LightenIntensityCompositeOp; - using MagickCore::LinearBurnCompositeOp; - using MagickCore::LinearDodgeCompositeOp; - using MagickCore::LinearLightCompositeOp; - using MagickCore::LuminizeCompositeOp; - using MagickCore::MathematicsCompositeOp; - using MagickCore::MinusDstCompositeOp; - using MagickCore::MinusSrcCompositeOp; - using MagickCore::ModulateCompositeOp; - using MagickCore::ModulusAddCompositeOp; - using MagickCore::ModulusSubtractCompositeOp; - using MagickCore::MultiplyCompositeOp; - using MagickCore::NoCompositeOp; - using MagickCore::OutCompositeOp; - using MagickCore::OverCompositeOp; - using MagickCore::OverlayCompositeOp; - using MagickCore::PegtopLightCompositeOp; - using MagickCore::PinLightCompositeOp; - using MagickCore::PlusCompositeOp; - using MagickCore::ReplaceCompositeOp; - using MagickCore::SaturateCompositeOp; - using MagickCore::ScreenCompositeOp; - using MagickCore::SoftLightCompositeOp; - using MagickCore::SrcAtopCompositeOp; - using MagickCore::SrcCompositeOp; - using MagickCore::SrcInCompositeOp; - using MagickCore::SrcOutCompositeOp; - using MagickCore::SrcOverCompositeOp; - using MagickCore::ThresholdCompositeOp; - using MagickCore::UndefinedCompositeOp; - using MagickCore::VividLightCompositeOp; - using MagickCore::XorCompositeOp; - - // Compression algorithms - using MagickCore::CompressionType; - using MagickCore::UndefinedCompression; - using MagickCore::NoCompression; - using MagickCore::B44ACompression; - using MagickCore::B44Compression; - using MagickCore::BZipCompression; - using MagickCore::DWAACompression; - using MagickCore::DWABCompression; - using MagickCore::DXT1Compression; - using MagickCore::DXT3Compression; - using MagickCore::DXT5Compression; - using MagickCore::FaxCompression; - using MagickCore::Group4Compression; - using MagickCore::JBIG1Compression; - using MagickCore::JBIG2Compression; - using MagickCore::JPEG2000Compression; - using MagickCore::JPEGCompression; - using MagickCore::LosslessJPEGCompression; - using MagickCore::LZMACompression; - using MagickCore::LZWCompression; - using MagickCore::PizCompression; - using MagickCore::Pxr24Compression; - using MagickCore::RLECompression; - using MagickCore::WebPCompression; - using MagickCore::ZipCompression; - using MagickCore::ZipSCompression; - using MagickCore::ZstdCompression; - - // Decoration types - using MagickCore::DecorationType; - using MagickCore::UndefinedDecoration; - using MagickCore::NoDecoration; - using MagickCore::UnderlineDecoration; - using MagickCore::OverlineDecoration; - using MagickCore::LineThroughDecoration; - - // Direction types - using MagickCore::DirectionType; - using MagickCore::UndefinedDirection; - using MagickCore::RightToLeftDirection; - using MagickCore::LeftToRightDirection; - - // Dispose methods - using MagickCore::DisposeType; - using MagickCore::UndefinedDispose; - using MagickCore::NoneDispose; - using MagickCore::BackgroundDispose; - using MagickCore::PreviousDispose; - - // Distort methods - using MagickCore::DistortMethod; - using MagickCore::UndefinedDistortion; - using MagickCore::AffineDistortion; - using MagickCore::AffineProjectionDistortion; - using MagickCore::ScaleRotateTranslateDistortion; - using MagickCore::PerspectiveDistortion; - using MagickCore::PerspectiveProjectionDistortion; - using MagickCore::BilinearForwardDistortion; - using MagickCore::BilinearDistortion; - using MagickCore::BilinearReverseDistortion; - using MagickCore::PolynomialDistortion; - using MagickCore::ArcDistortion; - using MagickCore::PolarDistortion; - using MagickCore::DePolarDistortion; - using MagickCore::Cylinder2PlaneDistortion; - using MagickCore::Plane2CylinderDistortion; - using MagickCore::BarrelDistortion; - using MagickCore::BarrelInverseDistortion; - using MagickCore::ShepardsDistortion; - using MagickCore::ResizeDistortion; - using MagickCore::SentinelDistortion; - - // Dither methods - using MagickCore::DitherMethod; - using MagickCore::UndefinedDitherMethod; - using MagickCore::NoDitherMethod; - using MagickCore::RiemersmaDitherMethod; - using MagickCore::FloydSteinbergDitherMethod; - - // Endian options - using MagickCore::EndianType; - using MagickCore::UndefinedEndian; - using MagickCore::LSBEndian; - using MagickCore::MSBEndian; - - // Boolean types - using MagickCore::MagickBooleanType; - using MagickCore::MagickFalse; - using MagickCore::MagickTrue; - - // Evaluate options - using MagickCore::MagickEvaluateOperator; - using MagickCore::UndefinedEvaluateOperator; - using MagickCore::AbsEvaluateOperator; - using MagickCore::AddEvaluateOperator; - using MagickCore::AddModulusEvaluateOperator; - using MagickCore::AndEvaluateOperator; - using MagickCore::CosineEvaluateOperator; - using MagickCore::DivideEvaluateOperator; - using MagickCore::ExponentialEvaluateOperator; - using MagickCore::GaussianNoiseEvaluateOperator; - using MagickCore::ImpulseNoiseEvaluateOperator; - using MagickCore::LaplacianNoiseEvaluateOperator; - using MagickCore::LeftShiftEvaluateOperator; - using MagickCore::LogEvaluateOperator; - using MagickCore::MaxEvaluateOperator; - using MagickCore::MeanEvaluateOperator; - using MagickCore::MedianEvaluateOperator; - using MagickCore::MinEvaluateOperator; - using MagickCore::MultiplicativeNoiseEvaluateOperator; - using MagickCore::MultiplyEvaluateOperator; - using MagickCore::OrEvaluateOperator; - using MagickCore::PoissonNoiseEvaluateOperator; - using MagickCore::PowEvaluateOperator; - using MagickCore::RootMeanSquareEvaluateOperator; - using MagickCore::RightShiftEvaluateOperator; - using MagickCore::SetEvaluateOperator; - using MagickCore::SineEvaluateOperator; - using MagickCore::SubtractEvaluateOperator; - using MagickCore::SumEvaluateOperator; - using MagickCore::ThresholdBlackEvaluateOperator; - using MagickCore::ThresholdEvaluateOperator; - using MagickCore::ThresholdWhiteEvaluateOperator; - using MagickCore::UniformNoiseEvaluateOperator; - using MagickCore::XorEvaluateOperator; - - // Fill rules - using MagickCore::FillRule; - using MagickCore::UndefinedRule; - using MagickCore::EvenOddRule; - using MagickCore::NonZeroRule; - - // Filter types - using MagickCore::FilterType; - using MagickCore::UndefinedFilter; - using MagickCore::PointFilter; - using MagickCore::BoxFilter; - using MagickCore::TriangleFilter; - using MagickCore::HermiteFilter; - using MagickCore::HannFilter; - using MagickCore::HammingFilter; - using MagickCore::BlackmanFilter; - using MagickCore::GaussianFilter; - using MagickCore::QuadraticFilter; - using MagickCore::CubicFilter; - using MagickCore::CatromFilter; - using MagickCore::MitchellFilter; - using MagickCore::JincFilter; - using MagickCore::SincFilter; - using MagickCore::SincFastFilter; - using MagickCore::KaiserFilter; - using MagickCore::WelchFilter; - using MagickCore::ParzenFilter; - using MagickCore::BohmanFilter; - using MagickCore::BartlettFilter; - using MagickCore::LagrangeFilter; - using MagickCore::LanczosFilter; - using MagickCore::LanczosSharpFilter; - using MagickCore::Lanczos2Filter; - using MagickCore::Lanczos2SharpFilter; - using MagickCore::RobidouxFilter; - using MagickCore::RobidouxSharpFilter; - using MagickCore::CosineFilter; - using MagickCore::SplineFilter; - using MagickCore::LanczosRadiusFilter; - using MagickCore::SentinelFilter; - - // Geometry flags; - using MagickCore::GeometryFlags; - using MagickCore::AreaValue; - using MagickCore::AspectValue; - using MagickCore::GreaterValue; - using MagickCore::HeightValue; - using MagickCore::LessValue; - using MagickCore::MinimumValue; - using MagickCore::NoValue; - using MagickCore::PercentValue; - using MagickCore::WidthValue; - using MagickCore::XNegative; - using MagickCore::XValue; - using MagickCore::YNegative; - using MagickCore::YValue; - - // Bit gravity - using MagickCore::GravityType; - using MagickCore::UndefinedGravity; - using MagickCore::ForgetGravity; - using MagickCore::NorthWestGravity; - using MagickCore::NorthGravity; - using MagickCore::NorthEastGravity; - using MagickCore::WestGravity; - using MagickCore::CenterGravity; - using MagickCore::EastGravity; - using MagickCore::SouthWestGravity; - using MagickCore::SouthGravity; - using MagickCore::SouthEastGravity; - - // Image types - using MagickCore::ImageType; - using MagickCore::UndefinedType; - using MagickCore::BilevelType; - using MagickCore::GrayscaleType; - using MagickCore::GrayscaleAlphaType; - using MagickCore::PaletteType; - using MagickCore::PaletteAlphaType; - using MagickCore::TrueColorType; - using MagickCore::TrueColorAlphaType; - using MagickCore::ColorSeparationType; - using MagickCore::ColorSeparationAlphaType; - using MagickCore::OptimizeType; - using MagickCore::PaletteBilevelAlphaType; - - // Interlace types - using MagickCore::InterlaceType; - using MagickCore::UndefinedInterlace; - using MagickCore::NoInterlace; - using MagickCore::LineInterlace; - using MagickCore::PlaneInterlace; - using MagickCore::PartitionInterlace; - using MagickCore::GIFInterlace; - using MagickCore::JPEGInterlace; - using MagickCore::PNGInterlace; - - // Built-in kernels - using MagickCore::KernelInfoType; - using MagickCore::UndefinedKernel; - using MagickCore::UnityKernel; - using MagickCore::GaussianKernel; - using MagickCore::DoGKernel; - using MagickCore::LoGKernel; - using MagickCore::BlurKernel; - using MagickCore::CometKernel; - using MagickCore::BinomialKernel; - using MagickCore::LaplacianKernel; - using MagickCore::SobelKernel; - using MagickCore::FreiChenKernel; - using MagickCore::RobertsKernel; - using MagickCore::PrewittKernel; - using MagickCore::CompassKernel; - using MagickCore::KirschKernel; - using MagickCore::DiamondKernel; - using MagickCore::SquareKernel; - using MagickCore::RectangleKernel; - using MagickCore::OctagonKernel; - using MagickCore::DiskKernel; - using MagickCore::PlusKernel; - using MagickCore::CrossKernel; - using MagickCore::RingKernel; - using MagickCore::PeaksKernel; - using MagickCore::EdgesKernel; - using MagickCore::CornersKernel; - using MagickCore::DiagonalsKernel; - using MagickCore::LineEndsKernel; - using MagickCore::LineJunctionsKernel; - using MagickCore::RidgesKernel; - using MagickCore::ConvexHullKernel; - using MagickCore::ThinSEKernel; - using MagickCore::SkeletonKernel; - using MagickCore::ChebyshevKernel; - using MagickCore::ManhattanKernel; - using MagickCore::OctagonalKernel; - using MagickCore::EuclideanKernel; - using MagickCore::UserDefinedKernel; - - // Layer method - using MagickCore::LayerMethod; - using MagickCore::UndefinedLayer; - using MagickCore::CoalesceLayer; - using MagickCore::CompareAnyLayer; - using MagickCore::CompareClearLayer; - using MagickCore::CompareOverlayLayer; - using MagickCore::DisposeLayer; - using MagickCore::OptimizeLayer; - using MagickCore::OptimizeImageLayer; - using MagickCore::OptimizePlusLayer; - using MagickCore::OptimizeTransLayer; - using MagickCore::RemoveDupsLayer; - using MagickCore::RemoveZeroLayer; - using MagickCore::CompositeLayer; - using MagickCore::MergeLayer; - using MagickCore::FlattenLayer; - using MagickCore::MosaicLayer; - using MagickCore::TrimBoundsLayer; - - // Line cap types - using MagickCore::LineCap; - using MagickCore::UndefinedCap; - using MagickCore::ButtCap; - using MagickCore::RoundCap; - using MagickCore::SquareCap; - - // Line join types - using MagickCore::LineJoin; - using MagickCore::UndefinedJoin; - using MagickCore::MiterJoin; - using MagickCore::RoundJoin; - using MagickCore::BevelJoin; - - // Log event types - using MagickCore::LogEventType; - using MagickCore::UndefinedEvents; - using MagickCore::NoEvents; - using MagickCore::AccelerateEvent; - using MagickCore::AnnotateEvent; - using MagickCore::BlobEvent; - using MagickCore::CacheEvent; - using MagickCore::CoderEvent; - using MagickCore::ConfigureEvent; - using MagickCore::DeprecateEvent; - using MagickCore::DrawEvent; - using MagickCore::ExceptionEvent; - using MagickCore::ImageEvent; - using MagickCore::LocaleEvent; - using MagickCore::ModuleEvent; - using MagickCore::PixelEvent; - using MagickCore::PolicyEvent; - using MagickCore::ResourceEvent; - using MagickCore::TraceEvent; - using MagickCore::TransformEvent; - using MagickCore::UserEvent; - using MagickCore::WandEvent; - using MagickCore::X11Event; - using MagickCore::CommandEvent; - using MagickCore::AllEvents; - - // Magick functions - using MagickCore::MagickFunction; - using MagickCore::UndefinedFunction; - using MagickCore::ArcsinFunction; - using MagickCore::ArctanFunction; - using MagickCore::PolynomialFunction; - using MagickCore::SinusoidFunction; - - // Metric types - using MagickCore::MetricType; - using MagickCore::UndefinedErrorMetric; - using MagickCore::AbsoluteErrorMetric; - using MagickCore::FuzzErrorMetric; - using MagickCore::MeanAbsoluteErrorMetric; - using MagickCore::MeanErrorPerPixelErrorMetric; - using MagickCore::MeanSquaredErrorMetric; - using MagickCore::NormalizedCrossCorrelationErrorMetric; - using MagickCore::PeakAbsoluteErrorMetric; - using MagickCore::PeakSignalToNoiseRatioErrorMetric; - using MagickCore::PerceptualHashErrorMetric; - using MagickCore::RootMeanSquaredErrorMetric; - - // Morphology methods - using MagickCore::MorphologyMethod; - using MagickCore::UndefinedMorphology; - using MagickCore::ConvolveMorphology; - using MagickCore::CorrelateMorphology; - using MagickCore::ErodeMorphology; - using MagickCore::DilateMorphology; - using MagickCore::ErodeIntensityMorphology; - using MagickCore::DilateIntensityMorphology; - using MagickCore::IterativeDistanceMorphology; - using MagickCore::OpenMorphology; - using MagickCore::CloseMorphology; - using MagickCore::OpenIntensityMorphology; - using MagickCore::CloseIntensityMorphology; - using MagickCore::SmoothMorphology; - using MagickCore::EdgeInMorphology; - using MagickCore::EdgeOutMorphology; - using MagickCore::EdgeMorphology; - using MagickCore::TopHatMorphology; - using MagickCore::BottomHatMorphology; - using MagickCore::HitAndMissMorphology; - using MagickCore::ThinningMorphology; - using MagickCore::ThickenMorphology; - using MagickCore::DistanceMorphology; - using MagickCore::VoronoiMorphology; - - // Noise types - using MagickCore::NoiseType; - using MagickCore::UndefinedNoise; - using MagickCore::UniformNoise; - using MagickCore::GaussianNoise; - using MagickCore::MultiplicativeGaussianNoise; - using MagickCore::ImpulseNoise; - using MagickCore::LaplacianNoise; - using MagickCore::PoissonNoise; - - // Orientation types - using MagickCore::OrientationType; - using MagickCore::UndefinedOrientation; - using MagickCore::TopLeftOrientation; - using MagickCore::TopRightOrientation; - using MagickCore::BottomRightOrientation; - using MagickCore::BottomLeftOrientation; - using MagickCore::LeftTopOrientation; - using MagickCore::RightTopOrientation; - using MagickCore::RightBottomOrientation; - using MagickCore::LeftBottomOrientation; - - // Paint methods - using MagickCore::PaintMethod; - using MagickCore::UndefinedMethod; - using MagickCore::PointMethod; - using MagickCore::ReplaceMethod; - using MagickCore::FloodfillMethod; - using MagickCore::FillToBorderMethod; - using MagickCore::ResetMethod; - - using MagickCore::PixelChannel; - using MagickCore::UndefinedPixelChannel; - using MagickCore::RedPixelChannel; - using MagickCore::CyanPixelChannel; - using MagickCore::GrayPixelChannel; - using MagickCore::LPixelChannel; - using MagickCore::YPixelChannel; - using MagickCore::aPixelChannel; - using MagickCore::GreenPixelChannel; - using MagickCore::MagentaPixelChannel; - using MagickCore::CbPixelChannel; - using MagickCore::bPixelChannel; - using MagickCore::BluePixelChannel; - using MagickCore::YellowPixelChannel; - using MagickCore::CrPixelChannel; - using MagickCore::BlackPixelChannel; - using MagickCore::AlphaPixelChannel; - using MagickCore::IndexPixelChannel; - using MagickCore::ReadMaskPixelChannel; - using MagickCore::WriteMaskPixelChannel; - using MagickCore::MetaPixelChannel; - using MagickCore::IntensityPixelChannel; - using MagickCore::CompositePixelChannel; - using MagickCore::SyncPixelChannel; - - // Pixel intensity method - using MagickCore::PixelIntensityMethod; - using MagickCore::UndefinedPixelIntensityMethod; - using MagickCore::AveragePixelIntensityMethod; - using MagickCore::BrightnessPixelIntensityMethod; - using MagickCore::LightnessPixelIntensityMethod; - using MagickCore::MSPixelIntensityMethod; - using MagickCore::Rec601LumaPixelIntensityMethod; - using MagickCore::Rec601LuminancePixelIntensityMethod; - using MagickCore::Rec709LumaPixelIntensityMethod; - using MagickCore::Rec709LuminancePixelIntensityMethod; - using MagickCore::RMSPixelIntensityMethod; - - // PixelInterpolate methods - using MagickCore::PixelInterpolateMethod; - using MagickCore::UndefinedInterpolatePixel; - using MagickCore::AverageInterpolatePixel; - using MagickCore::Average9InterpolatePixel; - using MagickCore::Average16InterpolatePixel; - using MagickCore::BackgroundInterpolatePixel; - using MagickCore::BilinearInterpolatePixel; - using MagickCore::BlendInterpolatePixel; - using MagickCore::CatromInterpolatePixel; - using MagickCore::IntegerInterpolatePixel; - using MagickCore::MeshInterpolatePixel; - using MagickCore::NearestInterpolatePixel; - using MagickCore::SplineInterpolatePixel; - - // Pixel traits - using MagickCore::PixelTrait; - using MagickCore::UndefinedPixelTrait; - using MagickCore::CopyPixelTrait; - using MagickCore::UpdatePixelTrait; - using MagickCore::BlendPixelTrait; - - // Policy domains - using MagickCore::PolicyDomain; - using MagickCore::UndefinedPolicyDomain; - using MagickCore::CoderPolicyDomain; - using MagickCore::DelegatePolicyDomain; - using MagickCore::FilterPolicyDomain; - using MagickCore::PathPolicyDomain; - using MagickCore::ResourcePolicyDomain; - using MagickCore::SystemPolicyDomain; - using MagickCore::CachePolicyDomain; - - // Preview types. Not currently used by Magick++ - using MagickCore::PreviewType; - using MagickCore::UndefinedPreview; - using MagickCore::RotatePreview; - using MagickCore::ShearPreview; - using MagickCore::RollPreview; - using MagickCore::HuePreview; - using MagickCore::SaturationPreview; - using MagickCore::BrightnessPreview; - using MagickCore::GammaPreview; - using MagickCore::SpiffPreview; - using MagickCore::DullPreview; - using MagickCore::GrayscalePreview; - using MagickCore::QuantizePreview; - using MagickCore::DespecklePreview; - using MagickCore::ReduceNoisePreview; - using MagickCore::AddNoisePreview; - using MagickCore::SharpenPreview; - using MagickCore::BlurPreview; - using MagickCore::ThresholdPreview; - using MagickCore::EdgeDetectPreview; - using MagickCore::SpreadPreview; - using MagickCore::SolarizePreview; - using MagickCore::ShadePreview; - using MagickCore::RaisePreview; - using MagickCore::SegmentPreview; - using MagickCore::SwirlPreview; - using MagickCore::ImplodePreview; - using MagickCore::WavePreview; - using MagickCore::OilPaintPreview; - using MagickCore::CharcoalDrawingPreview; - using MagickCore::JPEGPreview; - - // Quantum types - using MagickCore::QuantumType; - using MagickCore::IndexQuantum; - using MagickCore::GrayQuantum; - using MagickCore::IndexAlphaQuantum; - using MagickCore::GrayAlphaQuantum; - using MagickCore::RedQuantum; - using MagickCore::CyanQuantum; - using MagickCore::GreenQuantum; - using MagickCore::YellowQuantum; - using MagickCore::BlueQuantum; - using MagickCore::MagentaQuantum; - using MagickCore::AlphaQuantum; - using MagickCore::BlackQuantum; - using MagickCore::RGBQuantum; - using MagickCore::RGBAQuantum; - using MagickCore::CMYKQuantum; - - // Pixel mask types - using MagickCore::PixelMask; - using MagickCore::UndefinedPixelMask; - using MagickCore::ReadPixelMask; - using MagickCore::WritePixelMask; - - // Rendering intents - using MagickCore::RenderingIntent; - using MagickCore::UndefinedIntent; - using MagickCore::SaturationIntent; - using MagickCore::PerceptualIntent; - using MagickCore::AbsoluteIntent; - using MagickCore::RelativeIntent; - - // Resource types - using MagickCore::ResourceType; - using MagickCore::UndefinedResource; - using MagickCore::AreaResource; - using MagickCore::DiskResource; - using MagickCore::FileResource; - using MagickCore::HeightResource; - using MagickCore::MapResource; - using MagickCore::MemoryResource; - using MagickCore::ThreadResource; - using MagickCore::ThrottleResource; - using MagickCore::TimeResource; - using MagickCore::WidthResource; - using MagickCore::ListLengthResource; - - // Resolution units - using MagickCore::ResolutionType; - using MagickCore::UndefinedResolution; - using MagickCore::PixelsPerInchResolution; - using MagickCore::PixelsPerCentimeterResolution; - - // Sparse Color methods - using MagickCore::SparseColorMethod; - using MagickCore::UndefinedColorInterpolate; - using MagickCore::BarycentricColorInterpolate; - using MagickCore::BilinearColorInterpolate; - using MagickCore::PolynomialColorInterpolate; - using MagickCore::ShepardsColorInterpolate; - using MagickCore::VoronoiColorInterpolate; - using MagickCore::InverseColorInterpolate; - using MagickCore::ManhattanColorInterpolate; - - // Statistic type - using MagickCore::StatisticType; - using MagickCore::UndefinedStatistic; - using MagickCore::GradientStatistic; - using MagickCore::MaximumStatistic; - using MagickCore::MeanStatistic; - using MagickCore::MedianStatistic; - using MagickCore::MinimumStatistic; - using MagickCore::ModeStatistic; - using MagickCore::NonpeakStatistic; - using MagickCore::RootMeanSquareStatistic; - using MagickCore::StandardDeviationStatistic; - - // StorageType type - using MagickCore::StorageType; - using MagickCore::UndefinedPixel; - using MagickCore::CharPixel; - using MagickCore::DoublePixel; - using MagickCore::FloatPixel; - using MagickCore::LongPixel; - using MagickCore::LongLongPixel; - using MagickCore::QuantumPixel; - using MagickCore::ShortPixel; - - // StretchType type - using MagickCore::StretchType; - using MagickCore::UndefinedStretch; - using MagickCore::NormalStretch; - using MagickCore::UltraCondensedStretch; - using MagickCore::ExtraCondensedStretch; - using MagickCore::CondensedStretch; - using MagickCore::SemiCondensedStretch; - using MagickCore::SemiExpandedStretch; - using MagickCore::ExpandedStretch; - using MagickCore::ExtraExpandedStretch; - using MagickCore::UltraExpandedStretch; - using MagickCore::AnyStretch; - - // StyleType type - using MagickCore::StyleType; - using MagickCore::UndefinedStyle; - using MagickCore::NormalStyle; - using MagickCore::ItalicStyle; - using MagickCore::ObliqueStyle; - using MagickCore::AnyStyle; - - // Virtual pixel methods - using MagickCore::VirtualPixelMethod; - using MagickCore::UndefinedVirtualPixelMethod; - using MagickCore::BackgroundVirtualPixelMethod; - using MagickCore::DitherVirtualPixelMethod; - using MagickCore::EdgeVirtualPixelMethod; - using MagickCore::MirrorVirtualPixelMethod; - using MagickCore::RandomVirtualPixelMethod; - using MagickCore::TileVirtualPixelMethod; - using MagickCore::TransparentVirtualPixelMethod; - using MagickCore::MaskVirtualPixelMethod; - using MagickCore::BlackVirtualPixelMethod; - using MagickCore::GrayVirtualPixelMethod; - using MagickCore::WhiteVirtualPixelMethod; - using MagickCore::HorizontalTileVirtualPixelMethod; - using MagickCore::VerticalTileVirtualPixelMethod; - using MagickCore::HorizontalTileEdgeVirtualPixelMethod; - using MagickCore::VerticalTileEdgeVirtualPixelMethod; - using MagickCore::CheckerTileVirtualPixelMethod; - -#if defined(MAGICKCORE_IMPLEMENTATION) - // - // ImageMagick symbols used in implementation code - // - using MagickCore::AcquireAlignedMemory; - using MagickCore::AcquireAuthenticCacheView; - using MagickCore::AcquireDrawingWand; - using MagickCore::AcquireExceptionInfo; - using MagickCore::AcquireVirtualCacheView; - using MagickCore::AcquireImage; - using MagickCore::AcquireKernelInfo; - using MagickCore::AcquireMagickInfo; - using MagickCore::AcquireMagickMemory; - using MagickCore::AcquireQuantumInfo; - using MagickCore::AcquireString; - using MagickCore::AcquireStringInfo; - using MagickCore::AdaptiveBlurImage; - using MagickCore::AdaptiveResizeImage; - using MagickCore::AdaptiveSharpenImage; - using MagickCore::AdaptiveThresholdImage; - using MagickCore::AddNoiseImage; - using MagickCore::AffineTransformImage; - using MagickCore::AnnotateImage; - using MagickCore::AutoGammaImage; - using MagickCore::AutoLevelImage; - using MagickCore::AutoOrientImage; - using MagickCore::AutoThresholdImage; - using MagickCore::Base64Decode; - using MagickCore::Base64Encode; - using MagickCore::BilevelImage; - using MagickCore::BlackThresholdImage; - using MagickCore::BlobToImage; - using MagickCore::BlueShiftImage; - using MagickCore::BlurImage; - using MagickCore::BrightnessContrastImage; - using MagickCore::BorderImage; - using MagickCore::CharcoalImage; - using MagickCore::CannyEdgeImage; - using MagickCore::ChopImage; - using MagickCore::ClampImage; - using MagickCore::ClampToQuantum; - using MagickCore::ClearMagickException; - using MagickCore::CloneDrawInfo; - using MagickCore::CloneImage; - using MagickCore::CloneImageInfo; - using MagickCore::CloneQuantizeInfo; - using MagickCore::ClutImage; - using MagickCore::ColorDecisionListImage; - using MagickCore::ColorizeImage; - using MagickCore::ColorMatrixImage; - using MagickCore::CommandOptionToMnemonic; - using MagickCore::CompareImages; - using MagickCore::CompareImagesLayers; - using MagickCore::CompositeImage; - using MagickCore::ConnectedComponentsImage; - using MagickCore::ConstituteImage; - using MagickCore::ContrastImage; - using MagickCore::ContrastStretchImage; - using MagickCore::ConvertHSLToRGB; - using MagickCore::ConvertRGBToHSL; - using MagickCore::ConvolveImage; - using MagickCore::CopyImagePixels; - using MagickCore::CopyMagickString; - using MagickCore::CropImage; - using MagickCore::CropImageToTiles; - using MagickCore::CycleColormapImage; - using MagickCore::DecipherImage; - using MagickCore::DeleteImageOption; - using MagickCore::DeleteImageRegistry; - using MagickCore::DeskewImage; - using MagickCore::DespeckleImage; - using MagickCore::DestroyCacheView; - using MagickCore::DestroyDrawInfo; - using MagickCore::DestroyDrawingWand; - using MagickCore::DestroyExceptionInfo; - using MagickCore::DestroyImageInfo; - using MagickCore::DestroyImageList; - using MagickCore::DestroyKernelInfo; - using MagickCore::DestroyMagickWand; - using MagickCore::DestroyPixelWand; - using MagickCore::DestroyQuantizeInfo; - using MagickCore::DestroyQuantumInfo; - using MagickCore::DestroyString; - using MagickCore::DestroyStringInfo; - using MagickCore::DisplayImages; - using MagickCore::DistortImage; - using MagickCore::DrawAffine; - using MagickCore::DrawAlpha; - using MagickCore::DrawAnnotation; - using MagickCore::DrawArc; - using MagickCore::DrawBezier; - using MagickCore::DrawCircle; - using MagickCore::DrawColor; - using MagickCore::DrawComment; - using MagickCore::DrawComposite; - using MagickCore::DrawEllipse; - using MagickCore::DrawImage; - using MagickCore::DrawLine; - using MagickCore::DrawPathClose; - using MagickCore::DrawPathCurveToAbsolute; - using MagickCore::DrawPathCurveToQuadraticBezierAbsolute; - using MagickCore::DrawPathCurveToQuadraticBezierRelative; - using MagickCore::DrawPathCurveToQuadraticBezierSmoothAbsolute; - using MagickCore::DrawPathCurveToQuadraticBezierSmoothRelative; - using MagickCore::DrawPathCurveToRelative; - using MagickCore::DrawPathCurveToSmoothAbsolute; - using MagickCore::DrawPathCurveToSmoothRelative; - using MagickCore::DrawPathEllipticArcAbsolute; - using MagickCore::DrawPathEllipticArcRelative; - using MagickCore::DrawPathFinish; - using MagickCore::DrawPathLineToAbsolute; - using MagickCore::DrawPathLineToHorizontalAbsolute; - using MagickCore::DrawPathLineToHorizontalRelative; - using MagickCore::DrawPathLineToRelative; - using MagickCore::DrawPathLineToVerticalAbsolute; - using MagickCore::DrawPathLineToVerticalRelative; - using MagickCore::DrawPathMoveToAbsolute; - using MagickCore::DrawPathMoveToRelative; - using MagickCore::DrawPathStart; - using MagickCore::DrawPoint; - using MagickCore::DrawPolygon; - using MagickCore::DrawPolyline; - using MagickCore::DrawPopClipPath; - using MagickCore::DrawPopDefs; - using MagickCore::DrawPopPattern; - using MagickCore::DrawPushClipPath; - using MagickCore::DrawPushDefs; - using MagickCore::DrawPushPattern; - using MagickCore::DrawRectangle; - using MagickCore::DrawRender; - using MagickCore::DrawRotate; - using MagickCore::DrawRoundRectangle; - using MagickCore::DrawScale; - using MagickCore::DrawSetClipPath; - using MagickCore::DrawSetClipRule; - using MagickCore::DrawSetClipUnits; - using MagickCore::DrawSetFillColor; - using MagickCore::DrawSetFillOpacity; - using MagickCore::DrawSetFillPatternURL; - using MagickCore::DrawSetFillRule; - using MagickCore::DrawSetFont; - using MagickCore::DrawSetFontFamily; - using MagickCore::DrawSetFontSize; - using MagickCore::DrawSetFontStretch; - using MagickCore::DrawSetFontStyle; - using MagickCore::DrawSetFontWeight; - using MagickCore::DrawSetGravity; - using MagickCore::DrawSetStrokeAntialias; - using MagickCore::DrawSetStrokeColor; - using MagickCore::DrawSetStrokeDashArray; - using MagickCore::DrawSetStrokeDashOffset; - using MagickCore::DrawSetStrokeLineCap; - using MagickCore::DrawSetStrokeLineJoin; - using MagickCore::DrawSetStrokeMiterLimit; - using MagickCore::DrawSetStrokeOpacity; - using MagickCore::DrawSetStrokePatternURL; - using MagickCore::DrawSetStrokeWidth; - using MagickCore::DrawSetTextAntialias; - using MagickCore::DrawSetTextDecoration; - using MagickCore::DrawSetTextEncoding; - using MagickCore::DrawSetTextInterlineSpacing; - using MagickCore::DrawSetTextInterwordSpacing; - using MagickCore::DrawSetTextKerning; - using MagickCore::DrawSetTextUnderColor; - using MagickCore::DrawSetViewbox; - using MagickCore::DrawSkewX; - using MagickCore::DrawSkewY; - using MagickCore::DrawTranslate; - using MagickCore::EdgeImage; - using MagickCore::EmbossImage; - using MagickCore::EncipherImage; - using MagickCore::EnhanceImage; - using MagickCore::EqualizeImage; - using MagickCore::EvaluateImage; - using MagickCore::ExportImagePixels; - using MagickCore::ExportQuantumPixels; - using MagickCore::ExtentImage; - using MagickCore::FlipImage; - using MagickCore::FloodfillPaintImage; - using MagickCore::FlopImage; - using MagickCore::FormatLocaleString; - using MagickCore::ForwardFourierTransformImage; - using MagickCore::FrameImage; - using MagickCore::FxImage; - using MagickCore::GammaImage; - using MagickCore::GaussianBlurImage; - using MagickCore::GaussianBlurImage; - using MagickCore::GetAffineMatrix; - using MagickCore::GetAuthenticMetacontent; - using MagickCore::GetBlobSize; - using MagickCore::GetCacheViewAuthenticMetacontent; - using MagickCore::GetCacheViewAuthenticPixels; - using MagickCore::GetCacheViewVirtualPixels; - using MagickCore::GetClientName; - using MagickCore::GetColorTuple; - using MagickCore::GetDrawInfo; - using MagickCore::GetGeometry; - using MagickCore::GetImageArtifact; - using MagickCore::GetImageMoments; - using MagickCore::GetImageBoundingBox; - using MagickCore::GetImageDistortion; - using MagickCore::GetImageDepth; - using MagickCore::GetImageMask; - using MagickCore::GetImageMean; - using MagickCore::GetImageKurtosis; - using MagickCore::GetImageRange; - using MagickCore::GetImageDepth; - using MagickCore::GetImageInfo; - using MagickCore::GetImageInfoFile; - using MagickCore::GetImageOption; - using MagickCore::GetImagePerceptualHash; - using MagickCore::GetAuthenticPixels; - using MagickCore::GetImageProfile; - using MagickCore::GetImageProperty; - using MagickCore::GetImageQuantizeError; - using MagickCore::GetImageType; - using MagickCore::GetMagickDecoderThreadSupport; - using MagickCore::GetMagickEncoderThreadSupport; - using MagickCore::GetMagickInfo; - using MagickCore::GetMultilineTypeMetrics; - using MagickCore::GetNextValueInLinkedList; - using MagickCore::GetNumberOfElementsInLinkedList; - using MagickCore::GetPixelBlue; - using MagickCore::GetPixelChannelOffset; - using MagickCore::GetPixelChannelTraits; - using MagickCore::GetPixelGreen; - using MagickCore::GetPixelInfo; - using MagickCore::GetPixelRed; - using MagickCore::GetNumberColors; - using MagickCore::GetPageGeometry; - using MagickCore::GetQuantizeInfo; - using MagickCore::GetStringInfoDatum; - using MagickCore::GetStringInfoLength; - using MagickCore::GetTypeMetrics; - using MagickCore::GetValueFromLinkedList; - using MagickCore::GetVirtualMetacontent; - using MagickCore::GetVirtualPixels; - using MagickCore::GetImageVirtualPixelMethod; - using MagickCore::GlobExpression; - using MagickCore::GravityAdjustGeometry; - using MagickCore::GrayscaleImage; - using MagickCore::HaldClutImage; - using MagickCore::HoughLineImage; - using MagickCore::ImageToBlob; - using MagickCore::ImagesToBlob; - using MagickCore::ImplodeImage; - using MagickCore::ImportQuantumPixels; - using MagickCore::InterpretImageProperties; - using MagickCore::InverseFourierTransformImage; - using MagickCore::InvokeDynamicImageFilter; - using MagickCore::IsEventLogging; - using MagickCore::IsGeometry; - using MagickCore::IsImageOpaque; - using MagickCore::IsImagesEqual; - using MagickCore::KuwaharaImage; - using MagickCore::LevelImage; - using MagickCore::LevelImageColors; - using MagickCore::LevelizeImage; - using MagickCore::LinearStretchImage; - using MagickCore::LiquidRescaleImage; - using MagickCore::LocalContrastImage; - using MagickCore::LocaleCompare; - using MagickCore::LockSemaphoreInfo; - using MagickCore::LogMagickEvent; - using MagickCore::MagickCoreTerminus; - using MagickCore::MagickToMime; - using MagickCore::MagnifyImage; - using MagickCore::MergeImageLayers; - using MagickCore::MinifyImage; - using MagickCore::ModulateImage; - using MagickCore::MorphologyImage; - using MagickCore::MotionBlurImage; - using MagickCore::NegateImage; - using MagickCore::NewMagickWandFromImage; - using MagickCore::NewPixelWand; - using MagickCore::NormalizeImage; - using MagickCore::OilPaintImage; - using MagickCore::OpaquePaintImage; - using MagickCore::OrderedDitherImage; - using MagickCore::OptimizeImageLayers; - using MagickCore::OptimizeImageTransparency; - using MagickCore::OptimizePlusImageLayers; - using MagickCore::ParseMetaGeometry; - using MagickCore::PerceptibleImage; - using MagickCore::PingBlob; - using MagickCore::PingImage; - using MagickCore::PixelSetPixelColor; - using MagickCore::PolaroidImage; - using MagickCore::PopDrawingWand; - using MagickCore::PosterizeImage; - using MagickCore::ProfileImage; - using MagickCore::PushDrawingWand; - using MagickCore::QuantizeImage; - using MagickCore::QueueAuthenticPixels; - using MagickCore::QueueCacheViewAuthenticPixels; - using MagickCore::RaiseImage; - using MagickCore::RandomThresholdImage; - using MagickCore::ReadImage; - using MagickCore::RegisterMagickInfo; - using MagickCore::RelinquishMagickMemory; - using MagickCore::RemapImage; - using MagickCore::ResampleImage; - using MagickCore::ResetLinkedListIterator; - using MagickCore::ResizeImage; - using MagickCore::ResizeMagickMemory; - using MagickCore::RollImage; - using MagickCore::RotateImage; - using MagickCore::RotationalBlurImage; - using MagickCore::SampleImage; - using MagickCore::ScaleImage; - using MagickCore::SegmentImage; - using MagickCore::SelectiveBlurImage; - using MagickCore::SeparateImage; - using MagickCore::SepiaToneImage; - using MagickCore::SetGeometry; - using MagickCore::SetImageAlpha; - using MagickCore::SetImageArtifact; - using MagickCore::SetImageBackgroundColor; - using MagickCore::SetImageColorspace; - using MagickCore::SetImageDepth; - using MagickCore::SetImageExtent; - using MagickCore::SetImageInfo; - using MagickCore::SetImageInfoFile; - using MagickCore::SetImageMask; - using MagickCore::SetImageOption; - using MagickCore::SetImageProfile; - using MagickCore::SetImageProperty; - using MagickCore::SetImageRegistry; - using MagickCore::SetImageType; - using MagickCore::SetLogEventMask; - using MagickCore::SetMagickResourceLimit; - using MagickCore::SetImageVirtualPixelMethod; - using MagickCore::SetPixelChannel; - using MagickCore::SetImageChannelMask; - using MagickCore::SetStringInfoDatum; - using MagickCore::ShadeImage; - using MagickCore::ShadowImage; - using MagickCore::SharpenImage; - using MagickCore::SharpenImage; - using MagickCore::ShaveImage; - using MagickCore::ShearImage; - using MagickCore::SigmoidalContrastImage; - using MagickCore::SignatureImage; - using MagickCore::SimilarityImage; - using MagickCore::SketchImage; - using MagickCore::SmushImages; - using MagickCore::SolarizeImage; - using MagickCore::SparseColorImage; - using MagickCore::SpliceImage; - using MagickCore::SpreadImage; - using MagickCore::StatisticImage; - using MagickCore::SteganoImage; - using MagickCore::StereoImage; - using MagickCore::StripImage; - using MagickCore::SwirlImage; - using MagickCore::SyncCacheViewAuthenticPixels; - using MagickCore::SyncImage; - using MagickCore::SyncAuthenticPixels; - using MagickCore::TextureImage; - using MagickCore::ThrowException; - using MagickCore::TintImage; - using MagickCore::TransformImageColorspace; - using MagickCore::TransparentPaintImage; - using MagickCore::TransparentPaintImageChroma; - using MagickCore::TransposeImage; - using MagickCore::TransverseImage; - using MagickCore::TrimImage; - using MagickCore::UniqueImageColors; - using MagickCore::UnlockSemaphoreInfo; - using MagickCore::UnregisterMagickInfo; - using MagickCore::UnsharpMaskImage; - using MagickCore::VignetteImage; - using MagickCore::WaveImage; - using MagickCore::WaveletDenoiseImage; - using MagickCore::WhiteThresholdImage; - using MagickCore::WriteImage; - -#endif // MAGICKCORE_IMPLEMENTATION - -} - -////////////////////////////////////////////////////////////////////// -// -// No user-serviceable parts beyond this point -// -////////////////////////////////////////////////////////////////////// -#define GetPPException \ - MagickCore::ExceptionInfo \ - *exceptionInfo; \ - exceptionInfo=MagickCore::AcquireExceptionInfo(); -#define GetAndSetPPChannelMask(channel) \ - MagickCore::ChannelType \ - channel_mask; \ - channel_mask=MagickCore::SetImageChannelMask(image(),channel) -#define ClonePPDrawException(wand) \ - MagickCore::ExceptionInfo \ - *exceptionInfo; \ - exceptionInfo=MagickCore::DrawCloneExceptionInfo(wand) -#define RestorePPChannelMask \ - MagickCore::SetPixelChannelMask(image(),channel_mask) -#define SetPPChannelMask(channel) \ - (void) MagickCore::SetImageChannelMask(image(),channel) -#define ThrowPPDrawException(quiet) \ - throwException(exceptionInfo,quiet); \ - (void) MagickCore::DestroyExceptionInfo(exceptionInfo) -#define ThrowPPException(quiet) \ - throwException(exceptionInfo,quiet); \ - (void) MagickCore::DestroyExceptionInfo(exceptionInfo) - -#endif // Magick_Include_header diff --git a/Magick++/lib/Magick++/Montage.h b/Magick++/lib/Magick++/Montage.h deleted file mode 100644 index 61a161df0..000000000 --- a/Magick++/lib/Magick++/Montage.h +++ /dev/null @@ -1,155 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003 -// -// Definition of Montage class used to specify montage options. -// - -#if !defined(Magick_Montage_header) -#define Magick_Montage_header - -#include "Magick++/Include.h" -#include -#include "Magick++/Color.h" -#include "Magick++/Geometry.h" - -// -// Basic (Un-framed) Montage -// -namespace Magick -{ - class MagickPPExport Montage - { - public: - - Montage(void); - virtual ~Montage(void); - - // Color that thumbnails are composed on - void backgroundColor(const Color &backgroundColor_); - Color backgroundColor(void) const; - - // Composition algorithm to use (e.g. ReplaceCompositeOp) - void compose(CompositeOperator compose_); - CompositeOperator compose(void) const; - - // Filename to save montages to - void fileName(const std::string &fileName_); - std::string fileName(void) const; - - // Fill color - void fillColor(const Color &fill_); - Color fillColor(void) const; - - // Label font - void font(const std::string &font_); - std::string font(void) const; - - // Thumbnail width & height plus border width & height - void geometry(const Geometry &geometry_); - Geometry geometry(void) const; - - // Thumbnail position (e.g. SouthWestGravity) - void gravity(GravityType gravity_); - GravityType gravity(void) const; - - // Thumbnail label (applied to image prior to montage) - void label(const std::string &label_); - std::string label(void) const; - - // Font point size - void pointSize(size_t pointSize_); - size_t pointSize(void) const; - - // Enable drop-shadows on thumbnails - void shadow(bool shadow_); - bool shadow(void) const; - - // Outline color - void strokeColor(const Color &stroke_); - Color strokeColor(void) const; - - // Background texture image - void texture(const std::string &texture_); - std::string texture(void) const; - - // Thumbnail rows and colmns - void tile(const Geometry &tile_); - Geometry tile(void) const; - - // Montage title - void title(const std::string &title_); - std::string title(void) const; - - // Transparent color - void transparentColor(const Color &transparentColor_); - Color transparentColor(void) const; - - // - // Implementation methods/members - // - - // Update elements in existing MontageInfo structure - virtual void updateMontageInfo(MagickCore::MontageInfo &montageInfo_) const; - - private: - - Color _backgroundColor; - std::string _fileName; - Color _fill; - std::string _font; - Geometry _geometry; - GravityType _gravity; - std::string _label; - size_t _pointSize; - bool _shadow; - Color _stroke; - std::string _texture; - Geometry _tile; - std::string _title; - Color _transparentColor; - }; - - // - // Montage With Frames (Extends Basic Montage) - // - class MagickPPExport MontageFramed : public Montage - { - public: - - MontageFramed(void); - ~MontageFramed(void); - - // Frame foreground color - void matteColor(const Color &matteColor_); - Color matteColor(void) const; - - // Frame border color - void borderColor(const Color &borderColor_); - Color borderColor(void) const; - - // Pixels between thumbnail and surrounding frame - void borderWidth(size_t borderWidth_); - size_t borderWidth(void) const; - - // Frame geometry (width & height frame thickness) - void frameGeometry(const Geometry &frame_); - Geometry frameGeometry(void) const; - - // - // Implementation methods/members - // - - // Update elements in existing MontageInfo structure - void updateMontageInfo(MagickCore::MontageInfo &montageInfo_) const; - - private: - - Color _matteColor; - Color _borderColor; - size_t _borderWidth; - Geometry _frame; - }; -} // namespace Magick - -#endif // Magick_Montage_header diff --git a/Magick++/lib/Magick++/Options.h b/Magick++/lib/Magick++/Options.h deleted file mode 100644 index e7b127de9..000000000 --- a/Magick++/lib/Magick++/Options.h +++ /dev/null @@ -1,342 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003 -// Copyright Dirk Lemstra 2014-2016 -// -// Definition of Options -// -// Options which may be applied to an image. These options are the -// equivalent of options supplied to ImageMagick utilities. -// -// This is an internal implementation class and is not part of the -// Magick++ API -// - -#if !defined(Magick_Options_header) -#define Magick_Options_header - -#include "Magick++/Include.h" -#include -#include "Magick++/Color.h" -#include "Magick++/Geometry.h" -#include "Magick++/Drawable.h" - -namespace Magick -{ - class Image; - - class Options - { - public: - - // Default constructor - Options(void); - - // Copy constructor - Options(const Options& options_); - - // Destructor - ~Options(); - - // Join images into a single multi-image file - void adjoin(const bool flag_); - bool adjoin(void) const; - - // Transparent color - void matteColor(const Color &matteColor_); - Color matteColor(void) const; - - // Image background color - void backgroundColor(const Color &color_); - Color backgroundColor(void) const; - - // Name of texture image to tile onto the image background - void backgroundTexture(const std::string &backgroundTexture_); - std::string backgroundTexture(void) const; - - // Image border color - void borderColor(const Color &color_); - Color borderColor(void) const; - - // Text bounding-box base color (default none) - void boxColor(const Color &boxColor_); - Color boxColor(void) const; - - // Colors within this distance are considered equal - void colorFuzz(const double fuzz_); - double colorFuzz(void) const; - - // Image colorspace scheme - void colorspaceType(const ColorspaceType colorspace_); - ColorspaceType colorspaceType(void) const; - - // Compression type ( NoCompression, BZipCompression, - // FaxCompression, JPEGCompression, LZWCompression, - // RLECompression, or ZipCompression ) - void compressType(const CompressionType compressType_); - CompressionType compressType(void) const; - - // Enable printing of debug messages from ImageMagick - void debug(const bool flag_); - bool debug(void) const; - - // Vertical and horizontal resolution in pixels of the image - void density(const Point &density_); - Point density(void) const; - - // Image depth (8 or 16) - void depth(const size_t depth_); - size_t depth(void) const; - - // Endianness (little like Intel or big like SPARC) for image - // formats which support endian-specific options. - void endian(const EndianType endian_); - EndianType endian(void) const; - - // Image filename to read or write - void file(FILE *file_); - FILE *file(void) const; - - // Image filename to read or write - void fileName(const std::string &fileName_); - std::string fileName(void) const; - - // Color to use when filling drawn objects - void fillColor(const Color &fillColor_); - Color fillColor(void) const; - - // Fill pattern - void fillPattern(const MagickCore::Image *fillPattern_); - const MagickCore::Image *fillPattern(void) const; - - // Rule to use when filling drawn objects - void fillRule(const FillRule &fillRule_); - FillRule fillRule(void) const; - - // Font name - void font(const std::string &font_); - std::string font(void) const; - - // Font name - void fontFamily(const std::string &family_); - std::string fontFamily(void) const; - - // Font point size - void fontPointsize(const double pointSize_); - double fontPointsize(void) const; - - // Font style - void fontStyle(const StyleType style_); - StyleType fontStyle(void) const; - - // Font weight - void fontWeight(const size_t weight_); - size_t fontWeight(void) const; - - std::string format(void) const; - - // Image interlace scheme - void interlaceType(const InterlaceType interlace_); - InterlaceType interlaceType(void) const; - - // Image format to write or read - void magick(const std::string &magick_); - std::string magick(void) const; - - // Write as a monochrome image - void monochrome(const bool monochromeFlag_); - bool monochrome(void) const; - - // Preferred size and location of an image canvas. - void page(const Geometry &pageSize_); - Geometry page(void) const; - - // Desired image quality factor - void quality(const size_t quality_); - size_t quality(void) const; - - // Maximum number of colors to quantize to - void quantizeColors(const size_t colors_); - size_t quantizeColors(void) const; - - // Colorspace to quantize in. - void quantizeColorSpace(const ColorspaceType colorSpace_); - ColorspaceType quantizeColorSpace(void) const; - - // Dither image during quantization. - void quantizeDither(const bool ditherFlag_); - bool quantizeDither(void) const; - - // Dither method - void quantizeDitherMethod(const DitherMethod ditherMethod_); - DitherMethod quantizeDitherMethod(void) const; - - // Quantization tree-depth - void quantizeTreeDepth(const size_t treeDepth_); - size_t quantizeTreeDepth(void) const; - - // Suppress all warning messages. Error messages are still reported. - void quiet(const bool quiet_); - bool quiet(void) const; - - // Units of resolution to interpret density - void resolutionUnits(const ResolutionType resolutionUnits_); - ResolutionType resolutionUnits(void) const; - - // Image sampling factor - void samplingFactor(const std::string &samplingFactor_); - std::string samplingFactor(void) const; - - // Image size (required for raw formats) - void size(const Geometry &geometry_); - Geometry size(void) const; - - // enabled/disable stroke anti-aliasing - void strokeAntiAlias(const bool flag_); - bool strokeAntiAlias(void) const ; - - // Color to use when drawing object outlines - void strokeColor(const Color &strokeColor_); - Color strokeColor(void) const; - - // Control the pattern of dashes and gaps used to stroke - // paths. The strokeDashArray represents a list of numbers that - // specify the lengths of alternating dashes and gaps in user - // units. If an odd number of values is provided, then the list of - // values is repeated to yield an even number of values. - void strokeDashArray(const double *strokeDashArray_); - const double *strokeDashArray(void) const; - - // While drawing using strokeDashArray, specify distance into the dash - // pattern to start the dash (default 0). - void strokeDashOffset(const double strokeDashOffset_); - double strokeDashOffset(void) const; - - // Specify the shape to be used at the end of open subpaths when - // they are stroked. Values of LineCap are UndefinedCap, ButtCap, - // RoundCap, and SquareCap. - void strokeLineCap(const LineCap lineCap_); - LineCap strokeLineCap(void) const; - - // Specify the shape to be used at the corners of paths (or other - // vector shapes) when they are stroked. Values of LineJoin are - // UndefinedJoin, MiterJoin, RoundJoin, and BevelJoin. - void strokeLineJoin(const LineJoin lineJoin_); - LineJoin strokeLineJoin(void) const; - - // Specify miter limit. When two line segments meet at a sharp - // angle and miter joins have been specified for 'lineJoin', it is - // possible for the miter to extend far beyond the thickness of - // the line stroking the path. The miterLimit' imposes a limit on - // the ratio of the miter length to the 'stroke_width'. The default - // value of this parameter is 4. - void strokeMiterLimit(const size_t miterLimit_); - size_t strokeMiterLimit(void) const; - - // Pattern image to use for stroked outlines - void strokePattern(const MagickCore::Image *strokePattern_); - const MagickCore::Image *strokePattern(void) const; - - // Stroke width for drawing vector objects (default one) - void strokeWidth(const double strokeWidth_); - double strokeWidth(void) const; - - void subImage(const size_t subImage_); - size_t subImage(void) const; - - // Sub-frame number to return - void subRange(const size_t subRange_); - size_t subRange(void) const; - - // Remove pixel aliasing - void textAntiAlias(const bool flag_); - bool textAntiAlias(void) const; - - // Render text right-to-left or left-to-right. - void textDirection(const DirectionType direction_); - DirectionType textDirection() const; - - // Annotation text encoding (e.g. "UTF-16") - void textEncoding(const std::string &encoding_); - std::string textEncoding(void) const; - - // Text gravity. - void textGravity(const GravityType gravity_); - GravityType textGravity() const; - - // Text inter-line spacing - void textInterlineSpacing(const double spacing_); - double textInterlineSpacing(void) const; - - // Text inter-word spacing - void textInterwordSpacing(const double spacing_); - double textInterwordSpacing(void) const; - - // Text inter-character kerning - void textKerning(const double kerning_); - double textKerning(void) const; - - // Text undercolor box - void textUnderColor(const Color &underColor_); - Color textUnderColor(void) const; - - // Origin of coordinate system to use when annotating with text or drawing - void transformOrigin(const double tx_,const double ty_); - - // Reset transformation parameters to default - void transformReset(void); - - // Rotation to use when annotating with text or drawing - void transformRotation(const double angle_); - - // Scale to use when annotating with text or drawing - void transformScale(const double sx_,const double sy_); - - // Skew to use in X axis when annotating with text or drawing - void transformSkewX(const double skewx_); - - // Skew to use in Y axis when annotating with text or drawing - void transformSkewY(const double skewy_); - - // Image representation type - void type(const ImageType type_); - ImageType type(void) const; - - // Return verbose information about an image, or an operation - void verbose(const bool verboseFlag_); - bool verbose(void) const; - - // X11 display name - void x11Display(const std::string &display_); - std::string x11Display(void) const; - - // - // Internal implementation methods. Please do not use. - // - - MagickCore::DrawInfo *drawInfo(void); - MagickCore::ImageInfo *imageInfo(void); - MagickCore::QuantizeInfo *quantizeInfo(void); - - // Construct using raw structures - Options(const MagickCore::ImageInfo *imageInfo_, - const MagickCore::QuantizeInfo *quantizeInfo_, - const MagickCore::DrawInfo *drawInfo_); - - private: - - // Assignment not supported - Options& operator=(const Options&); - - void setOption(const char *name,const Color &value_); - - void setOption(const char *name,const double value_); - - MagickCore::ImageInfo *_imageInfo; - MagickCore::QuantizeInfo *_quantizeInfo; - MagickCore::DrawInfo *_drawInfo; - bool _quiet; - }; -} // namespace Magick - -#endif // Magick_Options_header diff --git a/Magick++/lib/Magick++/Pixels.h b/Magick++/lib/Magick++/Pixels.h deleted file mode 100644 index 1eb11b001..000000000 --- a/Magick++/lib/Magick++/Pixels.h +++ /dev/null @@ -1,152 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002 -// Copyright Dirk Lemstra 2014 -// -// Representation of a pixel view. -// - -#if !defined(Magick_Pixels_header) -#define Magick_Pixels_header - -#include "Magick++/Include.h" -#include "Magick++/Color.h" -#include "Magick++/Image.h" - -namespace Magick -{ - class MagickPPExport Pixels - { - public: - - // Construct pixel view using specified image. - Pixels(Magick::Image &image_); - - // Destroy pixel view - ~Pixels(void); - - // Transfer pixels from the image to the pixel view as defined by - // the specified region. Modified pixels may be subsequently - // transferred back to the image via sync. - Quantum *get(const ::ssize_t x_,const ::ssize_t y_, - const size_t columns_,const size_t rows_); - - // Transfer read-only pixels from the image to the pixel view as - // defined by the specified region. - const Quantum *getConst(const ::ssize_t x_,const ::ssize_t y_, - const size_t columns_,const size_t rows_); - - // Return pixel metacontent - void *metacontent(void); - - // Returns the offset for the specified channel. - ssize_t offset(PixelChannel channel) const; - - // Allocate a pixel view region to store image pixels as defined - // by the region rectangle. This area is subsequently transferred - // from the pixel view to the image via sync. - Quantum *set(const ::ssize_t x_,const ::ssize_t y_,const size_t columns_, - const size_t rows_ ); - - // Transfers the image view pixels to the image. - void sync(void); - - // Left ordinate of view - ::ssize_t x(void) const; - - // Top ordinate of view - ::ssize_t y(void) const; - - // Width of view - size_t columns(void) const; - - // Height of view - size_t rows(void) const; - - private: - - // Copying and assigning Pixels is not supported. - Pixels(const Pixels& pixels_); - const Pixels& operator=(const Pixels& pixels_); - - Magick::Image _image; // Image reference - MagickCore::CacheView *_view; // Image view handle - ::ssize_t _x; // Left ordinate of view - ::ssize_t _y; // Top ordinate of view - size_t _columns; // Width of view - size_t _rows; // Height of view - - }; // class Pixels - - class MagickPPExport PixelData - { - public: - - // Construct pixel data using specified image - PixelData(Magick::Image &image_,std::string map_,const StorageType type_); - - // Construct pixel data using specified image - PixelData(Magick::Image &image_,const ::ssize_t x_,const ::ssize_t y_, - const size_t width_,const size_t height_,std::string map_, - const StorageType type_); - - // Destroy pixel data - ~PixelData(void); - - // Pixel data buffer - const void *data(void) const; - - // Length of the buffer - ::ssize_t length(void) const; - - // Size of the buffer in bytes - ::ssize_t size(void) const; - - private: - - // Copying and assigning PixelData is not supported - PixelData(const PixelData& pixels_); - const PixelData& operator=(const PixelData& pixels_); - - void init(Magick::Image &image_,const ::ssize_t x_,const ::ssize_t y_, - const size_t width_,const size_t height_,std::string map_, - const StorageType type_); - - void relinquish(void) throw(); - - void *_data; // The pixel data - ::ssize_t _length; // Length of the data - ::ssize_t _size; // Size of the data - }; // class PixelData - -} // Magick namespace - -// -// Inline methods -// - -// Left ordinate of view -inline ::ssize_t Magick::Pixels::x(void) const -{ - return _x; -} - -// Top ordinate of view -inline ::ssize_t Magick::Pixels::y(void) const -{ - return _y; -} - -// Width of view -inline size_t Magick::Pixels::columns(void) const -{ - return _columns; -} - -// Height of view -inline size_t Magick::Pixels::rows(void) const -{ - return _rows; -} - -#endif // Magick_Pixels_header diff --git a/Magick++/lib/Magick++/ResourceLimits.h b/Magick++/lib/Magick++/ResourceLimits.h deleted file mode 100644 index 3643bc3db..000000000 --- a/Magick++/lib/Magick++/ResourceLimits.h +++ /dev/null @@ -1,76 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Dirk Lemstra 2014-2018 -// -// Definition of resource limits. -// - -#if !defined(Magick_ResourceLimits_header) -#define Magick_ResourceLimits_header - -#include "Magick++/Include.h" - -namespace Magick -{ - class MagickPPExport ResourceLimits - { - public: - - // Pixel cache limit in bytes. Requests for memory above this limit - // are automagically allocated on disk. - static void area(const MagickSizeType limit_); - static MagickSizeType area(void); - - // Pixel cache limit in bytes. Requests for memory above this limit - // will fail. - static void disk(const MagickSizeType limit_); - static MagickSizeType disk(void); - - // The maximum number of open pixel cache files. When this limit is - // exceeded, any subsequent pixels cached to disk are closed and reopened - // on demand. This behavior permits a large number of images to be accessed - // simultaneously on disk, but with a speed penalty due to repeated - // open/close calls. - static void file(const MagickSizeType limit_); - static MagickSizeType file(void); - - // The maximum height of an image. - static void height(const MagickSizeType limit_); - static MagickSizeType height(void); - - // The maximum number of images in an image list. - static void listLength(const MagickSizeType limit_); - static MagickSizeType listLength(); - - // Pixel cache limit in bytes. Once this memory limit is exceeded, - // all subsequent pixels cache operations are to/from disk. - static void map(const MagickSizeType limit_); - static MagickSizeType map(void); - - // Pixel cache limit in bytes. Once this memory limit is exceeded, - // all subsequent pixels cache operations are to/from disk or to/from - // memory mapped files. - static void memory(const MagickSizeType limit_); - static MagickSizeType memory(void); - - // Limits the number of threads used in multithreaded operations. - static void thread(const MagickSizeType limit_); - static MagickSizeType thread(void); - - // Periodically yield the CPU for at least the time specified in - // milliseconds. - static void throttle(const MagickSizeType limit_); - static MagickSizeType throttle(void); - - // The maximum width of an image. - static void width(const MagickSizeType limit_); - static MagickSizeType width(void); - - private: - ResourceLimits(void); - - }; // class ResourceLimits - -} // Magick namespace - -#endif // Magick_ResourceLimits_header diff --git a/Magick++/lib/Magick++/STL.h b/Magick++/lib/Magick++/STL.h deleted file mode 100644 index b1dd6152b..000000000 --- a/Magick++/lib/Magick++/STL.h +++ /dev/null @@ -1,2869 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003 -// Copyright Dirk Lemstra 2013-2017 -// -// Definition and implementation of template functions for using -// Magick::Image with STL containers. -// - -#ifndef Magick_STL_header -#define Magick_STL_header - -#include "Magick++/Include.h" -#include -#include -#include -#include -#include - -#include "Magick++/CoderInfo.h" -#include "Magick++/Drawable.h" -#include "Magick++/Exception.h" -#include "Magick++/Montage.h" - -namespace Magick -{ - // - // STL function object declarations/definitions - // - - // Function objects provide the means to invoke an operation on one - // or more image objects in an STL-compatable container. The - // arguments to the function object constructor(s) are compatable - // with the arguments to the equivalent Image class method and - // provide the means to supply these options when the function - // object is invoked. - - // For example, to read a GIF animation, set the color red to - // transparent for all frames, and write back out: - // - // list images; - // readImages( &images, "animation.gif" ); - // for_each( images.begin(), images.end(), transparentImage( "red" ) ); - // writeImages( images.begin(), images.end(), "animation.gif" ); - - // Adaptive-blur image with specified blur factor - class MagickPPExport adaptiveBlurImage - { - public: - adaptiveBlurImage( const double radius_ = 1, const double sigma_ = 0.5 ); - - void operator()( Image &image_ ) const; - - private: - double _radius; - double _sigma; - }; - - // Local adaptive threshold image - // http://www.dai.ed.ac.uk/HIPR2/adpthrsh.htm - // Width x height define the size of the pixel neighborhood - // offset = constant to subtract from pixel neighborhood mean - class MagickPPExport adaptiveThresholdImage - { - public: - adaptiveThresholdImage( const size_t width_, - const size_t height_, - const ::ssize_t offset_ = 0 ); - - void operator()( Image &image_ ) const; - - private: - size_t _width; - size_t _height; - ::ssize_t _offset; - }; - - // Add noise to image with specified noise type - class MagickPPExport addNoiseImage - { - public: - addNoiseImage(const NoiseType noiseType_,const double attenuate_ = 1.0); - - void operator()(Image &image_) const; - - private: - NoiseType _noiseType; - double _attenuate; - }; - - // Transform image by specified affine (or free transform) matrix. - class MagickPPExport affineTransformImage - { - public: - affineTransformImage( const DrawableAffine &affine_ ); - - void operator()( Image &image_ ) const; - - private: - DrawableAffine _affine; - }; - - // Annotate image (draw text on image) - class MagickPPExport annotateImage - { - public: - // Annotate using specified text, and placement location - annotateImage ( const std::string &text_, - const Geometry &geometry_ ); - - // Annotate using specified text, bounding area, and placement - // gravity - annotateImage ( const std::string &text_, - const Geometry &geometry_, - const GravityType gravity_ ); - - // Annotate with text using specified text, bounding area, - // placement gravity, and rotation. - annotateImage ( const std::string &text_, - const Geometry &geometry_, - const GravityType gravity_, - const double degrees_ ); - - // Annotate with text (bounding area is entire image) and - // placement gravity. - annotateImage ( const std::string &text_, - const GravityType gravity_ ); - - void operator()( Image &image_ ) const; - - private: - const std::string _text; - const Geometry _geometry; - const GravityType _gravity; - const double _degrees; - }; - - // Blur image with specified blur factor - class MagickPPExport blurImage - { - public: - blurImage( const double radius_ = 1, const double sigma_ = 0.5 ); - - void operator()( Image &image_ ) const; - - private: - double _radius; - double _sigma; - }; - - // Border image (add border to image) - class MagickPPExport borderImage - { - public: - borderImage( const Geometry &geometry_ = borderGeometryDefault ); - - void operator()( Image &image_ ) const; - - private: - Geometry _geometry; - }; - - // Extract channel from image - class MagickPPExport channelImage - { - public: - channelImage( const ChannelType channel_ ); - - void operator()( Image &image_ ) const; - - private: - ChannelType _channel; - }; - - // Charcoal effect image (looks like charcoal sketch) - class MagickPPExport charcoalImage - { - public: - charcoalImage( const double radius_ = 1, const double sigma_ = 0.5 ); - - void operator()( Image &image_ ) const; - - private: - double _radius; - double _sigma; - }; - - // Chop image (remove vertical or horizontal subregion of image) - class MagickPPExport chopImage - { - public: - chopImage( const Geometry &geometry_ ); - - void operator()( Image &image_ ) const; - - private: - Geometry _geometry; - }; - - // Accepts a lightweight Color Correction Collection (CCC) file which solely - // contains one or more color corrections and applies the correction to the - // image. - class MagickPPExport cdlImage - { - public: - cdlImage( const std::string &cdl_ ); - - void operator()( Image &image_ ) const; - - private: - std::string _cdl; - }; - - // Colorize image using pen color at specified percent alpha - class MagickPPExport colorizeImage - { - public: - colorizeImage( const unsigned int alphaRed_, - const unsigned int alphaGreen_, - const unsigned int alphaBlue_, - const Color &penColor_ ); - - colorizeImage( const unsigned int alpha_, - const Color &penColor_ ); - - void operator()( Image &image_ ) const; - - private: - unsigned int _alphaRed; - unsigned int _alphaGreen; - unsigned int _alphaBlue; - Color _penColor; - }; - - // Apply a color matrix to the image channels. The user supplied - // matrix may be of order 1 to 5 (1x1 through 5x5). - class MagickPPExport colorMatrixImage - { - public: - colorMatrixImage( const size_t order_, - const double *color_matrix_ ); - - void operator()( Image &image_ ) const; - - private: - size_t _order; - const double *_color_matrix; - }; - - // Convert the image colorspace representation - class MagickPPExport colorSpaceImage - { - public: - colorSpaceImage( ColorspaceType colorSpace_ ); - - void operator()( Image &image_ ) const; - - private: - ColorspaceType _colorSpace; - }; - - // Comment image (add comment string to image) - class MagickPPExport commentImage - { - public: - commentImage( const std::string &comment_ ); - - void operator()( Image &image_ ) const; - - private: - std::string _comment; - }; - - // Compose an image onto another at specified offset and using - // specified algorithm - class MagickPPExport compositeImage - { - public: - compositeImage( const Image &compositeImage_, - ::ssize_t xOffset_, - ::ssize_t yOffset_, - CompositeOperator compose_ = InCompositeOp ); - - compositeImage( const Image &compositeImage_, - const Geometry &offset_, - CompositeOperator compose_ = InCompositeOp ); - - void operator()( Image &image_ ) const; - - private: - Image _compositeImage; - ::ssize_t _xOffset; - ::ssize_t _yOffset; - CompositeOperator _compose; - }; - - // Contrast image (enhance intensity differences in image) - class MagickPPExport contrastImage - { - public: - contrastImage( const size_t sharpen_ ); - - void operator()( Image &image_ ) const; - - private: - size_t _sharpen; - }; - - // Crop image (subregion of original image) - class MagickPPExport cropImage - { - public: - cropImage( const Geometry &geometry_ ); - - void operator()( Image &image_ ) const; - - private: - Geometry _geometry; - }; - - // Cycle image colormap - class MagickPPExport cycleColormapImage - { - public: - cycleColormapImage( const ::ssize_t amount_ ); - - void operator()( Image &image_ ) const; - - private: - ::ssize_t _amount; - }; - - // Despeckle image (reduce speckle noise) - class MagickPPExport despeckleImage - { - public: - despeckleImage( void ); - - void operator()( Image &image_ ) const; - - private: - }; - - // Distort image. distorts an image using various distortion methods, by - // mapping color lookups of the source image to a new destination image - // usally of the same size as the source image, unless 'bestfit' is set to - // true. - class MagickPPExport distortImage - { - public: - distortImage( const Magick::DistortMethod method_, - const size_t number_arguments_, - const double *arguments_, - const bool bestfit_ ); - - distortImage( const Magick::DistortMethod method_, - const size_t number_arguments_, - const double *arguments_ ); - - void operator()( Image &image_ ) const; - - private: - DistortMethod _method; - size_t _number_arguments; - const double *_arguments; - bool _bestfit; - }; - - // Draw on image - class MagickPPExport drawImage - { - public: - // Draw on image using a single drawable - // Store in list to make implementation easier - drawImage( const Drawable &drawable_ ); - - // Draw on image using a drawable list - drawImage( const DrawableList &drawable_ ); - - void operator()( Image &image_ ) const; - - private: - DrawableList _drawableList; - }; - - // Edge image (hilight edges in image) - class MagickPPExport edgeImage - { - public: - edgeImage( const double radius_ = 0.0 ); - - void operator()( Image &image_ ) const; - - private: - double _radius; - }; - - // Emboss image (hilight edges with 3D effect) - class MagickPPExport embossImage - { - public: - embossImage( void ); - embossImage( const double radius_, const double sigma_ ); - - void operator()( Image &image_ ) const; - - private: - double _radius; - double _sigma; - }; - - // Enhance image (minimize noise) - class MagickPPExport enhanceImage - { - public: - enhanceImage( void ); - - void operator()( Image &image_ ) const; - - private: - }; - - // Equalize image (histogram equalization) - class MagickPPExport equalizeImage - { - public: - equalizeImage( void ); - - void operator()( Image &image_ ) const; - - private: - }; - - // Color to use when filling drawn objects - class MagickPPExport fillColorImage - { - public: - fillColorImage( const Color &fillColor_ ); - - void operator()( Image &image_ ) const; - - private: - Color _fillColor; - }; - - // Flip image (reflect each scanline in the vertical direction) - class MagickPPExport flipImage - { - public: - flipImage( void ); - - void operator()( Image &image_ ) const; - - private: - }; - - // Floodfill designated area with a matte value - class MagickPPExport floodFillAlphaImage - - { - public: - floodFillAlphaImage(const ::ssize_t x_,const ::ssize_t y_, - const unsigned int alpha_,const Color &target_,const bool invert_=false); - - void operator()(Image &image_) const; - - private: - Color _target; - unsigned int _alpha; - ::ssize_t _x; - ::ssize_t _y; - bool _invert; - }; - - // Flood-fill image with color - class MagickPPExport floodFillColorImage - - { - public: - // Flood-fill color across pixels starting at target-pixel and - // stopping at pixels matching specified border color. - // Uses current fuzz setting when determining color match. - floodFillColorImage(const Geometry &point_,const Color &fillColor_, - const bool invert_=false); - floodFillColorImage(const ::ssize_t x_,const ::ssize_t y_, - const Color &fillColor_,const bool invert_=false); - - // Flood-fill color across pixels starting at target-pixel and - // stopping at pixels matching specified border color. - // Uses current fuzz setting when determining color match. - floodFillColorImage(const Geometry &point_,const Color &fillColor_, - const Color &borderColor_,const bool invert_=false); - floodFillColorImage(const ::ssize_t x_,const ::ssize_t y_, - const Color &fillColor_,const Color &borderColor_, - const bool invert_=false); - - void operator()(Image &image_) const; - - private: - ::ssize_t _x; - ::ssize_t _y; - Color _fillColor; - Color _borderColor; - bool _invert; - }; - - // Flood-fill image with texture - class MagickPPExport floodFillTextureImage - - { - public: - // Flood-fill texture across pixels that match the color of the - // target pixel and are neighbors of the target pixel. - // Uses current fuzz setting when determining color match. - floodFillTextureImage(const ::ssize_t x_,const ::ssize_t y_, - const Image &texture_,const bool invert_=false); - floodFillTextureImage(const Geometry &point_,const Image &texture_, - const bool invert_=false); - - // Flood-fill texture across pixels starting at target-pixel and - // stopping at pixels matching specified border color. - // Uses current fuzz setting when determining color match. - floodFillTextureImage(const ::ssize_t x_,const ::ssize_t y_, - const Image &texture_,const Color &borderColor_, - const bool invert_=false); - - floodFillTextureImage(const Geometry &point_,const Image &texture_, - const Color &borderColor_,const bool invert_=false); - - void operator()(Image &image_) const; - - private: - ::ssize_t _x; - ::ssize_t _y; - Image _texture; - Color _borderColor; - bool _invert; - }; - - // Flop image (reflect each scanline in the horizontal direction) - class MagickPPExport flopImage - { - public: - flopImage( void ); - - void operator()( Image &image_ ) const; - - private: - }; - - // Frame image - class MagickPPExport frameImage - { - public: - frameImage( const Geometry &geometry_ = frameGeometryDefault ); - - frameImage( const size_t width_, const size_t height_, - const ::ssize_t innerBevel_ = 6, const ::ssize_t outerBevel_ = 6 ); - - void operator()( Image &image_ ) const; - - private: - size_t _width; - size_t _height; - ::ssize_t _outerBevel; - ::ssize_t _innerBevel; - }; - - // Gamma correct image - class MagickPPExport gammaImage - { - public: - gammaImage( const double gamma_ ); - - gammaImage ( const double gammaRed_, - const double gammaGreen_, - const double gammaBlue_ ); - - void operator()( Image &image_ ) const; - - private: - double _gammaRed; - double _gammaGreen; - double _gammaBlue; - }; - - // Gaussian blur image - // The number of neighbor pixels to be included in the convolution - // mask is specified by 'width_'. The standard deviation of the - // gaussian bell curve is specified by 'sigma_'. - class MagickPPExport gaussianBlurImage - { - public: - gaussianBlurImage( const double width_, const double sigma_ ); - - void operator()( Image &image_ ) const; - - private: - double _width; - double _sigma; - }; - - // Apply a color lookup table (Hald CLUT) to the image. - class MagickPPExport haldClutImage - { - public: - haldClutImage( const Image &haldClutImage_ ); - - void operator()( Image &image_ ) const; - - private: - Image _haldClutImage; - }; - - // Implode image (special effect) - class MagickPPExport implodeImage - { - public: - implodeImage( const double factor_ = 50 ); - - void operator()( Image &image_ ) const; - - private: - double _factor; - }; - - // implements the inverse discrete Fourier transform (IFT) of the image - // either as a magnitude / phase or real / imaginary image pair. - class MagickPPExport inverseFourierTransformImage - { - public: - inverseFourierTransformImage( const Image &phaseImage_ ); - - void operator()( Image &image_ ) const; - - private: - Image _phaseImage; - }; - - // Set image validity. Valid images become empty (inValid) if - // argument is false. - class MagickPPExport isValidImage - { - public: - isValidImage( const bool isValid_ ); - - void operator()( Image &image_ ) const; - - private: - bool _isValid; - }; - - // Label image - class MagickPPExport labelImage - { - public: - labelImage( const std::string &label_ ); - - void operator()( Image &image_ ) const; - - private: - std::string _label; - }; - - - // Level image - class MagickPPExport levelImage - { - public: - levelImage( const double black_point, - const double white_point, - const double mid_point=1.0 ); - - void operator()( Image &image_ ) const; - - private: - double _black_point; - double _white_point; - double _mid_point; - }; - - // Magnify image by integral size - class MagickPPExport magnifyImage - { - public: - magnifyImage( void ); - - void operator()( Image &image_ ) const; - - private: - }; - - // Remap image colors with closest color from reference image - class MagickPPExport mapImage - { - public: - mapImage( const Image &mapImage_ , - const bool dither_ = false ); - - void operator()( Image &image_ ) const; - - private: - Image _mapImage; - bool _dither; - }; - - // Filter image by replacing each pixel component with the median - // color in a circular neighborhood - class MagickPPExport medianConvolveImage - { - public: - medianConvolveImage( const double radius_ = 0.0 ); - - void operator()( Image &image_ ) const; - - private: - double _radius; - }; - - // Merge image layers - class MagickPPExport mergeLayersImage - { - public: - mergeLayersImage ( LayerMethod layerMethod_ ); - - void operator()( Image &image_ ) const; - - private: - LayerMethod _layerMethod; - }; - - // Reduce image by integral size - class MagickPPExport minifyImage - { - public: - minifyImage( void ); - - void operator()( Image &image_ ) const; - - private: - }; - - // Modulate percent hue, saturation, and brightness of an image - class MagickPPExport modulateImage - { - public: - modulateImage( const double brightness_, - const double saturation_, - const double hue_ ); - - void operator()( Image &image_ ) const; - - private: - double _brightness; - double _saturation; - double _hue; - }; - - // Negate colors in image. Set grayscale to only negate grayscale - // values in image. - class MagickPPExport negateImage - { - public: - negateImage( const bool grayscale_ = false ); - - void operator()( Image &image_ ) const; - - private: - bool _grayscale; - }; - - // Normalize image (increase contrast by normalizing the pixel - // values to span the full range of color values) - class MagickPPExport normalizeImage - { - public: - normalizeImage( void ); - - void operator()( Image &image_ ) const; - - private: - }; - - // Oilpaint image (image looks like oil painting) - class MagickPPExport oilPaintImage - { - public: - oilPaintImage( const double radius_ = 3 ); - - void operator()( Image &image_ ) const; - - private: - double _radius; - }; - - // Set or attenuate the image alpha channel. If the image pixels - // are opaque then they are set to the specified alpha value, - // otherwise they are blended with the supplied alpha value. The - // value of alpha_ ranges from 0 (completely opaque) to - // QuantumRange. The defines OpaqueAlpha and TransparentAlpha are - // available to specify completely opaque or completely transparent, - // respectively. - class MagickPPExport alphaImage - { - public: - alphaImage( const unsigned int alpha_ ); - - void operator()( Image &image_ ) const; - - private: - unsigned int _alpha; - }; - - // Change color of opaque pixel to specified pen color. - class MagickPPExport opaqueImage - { - public: - opaqueImage( const Color &opaqueColor_, - const Color &penColor_ ); - - void operator()( Image &image_ ) const; - - private: - Color _opaqueColor; - Color _penColor; - }; - - // Quantize image (reduce number of colors) - class MagickPPExport quantizeImage - { - public: - quantizeImage( const bool measureError_ = false ); - - void operator()( Image &image_ ) const; - - private: - bool _measureError; - }; - - // Raise image (lighten or darken the edges of an image to give a - // 3-D raised or lowered effect) - class MagickPPExport raiseImage - { - public: - raiseImage( const Geometry &geometry_ = raiseGeometryDefault, - const bool raisedFlag_ = false ); - - void operator()( Image &image_ ) const; - - private: - Geometry _geometry; - bool _raisedFlag; - }; - - class MagickPPExport ReadOptions - { - public: - - // Default constructor - ReadOptions(void); - - // Copy constructor - ReadOptions(const ReadOptions& options_); - - // Destructor - ~ReadOptions(); - - // Vertical and horizontal resolution in pixels of the image - void density(const Geometry &geomery_); - Geometry density(void) const; - - // Image depth (8 or 16) - void depth(size_t depth_); - size_t depth(void) const; - - // Ping the image instead of reading it - void ping(const bool flag_); - bool ping(void) const; - - // Suppress all warning messages. Error messages are still reported. - void quiet(const bool quiet_); - bool quiet(void) const; - - // Image size (required for raw formats) - void size(const Geometry &geometry_); - Geometry size(void) const; - - // - // Internal implementation methods. Please do not use. - // - - MagickCore::ImageInfo *imageInfo(void); - - private: - - // Assignment not supported - ReadOptions& operator=(const ReadOptions&); - - MagickCore::ImageInfo *_imageInfo; - bool _quiet; - }; - - // Reduce noise in image using a noise peak elimination filter - class MagickPPExport reduceNoiseImage - { - public: - reduceNoiseImage( void ); - - reduceNoiseImage (const size_t order_ ); - - void operator()( Image &image_ ) const; - - private: - size_t _order; - }; - - // Resize image to specified size. - class MagickPPExport resizeImage - { - public: - resizeImage( const Geometry &geometry_ ); - - void operator()( Image &image_ ) const; - - private: - Geometry _geometry; - }; - - // Roll image (rolls image vertically and horizontally) by specified - // number of columnms and rows) - class MagickPPExport rollImage - { - public: - rollImage( const Geometry &roll_ ); - - rollImage( const ::ssize_t columns_, const ::ssize_t rows_ ); - - void operator()( Image &image_ ) const; - - private: - size_t _columns; - size_t _rows; - }; - - // Rotate image counter-clockwise by specified number of degrees. - class MagickPPExport rotateImage - { - public: - rotateImage( const double degrees_ ); - - void operator()( Image &image_ ) const; - - private: - double _degrees; - }; - - // Resize image by using pixel sampling algorithm - class MagickPPExport sampleImage - { - public: - sampleImage( const Geometry &geometry_ ); - - void operator()( Image &image_ ) const; - - private: - Geometry _geometry; - }; - - // Resize image by using simple ratio algorithm - class MagickPPExport scaleImage - { - public: - scaleImage( const Geometry &geometry_ ); - - void operator()( Image &image_ ) const; - - private: - Geometry _geometry; - }; - - // Segment (coalesce similar image components) by analyzing the - // histograms of the color components and identifying units that are - // homogeneous with the fuzzy c-means technique. - // Also uses QuantizeColorSpace and Verbose image attributes - class MagickPPExport segmentImage - { - public: - segmentImage( const double clusterThreshold_ = 1.0, - const double smoothingThreshold_ = 1.5 ); - - void operator()( Image &image_ ) const; - - private: - double _clusterThreshold; - double _smoothingThreshold; - }; - - // Shade image using distant light source - class MagickPPExport shadeImage - { - public: - shadeImage( const double azimuth_ = 30, - const double elevation_ = 30, - const bool colorShading_ = false ); - - void operator()( Image &image_ ) const; - - private: - double _azimuth; - double _elevation; - bool _colorShading; - }; - - // Shadow effect image (simulate an image shadow) - class MagickPPExport shadowImage - { - public: - shadowImage( const double percent_opacity_ = 80, const double sigma_ = 0.5, - const ssize_t x_ = 5, const ssize_t y_ = 5 ); - - void operator()( Image &image_ ) const; - - private: - double _percent_opacity; - double _sigma; - ssize_t _x; - ssize_t _y; - }; - - // Sharpen pixels in image - class MagickPPExport sharpenImage - { - public: - sharpenImage( const double radius_ = 1, const double sigma_ = 0.5 ); - - void operator()( Image &image_ ) const; - - private: - double _radius; - double _sigma; - }; - - // Shave pixels from image edges. - class MagickPPExport shaveImage - { - public: - shaveImage( const Geometry &geometry_ ); - - void operator()( Image &image_ ) const; - - private: - Geometry _geometry; - }; - - - // Shear image (create parallelogram by sliding image by X or Y axis) - class MagickPPExport shearImage - { - public: - shearImage( const double xShearAngle_, - const double yShearAngle_ ); - - void operator()( Image &image_ ) const; - - private: - double _xShearAngle; - double _yShearAngle; - }; - - // Solarize image (similar to effect seen when exposing a - // photographic film to light during the development process) - class MagickPPExport solarizeImage - { - public: - solarizeImage( const double factor_ ); - - void operator()( Image &image_ ) const; - - private: - double _factor; - }; - - // Splice the background color into the image. - class MagickPPExport spliceImage - { - public: - spliceImage( const Geometry &geometry_ ); - - void operator()( Image &image_ ) const; - - private: - Geometry _geometry; - }; - - // Spread pixels randomly within image by specified ammount - class MagickPPExport spreadImage - { - public: - spreadImage( const size_t amount_ = 3 ); - - void operator()( Image &image_ ) const; - - private: - size_t _amount; - }; - - // Add a digital watermark to the image (based on second image) - class MagickPPExport steganoImage - { - public: - steganoImage( const Image &waterMark_ ); - - void operator()( Image &image_ ) const; - - private: - Image _waterMark; - }; - - // Create an image which appears in stereo when viewed with red-blue glasses - // (Red image on left, blue on right) - class MagickPPExport stereoImage - { - public: - stereoImage( const Image &rightImage_ ); - - void operator()( Image &image_ ) const; - - private: - Image _rightImage; - }; - - // Color to use when drawing object outlines - class MagickPPExport strokeColorImage - { - public: - strokeColorImage( const Color &strokeColor_ ); - - void operator()( Image &image_ ) const; - - private: - Color _strokeColor; - }; - - // Swirl image (image pixels are rotated by degrees) - class MagickPPExport swirlImage - { - public: - swirlImage( const double degrees_ ); - - void operator()( Image &image_ ) const; - - private: - double _degrees; - }; - - // Channel a texture on image background - class MagickPPExport textureImage - { - public: - textureImage( const Image &texture_ ); - - void operator()( Image &image_ ) const; - - private: - Image _texture; - }; - - // Threshold image - class MagickPPExport thresholdImage - { - public: - thresholdImage( const double threshold_ ); - - void operator()( Image &image_ ) const; - - private: - double _threshold; - }; - - // Set image color to transparent - class MagickPPExport transparentImage - { - public: - transparentImage( const Color& color_ ); - - void operator()( Image &image_ ) const; - - private: - Color _color; - }; - - // Trim edges that are the background color from the image - class MagickPPExport trimImage - { - public: - trimImage( void ); - - void operator()( Image &image_ ) const; - - private: - }; - - // Map image pixels to a sine wave - class MagickPPExport waveImage - { - public: - waveImage( const double amplitude_ = 25.0, - const double wavelength_ = 150.0 ); - - void operator()( Image &image_ ) const; - - private: - double _amplitude; - double _wavelength; - }; - - // Zoom image to specified size. - class MagickPPExport zoomImage - { - public: - zoomImage( const Geometry &geometry_ ); - - void operator()( Image &image_ ) const; - - private: - Geometry _geometry; - }; - - // - // Function object image attribute accessors - // - - // Join images into a single multi-image file - class MagickPPExport adjoinImage - { - public: - adjoinImage( const bool flag_ ); - - void operator()( Image &image_ ) const; - - private: - bool _flag; - }; - - // Time in 1/100ths of a second which must expire before displaying - // the next image in an animated sequence. - class MagickPPExport animationDelayImage - { - public: - animationDelayImage( const size_t delay_ ); - - void operator()( Image &image_ ) const; - - private: - size_t _delay; - }; - - // Number of iterations to loop an animation (e.g. Netscape loop - // extension) for. - class MagickPPExport animationIterationsImage - { - public: - animationIterationsImage( const size_t iterations_ ); - - void operator()( Image &image_ ) const; - - private: - size_t _iterations; - }; - - // Image background color - class MagickPPExport backgroundColorImage - { - public: - backgroundColorImage( const Color &color_ ); - - void operator()( Image &image_ ) const; - - private: - Color _color; - }; - - // Name of texture image to tile onto the image background - class MagickPPExport backgroundTextureImage - { - public: - backgroundTextureImage( const std::string &backgroundTexture_ ); - - void operator()( Image &image_ ) const; - - private: - std::string _backgroundTexture; - }; - - // Image border color - class MagickPPExport borderColorImage - { - public: - borderColorImage( const Color &color_ ); - - void operator()( Image &image_ ) const; - - private: - Color _color; - }; - - // Text bounding-box base color (default none) - class MagickPPExport boxColorImage - { - public: - boxColorImage( const Color &boxColor_ ); - - void operator()( Image &image_ ) const; - - private: - Color _boxColor; - }; - - // Chromaticity blue primary point. - class MagickPPExport chromaBluePrimaryImage - { - public: - chromaBluePrimaryImage(const double x_,const double y_,const double z_); - - void operator()(Image &image_) const; - - private: - double _x; - double _y; - double _z; - }; - - // Chromaticity green primary point. - class MagickPPExport chromaGreenPrimaryImage - { - public: - chromaGreenPrimaryImage(const double x_,const double y_,const double z_); - - void operator()(Image &image_) const; - - private: - double _x; - double _y; - double _z; - }; - - // Chromaticity red primary point. - class MagickPPExport chromaRedPrimaryImage - { - public: - chromaRedPrimaryImage(const double x_,const double y_,const double z_); - - void operator()(Image &image_) const; - - private: - double _x; - double _y; - double _z; - }; - - // Chromaticity white point. - class MagickPPExport chromaWhitePointImage - { - public: - chromaWhitePointImage(const double x_,const double y_,const double z_); - - void operator()(Image &image_) const; - - private: - double _x; - double _y; - double _z; - }; - - // Colors within this distance are considered equal - class MagickPPExport colorFuzzImage - { - public: - colorFuzzImage( const double fuzz_ ); - - void operator()( Image &image_ ) const; - - private: - double _fuzz; - }; - - // Color at colormap position index_ - class MagickPPExport colorMapImage - { - public: - colorMapImage( const size_t index_, const Color &color_ ); - - void operator()( Image &image_ ) const; - - private: - size_t _index; - Color _color; - }; - - // Composition operator to be used when composition is implicitly used - // (such as for image flattening). - class MagickPPExport composeImage - { - public: - composeImage( const CompositeOperator compose_ ); - - void operator()( Image &image_ ) const; - - private: - CompositeOperator _compose; - }; - - // Compression type - class MagickPPExport compressTypeImage - { - public: - compressTypeImage( const CompressionType compressType_ ); - - void operator()( Image &image_ ) const; - - private: - CompressionType _compressType; - }; - - // Vertical and horizontal resolution in pixels of the image - class MagickPPExport densityImage - { - public: - densityImage( const Point &point_ ); - - void operator()( Image &image_ ) const; - - private: - Point _point; - }; - - // Image depth (bits allocated to red/green/blue components) - class MagickPPExport depthImage - { - public: - depthImage( const size_t depth_ ); - - void operator()( Image &image_ ) const; - - private: - size_t _depth; - }; - - // Endianness (LSBEndian like Intel or MSBEndian like SPARC) for image - // formats which support endian-specific options. - class MagickPPExport endianImage - { - public: - endianImage( const EndianType endian_ ); - - void operator()( Image &image_ ) const; - - private: - EndianType _endian; - }; - - // Image file name - class MagickPPExport fileNameImage - { - public: - fileNameImage( const std::string &fileName_ ); - - void operator()( Image &image_ ) const; - - private: - std::string _fileName; - }; - - // Filter to use when resizing image - class MagickPPExport filterTypeImage - { - public: - filterTypeImage( const FilterType filterType_ ); - - void operator()( Image &image_ ) const; - - private: - FilterType _filterType; - }; - - // Text rendering font - class MagickPPExport fontImage - { - public: - fontImage( const std::string &font_ ); - - void operator()( Image &image_ ) const; - - private: - std::string _font; - }; - - // Font point size - class MagickPPExport fontPointsizeImage - { - public: - fontPointsizeImage( const size_t pointsize_ ); - - void operator()( Image &image_ ) const; - - private: - size_t _pointsize; - }; - - // GIF disposal method - class MagickPPExport gifDisposeMethodImage - { - public: - gifDisposeMethodImage( const DisposeType disposeMethod_ ); - - void operator()( Image &image_ ) const; - - private: - DisposeType _disposeMethod; - }; - - // Type of interlacing to use - class MagickPPExport interlaceTypeImage - { - public: - interlaceTypeImage( const InterlaceType interlace_ ); - - void operator()( Image &image_ ) const; - - private: - InterlaceType _interlace; - }; - - // File type magick identifier (.e.g "GIF") - class MagickPPExport magickImage - { - public: - magickImage( const std::string &magick_ ); - - void operator()( Image &image_ ) const; - - private: - std::string _magick; - }; - - // Image supports transparent color - class MagickPPExport alphaFlagImage - { - public: - alphaFlagImage( const bool alphaFlag_ ); - - void operator()( Image &image_ ) const; - - private: - bool _alphaFlag; - }; - - // Transparent color - class MagickPPExport matteColorImage - { - public: - matteColorImage( const Color &matteColor_ ); - - void operator()( Image &image_ ) const; - - private: - Color _matteColor; - }; - - // Indicate that image is black and white - class MagickPPExport monochromeImage - { - public: - monochromeImage( const bool monochromeFlag_ ); - - void operator()( Image &image_ ) const; - - private: - bool _monochromeFlag; - }; - - // Pen color - class MagickPPExport penColorImage - { - public: - penColorImage( const Color &penColor_ ); - - void operator()( Image &image_ ) const; - - private: - Color _penColor; - }; - - // Pen texture image. - class MagickPPExport penTextureImage - { - public: - penTextureImage( const Image &penTexture_ ); - - void operator()( Image &image_ ) const; - - private: - Image _penTexture; - }; - - // Set pixel color at location x & y. - class MagickPPExport pixelColorImage - { - public: - pixelColorImage( const ::ssize_t x_, - const ::ssize_t y_, - const Color &color_); - - void operator()( Image &image_ ) const; - - private: - ::ssize_t _x; - ::ssize_t _y; - Color _color; - }; - - // Postscript page size. - class MagickPPExport pageImage - { - public: - pageImage( const Geometry &pageSize_ ); - - void operator()( Image &image_ ) const; - - private: - Geometry _pageSize; - }; - - // JPEG/MIFF/PNG compression level (default 75). - class MagickPPExport qualityImage - { - public: - qualityImage( const size_t quality_ ); - - void operator()( Image &image_ ) const; - - private: - size_t _quality; - }; - - // Maximum number of colors to quantize to - class MagickPPExport quantizeColorsImage - { - public: - quantizeColorsImage( const size_t colors_ ); - - void operator()( Image &image_ ) const; - - private: - size_t _colors; - }; - - // Colorspace to quantize in. - class MagickPPExport quantizeColorSpaceImage - { - public: - quantizeColorSpaceImage( const ColorspaceType colorSpace_ ); - - void operator()( Image &image_ ) const; - - private: - ColorspaceType _colorSpace; - }; - - // Dither image during quantization (default true). - class MagickPPExport quantizeDitherImage - { - public: - quantizeDitherImage( const bool ditherFlag_ ); - - void operator()( Image &image_ ) const; - - private: - bool _ditherFlag; - }; - - // Quantization tree-depth - class MagickPPExport quantizeTreeDepthImage - { - public: - quantizeTreeDepthImage( const size_t treeDepth_ ); - - void operator()( Image &image_ ) const; - - private: - size_t _treeDepth; - }; - - // The type of rendering intent - class MagickPPExport renderingIntentImage - { - public: - renderingIntentImage( const RenderingIntent renderingIntent_ ); - - void operator()( Image &image_ ) const; - - private: - RenderingIntent _renderingIntent; - }; - - // Units of image resolution - class MagickPPExport resolutionUnitsImage - { - public: - resolutionUnitsImage( const ResolutionType resolutionUnits_ ); - - void operator()( Image &image_ ) const; - - private: - ResolutionType _resolutionUnits; - }; - - // Image scene number - class MagickPPExport sceneImage - { - public: - sceneImage( const size_t scene_ ); - - void operator()( Image &image_ ) const; - - private: - size_t _scene; - }; - - // adjust the image contrast with a non-linear sigmoidal contrast algorithm - class MagickPPExport sigmoidalContrastImage - { - public: - sigmoidalContrastImage( const size_t sharpen_, - const double contrast, - const double midpoint = QuantumRange / 2.0 ); - - void operator()( Image &image_ ) const; - - private: - size_t _sharpen; - double contrast; - double midpoint; - }; - - // Width and height of a raw image - class MagickPPExport sizeImage - { - public: - sizeImage( const Geometry &geometry_ ); - - void operator()( Image &image_ ) const; - - private: - Geometry _geometry; - }; - - // stripImage strips an image of all profiles and comments. - class MagickPPExport stripImage - { - public: - stripImage( void ); - - void operator()( Image &image_ ) const; - - private: - }; - - // Subimage of an image sequence - class MagickPPExport subImageImage - { - public: - subImageImage( const size_t subImage_ ); - - void operator()( Image &image_ ) const; - - private: - size_t _subImage; - }; - - // Number of images relative to the base image - class MagickPPExport subRangeImage - { - public: - subRangeImage( const size_t subRange_ ); - - void operator()( Image &image_ ) const; - - private: - size_t _subRange; - }; - - // Anti-alias Postscript and TrueType fonts (default true) - class MagickPPExport textAntiAliasImage - { - public: - textAntiAliasImage( const bool flag_ ); - - void operator()( Image &image_ ) const; - - private: - bool _flag; - }; - - // Image storage type - class MagickPPExport typeImage - { - public: - typeImage( const ImageType type_ ); - - void operator()( Image &image_ ) const; - - private: - Magick::ImageType _type; - }; - - - // Print detailed information about the image - class MagickPPExport verboseImage - { - public: - verboseImage( const bool verbose_ ); - - void operator()( Image &image_ ) const; - - private: - bool _verbose; - }; - - // X11 display to display to, obtain fonts from, or to capture - // image from - class MagickPPExport x11DisplayImage - { - public: - x11DisplayImage( const std::string &display_ ); - - void operator()( Image &image_ ) const; - - private: - std::string _display; - }; - - ////////////////////////////////////////////////////////// - // - // Implementation template definitions. Not for end-use. - // - ////////////////////////////////////////////////////////// - - // Changes the channel mask of the images and places the old - // values in the container. - template - void channelMaskImages(InputIterator first_,InputIterator last_, - Container *container_,const ChannelType channel_) - { - MagickCore::ChannelType - channel_mask; - - container_->clear(); - for (InputIterator iter = first_; iter != last_; ++iter) - { - iter->modifyImage(); - channel_mask=MagickCore::SetImageChannelMask(iter->image(),channel_); - container_->push_back(channel_mask); - } - } - - // Insert images in image list into existing container (appending to container) - // The images should not be deleted since only the image ownership is passed. - // The options are copied into the object. - template - void insertImages(Container *sequence_,MagickCore::Image* images_) - { - MagickCore::Image - *image, - *next; - - image=images_; - while (image != (MagickCore::Image *) NULL) - { - next=image->next; - image->next=(MagickCore::Image *) NULL; - - if (next != (MagickCore::Image *) NULL) - next->previous=(MagickCore::Image *) NULL; - - sequence_->push_back(Magick::Image(image)); - - image=next; - } - } - - // Link images together into an image list based on the ordering of - // the container implied by the iterator. This step is done in - // preparation for use with ImageMagick functions which operate on - // lists of images. - // Images are selected by range, first_ to last_ so that a subset of - // the container may be selected. Specify first_ via the - // container's begin() method and last_ via the container's end() - // method in order to specify the entire container. - template - bool linkImages(InputIterator first_,InputIterator last_) - { - MagickCore::Image - *current, - *previous; - - ::ssize_t - scene; - - scene=0; - previous=(MagickCore::Image *) NULL; - for (InputIterator iter = first_; iter != last_; ++iter) - { - // Unless we reduce the reference count to one, the same image - // structure may occur more than once in the container, causing - // the linked list to fail. - iter->modifyImage(); - - current=iter->image(); - - current->previous=previous; - current->next=(MagickCore::Image *) NULL; - current->scene=scene++; - - if (previous != (MagickCore::Image *) NULL) - previous->next=current; - - previous=current; - } - return(scene > 0 ? true : false); - } - - // Restores the channel mask of the images. - template - void restoreChannelMaskImages(InputIterator first_,InputIterator last_, - Container *container_) - { - typename Container::iterator - channel_mask; - - channel_mask=container_->begin(); - for (InputIterator iter = first_; iter != last_; ++iter) - { - iter->modifyImage(); - (void) MagickCore::SetImageChannelMask(iter->image(), - (const MagickCore::ChannelType) *channel_mask); - channel_mask++; - } - } - - // Remove links added by linkImages. This should be called after the - // ImageMagick function call has completed to reset the image list - // back to its pristine un-linked state. - template - void unlinkImages(InputIterator first_,InputIterator last_) - { - MagickCore::Image - *image; - - for (InputIterator iter = first_; iter != last_; ++iter) - { - image=iter->image(); - image->previous=(MagickCore::Image *) NULL; - image->next=(MagickCore::Image *) NULL; - } - } - - /////////////////////////////////////////////////////////////////// - // - // Template definitions for documented API - // - /////////////////////////////////////////////////////////////////// - - template - void animateImages( InputIterator first_,InputIterator last_) - { - if (linkImages(first_,last_) == false) - return; - GetPPException; - MagickCore::AnimateImages(first_->imageInfo(),first_->image(), - exceptionInfo); - unlinkImages(first_,last_); - ThrowPPException(first_->quiet()); - } - - // Append images from list into single image in either horizontal or - // vertical direction. - template - void appendImages( Image *appendedImage_, - InputIterator first_, - InputIterator last_, - bool stack_ = false) { - if (linkImages(first_,last_) == false) - return; - GetPPException; - MagickCore::Image* image = MagickCore::AppendImages( first_->image(), - (MagickBooleanType) stack_, - exceptionInfo ); - unlinkImages( first_, last_ ); - appendedImage_->replaceImage( image ); - ThrowPPException(appendedImage_->quiet()); - } - - // Adds the names of the artifacts of the image to the container. - template - void artifactNames(Container *names_,const Image* image_) - { - const char* - name; - - names_->clear(); - - MagickCore::ResetImageArtifactIterator(image_->constImage()); - name=MagickCore::GetNextImageArtifact(image_->constImage()); - while (name != (const char *) NULL) - { - names_->push_back(std::string(name)); - name=MagickCore::GetNextImageArtifact(image_->constImage()); - } - } - - // Adds the names of the attributes of the image to the container. - template - void attributeNames(Container *names_,const Image* image_) - { - const char* - name; - - names_->clear(); - - MagickCore::ResetImagePropertyIterator(image_->constImage()); - name=MagickCore::GetNextImageProperty(image_->constImage()); - while (name != (const char *) NULL) - { - names_->push_back(std::string(name)); - name=MagickCore::GetNextImageProperty(image_->constImage()); - } - } - - // Average a set of images. - // All the input images must be the same size in pixels. - template - void averageImages( Image *averagedImage_, - InputIterator first_, - InputIterator last_ ) { - if (linkImages(first_,last_) == false) - return; - GetPPException; - MagickCore::Image* image = MagickCore::EvaluateImages( first_->image(), - MagickCore::MeanEvaluateOperator, exceptionInfo ); - unlinkImages( first_, last_ ); - averagedImage_->replaceImage( image ); - ThrowPPException(averagedImage_->quiet()); - } - - // Merge a sequence of images. - // This is useful for GIF animation sequences that have page - // offsets and disposal methods. A container to contain - // the updated image sequence is passed via the coalescedImages_ - // option. - template - void coalesceImages(Container *coalescedImages_,InputIterator first_, - InputIterator last_) - { - bool - quiet; - - MagickCore::Image - *images; - - if (linkImages(first_,last_) == false) - return; - - GetPPException; - quiet=first_->quiet(); - images=MagickCore::CoalesceImages(first_->image(),exceptionInfo); - - // Unlink image list - unlinkImages(first_,last_); - - // Ensure container is empty - coalescedImages_->clear(); - - // Move images to container - insertImages(coalescedImages_,images); - - // Report any error - ThrowPPException(quiet); - } - - // Return format coders matching specified conditions. - // - // The default (if no match terms are supplied) is to return all - // available format coders. - // - // For example, to return all readable formats: - // list coderList; - // coderInfoList( &coderList, CoderInfo::TrueMatch, CoderInfo::AnyMatch, CoderInfo::AnyMatch) - // - template - void coderInfoList( Container *container_, - CoderInfo::MatchType isReadable_ = CoderInfo::AnyMatch, - CoderInfo::MatchType isWritable_ = CoderInfo::AnyMatch, - CoderInfo::MatchType isMultiFrame_ = CoderInfo::AnyMatch - ) { - // Obtain first entry in MagickInfo list - size_t number_formats; - GetPPException; - char **coder_list = - MagickCore::GetMagickList( "*", &number_formats, exceptionInfo ); - if( !coder_list ) - { - throwException(exceptionInfo); - throwExceptionExplicit(MagickCore::MissingDelegateError, - "Coder array not returned!", 0 ); - } - - // Clear out container - container_->clear(); - - for ( ::ssize_t i=0; i < (::ssize_t) number_formats; i++) - { - const MagickCore::MagickInfo *magick_info = - MagickCore::GetMagickInfo( coder_list[i], exceptionInfo ); - coder_list[i]=(char *) - MagickCore::RelinquishMagickMemory( coder_list[i] ); - - // Skip stealth coders - if ( MagickCore::GetMagickStealth(magick_info) ) - continue; - - try { - CoderInfo coderInfo( magick_info->name ); - - // Test isReadable_ - if ( isReadable_ != CoderInfo::AnyMatch && - (( coderInfo.isReadable() && isReadable_ != CoderInfo::TrueMatch ) || - ( !coderInfo.isReadable() && isReadable_ != CoderInfo::FalseMatch )) ) - continue; - - // Test isWritable_ - if ( isWritable_ != CoderInfo::AnyMatch && - (( coderInfo.isWritable() && isWritable_ != CoderInfo::TrueMatch ) || - ( !coderInfo.isWritable() && isWritable_ != CoderInfo::FalseMatch )) ) - continue; - - // Test isMultiFrame_ - if ( isMultiFrame_ != CoderInfo::AnyMatch && - (( coderInfo.isMultiFrame() && isMultiFrame_ != CoderInfo::TrueMatch ) || - ( !coderInfo.isMultiFrame() && isMultiFrame_ != CoderInfo::FalseMatch )) ) - continue; - - // Append matches to container - container_->push_back( coderInfo ); - } - // Intentionally ignore missing module errors - catch (Magick::ErrorModule&) - { - continue; - } - } - coder_list=(char **) MagickCore::RelinquishMagickMemory( coder_list ); - ThrowPPException(false); - } - - // - // Fill container with color histogram. - // Entries are of type "std::pair". Use the pair - // "first" member to access the Color and the "second" member to access - // the number of times the color occurs in the image. - // - // For example: - // - // Using : - // - // Image image("image.miff"); - // map histogram; - // colorHistogram( &histogram, image ); - // std::map::const_iterator p=histogram.begin(); - // while (p != histogram.end()) - // { - // cout << setw(10) << (int)p->second << ": (" - // << setw(quantum_width) << (int)p->first.redQuantum() << "," - // << setw(quantum_width) << (int)p->first.greenQuantum() << "," - // << setw(quantum_width) << (int)p->first.blueQuantum() << ")" - // << endl; - // p++; - // } - // - // Using : - // - // Image image("image.miff"); - // std::vector > histogram; - // colorHistogram( &histogram, image ); - // std::vector >::const_iterator p=histogram.begin(); - // while (p != histogram.end()) - // { - // cout << setw(10) << (int)p->second << ": (" - // << setw(quantum_width) << (int)p->first.redQuantum() << "," - // << setw(quantum_width) << (int)p->first.greenQuantum() << "," - // << setw(quantum_width) << (int)p->first.blueQuantum() << ")" - // << endl; - // p++; - // } - - template - void colorHistogram( Container *histogram_, const Image image) - { - GetPPException; - - // Obtain histogram array - size_t colors; - MagickCore::PixelInfo *histogram_array = - MagickCore::GetImageHistogram( image.constImage(), &colors, exceptionInfo ); - ThrowPPException(image.quiet()); - - // Clear out container - histogram_->clear(); - - // Transfer histogram array to container - for ( size_t i=0; i < colors; i++) - { - histogram_->insert( histogram_->end(), std::pair - ( Color(histogram_array[i]), (size_t) histogram_array[i].count) ); - } - - // Deallocate histogram array - histogram_array=(MagickCore::PixelInfo *) - MagickCore::RelinquishMagickMemory(histogram_array); - } - - // Combines one or more images into a single image. The grayscale value of - // the pixels of each image in the sequence is assigned in order to the - // specified channels of the combined image. The typical ordering would be - // image 1 => Red, 2 => Green, 3 => Blue, etc. - template - void combineImages(Image *combinedImage_,InputIterator first_, - InputIterator last_,const ChannelType channel_, - const ColorspaceType colorspace_ = MagickCore::sRGBColorspace) - { - MagickCore::Image - *image; - - std::vector - channelMask; - - if (linkImages(first_,last_) == false) - return; - GetPPException; - channelMaskImages(first_,last_,&channelMask,channel_); - image=CombineImages(first_->image(),colorspace_,exceptionInfo); - restoreChannelMaskImages(first_,last_,&channelMask); - unlinkImages(first_,last_); - combinedImage_->replaceImage(image); - ThrowPPException(combinedImage_->quiet()); - } - - template - void cropToTiles(Container *tiledImages_,const Image image_, - const Geometry &geometry_) - { - GetPPException; - MagickCore::Image* images=CropImageToTiles(image_.constImage(), - static_cast(geometry_).c_str(),exceptionInfo); - tiledImages_->clear(); - insertImages(tiledImages_,images); - ThrowPPException(image_.quiet()); - } - - // Break down an image sequence into constituent parts. This is - // useful for creating GIF or MNG animation sequences. - template - void deconstructImages(Container *deconstructedImages_, - InputIterator first_,InputIterator last_) - { - bool - quiet; - - MagickCore::Image - *images; - - if (linkImages(first_,last_) == false) - return; - GetPPException; - quiet=first_->quiet(); - images=CompareImagesLayers(first_->image(),CompareAnyLayer,exceptionInfo); - unlinkImages(first_,last_); - - deconstructedImages_->clear(); - insertImages(deconstructedImages_,images); - - ThrowPPException(quiet); - } - - // - // Display an image sequence - // - template - void displayImages(InputIterator first_,InputIterator last_) - { - if (linkImages(first_,last_) == false) - return; - GetPPException; - MagickCore::DisplayImages(first_->imageInfo(),first_->image(), - exceptionInfo); - unlinkImages(first_,last_); - ThrowPPException(first_->quiet()); - } - - // Applies a value to the image with an arithmetic, relational, - // or logical operator to an image. Use these operations to lighten or darken - // an image, to increase or decrease contrast in an image, or to produce the - // "negative" of an image. - template - void evaluateImages( Image *evaluatedImage_, - InputIterator first_, - InputIterator last_, - const MagickEvaluateOperator operator_ ) { - if (linkImages(first_,last_) == false) - return; - GetPPException; - MagickCore::Image* image = EvaluateImages( first_->image(), operator_, exceptionInfo ); - unlinkImages( first_, last_ ); - evaluatedImage_->replaceImage( image ); - ThrowPPException(evaluatedImage_->quiet()); - } - - // Merge a sequence of image frames which represent image layers. - // This is useful for combining Photoshop layers into a single image. - template - void flattenImages( Image *flattendImage_, - InputIterator first_, - InputIterator last_ ) { - if (linkImages(first_,last_) == false) - return; - GetPPException; - MagickCore::Image* image = MagickCore::MergeImageLayers( first_->image(), - FlattenLayer,exceptionInfo ); - unlinkImages( first_, last_ ); - flattendImage_->replaceImage( image ); - ThrowPPException(flattendImage_->quiet()); - } - - // Implements the discrete Fourier transform (DFT) of the image either as a - // magnitude / phase or real / imaginary image pair. - template - void forwardFourierTransformImage( Container *fourierImages_, - const Image &image_ ) { - GetPPException; - - // Build image list - MagickCore::Image* images = ForwardFourierTransformImage( - image_.constImage(), MagickTrue, exceptionInfo); - - // Ensure container is empty - fourierImages_->clear(); - - // Move images to container - insertImages( fourierImages_, images ); - - // Report any error - ThrowPPException(image_.quiet()); - } - template - void forwardFourierTransformImage( Container *fourierImages_, - const Image &image_, const bool magnitude_ ) { - GetPPException; - - // Build image list - MagickCore::Image* images = ForwardFourierTransformImage( - image_.constImage(), magnitude_ == true ? MagickTrue : MagickFalse, - exceptionInfo); - - // Ensure container is empty - fourierImages_->clear(); - - // Move images to container - insertImages( fourierImages_, images ); - - // Report any error - ThrowPPException(image_.quiet()); - } - - // Applies a mathematical expression to a sequence of images. - template - void fxImages(Image *fxImage_,InputIterator first_,InputIterator last_, - const std::string expression) - { - MagickCore::Image - *image; - - if (linkImages(first_,last_) == false) - return; - GetPPException; - image=FxImage(first_->constImage(),expression.c_str(),exceptionInfo); - unlinkImages(first_,last_); - fxImage_->replaceImage(image); - ThrowPPException(fxImage_->quiet()); - } - - // Replace the colors of a sequence of images with the closest color - // from a reference image. - // Set dither_ to true to enable dithering. Set measureError_ to - // true in order to evaluate quantization error. - template - void mapImages(InputIterator first_,InputIterator last_, - const Image& mapImage_,bool dither_=false,bool measureError_=false) - { - MagickCore::Image - *image; - - MagickCore::QuantizeInfo - quantizeInfo; - - if (linkImages(first_,last_) == false) - return; - GetPPException; - MagickCore::GetQuantizeInfo(&quantizeInfo); - quantizeInfo.dither_method = dither_ ? MagickCore::RiemersmaDitherMethod : - MagickCore::NoDitherMethod; - MagickCore::RemapImages(&quantizeInfo,first_->image(), - (mapImage_.isValid() ? mapImage_.constImage() : - (const MagickCore::Image*) NULL),exceptionInfo); - unlinkImages(first_,last_); - if (exceptionInfo->severity != MagickCore::UndefinedException) - { - unlinkImages(first_,last_); - throwException(exceptionInfo,mapImage_.quiet()); - } - - image=first_->image(); - while(image != (MagickCore::Image *) NULL) - { - // Calculate quantization error - if (measureError_) - { - MagickCore::GetImageQuantizeError(image,exceptionInfo); - if (exceptionInfo->severity > MagickCore::UndefinedException) - { - unlinkImages(first_,last_); - throwException(exceptionInfo,mapImage_.quiet()); - } - } - - // Update DirectClass representation of pixels - MagickCore::SyncImage(image,exceptionInfo); - if (exceptionInfo->severity > MagickCore::UndefinedException) - { - unlinkImages(first_,last_); - throwException(exceptionInfo,mapImage_.quiet()); - } - - // Next image - image=image->next; - } - - unlinkImages(first_,last_); - (void) MagickCore::DestroyExceptionInfo(exceptionInfo); - } - - // Composes all the image layers from the current given - // image onward to produce a single image of the merged layers. - template - void mergeImageLayers( Image *mergedImage_, - InputIterator first_, - InputIterator last_, - const LayerMethod method_ ) { - if (linkImages(first_,last_) == false) - return; - GetPPException; - MagickCore::Image* image = MergeImageLayers( first_->image(), method_, exceptionInfo ); - unlinkImages( first_, last_ ); - mergedImage_->replaceImage( image ); - ThrowPPException(mergedImage_->quiet()); - } - - // Create a composite image by combining several separate images. - template - void montageImages(Container *montageImages_,InputIterator first_, - InputIterator last_,const Montage &options_) - { - bool - quiet; - - MagickCore::Image - *images; - - MagickCore::MontageInfo - *montageInfo; - - if (linkImages(first_,last_) == false) - return; - - montageInfo=static_cast( - MagickCore::AcquireMagickMemory(sizeof(MagickCore::MontageInfo))); - - // Update montage options with those set in montageOpts_ - options_.updateMontageInfo(*montageInfo); - - // Update options which must transfer to image options - if (options_.label().length() != 0) - first_->label(options_.label()); - - // Do montage - GetPPException; - quiet=first_->quiet(); - images=MagickCore::MontageImages(first_->image(),montageInfo, - exceptionInfo); - - // Unlink linked image list - unlinkImages(first_,last_); - - // Reset output container to pristine state - montageImages_->clear(); - - if (images != (MagickCore::Image *) NULL) - insertImages(montageImages_,images); - - // Clean up any allocated data in montageInfo - MagickCore::DestroyMontageInfo(montageInfo); - - // Report any montage error - ThrowPPException(quiet); - - // Apply transparency to montage images - if (montageImages_->size() > 0 && options_.transparentColor().isValid()) - for_each(montageImages_->begin(),montageImages_->end(),transparentImage( - options_.transparentColor())); - } - - // Morph a set of images - template - void morphImages(Container *morphedImages_,InputIterator first_, - InputIterator last_,size_t frames_) - { - bool - quiet; - - MagickCore::Image - *images; - - if (linkImages(first_,last_) == false) - return; - - GetPPException; - quiet=first_->quiet(); - images=MagickCore::MorphImages(first_->image(),frames_,exceptionInfo); - - // Unlink image list - unlinkImages(first_,last_); - - // Ensure container is empty - morphedImages_->clear(); - - // Move images to container - insertImages(morphedImages_,images); - - // Report any error - ThrowPPException(quiet); - } - - // Inlay a number of images to form a single coherent picture. - template - void mosaicImages( Image *mosaicImage_, - InputIterator first_, - InputIterator last_ ) { - if (linkImages(first_,last_) == false) - return; - GetPPException; - MagickCore::Image* image = MagickCore::MergeImageLayers( first_->image(), - MosaicLayer,exceptionInfo ); - unlinkImages( first_, last_ ); - mosaicImage_->replaceImage( image ); - ThrowPPException(mosaicImage_->quiet()); - } - - // Compares each image the GIF disposed forms of the previous image in - // the sequence. From this it attempts to select the smallest cropped - // image to replace each frame, while preserving the results of the - // GIF animation. - template - void optimizeImageLayers(Container *optimizedImages_,InputIterator first_, - InputIterator last_) - { - bool - quiet; - - MagickCore::Image - *images; - - if (linkImages(first_,last_) == false) - return; - - GetPPException; - quiet=first_->quiet(); - images=OptimizeImageLayers(first_->image(),exceptionInfo); - - unlinkImages(first_,last_); - - optimizedImages_->clear(); - - insertImages(optimizedImages_,images); - - ThrowPPException(quiet); - } - - // optimizeImagePlusLayers is exactly as optimizeImageLayers, but may - // also add or even remove extra frames in the animation, if it improves - // the total number of pixels in the resulting GIF animation. - template - void optimizePlusImageLayers(Container *optimizedImages_, - InputIterator first_,InputIterator last_ ) - { - bool - quiet; - - MagickCore::Image - *images; - - if (linkImages(first_,last_) == false) - return; - - GetPPException; - quiet=first_->quiet(); - images=OptimizePlusImageLayers(first_->image(),exceptionInfo); - - unlinkImages(first_,last_); - - optimizedImages_->clear(); - - insertImages(optimizedImages_,images); - - ThrowPPException(quiet); - } - - // Compares each image the GIF disposed forms of the previous image in the - // sequence. Any pixel that does not change the displayed result is replaced - // with transparency. - template - void optimizeTransparency(InputIterator first_,InputIterator last_) - { - if (linkImages(first_,last_) == false) - return; - GetPPException; - OptimizeImageTransparency(first_->image(),exceptionInfo); - unlinkImages(first_,last_ ); - - ThrowPPException(first_->quiet()); - } - - // Ping images into existing container (appending to container) - template - void pingImages(Container *sequence_,const std::string &imageSpec_, - ReadOptions &options) - { - options.ping(true); - readImages(sequence_,imageSpec_,options); - } - - template - void pingImages(Container *sequence_,const std::string &imageSpec_) - { - ReadOptions options; - pingImages(sequence_,imageSpec_,options); - } - - template - void pingImages(Container *sequence_,const Blob &blob_,ReadOptions &options) - { - options.ping(true); - readImages(sequence_,blob_,options); - } - - template - void pingImages(Container *sequence_,const Blob &blob_) - { - ReadOptions options; - pingImages(sequence_,blob_,options); - } - - // Adds the names of the profiles of the image to the container. - template - void profileNames(Container *names_,const Image* image_) - { - const char* - name; - - names_->clear(); - - MagickCore::ResetImageProfileIterator(image_->constImage()); - name=MagickCore::GetNextImageProfile(image_->constImage()); - while (name != (const char *) NULL) - { - names_->push_back(std::string(name)); - name=MagickCore::GetNextImageProfile(image_->constImage()); - } - } - - // Quantize colors in images using current quantization settings - // Set measureError_ to true in order to measure quantization error - template - void quantizeImages(InputIterator first_,InputIterator last_, - bool measureError_ = false) - { - if (linkImages(first_,last_) == false) - return; - GetPPException; - MagickCore::QuantizeImages(first_->quantizeInfo(),first_->image(), - exceptionInfo); - unlinkImages(first_,last_); - - MagickCore::Image *image=first_->image(); - while (image != (MagickCore::Image *) NULL) - { - // Calculate quantization error - if (measureError_) - MagickCore::GetImageQuantizeError(image,exceptionInfo); - - // Update DirectClass representation of pixels - MagickCore::SyncImage(image,exceptionInfo); - - image=image->next; - } - unlinkImages(first_,last_); - ThrowPPException(first_->quiet()); - } - - // Read images into existing container (appending to container) - template - void readImages(Container *sequence_,const std::string &imageSpec_, - ReadOptions &options) - { - MagickCore::Image - *images; - - MagickCore::ImageInfo - *imageInfo; - - imageInfo=options.imageInfo(); - imageSpec_.copy(imageInfo->filename,MagickPathExtent-1); - imageInfo->filename[imageSpec_.length()] = 0; - GetPPException; - images=MagickCore::ReadImage(imageInfo,exceptionInfo); - insertImages(sequence_,images); - ThrowPPException(options.quiet()); - } - - template - void readImages(Container *sequence_,const std::string &imageSpec_) - { - ReadOptions options; - readImages(sequence_,imageSpec_,options); - } - - template - void readImages(Container *sequence_,const Blob &blob_,ReadOptions &options) - { - MagickCore::Image - *images; - - GetPPException; - images=MagickCore::BlobToImage(options.imageInfo(),blob_.data(), - blob_.length(),exceptionInfo); - insertImages(sequence_,images); - ThrowPPException(options.quiet()); - } - - template - void readImages(Container *sequence_,const Blob &blob_) - { - ReadOptions options; - readImages(sequence_,blob_,options); - } - - // Returns a separate grayscale image for each channel specified. - template - void separateImages(Container *separatedImages_,Image &image_, - const ChannelType channel_) - { - MagickCore::ChannelType - channel_mask; - - MagickCore::Image - *images; - - GetPPException; - channel_mask=MagickCore::SetImageChannelMask(image_.image(),channel_); - images=SeparateImages(image_.constImage(),exceptionInfo); - MagickCore::SetPixelChannelMask(image_.image(),channel_mask); - - separatedImages_->clear(); - insertImages(separatedImages_,images); - - ThrowPPException(image_.quiet()); - } - - // Smush images from list into single image in either horizontal or - // vertical direction. - template - void smushImages(Image *smushedImage_,InputIterator first_, - InputIterator last_,const ssize_t offset_,bool stack_=false) - { - MagickCore::Image - *newImage; - - if (linkImages(first_,last_) == false) - return; - GetPPException; - newImage=MagickCore::SmushImages(first_->constImage(), - (MagickBooleanType) stack_,offset_,exceptionInfo); - unlinkImages(first_,last_); - smushedImage_->replaceImage(newImage); - ThrowPPException(smushedImage_->quiet()); - } - - // Write Images - template - void writeImages( InputIterator first_, - InputIterator last_, - const std::string &imageSpec_, - bool adjoin_ = true ) { - - if (linkImages(first_,last_) == false) - return; - - first_->adjoin( adjoin_ ); - - GetPPException; - ::ssize_t errorStat = MagickCore::WriteImages( first_->constImageInfo(), - first_->image(), - imageSpec_.c_str(), - exceptionInfo ); - unlinkImages( first_, last_ ); - - if ( errorStat != false ) - { - (void) MagickCore::DestroyExceptionInfo( exceptionInfo ); - return; - } - - ThrowPPException(first_->quiet()); - } - // Write images to BLOB - template - void writeImages( InputIterator first_, - InputIterator last_, - Blob *blob_, - bool adjoin_ = true) { - if (linkImages(first_,last_) == false) - return; - - first_->adjoin( adjoin_ ); - - GetPPException; - size_t length = 2048; // Efficient size for small images - void* data = MagickCore::ImagesToBlob( first_->imageInfo(), - first_->image(), - &length, - exceptionInfo); - blob_->updateNoCopy( data, length, Magick::Blob::MallocAllocator ); - - unlinkImages( first_, last_ ); - - ThrowPPException(first_->quiet()); - } - -} // namespace Magick - -#endif // Magick_STL_header diff --git a/Magick++/lib/Magick++/SecurityPolicy.h b/Magick++/lib/Magick++/SecurityPolicy.h deleted file mode 100644 index 71405639b..000000000 --- a/Magick++/lib/Magick++/SecurityPolicy.h +++ /dev/null @@ -1,48 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Dirk Lemstra 2018 -// -// Definition of the security policy. -// - -#if !defined(Magick_SecurityPolicy_header) -#define Magick_SecurityPolicy_header - -#include "Magick++/Include.h" -#include - -namespace Magick -{ - class MagickPPExport SecurityPolicy - { - public: - - // The maximum number of significant digits to be printed. - static bool precision(const int precision_); - - // Enables anonymous mapping for pixel cache. - static bool anonymousCacheMemoryMap(); - - // Enables anonymous virtual memory. - static bool anonymousSystemMemoryMap(); - - // The memory request limit in bytes. - static bool maxMemoryRequest(const MagickSizeType limit_); - - // The number of passes to use when shredding files. - static bool shred(const int passes_); - - private: - SecurityPolicy(void); - - static bool setValue(const PolicyDomain domain_, const std::string name_, - const std::string value_); - - template - static std::string toString(const T& value); - - }; // class SecurityPolicy - -} // Magick namespace - -#endif // Magick_SecurityPolicy_header diff --git a/Magick++/lib/Magick++/Statistic.h b/Magick++/lib/Magick++/Statistic.h deleted file mode 100644 index f9d46a616..000000000 --- a/Magick++/lib/Magick++/Statistic.h +++ /dev/null @@ -1,307 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Dirk Lemstra 2014-2015 -// -// Definition of channel moments. -// - -#if !defined (Magick_ChannelMoments_header) -#define Magick_ChannelMoments_header - -#include "Magick++/Include.h" -#include - -namespace Magick -{ - class Image; - - class MagickPPExport ChannelMoments - { - public: - - // Default constructor - ChannelMoments(void); - - // Copy constructor - ChannelMoments(const ChannelMoments &channelMoments_); - - // Destroy channel moments - ~ChannelMoments(void); - - // X position of centroid - double centroidX(void) const; - - // Y position of centroid - double centroidY(void) const; - - // The channel - PixelChannel channel(void) const; - - // X position of ellipse axis - double ellipseAxisX(void) const; - - // Y position of ellipse axis - double ellipseAxisY(void) const; - - // Ellipse angle - double ellipseAngle(void) const; - - // Ellipse eccentricity - double ellipseEccentricity(void) const; - - // Ellipse intensity - double ellipseIntensity(void) const; - - // Hu invariants (valid range for index is 0-7) - double huInvariants(const size_t index_) const; - - // Does object contain valid channel moments? - bool isValid() const; - - // - // Implemementation methods - // - - ChannelMoments(const PixelChannel channel_, - const MagickCore::ChannelMoments *channelMoments_); - - private: - PixelChannel _channel; - std::vector _huInvariants; - double _centroidX; - double _centroidY; - double _ellipseAxisX; - double _ellipseAxisY; - double _ellipseAngle; - double _ellipseEccentricity; - double _ellipseIntensity; - }; - - class MagickPPExport ChannelPerceptualHash - { - public: - - // Default constructor - ChannelPerceptualHash(void); - - // Copy constructor - ChannelPerceptualHash(const ChannelPerceptualHash &channelPerceptualHash_); - - // Constructor using the specified hash string - ChannelPerceptualHash(const PixelChannel channel_, - const std::string &hash_); - - // Destroy channel perceptual hash - ~ChannelPerceptualHash(void); - - // Return hash string - operator std::string() const; - - // The channel - PixelChannel channel(void) const; - - // Does object contain valid channel perceptual hash? - bool isValid() const; - - // Returns the sum squared difference between this hash and the other hash - double sumSquaredDifferences( - const ChannelPerceptualHash &channelPerceptualHash_); - - // SRGB hu preceptual hash (valid range for index is 0-6) - double srgbHuPhash(const size_t index_) const; - - // HCLp hu preceptual hash (valid range for index is 0-6) - double hclpHuPhash(const size_t index_) const; - - // - // Implemementation methods - // - - ChannelPerceptualHash(const PixelChannel channel_, - const MagickCore::ChannelPerceptualHash *channelPerceptualHash_); - - private: - PixelChannel _channel; - std::vector _srgbHuPhash; - std::vector _hclpHuPhash; - }; - - // Obtain image statistics. Statistics are normalized to the range - // of 0.0 to 1.0 and are output to the specified ImageStatistics - // structure. - class MagickPPExport ChannelStatistics - { - public: - - // Default constructor - ChannelStatistics(void); - - // Copy constructor - ChannelStatistics(const ChannelStatistics &channelStatistics_); - - // Destroy channel statistics - ~ChannelStatistics(void); - - // Area - double area() const; - - // The channel - PixelChannel channel(void) const; - - // Depth - size_t depth() const; - - // Entropy - double entropy() const; - - // Does object contain valid channel statistics? - bool isValid() const; - - // Kurtosis - double kurtosis() const; - - // Minimum value observed - double maxima() const; - - // Average (mean) value observed - double mean() const; - - // Maximum value observed - double minima() const; - - // Skewness - double skewness() const; - - // Standard deviation, sqrt(variance) - double standardDeviation() const; - - // Sum - double sum() const; - - // Sum cubed - double sumCubed() const; - - // Sum fourth power - double sumFourthPower() const; - - // Sum squared - double sumSquared() const; - - // Variance - double variance() const; - - // - // Implemementation methods - // - - ChannelStatistics(const PixelChannel channel_, - const MagickCore::ChannelStatistics *channelStatistics_); - - private: - PixelChannel _channel; - double _area; - size_t _depth; - double _entropy; - double _kurtosis; - double _maxima; - double _mean; - double _minima; - double _skewness; - double _standardDeviation; - double _sum; - double _sumCubed; - double _sumFourthPower; - double _sumSquared; - double _variance; - }; - - class MagickPPExport ImageMoments - { - public: - - // Default constructor - ImageMoments(void); - - // Copy constructor - ImageMoments(const ImageMoments &imageMoments_); - - // Destroy image moments - ~ImageMoments(void); - - // Returns the moments for the specified channel - ChannelMoments channel(const PixelChannel channel_) const; - - // - // Implemementation methods - // - ImageMoments(const Image &image_); - - private: - std::vector _channels; - }; - - class MagickPPExport ImagePerceptualHash - { - public: - - // Default constructor - ImagePerceptualHash(void); - - // Copy constructor - ImagePerceptualHash(const ImagePerceptualHash &imagePerceptualHash_); - - // Constructor using the specified hash string - ImagePerceptualHash(const std::string &hash_); - - // Destroy image perceptual hash - ~ImagePerceptualHash(void); - - // Return hash string - operator std::string() const; - - // Returns the perceptual hash for the specified channel - ChannelPerceptualHash channel(const PixelChannel channel_) const; - - // Does object contain valid perceptual hash? - bool isValid() const; - - // Returns the sum squared difference between this hash and the other hash - double sumSquaredDifferences( - const ImagePerceptualHash &channelPerceptualHash_); - - // - // Implemementation methods - // - ImagePerceptualHash(const Image &image_); - - private: - std::vector _channels; - }; - - class MagickPPExport ImageStatistics - { - public: - - // Default constructor - ImageStatistics(void); - - // Copy constructor - ImageStatistics(const ImageStatistics &imageStatistics_); - - // Destroy image statistics - ~ImageStatistics(void); - - // Returns the statistics for the specified channel - ChannelStatistics channel(const PixelChannel channel_) const; - - // - // Implemementation methods - // - ImageStatistics(const Image &image_); - - private: - std::vector _channels; - }; -} - -#endif // Magick_ChannelMoments_header diff --git a/Magick++/lib/Magick++/Thread.h b/Magick++/lib/Magick++/Thread.h deleted file mode 100644 index 3a25713b0..000000000 --- a/Magick++/lib/Magick++/Thread.h +++ /dev/null @@ -1,60 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2003 -// Copyright Dirk Lemstra 2014 -// -// Definition of types and classes to support threads -// -// This class is a Magick++ implementation class and is not intended -// for use by end-users. -// -#if !defined (Magick_Thread_header) -#define Magick_Thread_header - -#include "Magick++/Include.h" - -#if defined(_VISUALC_) -#include -#endif // defined(_VISUALC_) - -#if defined(MAGICKCORE_HAVE_PTHREAD) -# include -#endif // defined(MAGICKCORE_HAVE_PTHREAD) - -namespace Magick -{ - // Mutex lock wrapper - class MagickPPExport MutexLock - { - public: - - // Default constructor - MutexLock(void); - - // Destructor - ~MutexLock(void); - - // Lock mutex - void lock(void); - - // Unlock mutex - void unlock(void); - - private: - - // Don't support copy constructor - MutexLock(const MutexLock& original_); - - // Don't support assignment - MutexLock& operator=(const MutexLock& original ); - -#if defined(MAGICKCORE_HAVE_PTHREAD) - pthread_mutex_t _mutex; -#endif -#if defined(_MT) && defined(_VISUALC_) - HANDLE _mutex; -#endif - }; -} - -#endif // Magick_Thread_header diff --git a/Magick++/lib/Magick++/TypeMetric.h b/Magick++/lib/Magick++/TypeMetric.h deleted file mode 100644 index cf779d389..000000000 --- a/Magick++/lib/Magick++/TypeMetric.h +++ /dev/null @@ -1,68 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 2001, 2002 -// Copyright Dirk Lemstra 2014-2018 -// -// TypeMetric Definition -// -// Container for font type metrics -// - -#if !defined (Magick_TypeMetric_header) -#define Magick_TypeMetric_header - -#include "Magick++/Include.h" -#include "Magick++/Drawable.h" - -namespace Magick -{ - class MagickPPExport TypeMetric - { - friend class Image; - - public: - - // Default constructor - TypeMetric(void); - - // Destructor - ~TypeMetric(void); - - // The distance in pixels from the text baseline to the highest/upper - // grid coordinate used to place an outline point. - double ascent(void) const; - - // The bounds of the type metric. - Geometry bounds(void) const; - - // The distance in pixels from the baseline to the lowest grid coordinate - // used to place an outline point. Always a negative value. - double descent(void) const; - - // Maximum horizontal advance in pixels. - double maxHorizontalAdvance(void) const; - - // The origin. - Coordinate origin(void) const; - - // The number of pixels per em. - Coordinate pixelsPerEm(void) const; - - // Text height in pixels. - double textHeight(void) const; - - // Text width in pixels. - double textWidth(void) const; - - // Underline position. - double underlinePosition(void) const; - - // Underline thickness. - double underlineThickness(void) const; - - private: - MagickCore::TypeMetric _typeMetric; - }; -} // namespace Magick - -#endif // Magick_TypeMetric_header diff --git a/Magick++/lib/Montage.cpp b/Magick++/lib/Montage.cpp deleted file mode 100644 index 33bf0ce07..000000000 --- a/Magick++/lib/Montage.cpp +++ /dev/null @@ -1,298 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003 -// -// Implementation of Montage -// - -#define MAGICKCORE_IMPLEMENTATION 1 -#define MAGICK_PLUSPLUS_IMPLEMENTATION 1 - -#include "Magick++/Include.h" -#include -#include - -#include "Magick++/Montage.h" -#include "Magick++/Functions.h" - -Magick::Montage::Montage(void) - : _backgroundColor("#ffffff"), - _fileName(), - _fill("#000000ff"), - _font(), - _geometry("120x120+4+3>"), - _gravity(CenterGravity), - _label(), - _pointSize(12), - _shadow(false), - _stroke(), - _texture(), - _tile("6x4"), - _title(), - _transparentColor() -{ -} - -Magick::Montage::~Montage(void) -{ -} - -void Magick::Montage::backgroundColor(const Magick::Color &backgroundColor_) -{ - _backgroundColor=backgroundColor_; -} - -Magick::Color Magick::Montage::backgroundColor(void) const -{ - return(_backgroundColor); -} - -void Magick::Montage::fileName(const std::string &fileName_) -{ - _fileName=fileName_; -} - -std::string Magick::Montage::fileName(void) const -{ - return(_fileName); -} - -void Magick::Montage::fillColor(const Color &fill_) -{ - _fill=fill_; -} - -Magick::Color Magick::Montage::fillColor(void) const -{ - return(_fill); -} - -void Magick::Montage::font(const std::string &font_) -{ - _font=font_; -} - -std::string Magick::Montage::font(void) const -{ - return(_font); -} - -void Magick::Montage::geometry(const Magick::Geometry &geometry_) -{ - _geometry=geometry_; -} - -Magick::Geometry Magick::Montage::geometry(void) const -{ - return(_geometry); -} - -void Magick::Montage::gravity(Magick::GravityType gravity_) -{ - _gravity=gravity_; -} - -Magick::GravityType Magick::Montage::gravity(void) const -{ - return(_gravity); -} - -void Magick::Montage::label(const std::string &label_) -{ - _label=label_; -} - -std::string Magick::Montage::label(void) const -{ - return(_label); -} - -void Magick::Montage::pointSize(size_t pointSize_) -{ - _pointSize=pointSize_; -} - -size_t Magick::Montage::pointSize(void) const -{ - return(_pointSize); -} - -void Magick::Montage::shadow(bool shadow_) -{ - _shadow=shadow_; -} - -bool Magick::Montage::shadow(void) const -{ - return(_shadow); -} - -void Magick::Montage::strokeColor(const Color &stroke_) -{ - _stroke=stroke_; -} - -Magick::Color Magick::Montage::strokeColor(void) const -{ - return(_stroke); -} - -void Magick::Montage::texture(const std::string &texture_) -{ - _texture=texture_; -} - -std::string Magick::Montage::texture(void) const -{ - return(_texture); -} - -void Magick::Montage::tile(const Geometry &tile_) -{ - _tile=tile_; -} - -Magick::Geometry Magick::Montage::tile(void) const -{ - return(_tile); -} - -void Magick::Montage::title(const std::string &title_) -{ - _title=title_; -} - -std::string Magick::Montage::title(void) const -{ - return(_title); -} - -void Magick::Montage::transparentColor(const Magick::Color &transparentColor_) -{ - _transparentColor=transparentColor_; -} - -Magick::Color Magick::Montage::transparentColor(void) const -{ - return(_transparentColor); -} - -void Magick::Montage::updateMontageInfo(MontageInfo &montageInfo_ ) const -{ - (void) memset(&montageInfo_,0,sizeof(montageInfo_)); - - // matte_color - montageInfo_.matte_color=Color(); - // background_color - montageInfo_.background_color=_backgroundColor; - // border_color - montageInfo_.border_color=Color(); - // border_width - montageInfo_.border_width=0; - // filename - if (_font.length() != 0) - { - _fileName.copy(montageInfo_.filename,MagickPathExtent-1); - montageInfo_.filename[ _fileName.length() ] = 0; // null terminate - } - // fill - montageInfo_.fill=_fill; - // font - if (_font.length() != 0) - Magick::CloneString(&montageInfo_.font,_font); - // geometry - if (_geometry.isValid()) - Magick::CloneString(&montageInfo_.geometry,_geometry); - // gravity - montageInfo_.gravity=_gravity; - // pointsize - montageInfo_.pointsize=_pointSize; - // shadow - montageInfo_.shadow=static_cast - (_shadow ? MagickTrue : MagickFalse); - // signature (validity stamp) - montageInfo_.signature=MagickCoreSignature; - // stroke - montageInfo_.stroke=_stroke; - // texture - if (_texture.length() != 0) - Magick::CloneString(&montageInfo_.texture,_texture); - // tile - if (_tile.isValid()) - Magick::CloneString(&montageInfo_.tile,_tile); - // title - if (_title.length() != 0) - Magick::CloneString(&montageInfo_.title,_title); -} - -// -// Implementation of MontageFramed -// - -Magick::MontageFramed::MontageFramed(void) - : _matteColor("#bdbdbd"), - _borderColor("#dfdfdf"), - _borderWidth(0), - _frame() -{ -} - -Magick::MontageFramed::~MontageFramed(void) -{ -} - -void Magick::MontageFramed::matteColor(const Magick::Color &matteColor_) -{ - _matteColor=matteColor_; -} - -Magick::Color Magick::MontageFramed::matteColor(void) const -{ - return(_matteColor); -} - -void Magick::MontageFramed::borderColor(const Magick::Color &borderColor_) -{ - _borderColor=borderColor_; -} - -Magick::Color Magick::MontageFramed::borderColor(void) const -{ - return(_borderColor); -} - -void Magick::MontageFramed::borderWidth(size_t borderWidth_) -{ - _borderWidth=borderWidth_; -} - -size_t Magick::MontageFramed::borderWidth(void) const -{ - return(_borderWidth); -} - -void Magick::MontageFramed::frameGeometry(const Magick::Geometry &frame_) -{ - _frame=frame_; -} - -Magick::Geometry Magick::MontageFramed::frameGeometry(void) const -{ - return(_frame); -} - -void Magick::MontageFramed::updateMontageInfo(MontageInfo &montageInfo_) const -{ - // Do base updates - Montage::updateMontageInfo(montageInfo_); - - // matte_color - montageInfo_.matte_color = _matteColor; - // border_color - montageInfo_.border_color=_borderColor; - // border_width - montageInfo_.border_width=_borderWidth; - // frame - if (_frame.isValid()) - Magick::CloneString(&montageInfo_.frame,_frame); -} diff --git a/Magick++/lib/Options.cpp b/Magick++/lib/Options.cpp deleted file mode 100644 index 9d2a5904b..000000000 --- a/Magick++/lib/Options.cpp +++ /dev/null @@ -1,988 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003 -// Copyright Dirk Lemstra 2014-2018 -// -// Implementation of Options -// -// A wrapper around DrawInfo, ImageInfo, and QuantizeInfo -// - -#define MAGICKCORE_IMPLEMENTATION 1 -#define MAGICK_PLUSPLUS_IMPLEMENTATION 1 - -#include "Magick++/Include.h" -#include -#include -#include -#include - -#include "Magick++/Options.h" -#include "Magick++/Functions.h" -#include "Magick++/Exception.h" - -#define MagickPI 3.14159265358979323846264338327950288419716939937510 -#define DegreesToRadians(x) (MagickPI*(x)/180.0) - -Magick::Options::Options(void) - : _imageInfo(static_cast(AcquireMagickMemory( - sizeof(ImageInfo)))), - _quantizeInfo(static_cast(AcquireMagickMemory( - sizeof(QuantizeInfo)))), - _drawInfo(static_cast(AcquireMagickMemory(sizeof(DrawInfo)))), - _quiet(false) -{ - // Initialize image info with defaults - GetImageInfo(_imageInfo); - - // Initialize quantization info - GetQuantizeInfo(_quantizeInfo); - - // Initialize drawing info - GetDrawInfo(_imageInfo,_drawInfo); -} - -Magick::Options::Options(const Options& options_) - : _imageInfo(CloneImageInfo(options_._imageInfo)), - _quantizeInfo(CloneQuantizeInfo(options_._quantizeInfo)), - _drawInfo(CloneDrawInfo(_imageInfo,options_._drawInfo)), - _quiet(options_._quiet) -{ -} - -Magick::Options::~Options() -{ - // Destroy image info - _imageInfo=DestroyImageInfo(_imageInfo); - - // Destroy quantization info - _quantizeInfo=DestroyQuantizeInfo(_quantizeInfo); - - // Destroy drawing info - _drawInfo=DestroyDrawInfo(_drawInfo); -} - -void Magick::Options::adjoin(const bool flag_) -{ - _imageInfo->adjoin=static_cast( - flag_ ? MagickTrue : MagickFalse); -} - -bool Magick::Options::adjoin(void) const -{ - return(static_cast(_imageInfo->adjoin)); -} - -void Magick::Options::matteColor(const Color &matteColor_) -{ - _imageInfo->matte_color=matteColor_; -} - -Magick::Color Magick::Options::matteColor(void) const -{ - return(Magick::Color(_imageInfo->matte_color)); -} - -void Magick::Options::backgroundColor(const Color &color_) -{ - _imageInfo->background_color=color_; -} - -Magick::Color Magick::Options::backgroundColor(void) const -{ - return(Color(_imageInfo->background_color)); -} - -void Magick::Options::backgroundTexture(const std::string &backgroundTexture_) -{ - if (backgroundTexture_.length() == 0) - _imageInfo->texture=(char *) RelinquishMagickMemory(_imageInfo->texture); - else - Magick::CloneString(&_imageInfo->texture,backgroundTexture_); -} - -std::string Magick::Options::backgroundTexture(void) const -{ - if (_imageInfo->texture) - return(std::string(_imageInfo->texture)); - else - return(std::string()); -} - -void Magick::Options::borderColor(const Color &color_) -{ - _imageInfo->border_color=color_; - _drawInfo->border_color=color_; -} - -Magick::Color Magick::Options::borderColor(void) const -{ - return(Color(_imageInfo->border_color)); -} - -void Magick::Options::boxColor(const Color &boxColor_) -{ - _drawInfo->undercolor=boxColor_; -} - -Magick::Color Magick::Options::boxColor(void) const -{ - return(Color(_drawInfo->undercolor)); -} - -void Magick::Options::colorspaceType(const ColorspaceType colorspace_) -{ - _imageInfo->colorspace=colorspace_; -} - -Magick::ColorspaceType Magick::Options::colorspaceType(void) const -{ - return(static_cast(_imageInfo->colorspace)); -} - -void Magick::Options::compressType(const CompressionType compressType_) -{ - _imageInfo->compression=compressType_; -} - -Magick::CompressionType Magick::Options::compressType(void) const -{ - return(static_cast(_imageInfo->compression)); -} - -void Magick::Options::colorFuzz(const double fuzz_) -{ - _imageInfo->fuzz=fuzz_; -} - -double Magick::Options::colorFuzz(void) const -{ - return(_imageInfo->fuzz); -} - -void Magick::Options::debug(const bool flag_) -{ - if (flag_) - SetLogEventMask("All"); - else - SetLogEventMask("None"); -} - -bool Magick::Options::debug(void) const -{ - if (IsEventLogging()) - return(true); - return(false); -} - -void Magick::Options::density(const Point &density_) -{ - if (!density_.isValid()) - _imageInfo->density=(char *) RelinquishMagickMemory(_imageInfo->density); - else - CloneString(&_imageInfo->density,density_); -} - -Magick::Point Magick::Options::density(void) const -{ - if (_imageInfo->density) - return(Point(_imageInfo->density)); - - return(Point()); -} - -void Magick::Options::depth(const size_t depth_) -{ - _imageInfo->depth=depth_; -} - -size_t Magick::Options::depth(void) const -{ - return(_imageInfo->depth); -} - -void Magick::Options::endian(const Magick::EndianType endian_) -{ - _imageInfo->endian=endian_; -} - -Magick::EndianType Magick::Options::endian(void) const -{ - return(_imageInfo->endian); -} - -void Magick::Options::file(FILE *file_) -{ - SetImageInfoFile(_imageInfo,file_); -} - -FILE *Magick::Options::file(void) const -{ - return(GetImageInfoFile(_imageInfo)); -} - -void Magick::Options::fileName(const std::string &fileName_) -{ - ssize_t - max_length; - - max_length=sizeof(_imageInfo->filename)-1; - fileName_.copy(_imageInfo->filename,max_length); - if ((ssize_t) fileName_.length() > max_length) - _imageInfo->filename[max_length]=0; - else - _imageInfo->filename[fileName_.length()]=0; -} - -std::string Magick::Options::fileName(void) const -{ - return(std::string(_imageInfo->filename)); -} - -void Magick::Options::fillColor(const Color &fillColor_) -{ - _drawInfo->fill=fillColor_; - if (fillColor_ == Color()) - fillPattern((const MagickCore::Image*) NULL); - setOption("fill",fillColor_); -} - -Magick::Color Magick::Options::fillColor(void) const -{ - return(_drawInfo->fill); -} - -void Magick::Options::fillPattern(const MagickCore::Image *fillPattern_) -{ - if (_drawInfo->fill_pattern) - _drawInfo->fill_pattern=DestroyImageList(_drawInfo->fill_pattern); - - if (fillPattern_) - { - GetPPException; - _drawInfo->fill_pattern=CloneImage(const_cast( - fillPattern_),0,0,static_cast(MagickTrue), - exceptionInfo); - ThrowPPException(_quiet); - } -} - -const MagickCore::Image *Magick::Options::fillPattern(void) const -{ - return(_drawInfo->fill_pattern); -} - -void Magick::Options::fillRule(const FillRule &fillRule_) -{ - _drawInfo->fill_rule=fillRule_; -} - -Magick::FillRule Magick::Options::fillRule(void) const -{ - return(_drawInfo->fill_rule); -} - -void Magick::Options::font(const std::string &font_) -{ - if (font_.length() == 0) - { - _imageInfo->font=(char *) RelinquishMagickMemory(_imageInfo->font); - _drawInfo->font=(char *) RelinquishMagickMemory(_drawInfo->font); - } - else - { - Magick::CloneString(&_imageInfo->font,font_); - Magick::CloneString(&_drawInfo->font,font_); - } -} - -std::string Magick::Options::font(void) const -{ - if (_imageInfo->font) - return(std::string(_imageInfo->font)); - - return(std::string()); -} - -void Magick::Options::fontFamily(const std::string &family_) -{ - if (family_.length() == 0) - { - _drawInfo->family=(char *) RelinquishMagickMemory(_drawInfo->font); - DestroyString(RemoveImageOption(imageInfo(),"family")); - } - else - { - Magick::CloneString(&_drawInfo->family,family_); - (void) SetImageOption(imageInfo(),"family",family_.c_str()); - } -} - -std::string Magick::Options::fontFamily(void) const -{ - if (_drawInfo->family) - return(std::string(_drawInfo->family)); - - return(std::string()); -} - -void Magick::Options::fontPointsize(const double pointSize_) -{ - _imageInfo->pointsize=pointSize_; - _drawInfo->pointsize=pointSize_; -} - -double Magick::Options::fontPointsize(void) const -{ - return(_imageInfo->pointsize); -} - -void Magick::Options::fontStyle(const StyleType style_) -{ - _drawInfo->style=style_; - (void) SetImageOption(_imageInfo,"style",CommandOptionToMnemonic( - MagickStyleOptions,(ssize_t) style_)); -} - -Magick::StyleType Magick::Options::fontStyle(void) const -{ - return(_drawInfo->style); -} - -void Magick::Options::fontWeight(const size_t weight_) -{ - _drawInfo->weight=weight_; - setOption("weight",(double) weight_); -} - -size_t Magick::Options::fontWeight(void) const -{ - return(_drawInfo->weight); -} - -std::string Magick::Options::format(void) const -{ - const MagickInfo - *magick_info=0; - - GetPPException; - if (*_imageInfo->magick != '\0' ) - magick_info = GetMagickInfo(_imageInfo->magick,exceptionInfo); - ThrowPPException(_quiet); - - if ((magick_info != 0) && (*magick_info->description != '\0')) - return(std::string( magick_info->description)); - - return(std::string()); -} - -void Magick::Options::interlaceType(const InterlaceType interlace_) -{ - _imageInfo->interlace=interlace_; -} - -Magick::InterlaceType Magick::Options::interlaceType(void) const -{ - return(static_cast(_imageInfo->interlace)); -} - -void Magick::Options::magick(const std::string &magick_) -{ - if (magick_.empty()) - { - _imageInfo->magick[0] = '\0'; - return; - } - - FormatLocaleString(_imageInfo->filename,MagickPathExtent,"%.1024s:", - magick_.c_str()); - GetPPException; - SetImageInfo(_imageInfo,1,exceptionInfo); - ThrowPPException(_quiet); - if ( _imageInfo->magick[0] == '\0' ) - throwExceptionExplicit(MagickCore::OptionError,"Unrecognized image format", - magick_.c_str()); -} - -std::string Magick::Options::magick(void) const -{ - if ( _imageInfo->magick[0] != '\0' ) - return(std::string(_imageInfo->magick)); - - return(std::string()); -} - -void Magick::Options::monochrome(const bool monochromeFlag_) -{ - _imageInfo->monochrome=(MagickBooleanType) monochromeFlag_; -} - -bool Magick::Options::monochrome(void) const -{ - return(static_cast(_imageInfo->monochrome)); -} - -void Magick::Options::page(const Geometry &pageSize_) -{ - if (!pageSize_.isValid()) - _imageInfo->page=(char *) RelinquishMagickMemory(_imageInfo->page); - else - Magick::CloneString(&_imageInfo->page,pageSize_); -} - -Magick::Geometry Magick::Options::page(void) const -{ - if (_imageInfo->page) - return(Geometry(_imageInfo->page)); - - return(Geometry()); -} - -void Magick::Options::quality(const size_t quality_) -{ - _imageInfo->quality=quality_; -} - -size_t Magick::Options::quality(void) const -{ - return(_imageInfo->quality); -} - -void Magick::Options::quantizeColors(const size_t colors_) -{ - _quantizeInfo->number_colors=colors_; -} - -size_t Magick::Options::quantizeColors(void) const -{ - return(_quantizeInfo->number_colors); -} - -void Magick::Options::quantizeColorSpace(const ColorspaceType colorSpace_) -{ - _quantizeInfo->colorspace=colorSpace_; -} - -Magick::ColorspaceType Magick::Options::quantizeColorSpace(void) const -{ - return(static_cast(_quantizeInfo->colorspace)); -} - -void Magick::Options::quantizeDither(const bool ditherFlag_) -{ - _imageInfo->dither=(MagickBooleanType) ditherFlag_; - _quantizeInfo->dither_method=ditherFlag_ ? RiemersmaDitherMethod : - NoDitherMethod; -} - -bool Magick::Options::quantizeDither(void) const -{ - return(static_cast(_imageInfo->dither)); -} - -void Magick::Options::quantizeDitherMethod(const DitherMethod ditherMethod_) -{ - _quantizeInfo->dither_method=ditherMethod_; -} - -MagickCore::DitherMethod Magick::Options::quantizeDitherMethod(void) const -{ - return(_quantizeInfo->dither_method); -} - -void Magick::Options::quantizeTreeDepth(const size_t treeDepth_) -{ - _quantizeInfo->tree_depth=treeDepth_; -} - -size_t Magick::Options::quantizeTreeDepth(void) const -{ - return(_quantizeInfo->tree_depth); -} - -void Magick::Options::quiet(const bool quiet_) -{ - _quiet=quiet_; -} - -bool Magick::Options::quiet(void) const -{ - return(_quiet); -} - -void Magick::Options::resolutionUnits(const ResolutionType resolutionUnits_) -{ - _imageInfo->units=resolutionUnits_; -} - -Magick::ResolutionType Magick::Options::resolutionUnits(void) const -{ - return(_imageInfo->units); -} - -void Magick::Options::samplingFactor(const std::string &samplingFactor_) -{ - if (samplingFactor_.length() == 0) - _imageInfo->sampling_factor=(char *) RelinquishMagickMemory( - _imageInfo->sampling_factor); - else - Magick::CloneString(&_imageInfo->sampling_factor,samplingFactor_); -} - -std::string Magick::Options::samplingFactor(void) const -{ - if (_imageInfo->sampling_factor) - return(std::string(_imageInfo->sampling_factor)); - - return(std::string()); -} - -void Magick::Options::size(const Geometry &geometry_) -{ - _imageInfo->size=(char *) RelinquishMagickMemory(_imageInfo->size); - - if (geometry_.isValid()) - Magick::CloneString(&_imageInfo->size,geometry_); -} - -Magick::Geometry Magick::Options::size(void) const -{ - if (_imageInfo->size) - return(Geometry(_imageInfo->size)); - - return(Geometry()); -} - -void Magick::Options::strokeAntiAlias(const bool flag_) -{ - flag_ ? _drawInfo->stroke_antialias=MagickTrue : - _drawInfo->stroke_antialias=MagickFalse; -} - -bool Magick::Options::strokeAntiAlias(void) const -{ - return(_drawInfo->stroke_antialias != 0 ? true : false); -} - -void Magick::Options::strokeColor(const Color &strokeColor_) -{ - _drawInfo->stroke=strokeColor_; - if (strokeColor_ == Color()) - strokePattern((const MagickCore::Image*) NULL); - setOption("stroke",strokeColor_); -} - -Magick::Color Magick::Options::strokeColor(void) const -{ - return(_drawInfo->stroke); -} - -void Magick::Options::strokeDashArray(const double *strokeDashArray_) -{ - _drawInfo->dash_pattern=(double *) RelinquishMagickMemory( - _drawInfo->dash_pattern); - - if(strokeDashArray_) - { - size_t - x; - // Count elements in dash array - for (x=0; strokeDashArray_[x]; x++) ; - // Allocate elements - _drawInfo->dash_pattern=static_cast(AcquireMagickMemory((x+1)* - sizeof(double))); - if (!_drawInfo->dash_pattern) - throwExceptionExplicit(MagickCore::ResourceLimitError, - "Unable to allocate dash-pattern memory"); - // Copy elements - memcpy(_drawInfo->dash_pattern,strokeDashArray_,(x+1)*sizeof(double)); - _drawInfo->dash_pattern[x]=0.0; - } -} - -const double *Magick::Options::strokeDashArray(void) const -{ - return(_drawInfo->dash_pattern); -} - -void Magick::Options::strokeDashOffset(const double strokeDashOffset_) -{ - _drawInfo->dash_offset=strokeDashOffset_; -} - -double Magick::Options::strokeDashOffset(void) const -{ - return(_drawInfo->dash_offset); -} - -void Magick::Options::strokeLineCap(const LineCap lineCap_) -{ - _drawInfo->linecap=lineCap_; -} - -Magick::LineCap Magick::Options::strokeLineCap(void) const -{ - return(_drawInfo->linecap); -} - -void Magick::Options::strokeLineJoin(const LineJoin lineJoin_) -{ - _drawInfo->linejoin=lineJoin_; -} - -Magick::LineJoin Magick::Options::strokeLineJoin(void) const -{ - return(_drawInfo->linejoin); -} - -void Magick::Options::strokeMiterLimit(const size_t miterLimit_) -{ - _drawInfo->miterlimit=miterLimit_; -} - -size_t Magick::Options::strokeMiterLimit(void) const -{ - return(_drawInfo->miterlimit); -} - -void Magick::Options::strokePattern(const MagickCore::Image *strokePattern_) -{ - if (_drawInfo->stroke_pattern) - _drawInfo->stroke_pattern=DestroyImageList(_drawInfo->stroke_pattern); - - if (strokePattern_) - { - GetPPException; - _drawInfo->stroke_pattern=CloneImage(const_cast( - strokePattern_),0,0,MagickTrue,exceptionInfo); - ThrowPPException(_quiet); - } -} - -const MagickCore::Image *Magick::Options::strokePattern(void) const -{ - return(_drawInfo->stroke_pattern); -} - -void Magick::Options::strokeWidth(const double strokeWidth_) -{ - _drawInfo->stroke_width=strokeWidth_; - setOption("strokewidth",strokeWidth_); -} - -double Magick::Options::strokeWidth(void) const -{ - return(_drawInfo->stroke_width); -} - -void Magick::Options::subImage(const size_t subImage_) -{ - _imageInfo->scene=subImage_; -} - -size_t Magick::Options::subImage(void) const -{ - return(_imageInfo->scene); -} - -void Magick::Options::subRange(const size_t subRange_) -{ - _imageInfo->number_scenes=subRange_; -} - -size_t Magick::Options::subRange(void) const -{ - return(_imageInfo->number_scenes); -} - -void Magick::Options::textAntiAlias(const bool flag_) -{ - _drawInfo->text_antialias=static_cast( - flag_ ? MagickTrue : MagickFalse); -} - -bool Magick::Options::textAntiAlias(void) const -{ - return(static_cast(_drawInfo->text_antialias)); -} - -void Magick::Options::textDirection(const DirectionType direction_) -{ - _drawInfo->direction=direction_; - (void) SetImageOption(_imageInfo,"direction",CommandOptionToMnemonic( - MagickDirectionOptions,(ssize_t) direction_)); -} - -Magick::DirectionType Magick::Options::textDirection() const -{ - return(_drawInfo->direction); -} - -void Magick::Options::textEncoding(const std::string &encoding_) -{ - CloneString(&_drawInfo->encoding,encoding_.c_str()); - (void) SetImageOption(imageInfo(),"encoding",encoding_.c_str()); -} - -std::string Magick::Options::textEncoding(void) const -{ - if (_drawInfo->encoding && *_drawInfo->encoding) - return(std::string(_drawInfo->encoding)); - - return(std::string()); -} - -void Magick::Options::textGravity(const GravityType gravity_) -{ - _drawInfo->gravity=gravity_; - (void) SetImageOption(_imageInfo,"gravity",CommandOptionToMnemonic( - MagickGravityOptions,(ssize_t) gravity_)); -} - -Magick::GravityType Magick::Options::textGravity() const -{ - return(_drawInfo->gravity); -} - -void Magick::Options::textInterlineSpacing(const double spacing_) -{ - _drawInfo->interline_spacing=spacing_; - setOption("interline-spacing",spacing_); -} - -double Magick::Options::textInterlineSpacing(void) const -{ - return(_drawInfo->interline_spacing); -} - -void Magick::Options::textInterwordSpacing(const double spacing_) -{ - _drawInfo->interword_spacing=spacing_; - setOption("interword-spacing",spacing_); -} - -double Magick::Options::textInterwordSpacing(void) const -{ - return(_drawInfo->interword_spacing); -} - -void Magick::Options::textKerning(const double kerning_) -{ - _drawInfo->kerning=kerning_; - setOption("kerning",kerning_); -} - -double Magick::Options::textKerning(void) const -{ - return(_drawInfo->kerning); -} - -void Magick::Options::textUnderColor(const Color &undercolor_) -{ - _drawInfo->undercolor=undercolor_; - setOption("undercolor",undercolor_); -} - -Magick::Color Magick::Options::textUnderColor(void) const -{ - return(_drawInfo->undercolor); -} - -void Magick::Options::transformOrigin(const double tx_,const double ty_) -{ - AffineMatrix - affine, - current=_drawInfo->affine; - - affine.sx=1.0; - affine.rx=0.0; - affine.ry=0.0; - affine.sy=1.0; - affine.tx=tx_; - affine.ty=ty_; - - _drawInfo->affine.sx=current.sx*affine.sx+current.ry*affine.rx; - _drawInfo->affine.rx=current.rx*affine.sx+current.sy*affine.rx; - _drawInfo->affine.ry=current.sx*affine.ry+current.ry*affine.sy; - _drawInfo->affine.sy=current.rx*affine.ry+current.sy*affine.sy; - _drawInfo->affine.tx=current.sx*affine.tx+current.ry*affine.ty+current.tx; - _drawInfo->affine.ty=current.rx*affine.tx+current.sy*affine.ty+current.ty; -} - -void Magick::Options::transformReset(void) -{ - _drawInfo->affine.sx=1.0; - _drawInfo->affine.rx=0.0; - _drawInfo->affine.ry=0.0; - _drawInfo->affine.sy=1.0; - _drawInfo->affine.tx=0.0; - _drawInfo->affine.ty=0.0; -} - -void Magick::Options::transformRotation(const double angle_) -{ - AffineMatrix - affine, - current=_drawInfo->affine; - - affine.sx=cos(DegreesToRadians(fmod(angle_,360.0))); - affine.rx=(-sin(DegreesToRadians(fmod(angle_,360.0)))); - affine.ry=sin(DegreesToRadians(fmod(angle_,360.0))); - affine.sy=cos(DegreesToRadians(fmod(angle_,360.0))); - affine.tx=0.0; - affine.ty=0.0; - - _drawInfo->affine.sx=current.sx*affine.sx+current.ry*affine.rx; - _drawInfo->affine.rx=current.rx*affine.sx+current.sy*affine.rx; - _drawInfo->affine.ry=current.sx*affine.ry+current.ry*affine.sy; - _drawInfo->affine.sy=current.rx*affine.ry+current.sy*affine.sy; - _drawInfo->affine.tx=current.sx*affine.tx+current.ry*affine.ty+current.tx; - _drawInfo->affine.ty=current.rx*affine.tx+current.sy*affine.ty+current.ty; -} - -void Magick::Options::transformScale(const double sx_,const double sy_) -{ - AffineMatrix - affine, - current=_drawInfo->affine; - - affine.sx=sx_; - affine.rx=0.0; - affine.ry=0.0; - affine.sy=sy_; - affine.tx=0.0; - affine.ty=0.0; - - _drawInfo->affine.sx=current.sx*affine.sx+current.ry*affine.rx; - _drawInfo->affine.rx=current.rx*affine.sx+current.sy*affine.rx; - _drawInfo->affine.ry=current.sx*affine.ry+current.ry*affine.sy; - _drawInfo->affine.sy=current.rx*affine.ry+current.sy*affine.sy; - _drawInfo->affine.tx=current.sx*affine.tx+current.ry*affine.ty+current.tx; - _drawInfo->affine.ty=current.rx*affine.tx+current.sy*affine.ty+current.ty; -} - -void Magick::Options::transformSkewX(const double skewx_) -{ - AffineMatrix - affine, - current=_drawInfo->affine; - - affine.sx=1.0; - affine.rx=0.0; - affine.ry=tan(DegreesToRadians(fmod(skewx_,360.0))); - affine.sy=1.0; - affine.tx=0.0; - affine.ty=0.0; - - _drawInfo->affine.sx=current.sx*affine.sx+current.ry*affine.rx; - _drawInfo->affine.rx=current.rx*affine.sx+current.sy*affine.rx; - _drawInfo->affine.ry=current.sx*affine.ry+current.ry*affine.sy; - _drawInfo->affine.sy=current.rx*affine.ry+current.sy*affine.sy; - _drawInfo->affine.tx=current.sx*affine.tx+current.ry*affine.ty+current.tx; - _drawInfo->affine.ty=current.rx*affine.tx+current.sy*affine.ty+current.ty; -} - -void Magick::Options::transformSkewY(const double skewy_) -{ - AffineMatrix - affine, - current=_drawInfo->affine; - - affine.sx=1.0; - affine.rx=tan(DegreesToRadians(fmod(skewy_,360.0))); - affine.ry=0.0; - affine.sy=1.0; - affine.tx=0.0; - affine.ty=0.0; - - _drawInfo->affine.sx=current.sx*affine.sx+current.ry*affine.rx; - _drawInfo->affine.rx=current.rx*affine.sx+current.sy*affine.rx; - _drawInfo->affine.ry=current.sx*affine.ry+current.ry*affine.sy; - _drawInfo->affine.sy=current.rx*affine.ry+current.sy*affine.sy; - _drawInfo->affine.tx=current.sx*affine.tx+current.ry*affine.ty+current.tx; - _drawInfo->affine.ty=current.rx*affine.tx+current.sy*affine.ty+current.ty; -} - -void Magick::Options::type(const ImageType type_) -{ - _imageInfo->type=type_; -} - -Magick::ImageType Magick::Options::type(void) const -{ - return(_imageInfo->type); -} - -void Magick::Options::verbose(const bool verboseFlag_) -{ - _imageInfo->verbose=(MagickBooleanType) verboseFlag_; -} - -bool Magick::Options::verbose(void) const -{ - return(static_cast(_imageInfo->verbose)); -} - -void Magick::Options::x11Display(const std::string &display_) -{ - if (display_.length() == 0) - _imageInfo->server_name=(char *) RelinquishMagickMemory( - _imageInfo->server_name); - else - Magick::CloneString(&_imageInfo->server_name,display_); -} - -std::string Magick::Options::x11Display(void) const -{ - if (_imageInfo->server_name) - return(std::string( _imageInfo->server_name)); - - return(std::string()); -} - -MagickCore::DrawInfo *Magick::Options::drawInfo(void) -{ - return(_drawInfo); -} - -MagickCore::ImageInfo *Magick::Options::imageInfo(void) -{ - return(_imageInfo); -} - -MagickCore::QuantizeInfo *Magick::Options::quantizeInfo(void) -{ - return(_quantizeInfo); -} - -Magick::Options::Options(const MagickCore::ImageInfo* imageInfo_, - const MagickCore::QuantizeInfo* quantizeInfo_, - const MagickCore::DrawInfo* drawInfo_) -: _imageInfo((MagickCore::ImageInfo* ) NULL), - _quantizeInfo((MagickCore::QuantizeInfo* ) NULL), - _drawInfo((MagickCore::DrawInfo* ) NULL), - _quiet(false) -{ - _imageInfo=CloneImageInfo(imageInfo_); - _quantizeInfo=CloneQuantizeInfo(quantizeInfo_); - _drawInfo=CloneDrawInfo(imageInfo_,drawInfo_); -} - -void Magick::Options::setOption(const char *name,const Color &value_) -{ - std::string - option; - - option=value_; - (void) SetImageOption(imageInfo(),name,option.c_str()); -} - -void Magick::Options::setOption(const char *name,const double value_) -{ - char - option[MagickPathExtent]; - - (void) FormatLocaleString(option,MagickPathExtent,"%.20g",value_); - (void) SetImageOption(_imageInfo,name,option); -} - diff --git a/Magick++/lib/Pixels.cpp b/Magick++/lib/Pixels.cpp deleted file mode 100644 index a24f5a331..000000000 --- a/Magick++/lib/Pixels.cpp +++ /dev/null @@ -1,202 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003 -// Copyright Dirk Lemstra 2013-2015 -// -// Pixels Implementation -// - -#define MAGICKCORE_IMPLEMENTATION 1 -#define MAGICK_PLUSPLUS_IMPLEMENTATION 1 - -#include -#include "Magick++/Include.h" -#include // This is here to compile with Visual C++ -#include "Magick++/Thread.h" -#include "Magick++/Exception.h" -#include "Magick++/Pixels.h" - -Magick::Pixels::Pixels(Magick::Image &image_) - : _image(image_), - _x(0), - _y(0), - _columns(0), - _rows(0) -{ - GetPPException; - _view=AcquireVirtualCacheView(image_.image(),exceptionInfo), - ThrowPPException(image_.quiet()); -} - -Magick::Pixels::~Pixels(void) -{ - if (_view) - _view=DestroyCacheView(_view); -} - -Magick::Quantum* Magick::Pixels::get(const ssize_t x_,const ssize_t y_, - const size_t columns_,const size_t rows_) -{ - _x=x_; - _y=y_; - _columns=columns_; - _rows=rows_; - - GetPPException; - Quantum* pixels=GetCacheViewAuthenticPixels(_view,x_,y_,columns_,rows_, - exceptionInfo); - ThrowPPException(_image.quiet()); - - return pixels; -} - -const Magick::Quantum* Magick::Pixels::getConst(const ssize_t x_, - const ssize_t y_,const size_t columns_,const size_t rows_) -{ - _x=x_; - _y=y_; - _columns=columns_; - _rows=rows_; - - GetPPException; - const Quantum* pixels=GetCacheViewVirtualPixels(_view,x_,y_,columns_,rows_, - exceptionInfo); - ThrowPPException(_image.quiet()); - - return pixels; -} - -ssize_t Magick::Pixels::offset(PixelChannel channel) const -{ - if (_image.constImage()->channel_map[channel].traits == UndefinedPixelTrait) - return -1; - return _image.constImage()->channel_map[channel].offset; -} - -Magick::Quantum* Magick::Pixels::set(const ssize_t x_,const ssize_t y_, - const size_t columns_,const size_t rows_) -{ - _x=x_; - _y=y_; - _columns=columns_; - _rows=rows_; - - GetPPException; - Quantum* pixels=QueueCacheViewAuthenticPixels(_view,x_,y_,columns_,rows_, - exceptionInfo); - ThrowPPException(_image.quiet()); - - return pixels; -} - -void Magick::Pixels::sync(void) -{ - GetPPException; - (void) SyncCacheViewAuthenticPixels(_view,exceptionInfo); - ThrowPPException(_image.quiet()); -} - -// Return pixel meta content -void* Magick::Pixels::metacontent(void) -{ - void* pixel_metacontent=GetCacheViewAuthenticMetacontent(_view); - - return pixel_metacontent; -} - -Magick::PixelData::PixelData(Magick::Image &image_,std::string map_, - const StorageType type_) -{ - init(image_,0,0,image_.columns(),image_.rows(),map_,type_); -} - -Magick::PixelData::PixelData(Magick::Image &image_,const ::ssize_t x_, - const ::ssize_t y_,const size_t width_,const size_t height_,std::string map_, - const StorageType type_) -{ - init(image_,x_,y_,width_,height_,map_,type_); -} - -Magick::PixelData::~PixelData(void) -{ - relinquish(); -} - -const void *Magick::PixelData::data(void) const -{ - return(_data); -} - -::ssize_t Magick::PixelData::length(void) const -{ - return(_length); -} - -::ssize_t Magick::PixelData::size(void) const -{ - return(_size); -} - -void Magick::PixelData::init(Magick::Image &image_,const ::ssize_t x_, - const ::ssize_t y_,const size_t width_,const size_t height_, - std::string map_,const StorageType type_) -{ - size_t - size; - - _data=(void *) NULL; - _length=0; - _size=0; - if ((x_ < 0) || (width_ == 0) || (y_ < 0) || (height_ == 0) || - (x_ > (ssize_t) image_.columns()) || ((width_ + x_) > image_.columns()) - || (y_ > (ssize_t) image_.rows()) || ((height_ + y_) > image_.rows()) - || (map_.length() == 0)) - return; - - switch(type_) - { - case CharPixel: - size=sizeof(unsigned char); - break; - case DoublePixel: - size=sizeof(double); - break; - case FloatPixel: - size=sizeof(float); - break; - case LongPixel: - size=sizeof(unsigned int); - break; - case LongLongPixel: - size=sizeof(MagickSizeType); - break; - case QuantumPixel: - size=sizeof(Quantum); - break; - case ShortPixel: - size=sizeof(unsigned short); - break; - default: - throwExceptionExplicit(MagickCore::OptionError,"Invalid type"); - return; - } - - _length=width_*height_*map_.length(); - _size=_length*size; - _data=AcquireMagickMemory(_size); - - GetPPException; - MagickCore::ExportImagePixels(image_.image(),x_,y_,width_,height_, - map_.c_str(),type_,_data,exceptionInfo); - if (exceptionInfo->severity != MagickCore::UndefinedException) - relinquish(); - ThrowPPException(image_.quiet()); -} - -void Magick::PixelData::relinquish(void) throw() -{ - if (_data != (void *)NULL) - _data=RelinquishMagickMemory(_data); - _length=0; - _size=0; -} diff --git a/Magick++/lib/ResourceLimits.cpp b/Magick++/lib/ResourceLimits.cpp deleted file mode 100644 index ac7d59e03..000000000 --- a/Magick++/lib/ResourceLimits.cpp +++ /dev/null @@ -1,115 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Dirk Lemstra 2014-2018 -// -// Implementation of ResourceLimits -// - -#define MAGICKCORE_IMPLEMENTATION 1 -#define MAGICK_PLUSPLUS_IMPLEMENTATION 1 - -#include "Magick++/ResourceLimits.h" - -void Magick::ResourceLimits::area(const MagickSizeType limit_) -{ - (void) SetMagickResourceLimit(AreaResource,limit_); -} - -MagickCore::MagickSizeType Magick::ResourceLimits::area(void) -{ - return(GetMagickResourceLimit(AreaResource)); -} - -void Magick::ResourceLimits::disk(const MagickSizeType limit_) -{ - (void) SetMagickResourceLimit(DiskResource,limit_); -} - -MagickCore::MagickSizeType Magick::ResourceLimits::disk(void) -{ - return(GetMagickResourceLimit(DiskResource)); -} - -void Magick::ResourceLimits::file(const MagickSizeType limit_) -{ - (void) SetMagickResourceLimit(FileResource,limit_); -} - -MagickCore::MagickSizeType Magick::ResourceLimits::file(void) -{ - return(GetMagickResourceLimit(FileResource)); -} - -void Magick::ResourceLimits::height(const MagickSizeType limit_) -{ - (void) SetMagickResourceLimit(HeightResource,limit_); -} - -MagickCore::MagickSizeType Magick::ResourceLimits::height(void) -{ - return(GetMagickResourceLimit(HeightResource)); -} - -void Magick::ResourceLimits::listLength(const MagickSizeType limit_) -{ - (void) SetMagickResourceLimit(ListLengthResource,limit_); -} - -MagickCore::MagickSizeType Magick::ResourceLimits::listLength(void) -{ - return(GetMagickResourceLimit(ListLengthResource)); -} - -void Magick::ResourceLimits::map(const MagickSizeType limit_) -{ - (void) SetMagickResourceLimit(MapResource,limit_); -} - -MagickCore::MagickSizeType Magick::ResourceLimits::map(void) -{ - return(GetMagickResourceLimit(MapResource)); -} - -void Magick::ResourceLimits::memory(const MagickSizeType limit_) -{ - (void) SetMagickResourceLimit(MemoryResource,limit_); -} - -MagickCore::MagickSizeType Magick::ResourceLimits::memory(void) -{ - return(GetMagickResourceLimit(MemoryResource)); -} - -void Magick::ResourceLimits::thread(const MagickSizeType limit_) -{ - (void) SetMagickResourceLimit(ThreadResource,limit_); -} - -MagickCore::MagickSizeType Magick::ResourceLimits::thread(void) -{ - return(GetMagickResourceLimit(ThreadResource)); -} - -void Magick::ResourceLimits::throttle(const MagickSizeType limit_) -{ - (void) SetMagickResourceLimit(ThrottleResource,limit_); -} - -MagickCore::MagickSizeType Magick::ResourceLimits::throttle(void) -{ - return(GetMagickResourceLimit(ThrottleResource)); -} - -void Magick::ResourceLimits::width(const MagickSizeType limit_) -{ - (void) SetMagickResourceLimit(WidthResource,limit_); -} - -MagickCore::MagickSizeType Magick::ResourceLimits::width(void) -{ - return(GetMagickResourceLimit(WidthResource)); -} - -Magick::ResourceLimits::ResourceLimits() -{ -} diff --git a/Magick++/lib/STL.cpp b/Magick++/lib/STL.cpp deleted file mode 100644 index b8d408de0..000000000 --- a/Magick++/lib/STL.cpp +++ /dev/null @@ -1,1637 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2002 -// Copyright Dirk Lemstra 2013-2017 -// -// Implementation of STL classes and functions -// - -#define MAGICKCORE_IMPLEMENTATION 1 -#define MAGICK_PLUSPLUS_IMPLEMENTATION 1 - -#include -#include -#include - -// Adaptive-blur image with specified blur factor -Magick::adaptiveBlurImage::adaptiveBlurImage( const double radius_, - const double sigma_ ) - : _radius( radius_ ), - _sigma( sigma_ ) -{ -} -void Magick::adaptiveBlurImage::operator()( Magick::Image &image_ ) const -{ - image_.adaptiveBlur( _radius, _sigma ); -} - -// Local adaptive threshold image -Magick::adaptiveThresholdImage::adaptiveThresholdImage( const size_t width_, - const size_t height_, - const ssize_t offset_ ) - : _width(width_), - _height(height_), - _offset(offset_) -{ -} -void Magick::adaptiveThresholdImage::operator()( Magick::Image &image_ ) const -{ - image_.adaptiveThreshold( _width, _height, _offset ); -} - -// Add noise to image with specified noise type -Magick::addNoiseImage::addNoiseImage(const Magick::NoiseType noiseType_, - const double attenuate_) - : _noiseType(noiseType_), - _attenuate(attenuate_) -{ -} - -void Magick::addNoiseImage::operator()(Magick::Image &image_) const -{ - image_.addNoise(_noiseType,_attenuate); -} - -// Transform image by specified affine (or free transform) matrix. -Magick::affineTransformImage::affineTransformImage( const DrawableAffine &affine_ ) - : _affine( affine_ ) -{ -} -void Magick::affineTransformImage::operator()( Magick::Image &image_ ) const -{ - image_.affineTransform( _affine ); -} - -// Annotate image (draw text on image) - -// Annotate using specified text, and placement location -Magick::annotateImage::annotateImage ( const std::string &text_, - const Magick::Geometry &geometry_ ) - : _text( text_ ), - _geometry( geometry_ ), - _gravity( Magick::NorthWestGravity ), - _degrees( 0 ) -{ -} -// Annotate using specified text, bounding area, and placement gravity -Magick::annotateImage::annotateImage ( const std::string &text_, - const Magick::Geometry &geometry_, - const Magick::GravityType gravity_ ) - : _text( text_ ), - _geometry( geometry_ ), - _gravity( gravity_ ), - _degrees( 0 ) -{ -} -// Annotate with text using specified text, bounding area, placement -// gravity, and rotation. -Magick::annotateImage::annotateImage ( const std::string &text_, - const Magick::Geometry &geometry_, - const Magick::GravityType gravity_, - const double degrees_ ) - : _text( text_ ), - _geometry( geometry_ ), - _gravity( gravity_ ), - _degrees( degrees_ ) -{ -} -// Annotate with text (bounding area is entire image) and placement -// gravity. -Magick::annotateImage::annotateImage ( const std::string &text_, - const Magick::GravityType gravity_ ) - : _text( text_ ), - _geometry( ), - _gravity( gravity_ ), - _degrees( 0 ) -{ -} -void Magick::annotateImage::operator()( Magick::Image &image_ ) const -{ - image_.annotate( _text, _geometry, _gravity, _degrees ); -} - -// Blur image with specified blur factor -Magick::blurImage::blurImage( const double radius_, const double sigma_ ) - : _radius( radius_ ), - _sigma( sigma_ ) -{ -} -void Magick::blurImage::operator()( Magick::Image &image_ ) const -{ - image_.blur( _radius, _sigma ); -} - -// Border image (add border to image) -Magick::borderImage::borderImage( const Magick::Geometry &geometry_ ) - : _geometry( geometry_ ) -{ -} -void Magick::borderImage::operator()( Magick::Image &image_ ) const -{ - image_.border( _geometry ); -} - -// Extract channel from image -Magick::channelImage::channelImage( const Magick::ChannelType channel_ ) - : _channel( channel_ ) -{ -} -void Magick::channelImage::operator()( Magick::Image &image_ ) const -{ - image_.channel( _channel ); -} - -// Charcoal effect image (looks like charcoal sketch) -Magick::charcoalImage::charcoalImage( const double radius_, const double sigma_ ) - : _radius( radius_ ), - _sigma( sigma_ ) -{ -} -void Magick::charcoalImage::operator()( Magick::Image &image_ ) const -{ - image_.charcoal( _radius, _sigma ); -} - -// Chop image (remove vertical or horizontal subregion of image) -Magick::chopImage::chopImage( const Magick::Geometry &geometry_ ) - : _geometry( geometry_ ) -{ -} -void Magick::chopImage::operator()( Magick::Image &image_ ) const -{ - image_.chop( _geometry ); -} - -// accepts a lightweight Color Correction Collection (CCC) file which solely -// contains one or more color corrections and applies the correction to the -// image. -Magick::cdlImage::cdlImage( const std::string &cdl_ ) - : _cdl ( cdl_ ) -{ -} -void Magick::cdlImage::operator()( Image &image_ ) const -{ - image_.cdl( _cdl.c_str() ); -} - -// Colorize image using pen color at specified percent alpha -Magick::colorizeImage::colorizeImage( const unsigned int alphaRed_, - const unsigned int alphaGreen_, - const unsigned int alphaBlue_, - const Magick::Color &penColor_ ) - : _alphaRed ( alphaRed_ ), - _alphaGreen ( alphaGreen_ ), - _alphaBlue ( alphaBlue_ ), - _penColor( penColor_ ) -{ -} -Magick::colorizeImage::colorizeImage( const unsigned int alpha_, - const Magick::Color &penColor_ ) - : _alphaRed ( alpha_ ), - _alphaGreen ( alpha_ ), - _alphaBlue ( alpha_ ), - _penColor( penColor_ ) -{ -} -void Magick::colorizeImage::operator()( Magick::Image &image_ ) const -{ - image_.colorize( _alphaRed, _alphaGreen, _alphaBlue, _penColor ); -} - -// Apply a color matrix to the image channels. The user supplied -// matrix may be of order 1 to 5 (1x1 through 5x5). -Magick::colorMatrixImage::colorMatrixImage( const size_t order_, - const double *color_matrix_ ) - : _order( order_ ), - _color_matrix( color_matrix_ ) -{ -} -void Magick::colorMatrixImage::operator()( Image &image_ ) const -{ - image_.colorMatrix( _order, _color_matrix ); -} - -// Convert the image colorspace representation -Magick::colorSpaceImage::colorSpaceImage( Magick::ColorspaceType colorSpace_ ) - : _colorSpace( colorSpace_ ) -{ -} -void Magick::colorSpaceImage::operator()( Magick::Image &image_ ) const -{ - image_.colorSpace( _colorSpace ); -} - -// Comment image (add comment string to image) -Magick::commentImage::commentImage( const std::string &comment_ ) - : _comment( comment_ ) -{ -} -void Magick::commentImage::operator()( Magick::Image &image_ ) const -{ - image_.comment( _comment ); -} - -// Compose an image onto another at specified offset and using -// specified algorithm -Magick::compositeImage::compositeImage( const Magick::Image &compositeImage_, - ssize_t xOffset_, - ssize_t yOffset_, - Magick::CompositeOperator compose_ ) - : _compositeImage( compositeImage_ ), - _xOffset ( xOffset_ ), - _yOffset ( yOffset_ ), - _compose ( compose_ ) -{ -} -Magick::compositeImage::compositeImage( const Magick::Image &compositeImage_, - const Magick::Geometry &offset_, - Magick::CompositeOperator compose_ ) - : _compositeImage( compositeImage_ ), - _xOffset ( offset_.xOff() ), - _yOffset ( offset_.yOff() ), - _compose ( compose_ ) -{ -} -void Magick::compositeImage::operator()( Image &image_ ) const -{ - image_.composite( _compositeImage, _xOffset, _yOffset, _compose ); -} - -// Contrast image (enhance intensity differences in image) -Magick::contrastImage::contrastImage( const size_t sharpen_ ) - : _sharpen( sharpen_ ) -{ -} -void Magick::contrastImage::operator()( Magick::Image &image_ ) const -{ - image_.contrast( _sharpen ); -} - -// Crop image (subregion of original image) -Magick::cropImage::cropImage( const Magick::Geometry &geometry_ ) - : _geometry( geometry_ ) -{ -} -void Magick::cropImage::operator()( Magick::Image &image_ ) const -{ - image_.crop( _geometry ); -} - -// Cycle image colormap -Magick::cycleColormapImage::cycleColormapImage( const ssize_t amount_ ) - : _amount( amount_ ) -{ -} -void Magick::cycleColormapImage::operator()( Magick::Image &image_ ) const -{ - image_.cycleColormap( _amount ); -} - -// Despeckle image (reduce speckle noise) -Magick::despeckleImage::despeckleImage( void ) -{ -} -void Magick::despeckleImage::operator()( Magick::Image &image_ ) const -{ - image_.despeckle( ); -} - -// Distort image. distorts an image using various distortion methods, by -// mapping color lookups of the source image to a new destination image -// usally of the same size as the source image, unless 'bestfit' is set to -// true. -Magick::distortImage::distortImage( const Magick::DistortMethod method_, - const size_t number_arguments_, - const double *arguments_, - const bool bestfit_ ) - : _method ( method_ ), - _number_arguments ( number_arguments_ ), - _arguments ( arguments_ ), - _bestfit( bestfit_ ) -{ -} -Magick::distortImage::distortImage( const Magick::DistortMethod method_, - const size_t number_arguments_, - const double *arguments_ ) - : _method ( method_ ), - _number_arguments ( number_arguments_ ), - _arguments ( arguments_ ), - _bestfit( false ) -{ -} -void Magick::distortImage::operator()( Magick::Image &image_ ) const -{ - image_.distort( _method, _number_arguments, _arguments, _bestfit ); -} - -// Draw on image -Magick::drawImage::drawImage( const Magick::Drawable &drawable_ ) - : _drawableList() -{ - _drawableList.push_back( drawable_ ); -} -Magick::drawImage::drawImage( const std::vector &drawable_ ) - : _drawableList( drawable_ ) -{ -} -void Magick::drawImage::operator()( Magick::Image &image_ ) const -{ - image_.draw( _drawableList ); -} - -// Edge image (hilight edges in image) -Magick::edgeImage::edgeImage( const double radius_ ) - : _radius( radius_ ) -{ -} -void Magick::edgeImage::operator()( Magick::Image &image_ ) const -{ - image_.edge( _radius ); -} - -// Emboss image (hilight edges with 3D effect) -Magick::embossImage::embossImage( void ) - : _radius( 1 ), - _sigma( 0.5 ) -{ -} -Magick::embossImage::embossImage( const double radius_, const double sigma_ ) - : _radius( radius_ ), - _sigma( sigma_ ) -{ -} -void Magick::embossImage::operator()( Magick::Image &image_ ) const -{ - image_.emboss( _radius, _sigma ); -} - -// Enhance image (minimize noise) -Magick::enhanceImage::enhanceImage( void ) -{ -} -void Magick::enhanceImage::operator()( Magick::Image &image_ ) const -{ - image_.enhance( ); -} - -// Equalize image (histogram equalization) -Magick::equalizeImage::equalizeImage( void ) -{ -} -void Magick::equalizeImage::operator()( Magick::Image &image_ ) const -{ - image_.equalize( ); -} - -// Color to use when filling drawn objects -Magick::fillColorImage::fillColorImage( const Magick::Color &fillColor_ ) - : _fillColor( fillColor_ ) -{ -} -void Magick::fillColorImage::operator()( Magick::Image &image_ ) const -{ - image_.fillColor( _fillColor ); -} - -// Flip image (reflect each scanline in the vertical direction) -Magick::flipImage::flipImage( void ) -{ -} -void Magick::flipImage::operator()( Magick::Image &image_ ) const -{ - image_.flip( ); -} - -Magick::floodFillAlphaImage::floodFillAlphaImage(const ssize_t x_, - const ssize_t y_,const unsigned int alpha_,const Color &target_, - const bool invert_) - : _target(target_), - _alpha(alpha_), - _x(x_), - _y(y_), - _invert(invert_) -{ -} - -void Magick::floodFillAlphaImage::operator()(Magick::Image &image_) const -{ - image_.floodFillAlpha(_x,_y,_alpha,_target,_invert); -} - -Magick::floodFillColorImage::floodFillColorImage(const ssize_t x_, - const ssize_t y_,const Magick::Color &fillColor_,const bool invert_) - : _x(x_), - _y(y_), - _fillColor(fillColor_), - _borderColor(), - _invert(invert_) -{ -} - -Magick::floodFillColorImage::floodFillColorImage( - const Magick::Geometry &point_,const Magick::Color &fillColor_, - const bool invert_) - : _x(point_.xOff()), - _y(point_.yOff()), - _fillColor(fillColor_), - _borderColor(), - _invert(invert_) -{ -} - -Magick::floodFillColorImage::floodFillColorImage(const ssize_t x_, - const ssize_t y_,const Magick::Color &fillColor_, - const Magick::Color &borderColor_,const bool invert_) - : _x(x_), - _y(y_), - _fillColor(fillColor_), - _borderColor(borderColor_), - _invert(invert_) -{ -} - -Magick::floodFillColorImage::floodFillColorImage(const Geometry &point_, - const Color &fillColor_,const Color &borderColor_,const bool invert_) - : _x(point_.xOff()), - _y(point_.yOff()), - _fillColor(fillColor_), - _borderColor(borderColor_), - _invert(invert_) -{ -} -void Magick::floodFillColorImage::operator()(Magick::Image &image_) const -{ - if (_borderColor.isValid()) - image_.floodFillColor(_x,_y,_fillColor,_borderColor,_invert); - else - image_.floodFillColor(_x,_y,_fillColor,_invert); -} - -Magick::floodFillTextureImage::floodFillTextureImage(const ssize_t x_, - const ssize_t y_,const Magick::Image &texture_,const bool invert_) - : _x(x_), - _y(y_), - _texture(texture_), - _borderColor(), - _invert(invert_) -{ -} - -Magick::floodFillTextureImage::floodFillTextureImage( - const Magick::Geometry &point_,const Magick::Image &texture_, - const bool invert_) - : _x(point_.xOff()), - _y(point_.yOff()), - _texture(texture_), - _borderColor(), - _invert(invert_) -{ -} - -Magick::floodFillTextureImage::floodFillTextureImage(const ssize_t x_, - const ssize_t y_,const Magick::Image &texture_, - const Magick::Color &borderColor_,const bool invert_) - : _x(x_), - _y(y_), - _texture(texture_), - _borderColor(borderColor_), - _invert(invert_) -{ -} - -Magick::floodFillTextureImage::floodFillTextureImage( - const Magick::Geometry &point_,const Magick::Image &texture_, - const Magick::Color &borderColor_,const bool invert_) - : _x(point_.xOff()), - _y(point_.yOff()), - _texture(texture_), - _borderColor(borderColor_), - _invert(invert_) -{ -} - -void Magick::floodFillTextureImage::operator()(Magick::Image &image_) const -{ - if (_borderColor.isValid()) - image_.floodFillTexture(_x,_y,_texture,_borderColor,_invert); - else - image_.floodFillTexture(_x,_y,_texture,_invert); -} - -// Flop image (reflect each scanline in the horizontal direction) -Magick::flopImage::flopImage( void ) -{ -} -void Magick::flopImage::operator()( Magick::Image &image_ ) const -{ - image_.flop( ); -} - -// Frame image -Magick::frameImage::frameImage( const Magick::Geometry &geometry_ ) - : _width( geometry_.width() ), - _height( geometry_.height() ), - _outerBevel( geometry_.xOff() ), - _innerBevel( geometry_.yOff() ) -{ -} -Magick::frameImage::frameImage( const size_t width_, const size_t height_, - const ssize_t innerBevel_, const ssize_t outerBevel_ ) - : _width( width_ ), - _height( height_ ), - _outerBevel( outerBevel_ ), - _innerBevel( innerBevel_ ) -{ -} -void Magick::frameImage::operator()( Magick::Image &image_ ) const -{ - image_.frame( _width, _height, _innerBevel, _outerBevel ); -} - -// Gamma correct image -Magick::gammaImage::gammaImage( const double gamma_ ) - : _gammaRed( gamma_ ), - _gammaGreen( gamma_ ), - _gammaBlue( gamma_ ) -{ -} -Magick::gammaImage::gammaImage ( const double gammaRed_, - const double gammaGreen_, - const double gammaBlue_ ) - : _gammaRed( gammaRed_ ), - _gammaGreen( gammaGreen_ ), - _gammaBlue( gammaBlue_ ) -{ -} -void Magick::gammaImage::operator()( Magick::Image &image_ ) const -{ - image_.gamma( _gammaRed, _gammaGreen, _gammaBlue ); -} - -// Gaussian blur image -// The number of neighbor pixels to be included in the convolution -// mask is specified by 'width_'. The standard deviation of the -// gaussian bell curve is specified by 'sigma_'. -Magick::gaussianBlurImage::gaussianBlurImage( const double width_, - const double sigma_ ) - : _width( width_ ), - _sigma( sigma_ ) -{ -} -void Magick::gaussianBlurImage::operator()( Magick::Image &image_ ) const -{ - image_.gaussianBlur( _width, _sigma ); -} - -// Apply a color lookup table (Hald CLUT) to the image. -Magick::haldClutImage::haldClutImage( const Image &haldClutImage_ ) - : _haldClutImage ( haldClutImage_ ) -{ -} -void Magick::haldClutImage::operator()( Image &image_ ) const -{ - image_.haldClut( _haldClutImage ); -} - -// Implode image (special effect) -Magick::implodeImage::implodeImage( const double factor_ ) - : _factor( factor_ ) -{ -} -void Magick::implodeImage::operator()( Magick::Image &image_ ) const -{ - image_.implode( _factor ); -} - -// Implements the inverse discrete Fourier transform (IFT) of the image -// either as a magnitude / phase or real / imaginary image pair. -Magick::inverseFourierTransformImage::inverseFourierTransformImage( const Magick::Image &phaseImage_ ) - : _phaseImage( phaseImage_ ) -{ -} -void Magick::inverseFourierTransformImage::operator()( Magick::Image &image_ ) const -{ - image_.inverseFourierTransform( _phaseImage ); -} - -// Set image validity. Valid images become empty (inValid) if argument -// is false. -Magick::isValidImage::isValidImage( const bool isValid_ ) - : _isValid( isValid_ ) -{ -} -void Magick::isValidImage::operator()( Magick::Image &image_ ) const -{ - image_.isValid( _isValid ); -} - -// Label image -Magick::labelImage::labelImage( const std::string &label_ ) - : _label( label_ ) -{ -} -void Magick::labelImage::operator()( Magick::Image &image_ ) const -{ - image_.label( _label ); -} - -// Level image -Magick::levelImage::levelImage( const double black_point, - const double white_point, - const double mid_point ) - : _black_point(black_point), - _white_point(white_point), - _mid_point(mid_point) -{ -} -void Magick::levelImage::operator()( Magick::Image &image_ ) const -{ - image_.level( _black_point, _white_point, _mid_point ); -} - -// Magnify image by integral size -Magick::magnifyImage::magnifyImage( void ) -{ -} -void Magick::magnifyImage::operator()( Magick::Image &image_ ) const -{ - image_.magnify( ); -} - -// Remap image colors with closest color from reference image -Magick::mapImage::mapImage( const Magick::Image &mapImage_ , - const bool dither_ ) - : _mapImage( mapImage_ ), - _dither( dither_ ) -{ -} -void Magick::mapImage::operator()( Magick::Image &image_ ) const -{ - image_.map( _mapImage, _dither ); -} - -// Filter image by replacing each pixel component with the median -// color in a circular neighborhood -Magick::medianConvolveImage::medianConvolveImage( const double radius_ ) - : _radius( radius_ ) -{ -} -void Magick::medianConvolveImage::operator()( Magick::Image &image_ ) const -{ - image_.medianFilter( _radius ); -} - -// Reduce image by integral size -Magick::minifyImage::minifyImage( void ) -{ -} -void Magick::minifyImage::operator()( Magick::Image &image_ ) const -{ - image_.minify( ); -} - -// Modulate percent hue, saturation, and brightness of an image -Magick::modulateImage::modulateImage( const double brightness_, - const double saturation_, - const double hue_ ) - : _brightness( brightness_ ), - _saturation( saturation_ ), - _hue( hue_ ) -{ -} -void Magick::modulateImage::operator()( Magick::Image &image_ ) const -{ - image_.modulate( _brightness, _saturation, _hue ); -} - -// Negate colors in image. Set grayscale to only negate grayscale -// values in image. -Magick::negateImage::negateImage( const bool grayscale_ ) - : _grayscale( grayscale_ ) -{ -} -void Magick::negateImage::operator()( Magick::Image &image_ ) const -{ - image_.negate( _grayscale ); -} - -// Normalize image (increase contrast by normalizing the pixel values -// to span the full range of color values) -Magick::normalizeImage::normalizeImage( void ) -{ -} -void Magick::normalizeImage::operator()( Magick::Image &image_ ) const -{ - image_.normalize( ); -} - -// Oilpaint image (image looks like oil painting) -Magick::oilPaintImage::oilPaintImage( const double radius_ ) - : _radius( radius_ ) -{ -} -void Magick::oilPaintImage::operator()( Magick::Image &image_ ) const -{ - image_.oilPaint( _radius ); -} - -// Set or attenuate the image alpha channel. If the image pixels are -// opaque then they are set to the specified alpha value, otherwise -// they are blended with the supplied alpha value. The value of -// alpha_ ranges from 0 (completely opaque) to QuantumRange. The defines -// OpaqueAlpha and TransparentAlpha are available to specify -// completely opaque or completely transparent, respectively. -Magick::alphaImage::alphaImage( const unsigned int alpha_ ) - : _alpha( alpha_ ) -{ -} -void Magick::alphaImage::operator()( Magick::Image &image_ ) const -{ - image_.alpha( _alpha ); -} - -// Change color of opaque pixel to specified pen color. -Magick::opaqueImage::opaqueImage( const Magick::Color &opaqueColor_, - const Magick::Color &penColor_ ) - : _opaqueColor( opaqueColor_ ), - _penColor( penColor_ ) -{ -} -void Magick::opaqueImage::operator()( Magick::Image &image_ ) const -{ - image_.opaque( _opaqueColor, _penColor ); -} - -// Quantize image (reduce number of colors) -Magick::quantizeImage::quantizeImage( const bool measureError_ ) - : _measureError( measureError_ ) -{ -} -void Magick::quantizeImage::operator()( Image &image_ ) const -{ - image_.quantize( _measureError ); -} - -// Raise image (lighten or darken the edges of an image to give a 3-D -// raised or lowered effect) -Magick::raiseImage::raiseImage( const Magick::Geometry &geometry_ , - const bool raisedFlag_ ) - : _geometry( geometry_ ), - _raisedFlag( raisedFlag_ ) -{ -} -void Magick::raiseImage::operator()( Magick::Image &image_ ) const -{ - image_.raise( _geometry, _raisedFlag ); -} - -Magick::ReadOptions::ReadOptions(void) - : _imageInfo(static_cast(AcquireMagickMemory( - sizeof(ImageInfo)))), - _quiet(false) -{ - GetImageInfo(_imageInfo); -} - -Magick::ReadOptions::ReadOptions(const Magick::ReadOptions& options_) - : _imageInfo(CloneImageInfo(options_._imageInfo)), - _quiet(false) -{ -} - -Magick::ReadOptions::~ReadOptions() -{ - _imageInfo=DestroyImageInfo(_imageInfo); -} - -void Magick::ReadOptions::density(const Magick::Geometry &density_) -{ - if (!density_.isValid()) - _imageInfo->density=(char *) RelinquishMagickMemory(_imageInfo->density); - else - Magick::CloneString(&_imageInfo->density,density_); -} - -Magick::Geometry Magick::ReadOptions::density(void) const -{ - if (_imageInfo->density) - return(Geometry(_imageInfo->density)); - - return(Geometry()); -} - -void Magick::ReadOptions::depth(size_t depth_) -{ - _imageInfo->depth=depth_; -} - -size_t Magick::ReadOptions::depth(void) const -{ - return(_imageInfo->depth); -} - -void Magick::ReadOptions::ping(const bool flag_) -{ - _imageInfo->ping=(MagickBooleanType) flag_; -} - -bool Magick::ReadOptions::ping(void) const -{ - return(static_cast(_imageInfo->ping)); -} - -void Magick::ReadOptions::quiet(const bool quiet_) -{ - _quiet=quiet_; -} - -bool Magick::ReadOptions::quiet(void) const -{ - return(_quiet); -} - -void Magick::ReadOptions::size(const Geometry &geometry_) -{ - _imageInfo->size=(char *) RelinquishMagickMemory(_imageInfo->size); - - if ( geometry_.isValid() ) - Magick::CloneString(&_imageInfo->size,geometry_); -} - -Magick::Geometry Magick::ReadOptions::size(void) const -{ - if (_imageInfo->size) - return(Geometry(_imageInfo->size)); - - return(Geometry()); -} - -MagickCore::ImageInfo *Magick::ReadOptions::imageInfo(void) -{ - return(_imageInfo); -} - -// Reduce noise in image using a noise peak elimination filter -Magick::reduceNoiseImage::reduceNoiseImage( void ) - : _order(3) -{ -} -Magick::reduceNoiseImage::reduceNoiseImage ( const size_t order_ ) - : _order(order_) -{ -} -void Magick::reduceNoiseImage::operator()( Image &image_ ) const -{ - image_.reduceNoise( _order ); -} - -// Roll image (rolls image vertically and horizontally) by specified -// number of columnms and rows) -Magick::rollImage::rollImage( const Magick::Geometry &roll_ ) - : _columns( roll_.width() ), - _rows( roll_.height() ) -{ -} -Magick::rollImage::rollImage( const ssize_t columns_, - const ssize_t rows_ ) - : _columns( columns_ ), - _rows( rows_ ) -{ -} -void Magick::rollImage::operator()( Magick::Image &image_ ) const -{ - image_.roll( _columns, _rows ); -} - -// Rotate image counter-clockwise by specified number of degrees. -Magick::rotateImage::rotateImage( const double degrees_ ) - : _degrees( degrees_ ) -{ -} -void Magick::rotateImage::operator()( Magick::Image &image_ ) const -{ - image_.rotate( _degrees ); -} - -// Resize image by using pixel sampling algorithm -Magick::sampleImage::sampleImage( const Magick::Geometry &geometry_ ) - : _geometry( geometry_ ) -{ -} -void Magick::sampleImage::operator()( Magick::Image &image_ ) const -{ - image_.sample( _geometry ); -} - -// Resize image by using simple ratio algorithm -Magick::scaleImage::scaleImage( const Magick::Geometry &geometry_ ) - : _geometry( geometry_ ) -{ -} -void Magick::scaleImage::operator()( Magick::Image &image_ ) const -{ - image_.scale( _geometry ); -} - -// Segment (coalesce similar image components) by analyzing the -// histograms of the color components and identifying units that are -// homogeneous with the fuzzy c-means technique. Also uses -// QuantizeColorSpace and Verbose image attributes -Magick::segmentImage::segmentImage( const double clusterThreshold_ , - const double smoothingThreshold_ ) - : _clusterThreshold( clusterThreshold_ ), - _smoothingThreshold( smoothingThreshold_ ) -{ -} -void Magick::segmentImage::operator()( Magick::Image &image_ ) const -{ - image_.segment( _clusterThreshold, _smoothingThreshold ); -} - -// Shade image using distant light source -Magick::shadeImage::shadeImage( const double azimuth_, - const double elevation_, - const bool colorShading_) - : _azimuth( azimuth_ ), - _elevation( elevation_ ), - _colorShading (colorShading_) -{ -} -void Magick::shadeImage::operator()( Magick::Image &image_ ) const -{ - image_.shade( _azimuth, _elevation, _colorShading ); -} - -// Simulate an image shadow -Magick::shadowImage::shadowImage( const double percent_opacity_, - const double sigma_, - const ssize_t x_, const ssize_t y_ ) - : _percent_opacity( percent_opacity_ ), - _sigma( sigma_ ), - _x ( x_ ), - _y ( y_ ) -{ -} -void Magick::shadowImage::operator()( Magick::Image &image_ ) const -{ - image_.shadow( _percent_opacity, _sigma, _x, _y ); -} - -// Sharpen pixels in image -Magick::sharpenImage::sharpenImage( const double radius_, const double sigma_ ) - : _radius( radius_ ), - _sigma( sigma_ ) -{ -} -void Magick::sharpenImage::operator()( Magick::Image &image_ ) const -{ - image_.sharpen( _radius, _sigma ); -} - -// Shave pixels from image edges. -Magick::shaveImage::shaveImage( const Magick::Geometry &geometry_ ) - : _geometry( geometry_ ) -{ -} -void Magick::shaveImage::operator()( Magick::Image &image_ ) const -{ - image_.shave( _geometry ); -} - -// Shear image (create parallelogram by sliding image by X or Y axis) -Magick::shearImage::shearImage( const double xShearAngle_, - const double yShearAngle_ ) - : _xShearAngle( xShearAngle_ ), - _yShearAngle( yShearAngle_ ) -{ -} -void Magick::shearImage::operator()( Magick::Image &image_ ) const -{ - image_.shear( _xShearAngle, _yShearAngle ); -} - -// Solarize image (similar to effect seen when exposing a photographic -// film to light during the development process) -Magick::solarizeImage::solarizeImage( const double factor_ ) - : _factor( factor_ ) -{ -} -void Magick::solarizeImage::operator()( Magick::Image &image_ ) const -{ - image_.solarize( _factor ); -} - -// Spread pixels randomly within image by specified ammount -Magick::spreadImage::spreadImage( const size_t amount_ ) - : _amount( amount_ ) -{ -} -void Magick::spreadImage::operator()( Magick::Image &image_ ) const -{ - image_.spread( _amount ); -} - -// Add a digital watermark to the image (based on second image) -Magick::steganoImage::steganoImage( const Magick::Image &waterMark_ ) - : _waterMark( waterMark_ ) -{ -} -void Magick::steganoImage::operator()( Magick::Image &image_ ) const -{ - image_.stegano( _waterMark ); -} - -// Create an image which appears in stereo when viewed with red-blue -// glasses (Red image on left, blue on right) -Magick::stereoImage::stereoImage( const Magick::Image &rightImage_ ) - : _rightImage( rightImage_ ) -{ -} -void Magick::stereoImage::operator()( Magick::Image &image_ ) const -{ - image_.stereo( _rightImage ); -} - -// Color to use when drawing object outlines -Magick::strokeColorImage::strokeColorImage( const Magick::Color &strokeColor_ ) - : _strokeColor( strokeColor_ ) -{ -} -void Magick::strokeColorImage::operator()( Magick::Image &image_ ) const -{ - image_.strokeColor( _strokeColor ); -} - -// Swirl image (image pixels are rotated by degrees) -Magick::swirlImage::swirlImage( const double degrees_ ) - : _degrees( degrees_ ) -{ -} -void Magick::swirlImage::operator()( Magick::Image &image_ ) const -{ - image_.swirl( _degrees ); -} - -// Channel a texture on image background -Magick::textureImage::textureImage( const Magick::Image &texture_ ) - : _texture( texture_ ) -{ -} -void Magick::textureImage::operator()( Magick::Image &image_ ) const -{ - image_.texture( _texture ); -} - -// Threshold image -Magick::thresholdImage::thresholdImage( const double threshold_ ) - : _threshold( threshold_ ) -{ -} -void Magick::thresholdImage::operator()( Magick::Image &image_ ) const -{ - image_.threshold( _threshold ); -} - -// Set image color to transparent -Magick::transparentImage::transparentImage( const Magick::Color& color_ ) - : _color( color_ ) -{ -} -void Magick::transparentImage::operator()( Magick::Image &image_ ) const -{ - image_.transparent( _color ); -} - -// Trim edges that are the background color from the image -Magick::trimImage::trimImage( void ) -{ -} -void Magick::trimImage::operator()( Magick::Image &image_ ) const -{ - image_.trim( ); -} - -// Map image pixels to a sine wave -Magick::waveImage::waveImage( const double amplitude_, - const double wavelength_ ) - : _amplitude( amplitude_ ), - _wavelength( wavelength_ ) -{ -} -void Magick::waveImage::operator()( Magick::Image &image_ ) const -{ - image_.wave( _amplitude, _wavelength ); -} - -// resize image to specified size. -Magick::resizeImage::resizeImage( const Magick::Geometry &geometry_ ) - : _geometry( geometry_ ) -{ -} -void Magick::resizeImage::operator()( Magick::Image &image_ ) const -{ - image_.resize( _geometry ); -} - -// Zoom image to specified size. -Magick::zoomImage::zoomImage( const Magick::Geometry &geometry_ ) - : _geometry( geometry_ ) -{ -} -void Magick::zoomImage::operator()( Magick::Image &image_ ) const -{ - image_.zoom( _geometry ); -} - -// -// Function object image attribute accessors -// - -// Join images into a single multi-image file -Magick::adjoinImage::adjoinImage( const bool flag_ ) - : _flag( flag_ ) -{ -} -void Magick::adjoinImage::operator()( Magick::Image &image_ ) const -{ - image_.adjoin( _flag ); -} - -// Time in 1/100ths of a second which must expire before displaying -// the next image in an animated sequence. -Magick::animationDelayImage::animationDelayImage( const size_t delay_ ) - : _delay( delay_ ) -{ -} -void Magick::animationDelayImage::operator()( Magick::Image &image_ ) const -{ - image_.animationDelay( _delay ); -} - -// Number of iterations to loop an animation (e.g. Netscape loop -// extension) for. -Magick::animationIterationsImage::animationIterationsImage( const size_t iterations_ ) - : _iterations( iterations_ ) -{ -} -void Magick::animationIterationsImage::operator()( Magick::Image &image_ ) const -{ - image_.animationIterations( _iterations ); -} - -// Image background color -Magick::backgroundColorImage::backgroundColorImage( const Magick::Color &color_ ) - : _color( color_ ) -{ -} -void Magick::backgroundColorImage::operator()( Magick::Image &image_ ) const -{ - image_.backgroundColor( _color ); -} - -// Name of texture image to tile onto the image background -Magick::backgroundTextureImage::backgroundTextureImage( const std::string &backgroundTexture_ ) - : _backgroundTexture( backgroundTexture_ ) -{ -} -void Magick::backgroundTextureImage::operator()( Magick::Image &image_ ) const -{ - image_.backgroundTexture( _backgroundTexture ); -} - -// Image border color -Magick::borderColorImage::borderColorImage( const Magick::Color &color_ ) - : _color( color_ ) -{ -} -void Magick::borderColorImage::operator()( Magick::Image &image_ ) const -{ - image_.borderColor( _color ); -} - -// Text bounding-box base color (default none) -Magick::boxColorImage::boxColorImage( const Magick::Color &boxColor_ ) - : _boxColor( boxColor_ ) { } - -void Magick::boxColorImage::operator()( Magick::Image &image_ ) const -{ - image_.boxColor( _boxColor ); -} - -Magick::chromaBluePrimaryImage::chromaBluePrimaryImage(const double x_, - const double y_,const double z_) - : _x(x_), - _y(y_), - _z(z_) -{ -} - -void Magick::chromaBluePrimaryImage::operator()(Magick::Image &image_) const -{ - image_.chromaBluePrimary(_x,_y,_z); -} - -Magick::chromaGreenPrimaryImage::chromaGreenPrimaryImage(const double x_, - const double y_,const double z_) - : _x(x_), - _y(y_), - _z(z_) -{ -} - -void Magick::chromaGreenPrimaryImage::operator()( Magick::Image &image_ ) const -{ - image_.chromaGreenPrimary(_x,_y,_z); -} - -Magick::chromaRedPrimaryImage::chromaRedPrimaryImage(const double x_, - const double y_,const double z_) - : _x(x_), - _y(y_), - _z(z_) -{ -} - -void Magick::chromaRedPrimaryImage::operator()(Magick::Image &image_) const -{ - image_.chromaRedPrimary(_x,_y,_z); -} - -Magick::chromaWhitePointImage::chromaWhitePointImage(const double x_, - const double y_,const double z_) - : _x(x_), - _y(y_), - _z(z_) -{ -} - -void Magick::chromaWhitePointImage::operator()(Magick::Image &image_) const -{ - image_.chromaWhitePoint(_x,_y,_z); -} - -// Colors within this distance are considered equal -Magick::colorFuzzImage::colorFuzzImage( const double fuzz_ ) - : _fuzz( fuzz_ ) -{ -} -void Magick::colorFuzzImage::operator()( Magick::Image &image_ ) const -{ - image_.colorFuzz( _fuzz ); -} - -// Color at colormap position index_ -Magick::colorMapImage::colorMapImage( const size_t index_, - const Color &color_ ) - : _index( index_ ), - _color( color_ ) -{ -} -void Magick::colorMapImage::operator()( Magick::Image &image_ ) const -{ - image_.colorMap( _index, _color ); -} - -// Composition operator to be used when composition is implicitly used -// (such as for image flattening). -Magick::composeImage::composeImage( const CompositeOperator compose_ ) - : _compose( compose_ ) -{ -} -void Magick::composeImage::operator()( Magick::Image &image_ ) const -{ - image_.compose( _compose ); -} - -// Compression type -Magick::compressTypeImage::compressTypeImage( const CompressionType compressType_ ) - : _compressType( compressType_ ) -{ -} -void Magick::compressTypeImage::operator()( Magick::Image &image_ ) const -{ - image_.compressType( _compressType ); -} - -// Vertical and horizontal resolution in pixels of the image -Magick::densityImage::densityImage( const Point &point_ ) - : _point( point_ ) -{ -} -void Magick::densityImage::operator()( Magick::Image &image_ ) const -{ - image_.density( _point ); -} - -// Image depth (bits allocated to red/green/blue components) -Magick::depthImage::depthImage( const size_t depth_ ) - : _depth( depth_ ) -{ -} -void Magick::depthImage::operator()( Magick::Image &image_ ) const -{ - image_.depth( _depth ); -} - -// Endianness (LSBEndian like Intel or MSBEndian like SPARC) for image -// formats which support endian-specific options. -Magick::endianImage::endianImage( const Magick::EndianType endian_ ) - : _endian( endian_ ) -{ -} -void Magick::endianImage::operator()( Magick::Image &image_ ) const -{ - image_.endian( _endian ); -} - -// Image file name -Magick::fileNameImage::fileNameImage( const std::string &fileName_ ) - : _fileName( fileName_ ) -{ -} -void Magick::fileNameImage::operator()( Magick::Image &image_ ) const -{ - image_.fileName( _fileName ); -} - -// Filter to use when resizing image -Magick::filterTypeImage::filterTypeImage( const FilterType filterType_ ) - : _filterType( filterType_ ) -{ -} -void Magick::filterTypeImage::operator()( Magick::Image &image_ ) const -{ - image_.filterType( _filterType ); -} - -// Text rendering font -Magick::fontImage::fontImage( const std::string &font_ ) - : _font( font_ ) -{ -} -void Magick::fontImage::operator()( Magick::Image &image_ ) const -{ - image_.font( _font ); -} - -// Font point size -Magick::fontPointsizeImage::fontPointsizeImage( const size_t pointsize_ ) - : _pointsize( pointsize_ ) -{ -} -void Magick::fontPointsizeImage::operator()( Magick::Image &image_ ) const -{ - image_.fontPointsize( _pointsize ); -} - -// GIF disposal method -Magick::gifDisposeMethodImage::gifDisposeMethodImage( const DisposeType disposeMethod_ ) - : _disposeMethod( disposeMethod_ ) -{ -} -void Magick::gifDisposeMethodImage::operator()( Magick::Image &image_ ) const -{ - image_.gifDisposeMethod( _disposeMethod ); -} - -// Type of interlacing to use -Magick::interlaceTypeImage::interlaceTypeImage( const InterlaceType interlace_ ) - : _interlace( interlace_ ) -{ -} -void Magick::interlaceTypeImage::operator()( Magick::Image &image_ ) const -{ - image_.interlaceType( _interlace ); -} - -// File type magick identifier (.e.g "GIF") -Magick::magickImage::magickImage( const std::string &magick_ ) - : _magick( magick_ ) -{ -} -void Magick::magickImage::operator()( Magick::Image &image_ ) const -{ - image_.magick( _magick ); -} - -// Image supports transparent color -Magick::alphaFlagImage::alphaFlagImage( const bool alphaFlag_ ) - : _alphaFlag( alphaFlag_ ) -{ -} -void Magick::alphaFlagImage::operator()( Magick::Image &image_ ) const -{ - image_.alpha( _alphaFlag ); -} - -// Transparent color -Magick::matteColorImage::matteColorImage( const Color &matteColor_ ) - : _matteColor( matteColor_ ) -{ -} -void Magick::matteColorImage::operator()( Magick::Image &image_ ) const -{ - image_.matteColor( _matteColor ); -} - -// Indicate that image is black and white -Magick::monochromeImage::monochromeImage( const bool monochromeFlag_ ) - : _monochromeFlag( monochromeFlag_ ) -{ -} -void Magick::monochromeImage::operator()( Magick::Image &image_ ) const -{ - image_.monochrome( _monochromeFlag ); -} - -// Set pixel color at location x & y. -Magick::pixelColorImage::pixelColorImage( const ssize_t x_, - const ssize_t y_, - const Color &color_) - : _x( x_ ), - _y( y_ ), - _color( color_ ) { } - -void Magick::pixelColorImage::operator()( Magick::Image &image_ ) const -{ - image_.pixelColor( _x, _y, _color ); -} - -// Postscript page size. -Magick::pageImage::pageImage( const Geometry &pageSize_ ) - : _pageSize( pageSize_ ) -{ -} -void Magick::pageImage::operator()( Magick::Image &image_ ) const -{ - image_.page( _pageSize ); -} - -// JPEG/MIFF/PNG compression level (default 75). -Magick::qualityImage::qualityImage( const size_t quality_ ) - : _quality( quality_ ) -{ -} -void Magick::qualityImage::operator()( Magick::Image &image_ ) const -{ - image_.quality( _quality ); -} - -// Maximum number of colors to quantize to -Magick::quantizeColorsImage::quantizeColorsImage( const size_t colors_ ) - : _colors( colors_ ) -{ -} -void Magick::quantizeColorsImage::operator()( Magick::Image &image_ ) const -{ - image_.quantizeColors( _colors ); -} - -// Colorspace to quantize in. -Magick::quantizeColorSpaceImage::quantizeColorSpaceImage( const ColorspaceType colorSpace_ ) - : _colorSpace( colorSpace_ ) -{ -} -void Magick::quantizeColorSpaceImage::operator()( Magick::Image &image_ ) const -{ - image_.quantizeColorSpace( _colorSpace ); -} - -// Dither image during quantization (default true). -Magick::quantizeDitherImage::quantizeDitherImage( const bool ditherFlag_ ) - : _ditherFlag( ditherFlag_ ) -{ -} -void Magick::quantizeDitherImage::operator()( Magick::Image &image_ ) const -{ - image_.quantizeDither( _ditherFlag ); -} - -// Quantization tree-depth -Magick::quantizeTreeDepthImage::quantizeTreeDepthImage( const size_t treeDepth_ ) - : _treeDepth( treeDepth_ ) { } - -void Magick::quantizeTreeDepthImage::operator()( Magick::Image &image_ ) const -{ - image_.quantizeTreeDepth( _treeDepth ); -} - -// The type of rendering intent -Magick::renderingIntentImage::renderingIntentImage( const Magick::RenderingIntent renderingIntent_ ) - : _renderingIntent( renderingIntent_ ) -{ -} -void Magick::renderingIntentImage::operator()( Magick::Image &image_ ) const -{ - image_.renderingIntent( _renderingIntent ); -} - -// Units of image resolution -Magick::resolutionUnitsImage::resolutionUnitsImage( const Magick::ResolutionType resolutionUnits_ ) - : _resolutionUnits( resolutionUnits_ ) -{ -} -void Magick::resolutionUnitsImage::operator()( Magick::Image &image_ ) const -{ - image_.resolutionUnits( _resolutionUnits ); -} - -// Image scene number -Magick::sceneImage::sceneImage( const size_t scene_ ) - : _scene( scene_ ) -{ -} -void Magick::sceneImage::operator()( Magick::Image &image_ ) const -{ - image_.scene( _scene ); -} - -// Width and height of a raw image -Magick::sizeImage::sizeImage( const Magick::Geometry &geometry_ ) - : _geometry( geometry_ ) -{ -} -void Magick::sizeImage::operator()( Magick::Image &image_ ) const -{ - image_.size( _geometry ); -} - -// Splice the background color into the image. -Magick::spliceImage::spliceImage( const Magick::Geometry &geometry_ ) - : _geometry( geometry_ ) -{ -} -void Magick::spliceImage::operator()( Magick::Image &image_ ) const -{ - image_.splice( _geometry ); -} - -// stripImage strips an image of all profiles and comments. -Magick::stripImage::stripImage( void ) -{ -} -void Magick::stripImage::operator()( Magick::Image &image_ ) const -{ - image_.strip( ); -} - -// Subimage of an image sequence -Magick::subImageImage::subImageImage( const size_t subImage_ ) - : _subImage( subImage_ ) -{ -} -void Magick::subImageImage::operator()( Magick::Image &image_ ) const -{ - image_.subImage( _subImage ); -} - -// Number of images relative to the base image -Magick::subRangeImage::subRangeImage( const size_t subRange_ ) - : _subRange( subRange_ ) -{ -} -void Magick::subRangeImage::operator()( Magick::Image &image_ ) const -{ - image_.subRange( _subRange ); -} - -// Anti-alias Postscript and TrueType fonts (default true) -Magick::textAntiAliasImage::textAntiAliasImage( const bool flag_ ) - : _flag( flag_ ) -{ -} -void Magick::textAntiAliasImage::operator()( Magick::Image &image_ ) const -{ - image_.textAntiAlias( _flag ); -} - -// Image storage type -Magick::typeImage::typeImage( const Magick::ImageType type_ ) - : _type( type_ ) -{ -} -void Magick::typeImage::operator()( Magick::Image &image_ ) const -{ - image_.type( _type ); -} - -// Print detailed information about the image -Magick::verboseImage::verboseImage( const bool verbose_ ) - : _verbose( verbose_ ) -{ -} -void Magick::verboseImage::operator()( Magick::Image &image_ ) const -{ - image_.verbose( _verbose ); -} - -// X11 display to display to, obtain fonts from, or to capture image -// from -Magick::x11DisplayImage::x11DisplayImage( const std::string &display_ ) - : _display( display_ ) -{ -} -void Magick::x11DisplayImage::operator()( Magick::Image &image_ ) const -{ - image_.x11Display( _display ); -} diff --git a/Magick++/lib/SecurityPolicy.cpp b/Magick++/lib/SecurityPolicy.cpp deleted file mode 100644 index 6e20345f5..000000000 --- a/Magick++/lib/SecurityPolicy.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Dirk Lemstra 2018 -// -// Implementation of the security policy. -// - -#define MAGICKCORE_IMPLEMENTATION 1 -#define MAGICK_PLUSPLUS_IMPLEMENTATION 1 - -#include "Magick++/SecurityPolicy.h" -#include "Magick++/Exception.h" -#include -#include - -using namespace std; - -bool Magick::SecurityPolicy::anonymousCacheMemoryMap() -{ - return(setValue(CachePolicyDomain,"memory-map","anonymous")); -} - -bool Magick::SecurityPolicy::anonymousSystemMemoryMap() -{ - return(setValue(SystemPolicyDomain,"memory-map","anonymous")); -} - -bool Magick::SecurityPolicy::precision(const int precision_) -{ - string - value; - - value=toString(precision_); - return(setValue(SystemPolicyDomain,"precision",value)); -} - -bool Magick::SecurityPolicy::maxMemoryRequest(const MagickSizeType limit_) -{ - string - value; - - value=toString(limit_); - return(setValue(SystemPolicyDomain,"max-memory-request",value)); -} - -bool Magick::SecurityPolicy::shred(const int passes_) -{ - string - value; - - value=toString(passes_); - return(setValue(SystemPolicyDomain,"shred",value)); -} - -Magick::SecurityPolicy::SecurityPolicy() -{ -} - -bool Magick::SecurityPolicy::setValue(const PolicyDomain domain_, - const std::string name_,const std::string value_) -{ - MagickBooleanType - status; - - GetPPException; - status=MagickCore::SetMagickSecurityPolicyValue(domain_,name_.c_str(), - value_.c_str(),exceptionInfo); - ThrowPPException(false); - return(status != MagickFalse); -} - -template -std::string Magick::SecurityPolicy::toString(const T& value) -{ - stringstream ss; - ss << value; - return ss.str(); -} diff --git a/Magick++/lib/Statistic.cpp b/Magick++/lib/Statistic.cpp deleted file mode 100644 index 250aca3fd..000000000 --- a/Magick++/lib/Statistic.cpp +++ /dev/null @@ -1,660 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Dirk Lemstra 2014-2015 -// -// Implementation of channel moments. -// - -#define MAGICKCORE_IMPLEMENTATION 1 -#define MAGICK_PLUSPLUS_IMPLEMENTATION 1 - -#include "Magick++/Include.h" -#include "Magick++/Exception.h" -#include "Magick++/Statistic.h" -#include "Magick++/Image.h" - -using namespace std; - -Magick::ChannelMoments::ChannelMoments(void) - : _channel(SyncPixelChannel), - _huInvariants(8), - _centroidX(0.0), - _centroidY(0.0), - _ellipseAxisX(0.0), - _ellipseAxisY(0.0), - _ellipseAngle(0.0), - _ellipseEccentricity(0.0), - _ellipseIntensity(0.0) -{ -} - -Magick::ChannelMoments::ChannelMoments(const ChannelMoments &channelMoments_) - : _channel(channelMoments_._channel), - _huInvariants(channelMoments_._huInvariants), - _centroidX(channelMoments_._centroidX), - _centroidY(channelMoments_._centroidY), - _ellipseAxisX(channelMoments_._ellipseAxisX), - _ellipseAxisY(channelMoments_._ellipseAxisY), - _ellipseAngle(channelMoments_._ellipseAngle), - _ellipseEccentricity(channelMoments_._ellipseEccentricity), - _ellipseIntensity(channelMoments_._ellipseIntensity) -{ -} - -Magick::ChannelMoments::~ChannelMoments(void) -{ -} - -double Magick::ChannelMoments::centroidX(void) const -{ - return(_centroidX); -} - -double Magick::ChannelMoments::centroidY(void) const -{ - return(_centroidY); -} - -Magick::PixelChannel Magick::ChannelMoments::channel(void) const -{ - return(_channel); -} - -double Magick::ChannelMoments::ellipseAxisX(void) const -{ - return(_ellipseAxisX); -} - -double Magick::ChannelMoments::ellipseAxisY(void) const -{ - return(_ellipseAxisY); -} - -double Magick::ChannelMoments::ellipseAngle(void) const -{ - return(_ellipseAngle); -} - -double Magick::ChannelMoments::ellipseEccentricity(void) const -{ - return(_ellipseEccentricity); -} - -double Magick::ChannelMoments::ellipseIntensity(void) const -{ - return(_ellipseIntensity); -} - -double Magick::ChannelMoments::huInvariants(const size_t index_) const -{ - if (index_ > 7) - throw ErrorOption("Valid range for index is 0-7"); - - return(_huInvariants.at(index_)); -} - -bool Magick::ChannelMoments::isValid() const -{ - return(_channel != SyncPixelChannel); -} - -Magick::ChannelMoments::ChannelMoments(const PixelChannel channel_, - const MagickCore::ChannelMoments *channelMoments_) - : _channel(channel_), - _huInvariants(), - _centroidX(channelMoments_->centroid.x), - _centroidY(channelMoments_->centroid.y), - _ellipseAxisX(channelMoments_->ellipse_axis.x), - _ellipseAxisY(channelMoments_->ellipse_axis.y), - _ellipseAngle(channelMoments_->ellipse_angle), - _ellipseEccentricity(channelMoments_->ellipse_eccentricity), - _ellipseIntensity(channelMoments_->ellipse_intensity) -{ - ssize_t - i; - - for (i=0; i<8; i++) - _huInvariants.push_back(channelMoments_->invariant[i]); -} - -Magick::ChannelPerceptualHash::ChannelPerceptualHash(void) - : _channel(SyncPixelChannel), - _srgbHuPhash(7), - _hclpHuPhash(7) -{ -} - -Magick::ChannelPerceptualHash::ChannelPerceptualHash( - const ChannelPerceptualHash &channelPerceptualHash_) - : _channel(channelPerceptualHash_._channel), - _srgbHuPhash(channelPerceptualHash_._srgbHuPhash), - _hclpHuPhash(channelPerceptualHash_._hclpHuPhash) -{ -} - -Magick::ChannelPerceptualHash::ChannelPerceptualHash( - const PixelChannel channel_,const std::string &hash_) - : _channel(channel_), - _srgbHuPhash(7), - _hclpHuPhash(7) -{ - ssize_t - i; - - if (hash_.length() != 70) - throw ErrorOption("Invalid hash length"); - - for (i=0; i<14; i++) - { - unsigned int - hex; - - double - value; - - if (sscanf(hash_.substr(i*5,5).c_str(),"%05x",&hex) != 1) - throw ErrorOption("Invalid hash value"); - - value=((unsigned short)hex) / pow(10.0, (double)(hex >> 17)); - if (hex & (1 << 16)) - value=-value; - if (i < 7) - _srgbHuPhash[i]=value; - else - _hclpHuPhash[i-7]=value; - } -} - -Magick::ChannelPerceptualHash::~ChannelPerceptualHash(void) -{ -} - -Magick::ChannelPerceptualHash::operator std::string() const -{ - std::string - hash; - - ssize_t - i; - - if (!isValid()) - return(std::string()); - - for (i=0; i<14; i++) - { - char - buffer[6]; - - double - value; - - unsigned int - hex; - - if (i < 7) - value=_srgbHuPhash[i]; - else - value=_hclpHuPhash[i-7]; - - hex=0; - while(hex < 7 && fabs(value*10) < 65536) - { - value=value*10; - hex++; - } - - hex=(hex<<1); - if (value < 0.0) - hex|=1; - hex=(hex<<16)+(unsigned int)(value < 0.0 ? -(value - 0.5) : value + 0.5); - (void) FormatLocaleString(buffer,6,"%05x",hex); - hash+=std::string(buffer); - } - return(hash); -} - -Magick::PixelChannel Magick::ChannelPerceptualHash::channel() const -{ - return(_channel); -} - -bool Magick::ChannelPerceptualHash::isValid() const -{ - return(_channel != SyncPixelChannel); -} - -double Magick::ChannelPerceptualHash::sumSquaredDifferences( - const ChannelPerceptualHash &channelPerceptualHash_) -{ - double - ssd; - - ssize_t - i; - - ssd=0.0; - for (i=0; i<7; i++) - { - ssd+=((_srgbHuPhash[i]-channelPerceptualHash_._srgbHuPhash[i])* - (_srgbHuPhash[i]-channelPerceptualHash_._srgbHuPhash[i])); - ssd+=((_hclpHuPhash[i]-channelPerceptualHash_._hclpHuPhash[i])* - (_hclpHuPhash[i]-channelPerceptualHash_._hclpHuPhash[i])); - } - return(ssd); -} - -double Magick::ChannelPerceptualHash::srgbHuPhash(const size_t index_) const -{ - if (index_ > 6) - throw ErrorOption("Valid range for index is 0-6"); - - return(_srgbHuPhash.at(index_)); -} - -double Magick::ChannelPerceptualHash::hclpHuPhash(const size_t index_) const -{ - if (index_ > 6) - throw ErrorOption("Valid range for index is 0-6"); - - return(_hclpHuPhash.at(index_)); -} - -Magick::ChannelPerceptualHash::ChannelPerceptualHash( - const PixelChannel channel_, - const MagickCore::ChannelPerceptualHash *channelPerceptualHash_) - : _channel(channel_), - _srgbHuPhash(7), - _hclpHuPhash(7) -{ - ssize_t - i; - - for (i=0; i<7; i++) - { - _srgbHuPhash[i]=channelPerceptualHash_->phash[0][i]; - _hclpHuPhash[i]=channelPerceptualHash_->phash[1][i]; - } -} - -Magick::ChannelStatistics::ChannelStatistics(void) - : _channel(SyncPixelChannel), - _area(0.0), - _depth(0.0), - _entropy(0.0), - _kurtosis(0.0), - _maxima(0.0), - _mean(0.0), - _minima(0.0), - _skewness(0.0), - _standardDeviation(0.0), - _sum(0.0), - _sumCubed(0.0), - _sumFourthPower(0.0), - _sumSquared(0.0), - _variance(0.0) -{ -} - -Magick::ChannelStatistics::ChannelStatistics( - const ChannelStatistics &channelStatistics_) - : _channel(channelStatistics_._channel), - _area(channelStatistics_._area), - _depth(channelStatistics_._depth), - _entropy(channelStatistics_._entropy), - _kurtosis(channelStatistics_._kurtosis), - _maxima(channelStatistics_._maxima), - _mean(channelStatistics_._mean), - _minima(channelStatistics_._minima), - _skewness(channelStatistics_._skewness), - _standardDeviation(channelStatistics_._standardDeviation), - _sum(channelStatistics_._sum), - _sumCubed(channelStatistics_._sumCubed), - _sumFourthPower(channelStatistics_._sumFourthPower), - _sumSquared(channelStatistics_._sumSquared), - _variance(channelStatistics_._variance) -{ -} - -Magick::ChannelStatistics::~ChannelStatistics(void) -{ -} - -double Magick::ChannelStatistics::area() const -{ - return(_area); -} - -Magick::PixelChannel Magick::ChannelStatistics::channel() const -{ - return(_channel); -} - -size_t Magick::ChannelStatistics::depth() const -{ - return(_depth); -} - -double Magick::ChannelStatistics::entropy() const -{ - return(_entropy); -} - -bool Magick::ChannelStatistics::isValid() const -{ - return(_channel != SyncPixelChannel); -} - -double Magick::ChannelStatistics::kurtosis() const -{ - return(_kurtosis); -} - -double Magick::ChannelStatistics::maxima() const -{ - return(_maxima); -} - -double Magick::ChannelStatistics::mean() const -{ - return(_mean); -} - -double Magick::ChannelStatistics::minima() const -{ - return(_minima); -} - -double Magick::ChannelStatistics::skewness() const -{ - return(_skewness); -} - -double Magick::ChannelStatistics::standardDeviation() const -{ - return(_standardDeviation); -} - -double Magick::ChannelStatistics::sum() const -{ - return(_sum); -} - -double Magick::ChannelStatistics::sumCubed() const -{ - return(_sumCubed); -} - -double Magick::ChannelStatistics::sumFourthPower() const -{ - return(_sumFourthPower); -} - -double Magick::ChannelStatistics::sumSquared() const -{ - return(_sumSquared); -} - -double Magick::ChannelStatistics::variance() const -{ - return(_variance); -} - -Magick::ChannelStatistics::ChannelStatistics(const PixelChannel channel_, - const MagickCore::ChannelStatistics *channelStatistics_) - : _channel(channel_), - _area(channelStatistics_->area), - _depth(channelStatistics_->depth), - _entropy(channelStatistics_->entropy), - _kurtosis(channelStatistics_->kurtosis), - _maxima(channelStatistics_->maxima), - _mean(channelStatistics_->mean), - _minima(channelStatistics_->minima), - _skewness(channelStatistics_->skewness), - _standardDeviation(channelStatistics_->standard_deviation), - _sum(channelStatistics_->sum), - _sumCubed(channelStatistics_->sum_cubed), - _sumFourthPower(channelStatistics_->sum_fourth_power), - _sumSquared(channelStatistics_->sum_squared), - _variance(channelStatistics_->variance) -{ -} - -Magick::ImageMoments::ImageMoments(void) - : _channels() -{ -} - -Magick::ImageMoments::ImageMoments(const ImageMoments &imageMoments_) - : _channels(imageMoments_._channels) -{ -} - -Magick::ImageMoments::~ImageMoments(void) -{ -} - -Magick::ChannelMoments Magick::ImageMoments::channel( - const PixelChannel channel_) const -{ - for (std::vector::const_iterator it = _channels.begin(); - it != _channels.end(); ++it) - { - if (it->channel() == channel_) - return(*it); - } - return(ChannelMoments()); -} - -Magick::ImageMoments::ImageMoments(const Image &image_) - : _channels() -{ - MagickCore::ChannelMoments* - channel_moments; - - GetPPException; - channel_moments=GetImageMoments(image_.constImage(),exceptionInfo); - if (channel_moments != (MagickCore::ChannelMoments *) NULL) - { - ssize_t - i; - - for (i=0; i < (ssize_t) GetPixelChannels(image_.constImage()); i++) - { - PixelChannel channel=GetPixelChannelChannel(image_.constImage(),i); - PixelTrait traits=GetPixelChannelTraits(image_.constImage(),channel); - if (traits == UndefinedPixelTrait) - continue; - if ((traits & UpdatePixelTrait) == 0) - continue; - _channels.push_back(Magick::ChannelMoments(channel, - &channel_moments[channel])); - } - _channels.push_back(Magick::ChannelMoments(CompositePixelChannel, - &channel_moments[CompositePixelChannel])); - channel_moments=(MagickCore::ChannelMoments *) RelinquishMagickMemory( - channel_moments); - } - ThrowPPException(image_.quiet()); -} - -Magick::ImagePerceptualHash::ImagePerceptualHash(void) - : _channels() -{ -} - -Magick::ImagePerceptualHash::ImagePerceptualHash( - const ImagePerceptualHash &imagePerceptualHash_) - : _channels(imagePerceptualHash_._channels) -{ -} - -Magick::ImagePerceptualHash::ImagePerceptualHash(const std::string &hash_) - : _channels() -{ - if (hash_.length() != 210) - throw ErrorOption("Invalid hash length"); - - _channels.push_back(Magick::ChannelPerceptualHash(RedPixelChannel, - hash_.substr(0, 70))); - _channels.push_back(Magick::ChannelPerceptualHash(GreenPixelChannel, - hash_.substr(70, 70))); - _channels.push_back(Magick::ChannelPerceptualHash(BluePixelChannel, - hash_.substr(140, 70))); -} - -Magick::ImagePerceptualHash::~ImagePerceptualHash(void) -{ -} - -Magick::ImagePerceptualHash::operator std::string() const -{ - if (!isValid()) - return(std::string()); - - return static_cast(_channels[0]) + - static_cast(_channels[1]) + - static_cast(_channels[2]); -} - -Magick::ChannelPerceptualHash Magick::ImagePerceptualHash::channel( - const PixelChannel channel_) const -{ - for (std::vector::const_iterator it = - _channels.begin(); it != _channels.end(); ++it) - { - if (it->channel() == channel_) - return(*it); - } - return(ChannelPerceptualHash()); -} - -bool Magick::ImagePerceptualHash::isValid() const -{ - if (_channels.size() != 3) - return(false); - - if (_channels[0].channel() != RedPixelChannel) - return(false); - - if (_channels[1].channel() != GreenPixelChannel) - return(false); - - if (_channels[2].channel() != BluePixelChannel) - return(false); - - return(true); -} - -double Magick::ImagePerceptualHash::sumSquaredDifferences( - const ImagePerceptualHash &channelPerceptualHash_) -{ - double - ssd; - - ssize_t - i; - - if (!isValid()) - throw ErrorOption("instance is not valid"); - if (!channelPerceptualHash_.isValid()) - throw ErrorOption("channelPerceptualHash_ is not valid"); - - ssd=0.0; - for (i=0; i<3; i++) - { - ssd+=_channels[i].sumSquaredDifferences(_channels[i]); - } - return(ssd); -} - -Magick::ImagePerceptualHash::ImagePerceptualHash( - const Image &image_) - : _channels() -{ - MagickCore::ChannelPerceptualHash* - channel_perceptual_hash; - - PixelTrait - traits; - - GetPPException; - channel_perceptual_hash=GetImagePerceptualHash(image_.constImage(), - exceptionInfo); - if (channel_perceptual_hash != (MagickCore::ChannelPerceptualHash *) NULL) - { - traits=GetPixelChannelTraits(image_.constImage(),RedPixelChannel); - if ((traits & UpdatePixelTrait) != 0) - _channels.push_back(Magick::ChannelPerceptualHash(RedPixelChannel, - &channel_perceptual_hash[RedPixelChannel])); - traits=GetPixelChannelTraits(image_.constImage(),GreenPixelChannel); - if ((traits & UpdatePixelTrait) != 0) - _channels.push_back(Magick::ChannelPerceptualHash(GreenPixelChannel, - &channel_perceptual_hash[GreenPixelChannel])); - traits=GetPixelChannelTraits(image_.constImage(),BluePixelChannel); - if ((traits & UpdatePixelTrait) != 0) - _channels.push_back(Magick::ChannelPerceptualHash(BluePixelChannel, - &channel_perceptual_hash[BluePixelChannel])); - channel_perceptual_hash=(MagickCore::ChannelPerceptualHash *) - RelinquishMagickMemory(channel_perceptual_hash); - } - ThrowPPException(image_.quiet()); -} - -Magick::ImageStatistics::ImageStatistics(void) - : _channels() -{ -} - -Magick::ImageStatistics::ImageStatistics( - const ImageStatistics &imageStatistics_) - : _channels(imageStatistics_._channels) -{ -} - -Magick::ImageStatistics::~ImageStatistics(void) -{ -} - -Magick::ChannelStatistics Magick::ImageStatistics::channel( - const PixelChannel channel_) const -{ - for (std::vector::const_iterator it = _channels.begin(); - it != _channels.end(); ++it) - { - if (it->channel() == channel_) - return(*it); - } - return(ChannelStatistics()); -} - -Magick::ImageStatistics::ImageStatistics(const Image &image_) - : _channels() -{ - MagickCore::ChannelStatistics* - channel_statistics; - - GetPPException; - channel_statistics=GetImageStatistics(image_.constImage(),exceptionInfo); - if (channel_statistics != (MagickCore::ChannelStatistics *) NULL) - { - ssize_t - i; - - for (i=0; i < (ssize_t) GetPixelChannels(image_.constImage()); i++) - { - PixelChannel channel=GetPixelChannelChannel(image_.constImage(),i); - PixelTrait traits=GetPixelChannelTraits(image_.constImage(),channel); - if (traits == UndefinedPixelTrait) - continue; - if ((traits & UpdatePixelTrait) == 0) - continue; - _channels.push_back(Magick::ChannelStatistics(channel, - &channel_statistics[channel])); - } - _channels.push_back(Magick::ChannelStatistics(CompositePixelChannel, - &channel_statistics[CompositePixelChannel])); - channel_statistics=(MagickCore::ChannelStatistics *) RelinquishMagickMemory( - channel_statistics); - } - ThrowPPException(image_.quiet()); -} diff --git a/Magick++/lib/Thread.cpp b/Magick++/lib/Thread.cpp deleted file mode 100644 index b89e9b8bf..000000000 --- a/Magick++/lib/Thread.cpp +++ /dev/null @@ -1,111 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002 -// Copyright Dirk Lemstra 2014-2017 -// -// Implementation of thread support -// - -#define MAGICKCORE_IMPLEMENTATION 1 -#define MAGICK_PLUSPLUS_IMPLEMENTATION 1 - -#include "Magick++/Thread.h" -#include "Magick++/Exception.h" - -#include - -// Default constructor -Magick::MutexLock::MutexLock(void) -#if defined(MAGICKCORE_HAVE_PTHREAD) - // POSIX threads - : _mutex() -{ - ::pthread_mutexattr_t - attr; - - int - sysError; - - if ((sysError=::pthread_mutexattr_init(&attr)) == 0) - if ((sysError=::pthread_mutex_init(&_mutex,&attr)) == 0) - { - ::pthread_mutexattr_destroy(&attr); - return; - } - throwExceptionExplicit(MagickCore::OptionError,"mutex initialization failed", - strerror(sysError)); -} -#else -#if defined(_VISUALC_) && defined(_MT) -// Win32 threads -{ - SECURITY_ATTRIBUTES - security; - - /* Allow the semaphore to be inherited */ - security.nLength=sizeof(security); - security.lpSecurityDescriptor=(LPVOID) NULL; - security.bInheritHandle=TRUE; - - /* Create the semaphore, with initial value signaled */ - _mutex=::CreateSemaphore(&security,1,1,(LPCSTR) NULL); - if (_mutex != (HANDLE) NULL) - return; - throwExceptionExplicit(MagickCore::OptionError, - "mutex initialization failed"); -} -#else -// Threads not supported -{ -} -#endif -#endif - -// Destructor -Magick::MutexLock::~MutexLock(void) -{ -#if defined(MAGICKCORE_HAVE_PTHREAD) - (void) ::pthread_mutex_destroy(&_mutex); -#endif -#if defined(_MT) && defined(_VISUALC_) - (void) ::CloseHandle(_mutex); -#endif -} - -// Lock mutex -void Magick::MutexLock::lock(void) -{ -#if defined(MAGICKCORE_HAVE_PTHREAD) - int - sysError; - - if ((sysError=::pthread_mutex_lock(&_mutex)) == 0) - return; - throwExceptionExplicit(MagickCore::OptionError,"mutex lock failed", - strerror(sysError)); -#endif -#if defined(_MT) && defined(_VISUALC_) - if (WaitForSingleObject(_mutex,INFINITE) != WAIT_FAILED) - return; - throwExceptionExplicit(MagickCore::OptionError,"mutex lock failed"); -#endif -} - -// Unlock mutex -void Magick::MutexLock::unlock(void) -{ -#if defined(MAGICKCORE_HAVE_PTHREAD) - int - sysError; - - if ((sysError=::pthread_mutex_unlock(&_mutex)) == 0) - return; - throwExceptionExplicit(MagickCore::OptionError,"mutex unlock failed", - strerror(sysError)); -#endif -#if defined(_MT) && defined(_VISUALC_) - if (ReleaseSemaphore(_mutex,1,(LPLONG) NULL) == TRUE) - return; - throwExceptionExplicit(MagickCore::OptionError,"mutex unlock failed"); -#endif -} diff --git a/Magick++/lib/TypeMetric.cpp b/Magick++/lib/TypeMetric.cpp deleted file mode 100644 index 0ba4e8679..000000000 --- a/Magick++/lib/TypeMetric.cpp +++ /dev/null @@ -1,75 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 2001 -// Copyright Dirk Lemstra 2014-2018 -// -// TypeMetric implementation -// - -#define MAGICKCORE_IMPLEMENTATION 1 -#define MAGICK_PLUSPLUS_IMPLEMENTATION 1 - -#include "Magick++/TypeMetric.h" -#include "Magick++/Drawable.h" -#include - -Magick::TypeMetric::TypeMetric(void) -{ - memset(&_typeMetric,0,sizeof(_typeMetric)); -} - -Magick::TypeMetric::~TypeMetric(void) -{ -} - -double Magick::TypeMetric::ascent(void) const -{ - return(_typeMetric.ascent); -} - -Magick::Geometry Magick::TypeMetric::bounds(void) const -{ - return(Geometry((size_t) (_typeMetric.bounds.x2-_typeMetric.bounds.x1), - (size_t) (_typeMetric.bounds.y2-_typeMetric.bounds.y1),(ssize_t) - _typeMetric.bounds.x1,(ssize_t) _typeMetric.bounds.y1)); -} - -double Magick::TypeMetric::descent(void) const -{ - return(_typeMetric.descent); -} - -double Magick::TypeMetric::maxHorizontalAdvance(void) const -{ - return(_typeMetric.max_advance); -} - -Magick::Coordinate Magick::TypeMetric::origin(void) const -{ - return(Coordinate(_typeMetric.origin.x,_typeMetric.origin.y)); -} - -Magick::Coordinate Magick::TypeMetric::pixelsPerEm(void) const -{ - return(Coordinate(_typeMetric.pixels_per_em.x,_typeMetric.pixels_per_em.y)); -} - -double Magick::TypeMetric::textHeight(void) const -{ - return(_typeMetric.height); -} - -double Magick::TypeMetric::textWidth(void) const -{ - return(_typeMetric.width); -} - -double Magick::TypeMetric::underlinePosition(void) const -{ - return(_typeMetric.underline_position); -} - -double Magick::TypeMetric::underlineThickness(void) const -{ - return(_typeMetric.underline_thickness); -} diff --git a/Magick++/lib/libMagick++.map b/Magick++/lib/libMagick++.map deleted file mode 100644 index 59ba60661..000000000 --- a/Magick++/lib/libMagick++.map +++ /dev/null @@ -1,4 +0,0 @@ - VERS_5.0 { - global: - *; - }; diff --git a/Magick++/tests/appendImages.cpp b/Magick++/tests/appendImages.cpp deleted file mode 100644 index b558a24d9..000000000 --- a/Magick++/tests/appendImages.cpp +++ /dev/null @@ -1,95 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2003 -// -// Test STL appendImages function -// - -#include -#include -#include -#include -#include - -using namespace std; - -using namespace Magick; - -int main( int /*argc*/, char ** argv) -{ - - // Initialize ImageMagick install location for Windows - InitializeMagick(*argv); - - int failures=0; - - try { - - string srcdir(""); - if(getenv("SRCDIR") != 0) - srcdir = getenv("SRCDIR"); - - // - // Test appendImages - // - - list imageList; - readImages( &imageList, srcdir + "test_image_anim.miff" ); - - Image appended; - - // Horizontal - appendImages( &appended, imageList.begin(), imageList.end() ); - // appended.display(); - if ( - ( appended.signature() != "f5ed4a96632126a30c353340a1ddc4e0745295bb1f4bbbb6e020138c972c2f5e" ) && - ( appended.signature() != "aa8789792be68dde5d686ddcbce4f551cbe8093cf3c782f5313443594abff8c0" ) && - ( appended.signature() != "d2b63ade27f08ba413533c56239fd5dca7ac5cdfcae7a15d48980209dbfc0a40" ) && - ( appended.signature() != "f48dd74b57ed277c9c62da1a65788186a910b8f2faa47851fcf1f4572640ed9c" )) - { - ++failures; - cout << "Line: " << __LINE__ - << " Horizontal append failed, signature = " - << appended.signature() << endl; - appended.write("appendImages_horizontal_out.miff"); - // appended.display(); - } - - // Vertical - appendImages( &appended, imageList.begin(), imageList.end(), true ); - if ( - ( appended.signature() != "de891eb85d168bd2177ee92940ab0e29d32c9f8e4be41906f9272a88925d9dd3" ) && - ( appended.signature() != "5e119331c70db1b0bc3fdf51920b85449b4b02f63653250c34b68c1528171bb2" ) && - ( appended.signature() != "bb411d8cc99700f29547e8ca60d925d0d3be3aaf16e70260a3506428e61339de" ) && - ( appended.signature() != "9cfe22dacae97e4e0fe1c12567a5d7e111f4680ec65a40da16281928cf4ba6be" )) - { - ++failures; - cout << "Line: " << __LINE__ - << " Vertical append failed, signature = " - << appended.signature() << endl; - appended.write("appendImages_vertical_out.miff"); - // appended.display(); - } - - } - - catch( Exception &error_ ) - { - cout << "Caught exception: " << error_.what() << endl; - return 1; - } - catch( exception &error_ ) - { - cout << "Caught exception: " << error_.what() << endl; - return 1; - } - - if ( failures ) - { - cout << failures << " failures" << endl; - return 1; - } - - return 0; -} - diff --git a/Magick++/tests/attributes.cpp b/Magick++/tests/attributes.cpp deleted file mode 100644 index 8392d950e..000000000 --- a/Magick++/tests/attributes.cpp +++ /dev/null @@ -1,1450 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003 -// -// Tests for setting/getting Magick::Image attributes -// - -#include -#include -#include - -using namespace std; - -using namespace Magick; - -int main( int /*argc*/, char ** argv) -{ - - // Initialize ImageMagick install location for Windows - InitializeMagick(*argv); - - volatile int failures=0; - - try { - - size_t columns = 640; - size_t rows = 480; - Geometry geometry(columns,rows); - Color canvasColor( "red" ); - Image image( geometry, canvasColor); - - // - // antiAlias - // - - // Test default value - if ( image.textAntiAlias() != true ) - { - ++failures; - cout << "Line: " << __LINE__ << ", textAntiAlias default not true" << endl; - } - - // Test setting false - image.textAntiAlias( false ); - if ( image.textAntiAlias() != false ) - { - ++failures; - cout << "Line: " << __LINE__ << ", textAntiAlias not false" << endl; - } - - // Test setting true - image.textAntiAlias( true ); - if ( image.textAntiAlias() != true ) - { - ++failures; - cout << "Line: " << __LINE__ << ", textAntiAlias not true" << endl; - } - - // - // adjoin - // - - // Test default value - if ( image.adjoin() != true ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", adjoin default not 'true' as expected" << endl; - } - - // Test setting false - image.adjoin( false ); - if ( image.adjoin() != false ) - { - ++failures; - cout << "Line: " << __LINE__ << ", adjoin failed set to 'false'" << endl; - } - - // Test setting true - image.adjoin( true ); - if ( image.adjoin() != true ) - { - ++failures; - cout << "Line: " << __LINE__ << ", adjoin failed set to 'true'" << endl; - } - - // - // animationDelay - // - - // Test default value - if ( image.animationDelay() != 0 ) - { - ++failures; - cout << "Line: " << __LINE__ << ", animationDelay default (" - << image.animationDelay() - << ") not 0 as expected" << endl; - } - - // Test setting to 0 - image.animationDelay( 0 ); - if ( image.animationDelay() != 0 ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", failed to set animationDelay to 0" << endl; - } - - // Test setting to 100 - image.animationDelay( 100 ); - if ( image.animationDelay() != 100 ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", failed to set animationDelay to 100" << endl; - } - image.animationDelay(0); - - // - // animationIterations - // - - // Test default value - if ( image.animationIterations() != 0 ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", animationIterations default (" - << image.animationIterations() - << ") not 0 as expected" << endl; - } - - // Test setting to 0 - image.animationIterations( 0 ); - if ( image.animationIterations() != 0 ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", failed to set animationIterations to 0" << endl; - } - - // Test setting to 100 - image.animationIterations( 100 ); - if ( image.animationIterations() != 100 ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", failed to set animationIterations to 100" << endl; - } - image.animationIterations( 0 ); - - // - // backgroundColor - // - - // Test default value. - if ( string(image.backgroundColor()) != string(ColorRGB("white")) ) - { - ++failures; - cout << "Line: " << __LINE__ << ", backgroundColor default (" - << string(image.backgroundColor()) - << ") is incorrect" << endl; - } - - // Test setting to blue - image.backgroundColor("blue"); - if ( !image.backgroundColor().isValid() ) - { - ++failures; - cout << "Line: " << __LINE__ << ", backgroundColor (" - << string(image.backgroundColor()) - << ") failed set to 'blue'" << endl; - } - else - if ( string(image.backgroundColor()) != "#0000FF" && - string(image.backgroundColor()) != "#00000000FFFF" && - string(image.backgroundColor()) != "#0000000000000000FFFFFFFF" && - string(image.backgroundColor()) != "#00000000000000000000000000000000FFFFFFFFFFFFFFFF" ) - { - ++failures; - cout << "Line: " << __LINE__ << ", backgroundColor (" - << string(image.backgroundColor()) << ") is incorrect" - << endl; - } - - // Test setting using hex color - image.backgroundColor("#00AAFF"); - if ( !image.backgroundColor().isValid() ) - { - ++failures; - cout << "Line: " << __LINE__ << ", backgroundColor (" - << string(image.backgroundColor()) - << ") is incorrectly invalid" << endl; - } - else - if ( string(image.backgroundColor()) != "#00AAFF" && - string(image.backgroundColor()) != "#0000AAAAFFFF" && - string(image.backgroundColor()) != "#00000000AAAAAAAAFFFFFFFF" && - string(image.backgroundColor()) != "#0000000000000000AAAAAAAAAAAAAAAAFFFFFFFFFFFFFFFF" ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", backgroundColor (" - << string(image.backgroundColor()) - << ") is incorrect" - << endl; - } - - // - // backgroundTexture - // - - // Test default value - if ( image.backgroundTexture() != "" ) - { - ++failures; - cout << "Line: " << __LINE__ << ", backgroundTexture default (" - << image.backgroundTexture() - << ") is incorrect" << endl; - } - - // Test setting/getting value - image.backgroundTexture("afile.jpg"); - if ( image.backgroundTexture() != "afile.jpg" ) - { - ++failures; - cout << "Line: " << __LINE__ << ", backgroundTexture (" - << image.backgroundTexture() - << ") is incorrect" << endl; - } - - // Test setting back to default - image.backgroundTexture(""); - if ( image.backgroundTexture() != "" ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", backgroundTexture (" - << image.backgroundTexture() - << ") failed to set to \"\"" << endl; - } - - // - // baseColumns - // - if ( image.baseColumns() != columns ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", baseColumns (" - << image.baseColumns() - << ") is not equal to " - << columns - << " as expected" - << endl; - } - - - // - // baseFilename - // - // Base filename is color for xc images - if ( image.baseFilename() != "xc:#FF0000" && - image.baseFilename() != "xc:#FFFF00000000" && - image.baseFilename() != "xc:#FFFFFFFF0000000000000000" && - image.baseFilename() != "xc:#FFFFFFFFFFFFFFFF00000000000000000000000000000000") - { - ++failures; - cout << "Line: " << __LINE__ - << ", baseFilename (" - << image.baseFilename() - << ") is incorrect" - << endl; - } - - // - // baseRows - // - if ( image.baseRows() != rows ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", baseRows (" - << image.baseRows() - << ") != rows (" - << rows - << ")" - << endl; - } - - // - // borderColor - // - if ( image.borderColor() != ColorRGB("#dfdfdf") ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", borderColor default (" - << string(image.borderColor()) - << ") is incorrect" << endl; - } - - image.borderColor("#FF0000"); - if ( image.borderColor() != Color("#FF0000") ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", failed to set borderColor (" - << string(image.borderColor()) - << ")" << endl; - } - - image.borderColor("black"); - if ( image.borderColor() != Color("#000000") ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", failed to set borderColor (" - << string(image.borderColor()) - << ")" - << endl; - } - - // - // boxColor - // - image.boxColor("#FF0000"); - if ( image.boxColor() != Color("#FF0000") ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", failed to set boxColor (" - << string(image.boxColor()) - << ")" - << endl; - } - - image.boxColor("black"); - if ( image.boxColor() != Color("#000000") ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", failed to set boxColor (" - << string(image.boxColor()) - << ") to #000000" - << endl; - } - - // - // chromaBluePrimary - // - { - // Test default setting - double x, y, z; - image.chromaBluePrimary(&x, &y, &z); - if ( x == 0.0f || y == 0.0f ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", chromaBluePrimary x/y defaults are zero" - << endl; - } - - // Test set/get - image.chromaBluePrimary(50, 100, 150 ); - image.chromaBluePrimary(&x, &y, &z); - if ( x != 50 || y != 100 || z != 150 ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", chromaBluePrimary x/y failed set/get" << endl; - } - } - - // - // chromaGreenPrimary - // - { - // Test default setting - double x, y, z; - image.chromaGreenPrimary(&x, &y, &z); - if ( x == 0.0f || y == 0.0f ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", chromaGreenPrimary x/y defaults are zero" << endl; - } - - // Test set/get - image.chromaGreenPrimary(50, 100, 150); - image.chromaGreenPrimary(&x, &y, &z); - if (x != 50 || y != 100 || z != 150) - { - ++failures; - cout << "Line: " << __LINE__ - << ", chromaGreenPrimary x/y failed set/get" << endl; - } - } - - // - // chromaRedPrimary - // - { - // Test default setting - double x, y, z; - image.chromaRedPrimary(&x, &y, &z); - if ( x == 0.0f || y == 0.0f ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", chromaRedPrimary x/y defaults are zero" << endl; - } - - // Test set/get - image.chromaRedPrimary(50, 100, 150); - image.chromaRedPrimary(&x, &y, &z); - if (x != 50 || y != 100 || z != 150) - { - ++failures; - cout << "Line: " << __LINE__ - << ", chromaRedPrimary x/y failed set/get" << endl; - } - } - - // - // chromaWhitePoint - // - { - // Test default setting - double x, y, z; - image.chromaWhitePoint(&x, &y, &z); - if ( x == 0.0f || y == 0.0f ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", chromaWhitePoint x/y defaults are zero" << endl; - } - - // Test set/get - image.chromaWhitePoint(50, 100, 150); - image.chromaWhitePoint(&x, &y, &z); - if (x != 50 || y != 100 || z != 150) - { - ++failures; - cout << "Line: " << __LINE__ - << ", chromaWhitePoint x/y failed set/get" << endl; - } - } - - // - // classType - // - if ( image.classType() != DirectClass ) - { - ++failures; - cout << "Line: " << __LINE__ << ", classType is not DirectClass" << endl; - } - - // - // colorFuzz - // - - // Test default - if ( image.colorFuzz() != 0 ) - { - ++failures; - cout << "Line: " << __LINE__ << ", colorFuzz default is non-zero" << endl; - } - - // Test set/get - image.colorFuzz( 2 ); - if ( image.colorFuzz() != 2 ) - { - ++failures; - cout << "Line: " << __LINE__ << ", colorFuzz failed to set/get" << endl; - } - image.colorFuzz( 0 ); - - // - // columns - // - if ( image.columns() != columns ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", columns is not equal to canvas image columns" << endl; - } - - // - // comment - // - // Test default - if ( image.comment().length() != 0 ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", comment default non-zero length" << endl; - } - - // Test set/get - { - std::string comment("This is a comment."); - image.comment( comment ); - if ( image.comment() != comment ) - { - ++failures; - cout << "Line: " << __LINE__ << ", comment set/get failed" << endl; - } - } - - // Test resetting comment - image.comment( string() ); - if ( image.comment().length() != 0 ) - { - ++failures; - cout << "Line: " << __LINE__ << ", comment failed to reset" << endl; - } - - // - // compressType - // - // Test default - if ( image.compressType() != UndefinedCompression ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", compressType default is incorrect" << endl; - } - - // Test set/get - image.compressType(RLECompression); - if ( image.compressType() != RLECompression ) - { - ++failures; - cout << "Line: " << __LINE__ << ", compressType set/get failed" << endl; - } - image.compressType(UndefinedCompression); - - // - // density - // - { - // Test defaults - if ( image.density() != Point(72) ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", density default is not 72x72 as expected" << endl; - } - - // Test set/get - Point density(150,75); - image.density(density); - if ( image.density() != density ) - { - ++failures; - cout << "Line: " << __LINE__ << ", density set/get failed" << endl; - } - - - if ( image.xResolution() != 150 || - image.yResolution() != 75 ) - { - ++failures; - cout << "Line: " << __LINE__ << ", density set/get failed" << endl; - } - - image.density("72x72"); - - } - - // - // Format specific defines - // - if (image.defineSet("foo","bar")) - { - ++failures; - cout << "Line: " << __LINE__ - << ", define for foo:bar incorrectly reports set." - << endl; - } - - image.defineSet("foo","bar",true); - if (!image.defineSet("foo","bar")) - { - ++failures; - cout << "Line: " << __LINE__ - << ", define for foo:bar incorrectly reports not set." - << endl; - } - - image.defineSet("foo","bar",false); - if (image.defineSet("foo","bar")) - { - ++failures; - cout << "Line: " << __LINE__ - << ", define for foo:bar incorrectly reports set." - << endl; - } - - image.defineValue("foo","bar","value"); - std::string value = image.defineValue("foo","bar"); - if (image.defineValue("foo","bar") != "value") - { - ++failures; - cout << "Line: " << __LINE__ - << ", define for foo:bar incorrectly reports value \"" - << value << "\"" - << endl; - } - - image.defineSet("foo","bar",false); - if (image.defineSet("foo","bar")) - { - ++failures; - cout << "Line: " << __LINE__ - << ", define for foo:bar incorrectly reports set." - << endl; - } - - // - // depth - // - if ( image.depth() != MAGICKCORE_QUANTUM_DEPTH ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", depth (" - << image.depth() - << ") is not equal to " << MAGICKCORE_QUANTUM_DEPTH << endl; - } - - // - // Directory - // - { - // Since this is not a montage image, simply verify error report - bool caughtException = false; - cout << "Testing throwing and catching exceptions. A program crash or a message" << endl - << "that the exception was not caught indicates a test failure. A properly" << endl - << "formatted exception message indicates success:" << endl; - try - { - //image.directory(); - Magick::Image bad_image("foo"); - } - catch ( Exception &exception_) - { - cout << "Caught exception, good!:" << endl - << " \"" << exception_.what() << "\"" << endl; - caughtException = true; - } - if ( caughtException != true ) - { - ++failures; - cout << "failed to catch exception!" << endl; - } - } - - // - // fileName - // - // Test default - if ( image.fileName() != string("xc:") + string(canvasColor) ) - { - ++failures; - cout << "Line: " - << __LINE__ - << ", fileName (" - << image.fileName() - << ") is not canvas color (" - << string(canvasColor) - <<") as expected" << endl; - } - - // Set/get value - image.fileName("filename.jpg"); - if ( image.fileName() != "filename.jpg" ) - { - ++failures; - cout << "Line: " - << __LINE__ - << ", fileName (" - << image.fileName() - << ") failed to set/get" << endl; - } - image.fileName(canvasColor); - - // - // fileSize - // - // Test default - if ( image.fileSize() != 0 ) - { - ++failures; - cout << "Line: " << __LINE__ << ", fileSize (" - << static_cast(image.fileSize()) - << ") is not zero as expected" << endl; - } - - // - // filterType - // - // Test default - if ( image.filterType() != UndefinedFilter ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", filterType default (" - << (int)image.filterType() - << ") is incorrect" << endl; - } - - // Test set/get - image.filterType( TriangleFilter ); - if ( image.filterType() != TriangleFilter ) - { - ++failures; - cout << "Line: " << __LINE__ << ", filterType set/get failed" - << endl; - } - - // - // font - // - - // Test set/get - image.font("helvetica"); - if ( image.font() != "helvetica" ) - { - ++failures; - cout << "Line: " << __LINE__ << ", font set/get failed" << endl; - } - // Test set to null font - image.font( string() ); - if ( image.font().length() != 0 ) - { - ++failures; - cout << "Line: " << __LINE__ << ", font failed to unset" << endl; - } - - // - // fontPointsize - // - // Test default - if ( image.fontPointsize() != 0 ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", fontPointsize (" - << image.fontPointsize() - << ") is not default of 0 as expected" - << endl; - } - - // Test set/get - image.fontPointsize(10); - if ( image.fontPointsize() != 10 ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", fontPointsize set/get failed" << endl; - } - image.fontPointsize(12); - - // - // format - // - if ( image.format() != "Constant image uniform color" ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", format (" << image.format() << ") is not expected value" << endl; - } - - // - // gamma - // - if ( image.gamma() == 1.0f) - { - ++failures; - cout << "Line: " << __LINE__ - << ", gamma correction is unity as expected" << endl; - } - - // - // geometry - // - { - bool caughtException = false; - try - { - image.geometry(); - } - catch ( Exception& ) - { - caughtException = true; - } - if ( caughtException != true ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", geometry failed to report missing image geometry"; - } - } - - // - // gifDisposeMethod - // - // Test default - if ( image.gifDisposeMethod() != 0 ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", gifDisposeMethod default is not zero as expected" << endl; - } - - // Test set/get - image.gifDisposeMethod(BackgroundDispose); - if ( image.gifDisposeMethod() != BackgroundDispose ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", gifDisposeMethod set/get failed" << endl; - } - image.gifDisposeMethod(UndefinedDispose); - - // - // interlaceType - // - // Test default - if ( image.interlaceType() != NoInterlace ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", interlaceType default is not NoInterlace as expected" << endl; - } - - // Test set/get - image.interlaceType( PlaneInterlace ); - if ( image.interlaceType() != PlaneInterlace ) - { - ++failures; - cout << "Line: " << __LINE__ << ", interlaceType set/get failed" << endl; - } - image.interlaceType(NoInterlace); - - // - // label - // - // Test default - if ( image.label().length() != 0 ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", label default is not empty string as expected" << endl; - } - - // Test set/get - image.label("How now brown cow?"); - if ( image.label() != "How now brown cow?" ) - { - ++failures; - cout << "Line: " << __LINE__ << ", label set/get failed" << endl; - } - // Test set to default - image.label( string() ); - if ( image.label().length() != 0 ) - { - ++failures; - cout << "Line: " << __LINE__ << ", label failed to unset" << endl; - } - - // - // strokeWidth - // - // Test default - if ( image.strokeWidth() != 1 ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", strokeWidth default is not 1 as expected" << endl; - } - - // Test set/get - image.strokeWidth(2); - if ( image.strokeWidth() != 2 ) - { - ++failures; - cout << "Line: " << __LINE__ << ", strokeWidth set/get failed" << endl; - } - image.strokeWidth(1); - - // - // magick - // - // Test canvas default - if ( image.magick() != "XC" ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", magick canvas default is not XC as expected" << endl; - } - - // Test set/get - image.magick("GIF"); - if ( image.magick() != "GIF" ) - { - ++failures; - cout << "Line: " << __LINE__ << ", magick set/get failed" << endl; - } - - image.magick("XC"); - - // - // alpha - // - // Test default - if ( image.alpha() != false ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", alpha default is not false as expected" << endl; - } - - // Test set/get - image.alpha(true); - if ( image.alpha() != true ) - { - ++failures; - cout << "Line: " << __LINE__ << ", alpha set/get failed" << endl; - } - image.alpha(false); - - // - // matteColor - // - // Test default - if ( image.matteColor() != Color("#BDBDBD") ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", matteColor default is not #BDBDBD as expected" << endl; - } - - // Test set/get - image.matteColor(ColorRGB(0.5,0.5,1)); - if ( image.matteColor() != ColorRGB(0.5,0.5,1) ) - { - ++failures; - cout << "Line: " << __LINE__ << ", matteColor set/get failed" << endl; - } - - // Test unset - image.matteColor( Color() ); - - image.matteColor("#BDBDBD"); - - // - // meanErrorPerPixel - // - if ( image.meanErrorPerPixel() != 0 ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", meanErrorPerPixel is not zero as expected" << endl; - } - - // - // montageGeometry - // - { - bool caughtException = false; - try - { - image.montageGeometry(); - } - catch ( Exception& ) - { - caughtException = true; - } - if ( caughtException != true ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", montageGeometry failed to report missing montage geometry"; - } - } - - // - // monochrome - // - // Test default - if ( image.monochrome() != false ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", monochrome is not false as expected" << endl; - } - - // Test set/get - image.monochrome(true); - if ( image.monochrome() != true ) - { - ++failures; - cout << "Line: " << __LINE__ << ", monochrome get/set failed" << endl; - } - image.monochrome(false); - - // - // normalizedMaxError - // - if ( image.normalizedMaxError() != 0 ) - { - ++failures; - cout << "Line: " << __LINE__ - << ",normalizedMaxError is not zero as expected" << endl; - } - - // - // normalizedMeanError - // - if ( image.normalizedMeanError() != 0 ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", normalizedMeanError is not zero as expected" << endl; - } - - // - // strokeColor - // - - image.strokeColor(ColorRGB(0.5,0.5,1)); - if ( image.strokeColor() != ColorRGB(0.5,0.5,1) ) - { - ++failures; - cout << "Line: " << __LINE__ << ", strokeColor (" - << string(image.strokeColor()) - << ") set/get failed" << endl; - } - - - // - // fillColor - // - - image.fillColor(ColorRGB(0.5,0.5,1)); - if ( image.fillColor() != ColorRGB(0.5,0.5,1) ) - { - ++failures; - cout << "Line: " << __LINE__ << ", fillColor (" - << string(image.fillColor()) - << ") set/get failed" << endl; - } - - // - // pixelColor - // - // Test default - if ( image.pixelColor(40,60) != string(canvasColor) ) - { - ++failures; - cout << "Line: " << __LINE__ << ", pixelColor default (" - << string(image.pixelColor(40,60)) - << ") is not canvas color (" - << string(canvasColor) - << ") as expected" << endl; - } - - // Test set/get - image.pixelColor(40,60, ColorRGB(0.5,1,1)); - if ( image.pixelColor(40,60) != ColorRGB(0.5,1,1) ) - { - ++failures; - cout << "Line: " << __LINE__ << ", pixelColor set/get failed" << endl; - } - - // - // page - // - // Test default - if ( image.page() != Geometry(640,480,0,0) ) - { - ++failures; - cout << "Line: " << __LINE__ << ", page default " - << "(" << string(image.page()) << ")" - << " is not 640x480 as expected" << endl; - } - - // Test set/get - image.page("letter+43+43>"); - if ( image.page() != "612x792+43+43" ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", page set/get failed (" << string(image.page()) << ")" << endl; - } - - // - // quality - // - // Test default - if ( image.quality() != 0 ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", quality default is not 0 as expected" << endl; - } - - // Test set/get - image.quality(65); - if ( image.quality() != 65 ) - { - ++failures; - cout << "Line: " << __LINE__ << ", quality set/get failed" << endl; - } - image.quality(0); - - // - // quantizeColors - // - // Test default - if ( image.quantizeColors() != 256 ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", quantizeColors is not 256 as expected" << endl; - } - - // Test set/get - image.quantizeColors(200); - if ( image.quantizeColors() != 200 ) - { - ++failures; - cout << "Line: " << __LINE__ << ", quantizeColors set/get failed" << endl; - } - image.quantizeColors(0); - - // - // quantizeColorSpace - // - // Test default - if ( image.quantizeColorSpace() != UndefinedColorspace ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", quantizeColorSpace is not RGBColorspace as expected" << endl; - } - - // Test set/get - image.quantizeColorSpace(YIQColorspace); - if ( image.quantizeColorSpace() != YIQColorspace ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", quantizeColorSpace set/get failed" << endl; - } - image.quantizeColorSpace(RGBColorspace); - - // - // quantizeDither - // - // Test default - if ( image.quantizeDither() == false ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", quantizeDither is not false as expected" << endl; - } - - // Test set/get - image.quantizeDither(false); - if ( image.quantizeDither() != false ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", quantizeDither get/set failed" << endl; - } - image.quantizeDither(true); - - // - // quantizeTreeDepth - // - if ( image.quantizeTreeDepth() != 0 ) - { - ++failures; - cout << "Line: " << __LINE__ << ", quantizeTreeDepth default is " - << image.quantizeTreeDepth() - << " rather than zero as expected" << endl; - } - - image.quantizeTreeDepth(7); - if ( image.quantizeTreeDepth() != 7 ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", quantizeTreeDepth set/get failed" << endl; - } - image.quantizeTreeDepth(8); - - // - // renderingIntent - // - if ( image.renderingIntent() == UndefinedIntent ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", renderingIntent default is UndefinedIntent as expected" - << endl; - } - - image.renderingIntent(PerceptualIntent); - if ( image.renderingIntent() != PerceptualIntent ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", renderingIntent set/get failed" << endl; - } - image.renderingIntent(UndefinedIntent); - - // - // resolutionUnits - // - if ( image.resolutionUnits() != UndefinedResolution ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", resolutionUnits default is not UndefinedResolution as expected" - << endl; - } - - image.resolutionUnits(PixelsPerCentimeterResolution); - if ( image.resolutionUnits() != PixelsPerCentimeterResolution ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", resolutionUnits set/get failed" << endl; - } - image.resolutionUnits(UndefinedResolution); - - // - // rows - // - if ( image.rows() != rows ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", rows is canvas rows as expected" << endl; - } - - // - // scene - // - if ( image.scene() != 0 ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", scene default is not zero as expected" << endl; - } - - image.scene(5); - if ( image.scene() != 5 ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", scene set/get failed" << endl; - } - image.scene(0); - - // - // signature - // - - if ( - ( image.signature() != "6b08f7559b92760e8945b924f514a2e997753eb4408ddf571dd5222a782b8b48") && - ( image.signature() != "5e32612a0a3f2f1632d135f8c2df360604b0b84e9f082ddc20efbb0de752a53e") && - ( image.signature() != "dba5480face4d9eb973a116fe32ef37a7b47211e563900d21f47d6f0904aba22") && - ( image.signature() != "eccb7a8ac230b0deb76c8dd10ddeeb76a0918cbe6e3469d2d9f223d35c66498b") && - ( image.signature() != "a0747a8a5a0e6a1ec960ab8994986ba087d518db97db6f17e7bb4da3bbc3c91d") && - ( image.signature() != "6857675cd7d967e1e3ff094e1b3e5f4bb3fb9ba2557eb6d083d37881db0a2039") - ) - { - ++failures; - cout << "Line: " << __LINE__ << ", signature (" - << image.signature() - << ") is incorrect" << endl; - image.display(); - } - - // - // size - // - if ( image.size() != geometry ) - { - ++failures; - cout << "Line: " << __LINE__ << ", size (" - << string(image.size()) - << ") is not equal to geometry (" - << string(geometry) - << ")" - << endl; - } - - image.size("800x600"); - if ( image.size() != Geometry("800x600") ) - { - ++failures; - cout << "Line: " << __LINE__ << ", size set/get failed" << endl; - } - image.size( geometry ); - - // - // subImage - // - if ( image.subImage() != 0 ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", subImage default is not zero as expected" << endl; - } - - image.subImage(5); - if ( image.subImage() != 5 ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", subImage set/get failed" << endl; - } - image.subImage(0); - - // - // subRange - // - if ( image.subRange() != 0 ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", subRange default is not zero as expected" << endl; - } - - image.subRange(5); - if ( image.subRange() != 5 ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", subRange set/get failed" << endl; - } - image.subRange(0); - - // - // totalColors - // - if ( image.totalColors() != 2 ) - { - ++failures; - cout << "Line: " << __LINE__ << ", totalColors is " << image.totalColors() - << " rather than 2 as expected" << endl; - } - - // - // type - // - image.type(PaletteType); - if ( image.type() != PaletteType ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", type is not PaletteType as expected. Reported type " - << (int) image.type() << endl; - - } - - // - // verbose - // - if ( image.verbose() != false ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", verbose is not false as expected" << endl; - } - - // - // x11Display - // - if ( image.x11Display().length() != 0 ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", x11Display default is not empty string as expected" << endl; - } - - image.x11Display(":0.0"); - if ( image.x11Display() != ":0.0" ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", x11Display set/get failed" << endl; - } - - image.x11Display( string() ); - if ( image.x11Display().length() != 0 ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", x11Display failed to unset" << endl; - } - - // - // xResolution - // - if ( image.xResolution() != 72 ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", xResolution default (" << image.xResolution() - << ") is not zero as expected" << endl; - } - - // - // yResolution - // - if ( image.yResolution() != 72 ) - { - ++failures; - cout << "Line: " << __LINE__ - << ", yResolution default (" << image.yResolution() - << ") is not zero as expected" << endl; - } - } - catch( Exception &error_ ) - { - cout << "Caught exception: " << error_.what() << endl; - return 1; - } - catch( exception &error_ ) - { - cout << "Caught exception: " << error_.what() << endl; - return 1; - } - - if ( failures ) - { - cout << failures << " failures" << endl; - return 1; - } - - return 0; -} diff --git a/Magick++/tests/averageImages.cpp b/Magick++/tests/averageImages.cpp deleted file mode 100644 index 336cceb0a..000000000 --- a/Magick++/tests/averageImages.cpp +++ /dev/null @@ -1,79 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2003 -// -// Test STL averageImages function -// - -#include -#include -#include -#include -#include - -using namespace std; - -using namespace Magick; - -int main( int /*argc*/, char ** argv) -{ - - // Initialize ImageMagick install location for Windows - InitializeMagick(*argv); - - int failures=0; - - try { - - string srcdir(""); - if(getenv("SRCDIR") != 0) - srcdir = getenv("SRCDIR"); - - // - // Test averageImages - // - - list imageList; - readImages( &imageList, srcdir + "test_image_anim.miff" ); - - Image averaged; - averageImages( &averaged, imageList.begin(), imageList.end() ); - // averaged.display(); - if ( - ( averaged.signature() != "16fac0dc82f3901de623ce9ff991c368f6752acf6cb0c11170d78412c3729730") && - ( averaged.signature() != "6574796b7b07d7400a7a310052eabf2b58f81952d1854a76ac9a23890ac2073b") && - ( averaged.signature() != "ad4861b99339d84bed685eb42bbabe657abb60d48b8fc7ddf680af866dd45ad4") && - ( averaged.signature() != "8e6e1a9b5f1eec5539b1f44347249f227f3e07f9acb07d80404ca6a19f88db7c") && - ( averaged.signature() != "a88e978776d45b73bc8c9f37f6726cc9f14a3118b9a82384ee5acf488c5c2863") && - ( averaged.signature() != "6bda37a8b6734ac271595f5b583d801cfb2479637401d056eae9be97127f558f") && - ( averaged.signature() != "919a9e18a5e5ded83c2c4e5cfcd21d654802fcc14b06b02898d96fe28f04a1a1") - ) - { - cout << "Line: " << __LINE__ - << " Averaging image failed, signature = " - << averaged.signature() << endl; - averaged.display(); - ++failures; - } - } - - catch( Exception &error_ ) - { - cout << "Caught exception: " << error_.what() << endl; - return 1; - } - catch( exception &error_ ) - { - cout << "Caught exception: " << error_.what() << endl; - return 1; - } - - if ( failures ) - { - cout << failures << " failures" << endl; - return 1; - } - - return 0; -} - diff --git a/Magick++/tests/coalesceImages.cpp b/Magick++/tests/coalesceImages.cpp deleted file mode 100644 index 4db76f9df..000000000 --- a/Magick++/tests/coalesceImages.cpp +++ /dev/null @@ -1,62 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2003 -// -// Test STL coalesceImages function -// - -#include -#include -#include -#include -#include - -using namespace std; - -using namespace Magick; - -int main( int /*argc*/, char ** argv) -{ - - // Initialize ImageMagick install location for Windows - InitializeMagick(*argv); - - int failures=0; - - try { - - string srcdir(""); - if(getenv("SRCDIR") != 0) - srcdir = getenv("SRCDIR"); - - // - // Test coalesceImages - // - - list imageList; - readImages( &imageList, srcdir + "test_image_anim.miff" ); - - list coalescedList; - coalesceImages( &coalescedList, imageList.begin(), imageList.end() ); - } - - catch( Exception &error_ ) - { - cout << "Caught exception: " << error_.what() << endl; - return 1; - } - catch( exception &error_ ) - { - cout << "Caught exception: " << error_.what() << endl; - return 1; - } - - if ( failures ) - { - cout << failures << " failures" << endl; - return 1; - } - - return 0; -} - diff --git a/Magick++/tests/coderInfo.cpp b/Magick++/tests/coderInfo.cpp deleted file mode 100644 index e5c5df0bd..000000000 --- a/Magick++/tests/coderInfo.cpp +++ /dev/null @@ -1,134 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 2001, 2002, 2003 -// -// Test Magick::CoderInfo class and Magick::coderInfoList -// - -#include -#include -#include -#include - -using namespace std; - -using namespace Magick; - -int test( CoderInfo::MatchType isReadable_, - CoderInfo::MatchType isWritable_, - CoderInfo::MatchType isMultiFrame_ ) -{ - int result = 0; - list coderList; - coderInfoList( &coderList, isReadable_, isWritable_, isMultiFrame_ ); - list::iterator entry = coderList.begin(); - while( entry != coderList.end() ) - { - // Readable - if ( isReadable_ != CoderInfo::AnyMatch && - (( entry->isReadable() && isReadable_ != CoderInfo::TrueMatch ) || - ( !entry->isReadable() && isReadable_ != CoderInfo::FalseMatch )) ) - { - cout << "Entry \"" - << entry->name() - << "\" has unexpected readablity state (" - << static_cast(entry->isReadable()) - << ")" - << endl; - ++result; - } - - // Writable - if ( isWritable_ != CoderInfo::AnyMatch && - (( entry->isWritable() && isWritable_ != CoderInfo::TrueMatch ) || - ( !entry->isWritable() && isWritable_ != CoderInfo::FalseMatch )) ) - { - cout << "Entry \"" - << entry->name() - << "\" has unexpected writablity state (" - << static_cast(entry->isWritable()) - << ")" - << endl; - ++result; - } - - // MultiFrame - if ( isMultiFrame_ != CoderInfo::AnyMatch && - (( entry->isMultiFrame() && isMultiFrame_ != CoderInfo::TrueMatch ) || - ( !entry->isMultiFrame() && isMultiFrame_ != CoderInfo::FalseMatch )) ) - { - cout << "Entry \"" - << entry->name() - << "\" has unexpected multiframe state (" - << static_cast(entry->isMultiFrame()) - << ")" - << endl; - ++result; - } - - entry++; - } - - return result; -} - -int main( int /*argc*/, char **argv) -{ - - // Initialize ImageMagick install location for Windows - InitializeMagick(*argv); - - int failures=0; - - try { - - CoderInfo coderInfo("GIF"); - if ( coderInfo.name() != string("GIF") ) - { - cout << "Unexpected coder name \"" - << coderInfo.name() - << "\"" - << endl; - ++failures; - } - - if( coderInfo.description() != string("CompuServe graphics interchange format") ) - { - cout << "Unexpected coder description \"" - << coderInfo.description() - << "\"" - << endl; - ++failures; - } - - failures += test(CoderInfo::AnyMatch,CoderInfo::AnyMatch,CoderInfo::AnyMatch); - failures += test(CoderInfo::FalseMatch,CoderInfo::FalseMatch,CoderInfo::FalseMatch); - - failures += test(CoderInfo::TrueMatch,CoderInfo::AnyMatch,CoderInfo::AnyMatch); - failures += test(CoderInfo::FalseMatch,CoderInfo::AnyMatch,CoderInfo::AnyMatch); - - failures += test(CoderInfo::AnyMatch,CoderInfo::TrueMatch,CoderInfo::AnyMatch); - failures += test(CoderInfo::AnyMatch,CoderInfo::FalseMatch,CoderInfo::AnyMatch); - - failures += test(CoderInfo::AnyMatch,CoderInfo::AnyMatch,CoderInfo::TrueMatch); - failures += test(CoderInfo::AnyMatch,CoderInfo::AnyMatch,CoderInfo::FalseMatch); - } - catch( Exception &error_ ) - { - cout << "Caught exception: " << error_.what() << endl; - return 1; - } - catch( exception &error_ ) - { - cout << "Caught exception: " << error_.what() << endl; - return 1; - } - - if ( failures ) - { - cout << failures << " failures" << endl; - return 1; - } - - return 0; -} diff --git a/Magick++/tests/color.cpp b/Magick++/tests/color.cpp deleted file mode 100644 index 138ed2127..000000000 --- a/Magick++/tests/color.cpp +++ /dev/null @@ -1,154 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003 -// -// Test Magick::Color classes -// - -#include -#include -#include - -using namespace std; - -using namespace Magick; - -int main( int /*argc*/, char **argv) -{ - - // Initialize ImageMagick install location for Windows - InitializeMagick(*argv); - - int failures=0; - - try { - - // - // Verify conversion from named colors as well as ColorRGB constructor - // - - { - struct colorStr - { - const char* color; - double red; - double green; - double blue; - }; - - // Convert ratios from rgb.txt via value/255 - struct colorStr colorMap [] = - { - { "red", 1,0,0 }, - { "lime", 0,1,0 }, - { "blue", 0,0,1 }, - { "black", 0,0,0 }, - { "white", 1,1,1 }, - { "cyan", 0,1,1 }, - { "magenta", 1,0,1 }, - { "yellow", 1,1,0 }, - { NULL, 0,0,0 } - }; - - for ( int i = 0; colorMap[i].color != NULL; i++ ) - { - { - Color color( colorMap[i].color ); - ColorRGB colorMatch( colorMap[i].red, - colorMap[i].green, - colorMap[i].blue ); - if ( color != colorMatch ) - { - ++failures; - cout << "Line: " << __LINE__ << " Color(\"" - << colorMap[i].color << "\") is " - << string(color) - << " rather than " - << string(colorMatch) - << endl; - // printf ("Green: %10.16f\n", color.green()); - } - } - } - } - - // Test conversion to/from X11-style color specifications - { - const char * colorStrings[] = - { - "#ABC", - "#AABBCC", - "#AAAABBBBCCCC", - NULL - }; - -#if MAGICKCORE_QUANTUM_DEPTH == 8 - string expectedString = "#AABBCC"; -#elif MAGICKCORE_QUANTUM_DEPTH == 16 - string expectedString = "#AAAABBBBCCCC"; -#elif MAGICKCORE_QUANTUM_DEPTH == 32 - string expectedString = "#AAAAAAAABBBBBBBBCCCCCCCC"; -#elif MAGICKCORE_QUANTUM_DEPTH == 64 - string expectedString = "#AAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCC"; -#else -# error Quantum depth not supported! -#endif - - for ( int i = 0; colorStrings[i] != NULL; ++i ) - { - if ( string(Color(colorStrings[i])) != expectedString ) - { - ++failures; - cout << "Line: " << __LINE__ - << " Conversion from " << colorStrings[i] - << " is " - << string(Color(colorStrings[i])) << " rather than " - << expectedString - << endl; - } - } - } - - // Test ColorGray - { - double resolution = 1.0/QuantumRange; - if ( resolution < 0.0000001 ) - resolution = 0.0000001; - double max_error = resolution + MagickEpsilon; - - for( double value = 0; value < 1.0 + MagickEpsilon; value += resolution ) - { - ColorGray gray(value); - if ( gray.shade() < value - max_error || gray.shade() > value + max_error ) - { - ++failures; - cout << "Line: " << __LINE__ - << " shade is " - << gray.shade() - << " rather than nominal " - << value - << endl; - } - } - } - - } - catch( Exception &error_ ) - { - cout << "Caught exception: " << error_.what() << endl; - return 1; - } - catch( exception &error_ ) - { - cout << "Caught exception: " << error_.what() << endl; - return 1; - } - - if ( failures ) - { - cout << failures << " failures" << endl; - return 1; - } - - return 0; -} diff --git a/Magick++/tests/colorHistogram.cpp b/Magick++/tests/colorHistogram.cpp deleted file mode 100644 index 3085a0931..000000000 --- a/Magick++/tests/colorHistogram.cpp +++ /dev/null @@ -1,101 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 2003 -// -// Test STL colorHistogram function -// - -#undef USE_VECTOR -#define USE_MAP - -#include -#include -#include -#include -#if defined(USE_VECTOR) -# include -# include -#endif -#if defined(USE_MAP) -# include -#endif - -using namespace std; - -using namespace Magick; - -int main( int /*argc*/, char ** argv) -{ - - // Initialize ImageMagick install location for Windows - InitializeMagick(*argv); - - int failures=0; - - try { - - string srcdir(""); - if(getenv("SRCDIR") != 0) - srcdir = getenv("SRCDIR"); - - // Read image - Image image; - image.read( srcdir + "test_image.miff" ); - - // Create histogram vector -#if defined(USE_MAP) - std::map histogram; -#elif defined(USE_VECTOR) - std::vector > histogram; -#endif - - colorHistogram( &histogram, image ); - - // Print out histogram -#if (MAGICKCORE_QUANTUM_DEPTH == 8) - int quantum_width=3; -#elif (MAGICKCORE_QUANTUM_DEPTH == 16) - int quantum_width=5; -#else - int quantum_width=10; -#endif - - cout << "Histogram for file \"" << image.fileName() << "\"" << endl - << histogram.size() << " entries:" << endl; - -#if defined(USE_MAP) - std::map::const_iterator p=histogram.begin(); -#elif defined(USE_VECTOR) - std::vector >::const_iterator p=histogram.begin(); -#endif - while (p != histogram.end()) - { - cout << setw(10) << (int)p->second << ": (" - << setw(quantum_width) << (int)p->first.quantumRed() << "," - << setw(quantum_width) << (int)p->first.quantumGreen() << "," - << setw(quantum_width) << (int)p->first.quantumBlue() << ")" - << endl; - p++; - } - } - - catch( Exception &error_ ) - { - cout << "Caught exception: " << error_.what() << endl; - return 1; - } - catch( exception &error_ ) - { - cout << "Caught exception: " << error_.what() << endl; - return 1; - } - - if ( failures ) - { - cout << failures << " failures" << endl; - return 1; - } - - return 0; -} - diff --git a/Magick++/tests/exceptions.cpp b/Magick++/tests/exceptions.cpp deleted file mode 100644 index 608c588f3..000000000 --- a/Magick++/tests/exceptions.cpp +++ /dev/null @@ -1,102 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003 -// -// Tests for throwing exceptions -// - -#include -#include -#include - -using namespace std; - -using namespace Magick; - -int main( int /*argc*/, char ** argv) -{ - // Initialize ImageMagick install location for Windows - InitializeMagick(*argv); - - volatile int failures=0; - - cout << "Checking for working exceptions (may crash) ... "; - cout.flush(); - - { - // Basic exception test - try - { - failures++; - throw int(100); - } - catch ( int /*value_*/ ) - { - failures--; - } - - // Throw a Magick++ exception class. - try - { - failures++; - cout << "Throwing 'Magick::WarningResourceLimit' exception" << endl; - cout.flush(); - throw WarningResourceLimit("How now brown cow?"); - } - catch( Exception & /*error_*/ ) - { - cout << "Successfully caught 'Magick::WarningResourceLimit' exception" << endl; - cout.flush(); - failures--; - } - - // A more complex test - try - { - size_t columns = 640; - size_t rows = 480; - Geometry geometry(columns,rows); - Color canvasColor( "red" ); - Image image( geometry, canvasColor); - - { - try - { - failures++; - cout << "Throwing library 'Magick::Exception' exception" << endl; - cout.flush(); - image.directory(); - } - catch ( Exception& /*error_*/ ) - { - cout << "Successfully caught library 'Magick::Exception' exception" << endl; - cout.flush(); - failures--; - } - } - - } - catch( Exception &error_ ) - { - cout << "Bogus catch: Caught exception: " << error_.what() << endl; - cout.flush(); - return 1; - } - catch( exception &error_ ) - { - cout << "Bogus catch: Caught exception: " << error_.what() << endl; - cout.flush(); - return 1; - } - - if ( failures ) - { - cout << failures << " failures" << endl; - cout.flush(); - return 1; - } - cout << "Exception testing passed!" << endl; - } - - return 0; -} diff --git a/Magick++/tests/geometry.cpp b/Magick++/tests/geometry.cpp deleted file mode 100644 index ffaf31173..000000000 --- a/Magick++/tests/geometry.cpp +++ /dev/null @@ -1,71 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Dirk Lemstra 2015 -// -// Test Magick::Geometry class -// - -#include -#include -#include - -using namespace std; - -using namespace Magick; - -int main(int, char **argv) -{ - - // Initialize ImageMagick install location for Windows - InitializeMagick(*argv); - - int failures=0; - - try - { - - // - // Verify conversion from and to string - // - - string input="100x50+10-5!"; - Geometry geometry(input); - - if ((geometry.width() != 100) || (geometry.height() != 50) || - (geometry.xOff() != 10) || (geometry.yOff() != -5) || - (geometry.aspect() == false)) - { - ++failures; - cout << "Line: " << __LINE__ - << " Conversion from " << input << " failed" - << endl; - } - - string output=geometry; - if (output != input) - { - ++failures; - cout << "Line: " << __LINE__ - << " Output " << output << " is not the same as " << input - << endl; - } - } - catch( Exception &error_ ) - { - cout << "Caught exception: " << error_.what() << endl; - return 1; - } - catch( exception &error_ ) - { - cout << "Caught exception: " << error_.what() << endl; - return 1; - } - - if ( failures ) - { - cout << failures << " failures" << endl; - return 1; - } - - return 0; -} diff --git a/Magick++/tests/montageImages.cpp b/Magick++/tests/montageImages.cpp deleted file mode 100644 index 6ea74a986..000000000 --- a/Magick++/tests/montageImages.cpp +++ /dev/null @@ -1,143 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2002, 2003 -// -// Test STL montageImages function -// - -#include -#include -#include -#include -#include - -using namespace std; - -using namespace Magick; - -int main( int /*argc*/, char ** /*argv*/) -{ - - // Initialize ImageMagick install location for Windows - // InitializeMagick(*argv); - InitializeMagick(""); - - const char *const p = getenv("MAGICK_FONT"); - const string MAGICK_FONT(p ? p : ""); - - int failures=0; - - try { - - string srcdir(""); - if(getenv("SRCDIR") != 0) - srcdir = getenv("SRCDIR"); - - // - // Test montageImages - // - - list imageList; - readImages( &imageList, srcdir + "test_image_anim.miff" ); - - vector montage; - MontageFramed montageOpts; - montageOpts.font(MAGICK_FONT); - - // Default montage - montageImages( &montage, imageList.begin(), imageList.end(), montageOpts ); - - { - Geometry targetGeometry(128, 126 ); - if ( montage[0].montageGeometry() != targetGeometry ) - { - ++failures; - cout << "Line: " << __LINE__ - << " Montage geometry (" - << string(montage[0].montageGeometry()) - << ") is incorrect (expected " - << string(targetGeometry) - << ")" - << endl; - } - } - - if ( montage[0].columns() != 768 || montage[0].rows() != 504 ) - { - ++failures; - cout << "Line: " << __LINE__ - << " Montage columns/rows (" - << montage[0].columns() << "x" - << montage[0].rows() - << ") incorrect. (expected 768x504)" << endl; - } - - // Montage with options set - montage.clear(); - montageOpts.borderColor( "green" ); - montageOpts.borderWidth( 1 ); - montageOpts.fileName( "Montage" ); - montageOpts.frameGeometry( "6x6+3+3" ); - montageOpts.geometry("50x50+2+2>"); - montageOpts.gravity( CenterGravity ); - montageOpts.strokeColor( "yellow" ); - montageOpts.shadow( true ); - montageOpts.texture( "granite:" ); - montageOpts.tile("2x1"); - montageImages( &montage, imageList.begin(), imageList.end(), montageOpts ); - - if ( montage.size() != 3 ) - { - ++failures; - cout << "Line: " << __LINE__ - << " Montage images failed, number of montage frames is " - << montage.size() - << " rather than 3 as expected." << endl; - } - - { - Geometry targetGeometry( 66, 70 ); - if ( montage[0].montageGeometry() != targetGeometry ) - { - ++failures; - cout << "Line: " << __LINE__ - << " Montage geometry (" - << string(montage[0].montageGeometry()) - << ") is incorrect (expected " - << string(targetGeometry) - << ")." - << endl; - } - } - - if ( montage[0].columns() != 136 || montage[0].rows() != 70 ) - { - ++failures; - cout << "Line: " << __LINE__ - << " Montage columns/rows (" - << montage[0].columns() << "x" - << montage[0].rows() - << ") incorrect. (expected 136x70)" << endl; - } - } - - catch( Exception &error_ ) - { - cout << "Caught exception: " << error_.what() << endl; - return 1; - } - catch( exception &error_ ) - { - cout << "Caught exception: " << error_.what() << endl; - return 1; - } - - if ( failures ) - { - cout << failures << " failures" << endl; - return 1; - } - - return 0; -} - diff --git a/Magick++/tests/morphImages.cpp b/Magick++/tests/morphImages.cpp deleted file mode 100644 index 00a0c8249..000000000 --- a/Magick++/tests/morphImages.cpp +++ /dev/null @@ -1,71 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2003 -// -// Test STL morphImages function -// - -#include -#include -#include -#include -#include - -using namespace std; - -using namespace Magick; - -int main( int /*argc*/, char **argv) -{ - - // Initialize ImageMagick install location for Windows - InitializeMagick(*argv); - - int failures=0; - - try { - - string srcdir(""); - if(getenv("SRCDIR") != 0) - srcdir = getenv("SRCDIR"); - - // - // Test morphImages - // - - list imageList; - readImages( &imageList, srcdir + "test_image_anim.miff" ); - - list morphed; - morphImages( &morphed, imageList.begin(), imageList.end(), 3 ); - - if ( morphed.size() != 21 ) - { - ++failures; - cout << "Line: " << __LINE__ - << " Morph images failed, number of frames is " - << morphed.size() - << " rather than 21 as expected." << endl; - } - } - - catch( Exception &error_ ) - { - cout << "Caught exception: " << error_.what() << endl; - return 1; - } - catch( exception &error_ ) - { - cout << "Caught exception: " << error_.what() << endl; - return 1; - } - - if ( failures ) - { - cout << failures << " failures" << endl; - return 1; - } - - return 0; -} - diff --git a/Magick++/tests/readWriteBlob.cpp b/Magick++/tests/readWriteBlob.cpp deleted file mode 100644 index a15f046b6..000000000 --- a/Magick++/tests/readWriteBlob.cpp +++ /dev/null @@ -1,255 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2003 -// -// Test reading/writing BLOBs using Magick++ -// - -#include -#include -#include -#include - -#if defined(MISSING_STD_IOS_BINARY) -# define IOS_IN_BINARY ios::in -#else -# define IOS_IN_BINARY ios::in | ios::binary -#endif - -using namespace std; - -using namespace Magick; - -// A derived Blob class to exercise updateNoCopy() -class myBlob : public Blob -{ -public: - // Construct from open binary stream - myBlob( ifstream &stream_ ) - : Blob() - { - unsigned char* blobData = new unsigned char[100000]; - char* c= reinterpret_cast(blobData); - size_t blobLen=0; - while( (blobLen< 100000) && stream_.get(*c) ) - { - c++; - blobLen++; - } - if ((!stream_.eof()) || (blobLen == 0)) - { - cout << "Failed to stream into blob!" << endl; - exit(1); - } - - // Insert data into blob - updateNoCopy( reinterpret_cast(blobData), blobLen, - Blob::NewAllocator ); - } -}; - - -int main( int /*argc*/, char ** argv) -{ - - // Initialize ImageMagick install location for Windows - InitializeMagick(*argv); - - int failures=0; - - try - { - string srcdir(""); - if(getenv("SRCDIR") != 0) - srcdir = getenv("SRCDIR"); - - string testimage; - - // - // Test reading BLOBs - // - { - string signature(""); - { - Image image(srcdir + "test_image.miff"); - signature = image.signature(); - } - - // Read raw data from file into BLOB - testimage = srcdir + "test_image.miff"; - ifstream in( testimage.c_str(), ios::in | IOS_IN_BINARY ); - if( !in ) - { - cout << "Failed to open file " << testimage << " for input!" << endl; - exit(1); - } - unsigned char* blobData = new unsigned char[100000]; - char* c=reinterpret_cast(blobData); - size_t blobLen=0; - while( (blobLen< 100000) && in.get(*c) ) - { - c++; - blobLen++; - } - if ((!in.eof()) || (blobLen == 0)) - { - cout << "Failed to read file " << testimage << " for input!" << endl; - exit(1); - } - in.close(); - - // Construct Magick++ Blob - Blob blob(static_cast(blobData), blobLen); - delete [] blobData; - - // If construction of image fails, an exception should be thrown - { - // Construct with blob data only - Image image( blob ); - if ( image.signature() != signature ) - { - ++failures; - cout << "Line: " << __LINE__ - << " Image signature " - << image.signature() - << " != " - << signature << endl; - } - } - - { - // Construct with image geometry and blob data - Image image( blob, Geometry(148,99)); - if ( image.signature() != signature ) - { - ++failures; - cout << "Line: " << __LINE__ - << " Image signature " - << image.signature() - << " != " - << signature << endl; - } - } - - { - // Construct default image, and then read in blob data - Image image; - image.read( blob ); - if ( image.signature() != signature ) - { - ++failures; - cout << "Line: " << __LINE__ - << " Image signature " - << image.signature() - << " != " - << signature << endl; - } - } - - { - // Construct default image, and then read in blob data with - // image geometry - Image image; - image.read( blob, Geometry(148,99) ); - if ( image.signature() != signature ) - { - ++failures; - cout << "Line: " << __LINE__ - << " Image signature " - << image.signature() - << " != " - << signature << endl; - } - } - - } - - // Test writing BLOBs - { - Blob blob; - string signature(""); - { - Image image(srcdir + "test_image.miff"); - image.magick("MIFF"); - image.write( &blob ); - signature = image.signature(); - } - { - Image image(blob); - if ( image.signature() != signature ) - { - ++failures; - cout << "Line: " << __LINE__ - << " Image signature " - << image.signature() - << " != " - << signature << endl; - image.display(); - } - } - - } - // Test writing BLOBs via STL writeImages - { - Blob blob; - - list first; - readImages( &first, srcdir + "test_image_anim.miff" ); - writeImages( first.begin(), first.end(), &blob, true ); - } - - // Test constructing a BLOB from a derived class - { - - string signature(""); - { - Image image(srcdir + "test_image.miff"); - signature = image.signature(); - } - - // Read raw data from file into BLOB - testimage = srcdir + "test_image.miff"; - ifstream in( testimage.c_str(), ios::in | IOS_IN_BINARY ); - if( !in ) - { - cout << "Failed to open file for input!" << endl; - exit(1); - } - - myBlob blob( in ); - in.close(); - - Image image( blob ); - if ( image.signature() != signature ) - { - ++failures; - cout << "Line: " << __LINE__ - << " Image signature " - << image.signature() - << " != " - << signature << endl; - } - } - } - - catch( Exception &error_ ) - { - cout << "Caught exception: " << error_.what() << endl; - return 1; - } - catch( exception &error_ ) - { - cout << "Caught exception: " << error_.what() << endl; - return 1; - } - - if ( failures ) - { - cout << failures << " failures" << endl; - return 1; - } - - return 0; -} - - diff --git a/Magick++/tests/readWriteImages.cpp b/Magick++/tests/readWriteImages.cpp deleted file mode 100644 index c9f3995c2..000000000 --- a/Magick++/tests/readWriteImages.cpp +++ /dev/null @@ -1,179 +0,0 @@ -// This may look like C code, but it is really -*- C++ -*- -// -// Copyright Bob Friesenhahn, 1999, 2000, 2003 -// Copyright Dirk Lemstra 2014 -// -// Test STL readImages and writeImages functions and test -// image format when reading/writing. -// - -#include -#include -#include -#include -#include - -using namespace std; - -using namespace Magick; - -int main(int,char ** argv) -{ - int - failures=0; - - string - srcdir(""); - - - // Initialize ImageMagick install location for Windows - InitializeMagick(*argv); - - try - { - if (getenv("SRCDIR") != 0) - srcdir=getenv("SRCDIR"); - - // - // Test readImages and writeImages - // - list first; - readImages(&first,srcdir + "test_image_anim.miff"); - - if (first.size() != 6) - { - ++failures; - cout << "Line: " << __LINE__ - << " Read images failed, number of frames is " - << first.size() - << " rather than 6 as expected." << endl; - } - - writeImages(first.begin(),first.end(),"testmagick_anim_out.miff"); - - list second; - readImages(&second,"testmagick_anim_out.miff"); - - list::iterator firstIter = first.begin(); - list::iterator secondIter = second.begin(); - while (firstIter != first.end() && secondIter != second.end()) - { - if (firstIter->scene() != secondIter->scene()) - { - ++failures; - cout << "Line: " << __LINE__ - << " Image scene: " << secondIter->scene() - << " is not equal to original " - << firstIter->scene() - << endl; - } - - if (firstIter->rows() != secondIter->rows()) - { - ++failures; - cout << "Line: " << __LINE__ - << " Image rows " << secondIter->rows() - << " are not equal to original " - << firstIter->rows() - << endl; - } - - if (firstIter->columns() != secondIter->columns()) - { - ++failures; - cout << "Line: " << __LINE__ - << " Image columns " << secondIter->columns() - << " are not equal to original " - << firstIter->rows() - << endl; - } - - firstIter++; - secondIter++; - } - - Image third(*first.begin()); - third.write("testmagick_anim_out"); - - Image fourth; - fourth.read("testmagick_anim_out"); - - if (fourth.magick() != "MIFF") - { - ++failures; - cout << "Line: " << __LINE__ - << " Image magick: " << fourth.magick() - << " is not equal to MIFF" - << endl; - } - - third.write("testmagick_anim_out.ico"); - fourth.read("testmagick_anim_out.ico"); - - if (fourth.magick() != "ICO") - { - ++failures; - cout << "Line: " << __LINE__ - << " Image magick: " << fourth.magick() - << " is not equal to ICO" - << endl; - } - - third.magick("BMP"); - third.write("testmagick_anim_out.ico"); - fourth.read("testmagick_anim_out.ico"); - - if (fourth.magick() != "BMP") - { - ++failures; - cout << "Line: " << __LINE__ - << " Image magick: " << fourth.magick() - << " is not equal to BMP" - << endl; - } - - third.write("PDB:testmagick_anim_out.ico"); - fourth.read("testmagick_anim_out.ico"); - - if (fourth.magick() != "PDB") - { - ++failures; - cout << "Line: " << __LINE__ - << " Image magick: " << fourth.magick() - << " is not equal to PDB" - << endl; - } - - third.magick(""); - third.write("testmagick_anim_out.ico"); - fourth.read("testmagick_anim_out.ico"); - - if (fourth.magick() != "ICO") - { - ++failures; - cout << "Line: " << __LINE__ - << " Image magick: " << fourth.magick() - << " is not equal to ICO" - << endl; - } - } - catch(Exception &error_) - { - cout << "Caught exception: " << error_.what() << endl; - return 1; - } - catch(exception &error_) - { - cout << "Caught exception: " << error_.what() << endl; - return 1; - } - - if (failures) - { - cout << failures << " failures" << endl; - return 1; - } - - return 0; -} - diff --git a/Magick++/tests/test_image.miff b/Magick++/tests/test_image.miff deleted file mode 100644 index 328281b2c..000000000 Binary files a/Magick++/tests/test_image.miff and /dev/null differ diff --git a/Magick++/tests/test_image_anim.miff b/Magick++/tests/test_image_anim.miff deleted file mode 100644 index b8e5f0ca9..000000000 Binary files a/Magick++/tests/test_image_anim.miff and /dev/null differ diff --git a/Magick++/tests/tests.tap b/Magick++/tests/tests.tap deleted file mode 100755 index b5c15ff8e..000000000 --- a/Magick++/tests/tests.tap +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -# -# Copyright 2004 Bob Friesenhahn -# -# This file is part of Magick++, the C++ API for ImageMagick and -# ImageMagick. Please see the file "COPYING" included with Magick++ -# for usage and copying restrictions. -# -subdir=Magick++/tests -. ./common.shi -echo "1..13" - -SRCDIR=${top_srcdir}/${subdir}/ -export SRCDIR - -cd ${subdir} || exit 1 - -for mytest in appendImages attributes averageImages coalesceImages coderInfo color colorHistogram exceptions geometry montageImages morphImages readWriteBlob readWriteImages -do - ./${mytest} && echo "ok" || echo "not ok" -done -: -- cgit v1.2.3