forked from openkylin/imagemagick
Import Upstream version 6.9.11.60
This commit is contained in:
commit
6a2a728e81
|
@ -0,0 +1,157 @@
|
|||
These active developers and have made source code contributions to the
|
||||
ImageMagick project in the last few years:
|
||||
|
||||
Cristy
|
||||
Principal architect of ImageMagick and still maintains the ImageMagick
|
||||
distribution.
|
||||
|
||||
Dirk Lemstra
|
||||
Contributor to and maintainer of Magick++, OpenCL acceleration, and
|
||||
the Windows build (configure, ImageMagickObject, etc.).
|
||||
|
||||
Bastien ROUCARIÈS
|
||||
Various patches from Debian downstream.
|
||||
|
||||
Fred Weinhaus
|
||||
Contributed support and documentation for the discrete Fourier transform,
|
||||
connected component labeling, perceptual hash, kuwahara filter and others.
|
||||
Also provides scripts that perform some out-of-the ordinary image
|
||||
processing operations @ http://www.fmwconcepts.com/imagemagick/. He
|
||||
utilized his scripts as unit tests for ImageMagick version 7 to ensure
|
||||
version 6 compatibility before its release.
|
||||
|
||||
|
||||
These individuals have made source code contributions to the ImageMagick
|
||||
project in the past but are no longer active developers:
|
||||
|
||||
Glenn Randers-Pehrson
|
||||
Contributed significantly to the utilities. Authored support for JNG,
|
||||
MNG, and PNG formats. Provided significant support for the BMP format.
|
||||
Made significant improvements to the documentation.
|
||||
|
||||
Kelly Bergougnoux
|
||||
Authored the Cineon image coder (based on the existing DPX source).
|
||||
|
||||
Nathan Brown
|
||||
Original author of the JP2 coder.
|
||||
|
||||
Siu Chi Chan
|
||||
Accelerate numerous image filters with OpenCL under AMD, Intel,
|
||||
and NVidia. Adapted from MulticoreWare OpenCL contribution.
|
||||
|
||||
Mike Chiarappa
|
||||
Created a Borland C++ Builder 6.0 build environment for ImageMagick.
|
||||
|
||||
Troy Edwards
|
||||
Authored the source RPM spec file for ImageMagick.
|
||||
|
||||
Jaroslav Fojtik
|
||||
Authored the CUT, ART, and MATLAB coder modules.
|
||||
|
||||
Francis J. Franklin
|
||||
Ported the WMF coder to the libwmf 0.2 API.
|
||||
|
||||
Markus Friedl
|
||||
Original author of Base64 encode/decode sources.
|
||||
|
||||
Bob Friesenhahn
|
||||
Author of Magick++ (C++ API to ImageMagick). Author of module loader
|
||||
facility, automatic file identification (magic) support, Unix/Cygwin/MinGW
|
||||
configure/make facility, Windows setup.exe style installer, WMF renderer,
|
||||
C API documentation formatter, and the C, C++, and Perl test suites
|
||||
used by ImageMagick.
|
||||
|
||||
David Harr
|
||||
Contributed (with Leonard Rosenthol) dash pattern, linecap stroking
|
||||
algorithm, and minor rendering improvements.
|
||||
|
||||
Christopher R. Hawks
|
||||
Authored the PALM coder.
|
||||
|
||||
Rick Mabry
|
||||
Contributed code to support filling drawn objects using a pattern image
|
||||
and major improvements to the web page (both content and appearance).
|
||||
|
||||
Catalin Mihaila
|
||||
Contributed a ZX-Spectrum SCREEN$ reader.
|
||||
|
||||
Chantal Racette, Laurentian University
|
||||
Sped up Sinc and Blackman filter kernels. EWA resampling code
|
||||
verification.
|
||||
|
||||
William Radcliffe
|
||||
Author of the VisualMagick project configure facility for Visual C++.
|
||||
Author of FlashPix module. Author of the EMF, XTRN, and META coders.
|
||||
Significant contributions to the MSL, JPEG, TIFF, SVG, and URL coders.
|
||||
Authored "process" module support. Wrote the micro-timer facility used
|
||||
by 'identify'. Ported module loader support to Windows. Significantly
|
||||
improved polygon rendering performance.
|
||||
|
||||
Nicolas Robidoux, Laurentian University
|
||||
New ellipse clamping method and vertical/horizontal line preserving
|
||||
filters for EWA resampling. Sped up resampling filter kernels.
|
||||
|
||||
Leonard Rosenthol
|
||||
Authored the 'conjure' utility and associated MSL execution environment.
|
||||
Provided MacOS support. Authored the CLIPBOARD, XCF, and PSD coders.
|
||||
Postscript and PDF expertise. Significant drawing enhancements including
|
||||
support for dash patterns, linecap stroking, clipping masks and a
|
||||
mask image.
|
||||
|
||||
Kyle Shorter
|
||||
Original author of PerlMagick. Author of the LOCALE coder.
|
||||
|
||||
Lars Ruben Skyum
|
||||
Contributed the -clippath functionality, improved color profile support,
|
||||
and re-wrote the PS3 coder.
|
||||
|
||||
Anthony Thyssen
|
||||
Designed the ImageMagick 6.0 command line processing with parenthesis,
|
||||
image sequence operators, and GIF animation processing. Wrote the
|
||||
image perspective distortions (-distort) and resampling methods.
|
||||
Maintains a comprehensive set of examples of using ImageMagick at
|
||||
https://legacy.imagemagick.org/Usage/.
|
||||
|
||||
Milan Votava
|
||||
Contributed support for Wireless BitMap, used in WAP - Wireless Access
|
||||
Protocol.
|
||||
|
||||
|
||||
We acknowledge these non-developer contributors to the ImageMagick project:
|
||||
|
||||
Rod Bogart and John W. Peterson, University of Utah
|
||||
Image compositing is loosely based on rlecomp of the Utah Raster Toolkit.
|
||||
|
||||
Hanno Böck
|
||||
Contributed numerous fuzzed-images that revealed program flaws in
|
||||
ImageMagick. Additional checks were added to guard against nefarious
|
||||
image files.
|
||||
|
||||
Thomas R Crimmins
|
||||
Inventor of the eight hull algorithm used for speckle reduction.
|
||||
|
||||
Michael Halle, Spatial Imaging Group at MIT
|
||||
Contributed the initial implementation of Alan Paeth's image rotation
|
||||
algorithm.
|
||||
|
||||
Paul Heckbert, Carnegie Mellon University
|
||||
Image resizing is loosely based on Paul Heckbert's Zoom program.
|
||||
|
||||
Peder Langlo, Hewlett Packard
|
||||
Made hundreds of suggestions and bug reports. Without Peder, this
|
||||
software would not be nearly as useful as it is today.
|
||||
|
||||
David Pensak, E. I. du Pont de Nemours and Company
|
||||
For providing the computing environment that made developing ImageMagick
|
||||
possible.
|
||||
|
||||
Paul Raveling, USC Information Sciences Institute
|
||||
The spatial subdivision color reduction algorithm is based on his
|
||||
Img software.
|
||||
|
||||
Alvy Ray Smith and Eric Ray Lyons
|
||||
HWB color transform and algorithm.
|
||||
|
||||
Alexander Zimmermann
|
||||
Responsible for the ImageMagick Linux binary distributions for many years.
|
||||
His efforts are very much appreciated.
|
|
@ -0,0 +1,303 @@
|
|||
%global VERSION @PACKAGE_BASE_VERSION@
|
||||
%global Patchlevel @MAGICK_PATCHLEVEL_VERSION@
|
||||
|
||||
Name: @PACKAGE_NAME@
|
||||
Version: %{VERSION}
|
||||
Release: %{Patchlevel}
|
||||
Summary: Use ImageMagick to convert, edit, or compose bitmap images in a variety of formats. In addition resize, rotate, shear, distort and transform images.
|
||||
Group: Applications/Multimedia
|
||||
License: https://imagemagick.org/script/license.php
|
||||
Url: https://imagemagick.org/
|
||||
Source0: https://imagemagick.org/download/%{name}/%{name}-%{VERSION}-%{Patchlevel}.tar.bz2
|
||||
|
||||
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
|
||||
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
BuildRequires: bzip2-devel, freetype-devel, libjpeg-devel, libpng-devel
|
||||
BuildRequires: libtiff-devel, giflib-devel, zlib-devel, perl-devel >= 5.8.1
|
||||
BuildRequires: ghostscript-devel, djvulibre-devel
|
||||
BuildRequires: libwmf-devel
|
||||
BuildRequires: libX11-devel, libXext-devel, libXt-devel
|
||||
BuildRequires: lcms2-devel, libxml2-devel, librsvg2-devel, OpenEXR-devel
|
||||
BuildRequires: fftw-devel, OpenEXR-devel, libwebp-devel
|
||||
BuildRequires: jbigkit-devel
|
||||
BuildRequires: openjpeg2-devel >= 2.1.0
|
||||
BuildRequires: autoconf automake libtool-ltdl-devel
|
||||
|
||||
%description
|
||||
ImageMagick® is a software suite to create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats (over 200) including PNG, JPEG, JPEG-2000, GIF, TIFF, DPX, EXR, WebP, Postscript, PDF, and SVG. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves.
|
||||
|
||||
The functionality of ImageMagick is typically utilized from the command-line or you can use the features from programs written in your favorite language. Choose from these interfaces: G2F (Ada), MagickCore (C), MagickWand (C), ChMagick (Ch), ImageMagickObject (COM+), Magick++ (C++), JMagick (Java), L-Magick (Lisp), Lua (LuaJIT), NMagick (Neko/haXe), Magick.NET (.NET), PascalMagick (Pascal), PerlMagick (Perl), MagickWand for PHP (PHP), IMagick (PHP), PythonMagick (Python), RMagick (Ruby), or TclMagick (Tcl/TK). With a language interface, use ImageMagick to modify or create images dynamically and automagically.
|
||||
|
||||
ImageMagick utilizes multiple computational threads to increase performance and can read, process, or write mega-, giga-, or tera-pixel image sizes.
|
||||
|
||||
ImageMagick is free software delivered as a ready-to-run binary distribution or as source code that you may use, copy, modify, and distribute in both open and proprietary applications. It is distributed under the Apache 2.0 license.
|
||||
|
||||
The ImageMagick development process ensures a stable API and ABI. Before each ImageMagick release, we perform a comprehensive security assessment that includes memory error and thread data race detection to prevent security vulnerabilities.
|
||||
|
||||
The authoritative ImageMagick web site is https://imagemagick.org. The authoritative source code repository is http://git.imagemagick.org/repos/ImageMagick. We maintain a source code mirror at GitHub.
|
||||
|
||||
|
||||
%package devel
|
||||
Summary: Library links and header files for ImageMagick application development
|
||||
Group: Development/Libraries
|
||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||
Requires: libX11-devel, libXext-devel, libXt-devel, ghostscript-devel
|
||||
Requires: bzip2-devel, freetype-devel, libtiff-devel, libjpeg-devel, lcms2-devel
|
||||
Requires: libwebp-devel, OpenEXR-devel, openjpeg2-devel, pkgconfig
|
||||
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
|
||||
|
||||
%description devel
|
||||
ImageMagick-devel contains the library links and header files you'll
|
||||
need to develop ImageMagick applications. ImageMagick is an image
|
||||
manipulation program.
|
||||
|
||||
If you want to create applications that will use ImageMagick code or
|
||||
APIs, you need to install ImageMagick-devel as well as ImageMagick.
|
||||
You do not need to install it if you just want to use ImageMagick,
|
||||
however.
|
||||
|
||||
%package libs
|
||||
Summary: ImageMagick libraries to link with
|
||||
Group: Applications/Multimedia
|
||||
|
||||
%description libs
|
||||
This packages contains a shared libraries to use within other applications.
|
||||
|
||||
|
||||
%package djvu
|
||||
Summary: DjVu plugin for ImageMagick
|
||||
Group: Applications/Multimedia
|
||||
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
|
||||
|
||||
%description djvu
|
||||
This packages contains a plugin for ImageMagick which makes it possible to
|
||||
save and load DjvU files from ImageMagick and libMagickCore using applications.
|
||||
|
||||
|
||||
%package doc
|
||||
Summary: ImageMagick HTML documentation
|
||||
Group: Documentation
|
||||
|
||||
|
||||
%description doc
|
||||
ImageMagick documentation, this package contains usage (for the
|
||||
commandline tools) and API (for the libraries) documentation in HTML format.
|
||||
Note this documentation can also be found on the ImageMagick website:
|
||||
https://imagemagick.org/.
|
||||
|
||||
|
||||
%package perl
|
||||
Summary: ImageMagick perl bindings
|
||||
Group: System Environment/Libraries
|
||||
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
|
||||
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
|
||||
|
||||
|
||||
%description perl
|
||||
Perl bindings to ImageMagick.
|
||||
|
||||
Install ImageMagick-perl if you want to use any perl scripts that use
|
||||
ImageMagick.
|
||||
|
||||
|
||||
%package c++
|
||||
Summary: ImageMagick Magick++ library (C++ bindings)
|
||||
Group: System Environment/Libraries
|
||||
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
|
||||
|
||||
%description c++
|
||||
This package contains the Magick++ library, a C++ binding to the ImageMagick
|
||||
graphics manipulation library.
|
||||
|
||||
Install ImageMagick-c++ if you want to use any applications that use Magick++.
|
||||
|
||||
|
||||
%package c++-devel
|
||||
Summary: C++ bindings for the ImageMagick library
|
||||
Group: Development/Libraries
|
||||
Requires: %{name}-c++%{?_isa} = %{version}-%{release}
|
||||
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
|
||||
|
||||
%description c++-devel
|
||||
ImageMagick-devel contains the static libraries and header files you'll
|
||||
need to develop ImageMagick applications using the Magick++ C++ bindings.
|
||||
ImageMagick is an image manipulation program.
|
||||
|
||||
If you want to create applications that will use Magick++ code
|
||||
or APIs, you'll need to install ImageMagick-c++-devel, ImageMagick-devel and
|
||||
ImageMagick.
|
||||
|
||||
You don't need to install it if you just want to use ImageMagick, or if you
|
||||
want to develop/compile applications using the ImageMagick C interface,
|
||||
however.
|
||||
|
||||
|
||||
%prep
|
||||
%setup -q -n %{name}-%{VERSION}-%{Patchlevel}
|
||||
|
||||
# for %%doc
|
||||
mkdir Magick++/examples
|
||||
cp -p Magick++/demo/*.cpp Magick++/demo/*.miff Magick++/examples
|
||||
|
||||
%build
|
||||
%configure --enable-shared \
|
||||
--disable-static \
|
||||
--with-modules \
|
||||
--with-perl \
|
||||
--with-x \
|
||||
--with-threads \
|
||||
--with-magick_plus_plus \
|
||||
--with-wmf \
|
||||
--with-webp \
|
||||
--with-openexr \
|
||||
--with-rsvg \
|
||||
--with-xml \
|
||||
--with-perl-options="INSTALLDIRS=vendor %{?perl_prefix} CC='%__cc -L$PWD/magick/.libs' LDDLFLAGS='-shared -L$PWD/magick/.libs'" \
|
||||
--without-dps \
|
||||
--without-gcc-arch \
|
||||
--with-jbig \
|
||||
--with-openjp2
|
||||
|
||||
# Do *NOT* use %%{?_smp_mflags}, this causes PerlMagick to be silently misbuild
|
||||
make
|
||||
|
||||
|
||||
%install
|
||||
make %{?_smp_mflags} install DESTDIR=%{buildroot} INSTALL="install -p"
|
||||
cp -a www/source %{buildroot}%{_datadir}/doc/%{name}-%{VERSION}
|
||||
rm %{buildroot}%{_libdir}/*.la
|
||||
|
||||
# fix weird perl Magick.so permissions
|
||||
chmod -f 755 %{buildroot}%{perl_vendorarch}/auto/Image/Magick/*/*.so
|
||||
|
||||
# perlmagick: fix perl path of demo files
|
||||
%{__perl} -MExtUtils::MakeMaker -e 'MY->fixin(@ARGV)' PerlMagick/demo/*.pl
|
||||
|
||||
# perlmagick: cleanup various perl tempfiles from the build which get installed
|
||||
find %{buildroot} -name "*.bs" |xargs rm -f
|
||||
find %{buildroot} -name ".packlist" |xargs rm -f
|
||||
find %{buildroot} -name "perllocal.pod" |xargs rm -f
|
||||
|
||||
# perlmagick: build files list
|
||||
echo "%defattr(-,root,root,-)" > perl-pkg-files
|
||||
find %{buildroot}/%{_libdir}/perl* -type f -print \
|
||||
| sed "s@^%{buildroot}@@g" > perl-pkg-files
|
||||
find %{buildroot}%{perl_vendorarch} -type d -print \
|
||||
| sed "s@^%{buildroot}@%dir @g" \
|
||||
| grep -v '^%dir %{perl_vendorarch}$' \
|
||||
| grep -v '/auto$' >> perl-pkg-files
|
||||
if [ -z perl-pkg-files ] ; then
|
||||
echo "ERROR: EMPTY FILE LIST"
|
||||
exit -1
|
||||
fi
|
||||
|
||||
# fix multilib issues: Rename provided file with platform-bits in name.
|
||||
# Create platform independant file inplace of provided and conditionally include required.
|
||||
# $1 - filename.h to process.
|
||||
function multilibFileVersions(){
|
||||
mv $1 ${1%%.h}-%{__isa_bits}.h
|
||||
|
||||
local basename=$(basename $1)
|
||||
|
||||
cat >$1 <<EOF
|
||||
#include <bits/wordsize.h>
|
||||
|
||||
#if __WORDSIZE == 32
|
||||
# include "${basename%%.h}-32.h"
|
||||
#elif __WORDSIZE == 64
|
||||
# include "${basename%%.h}-64.h"
|
||||
#else
|
||||
# error "unexpected value for __WORDSIZE macro"
|
||||
#endif
|
||||
EOF
|
||||
}
|
||||
|
||||
multilibFileVersions %{buildroot}%{_includedir}/%{name}-6/magick/magick-config.h
|
||||
multilibFileVersions %{buildroot}%{_includedir}/%{name}-6/magick/magick-baseconfig.h
|
||||
multilibFileVersions %{buildroot}%{_includedir}/%{name}-6/magick/version.h
|
||||
|
||||
%check
|
||||
export LD_LIBRARY_PATH=%{buildroot}/%{_libdir}
|
||||
make %{?_smp_mflags} check
|
||||
|
||||
%post libs -p /sbin/ldconfig
|
||||
|
||||
%post c++ -p /sbin/ldconfig
|
||||
|
||||
%postun libs -p /sbin/ldconfig
|
||||
|
||||
%postun c++ -p /sbin/ldconfig
|
||||
|
||||
|
||||
%files
|
||||
%doc README.txt LICENSE NOTICE AUTHORS.txt NEWS.txt ChangeLog
|
||||
%{_bindir}/[a-z]*
|
||||
%{_mandir}/man[145]/[a-z]*
|
||||
%{_mandir}/man1/%{name}.*
|
||||
|
||||
%files libs
|
||||
%doc LICENSE NOTICE AUTHORS.txt QuickStart.txt
|
||||
%{_libdir}/libMagickCore-6.Q16.so*
|
||||
%{_libdir}/libMagickWand-6.Q16.so*
|
||||
%{_libdir}/%{name}-%{VERSION}
|
||||
%{_datadir}/%{name}-6
|
||||
%exclude %{_libdir}/%{name}-%{VERSION}/modules-Q16/coders/djvu.*
|
||||
%dir %{_sysconfdir}/%{name}-6
|
||||
%config(noreplace) %{_sysconfdir}/%{name}-6/*.xml
|
||||
|
||||
%files devel
|
||||
%{_bindir}/MagickCore-config
|
||||
%{_bindir}/Magick-config
|
||||
%{_bindir}/MagickWand-config
|
||||
%{_bindir}/Wand-config
|
||||
%{_libdir}/libMagickCore-6.Q16.so
|
||||
%{_libdir}/libMagickWand-6.Q16.so
|
||||
%{_libdir}/pkgconfig/MagickCore.pc
|
||||
%{_libdir}/pkgconfig/MagickCore-6.Q16.pc
|
||||
%{_libdir}/pkgconfig/ImageMagick.pc
|
||||
%{_libdir}/pkgconfig/ImageMagick-6.Q16.pc
|
||||
%{_libdir}/pkgconfig/MagickWand.pc
|
||||
%{_libdir}/pkgconfig/MagickWand-6.Q16.pc
|
||||
%{_libdir}/pkgconfig/Wand.pc
|
||||
%{_libdir}/pkgconfig/Wand-6.Q16.pc
|
||||
%dir %{_includedir}/%{name}-6
|
||||
%{_includedir}/%{name}-6/magick
|
||||
%{_includedir}/%{name}-6/wand
|
||||
%{_mandir}/man1/Magick-config.*
|
||||
%{_mandir}/man1/MagickCore-config.*
|
||||
%{_mandir}/man1/Wand-config.*
|
||||
%{_mandir}/man1/MagickWand-config.*
|
||||
|
||||
%files djvu
|
||||
%{_libdir}/%{name}-%{VERSION}/modules-Q16/coders/djvu.*
|
||||
|
||||
%files doc
|
||||
%doc %{_datadir}/doc/%{name}-6
|
||||
%doc %{_datadir}/doc/%{name}-%{VERSION}
|
||||
%doc LICENSE
|
||||
|
||||
%files c++
|
||||
%doc Magick++/AUTHORS Magick++/ChangeLog Magick++/NEWS Magick++/README
|
||||
%doc www/Magick++/COPYING
|
||||
%{_libdir}/libMagick++-6.Q16.so.*
|
||||
|
||||
%files c++-devel
|
||||
%doc Magick++/examples
|
||||
%{_bindir}/Magick++-config
|
||||
%{_includedir}/%{name}-6/Magick++
|
||||
%{_includedir}/%{name}-6/Magick++.h
|
||||
%{_libdir}/libMagick++-6.Q16.so
|
||||
%{_libdir}/pkgconfig/Magick++.pc
|
||||
%{_libdir}/pkgconfig/Magick++-6.Q16.pc
|
||||
%{_libdir}/pkgconfig/ImageMagick++.pc
|
||||
%{_libdir}/pkgconfig/ImageMagick++-6.Q16.pc
|
||||
%{_mandir}/man1/Magick++-config.*
|
||||
|
||||
%files perl -f perl-pkg-files
|
||||
%{_mandir}/man3/*
|
||||
%doc PerlMagick/demo/ PerlMagick/Changelog PerlMagick/README.txt
|
||||
|
||||
%changelog
|
||||
* Sun May 01 2005 Cristy <cristy@mystic.es.dupont.com> 1.0-0
|
||||
- Port of Redhat's RPM script to support ImageMagick.
|
|
@ -0,0 +1,98 @@
|
|||
Mac OS X-specific Build instructions
|
||||
|
||||
In order to install ImageMagick on OSX, you will first need Apple's "Xcode",
|
||||
which you can get by going to the AppStore and searching for "Xcode" and
|
||||
installing it.
|
||||
|
||||
Next, you will need to install the "Xcode Command Line Tools" which includes
|
||||
the compiler. You can install those by running the following command in the
|
||||
Terminal:
|
||||
|
||||
xcode-select --install
|
||||
|
||||
Now that you have the necessary tools, you have a choice of how to install
|
||||
ImageMagick. The simplest method is to use "homebrew", and that method is shown
|
||||
first below. The alternative method is to install from source, which is shown
|
||||
afterwards.
|
||||
|
||||
################################################################################
|
||||
Method 1: Using "homebrew"
|
||||
################################################################################
|
||||
|
||||
Go to http://brew.sh and copy the one-liner that installs "homebrew".
|
||||
|
||||
Paste that into the Terminal and run it.
|
||||
|
||||
For the very simplest, fastest, most basic ImageMagick installation, run:
|
||||
|
||||
brew install imagemagick
|
||||
|
||||
Test your installation by running:
|
||||
|
||||
identify -version
|
||||
|
||||
If you want to add support for extra features, such as HDRI, Perl, JPEG2000,
|
||||
pango,fftw, TIFF or rsvg etc. you can configure the necessary options by running:
|
||||
|
||||
brew edit imagemagick
|
||||
|
||||
then find the options you need and apply them like this:
|
||||
|
||||
brew reinstall -s imagemagick
|
||||
|
||||
If you have any problems with "homebrew", simply run:
|
||||
|
||||
brew doctor
|
||||
|
||||
and follow the doctor's advice.
|
||||
|
||||
|
||||
################################################################################
|
||||
Method 2: Compile from source - not necessary if you used "homebrew" method
|
||||
################################################################################
|
||||
|
||||
|
||||
Perform these steps as an administrator or with the sudo command:
|
||||
|
||||
Install MacPorts. Download and install http://www.macports.org/ and type the
|
||||
following commands:
|
||||
|
||||
$magick> sudo port -v install freetype +bytecode
|
||||
$magick> sudo port -v install librsvg
|
||||
$magick> sudo port -v install graphviz +gs +wmf +jbig +jpeg2 +lcms
|
||||
|
||||
This installs many of the delegate libraries ImageMagick will utilize such as
|
||||
JPEG and FreeType.
|
||||
|
||||
Use the port command to install any delegate libraries you require, for example:
|
||||
|
||||
$magick> sudo port install jpeg
|
||||
|
||||
Now let's build ImageMagick:
|
||||
|
||||
Download the ImageMagick source distribution and verify the distribution
|
||||
against its message digest.
|
||||
|
||||
Unpack and change into the top-level ImageMagick directory:
|
||||
|
||||
$magick> tar xvfz ImageMagick-6.5.9-0.tar.gz
|
||||
$magick> cd ImageMagick-6.5.9
|
||||
|
||||
Configure ImageMagick:
|
||||
|
||||
$magick> ./configure --prefix=/opt --with-quantum-depth=16 \
|
||||
--disable-dependency-tracking --without-perl
|
||||
|
||||
Build ImageMagick:
|
||||
|
||||
$magick> make
|
||||
|
||||
Install ImageMagick:
|
||||
|
||||
$magick> sudo make install
|
||||
|
||||
To verify your install, type
|
||||
|
||||
$magick> /opt/local/bin/identify -list font
|
||||
|
||||
to list all the fonts ImageMagick knows about.
|
|
@ -0,0 +1,658 @@
|
|||
Download & Unpack
|
||||
|
||||
ImageMagick builds on a variety of Unix and Unix-like operating systems
|
||||
including Linux, Solaris, FreeBSD, Mac OS X, and others. A compiler is
|
||||
required and fortunately almost all modern Unix systems have one. Download
|
||||
ImageMagick.tar.gz from ftp.imagemagick.org or its mirrors and verify the
|
||||
distribution against its message digest.
|
||||
|
||||
Unpack the distribution with this command:
|
||||
|
||||
$magick> tar xvfz ImageMagick.tar.gz
|
||||
|
||||
Now that you have the ImageMagick Unix/Linux source distribution unpacked,
|
||||
let's configure it.
|
||||
|
||||
Configure
|
||||
|
||||
The configure script looks at your environment and decides what it can cobble
|
||||
together to get ImageMagick compiled and installed on your system. This
|
||||
includes finding a compiler, where your compiler header files are located
|
||||
(e.g. stdlib.h), and if any delegate libraries are available for ImageMagick
|
||||
to use (e.g. JPEG, PNG, TIFF, etc.). If you are willing to accept configure's
|
||||
default options, and build from within the source directory, you can simply
|
||||
type:
|
||||
|
||||
$magick> cd ImageMagick-6.9.6
|
||||
$magick> ./configure
|
||||
|
||||
Watch the configure script output to verify that it finds everything that
|
||||
you think it should. Pay particular attention to the last lines of the script
|
||||
output. For example, here is a recent report from our system:
|
||||
|
||||
ImageMagick is configured as follows. Please verify that this configuration
|
||||
matches your expectations.
|
||||
|
||||
Host system type: x86_64-unknown-linux-gnu
|
||||
Build system type: x86_64-unknown-linux-gnu
|
||||
|
||||
Option Value
|
||||
----------------------------------------------------------------------------
|
||||
Shared libraries --enable-shared=yes yes
|
||||
Static libraries --enable-static=yes yes
|
||||
Module support --with-modules=yes yes
|
||||
GNU ld --with-gnu-ld=yes yes
|
||||
Quantum depth --with-quantum-depth=16 16
|
||||
High Dynamic Range Imagery
|
||||
--enable-hdri=no no
|
||||
|
||||
Delegate Configuration:
|
||||
BZLIB --with-bzlib=yes yes
|
||||
Autotrace --with-autotrace=yes yes
|
||||
DJVU --with-djvu=yes no
|
||||
DPS --with-dps=yes no
|
||||
FlashPIX --with-fpx=yes no
|
||||
FontConfig --with-fontconfig=yes yes
|
||||
FreeType --with-freetype=yes yes
|
||||
GhostPCL None pcl6 (unknown)
|
||||
GhostXPS None gxps (unknown)
|
||||
Ghostscript None gs (8.63)
|
||||
result_ghostscript_font_dir='none'
|
||||
Ghostscript fonts --with-gs-font-dir=default
|
||||
Ghostscript lib --with-gslib=yes no (failed tests)
|
||||
Graphviz --with-gvc=yes yes
|
||||
JBIG --with-jbig= no
|
||||
JPEG v1 --with-jpeg=yes yes
|
||||
JPEG-2000 --with-jp2=yes yes
|
||||
LCMS v1 --with-lcms=yes yes
|
||||
LCMS v2 --with-lcms2=yes yes
|
||||
LQR --with-lqr=yes no
|
||||
Magick++ --with-magick-plus-plus=yes yes
|
||||
OpenEXR --with-openexr=yes yes
|
||||
PERL --with-perl=yes /usr/bin/perl
|
||||
PNG --with-png=yes yes
|
||||
RSVG --with-rsvg=yes yes
|
||||
TIFF --with-tiff=yes yes
|
||||
result_windows_font_dir='none'
|
||||
Windows fonts --with-windows-font-dir=
|
||||
WMF --with-wmf=yes yes
|
||||
X11 --with-x= yes
|
||||
XML --with-xml=yes yes
|
||||
ZLIB --with-zlib=yes yes
|
||||
|
||||
X11 Configuration:
|
||||
X_CFLAGS =
|
||||
X_PRE_LIBS = -lSM -lICE
|
||||
X_LIBS =
|
||||
X_EXTRA_LIBS =
|
||||
|
||||
Options used to compile and link:
|
||||
PREFIX = /usr/local
|
||||
EXEC-PREFIX = /usr/local
|
||||
VERSION = 6.4.8
|
||||
CC = gcc -std=gnu99
|
||||
CFLAGS = -fopenmp -g -O2 -Wall -W -pthread
|
||||
MAGICK_CFLAGS = -fopenmp -g -O2 -Wall -W -pthread
|
||||
CPPFLAGS = -I/usr/local/include/ImageMagick
|
||||
PCFLAGS = -fopenmp
|
||||
DEFS = -DHAVE_CONFIG_H
|
||||
LDFLAGS = -lfreetype
|
||||
MAGICK_LDFLAGS = -L/usr/local/lib -lfreetype
|
||||
LIBS = -lMagickCore -llcms -ltiff -lfreetype -ljpeg
|
||||
-lfontconfig -lXext -lSM -lICE -lX11 -lXt -lbz2 -lz
|
||||
-lm -lgomp -lpthread -lltdl
|
||||
CXX = g++
|
||||
CXXFLAGS = -g -O2 -Wall -W -pthread
|
||||
|
||||
You can influence the choice of compiler, compilation flags, or libraries of
|
||||
the configure script by setting initial values for variables in the configure
|
||||
command line. These include, among others:
|
||||
|
||||
CC
|
||||
Name of C compiler (e.g. cc -Xa) to use.
|
||||
|
||||
CXX
|
||||
Name of C++ compiler to use (e.g. CC).
|
||||
|
||||
CFLAGS
|
||||
Compiler flags (e.g. -g -O2) to compile C code.
|
||||
|
||||
CXXFLAGS
|
||||
Compiler flags (e.g. -g -O2) to compile C++ code.
|
||||
|
||||
CPPFLAGS
|
||||
Include paths (.e.g. -I/usr/local) to look for header files.
|
||||
|
||||
LDFLAGS
|
||||
Library paths (.e.g. -L/usr/local) to look for libraries systems that
|
||||
support the notion of a library run-path may require an additional
|
||||
argument in order to find shared libraries at run time. For example,
|
||||
the Solaris linker requires an argument of the form -R/path. Some
|
||||
Linux systems will work with -rpath /usr/local/lib, while some other
|
||||
Linux systems who's gcc does not pass -rpath to the linker require
|
||||
an argument of the form -Wl,-rpath,/usr/local/lib.
|
||||
|
||||
LIBS
|
||||
Extra libraries (.e.g. -l/usr/local/lib) required to link.
|
||||
|
||||
Here is an example of setting configure variables from the command line:
|
||||
|
||||
$magick> ./configure CC=c99 CFLAGS=-O2 LIBS=-lposix
|
||||
|
||||
Any variable (e.g. CPPFLAGS or LDFLAGS) which requires a directory path must
|
||||
specify an absolute path rather than a relative path.
|
||||
|
||||
Configure can usually find the X include and library files automagically,
|
||||
but if it doesn't, you can use the --x-includes=path and --x-libraries=path
|
||||
options to specify their locations.
|
||||
|
||||
The configure script provides a number of ImageMagick specific
|
||||
options. When disabling an option --disable-something is equivalent to
|
||||
specifying --enable-something=no and --without-something is equivalent to
|
||||
--with-something=no. The configure options are as follows (execute configure
|
||||
--help to see all options).
|
||||
|
||||
ImageMagick options represent either features to be enabled, disabled,
|
||||
or packages to be included in the build. When a feature is enabled (via
|
||||
--enable-something), it enables code already present in ImageMagick. When a
|
||||
package is enabled (via --with-something), the configure script will search
|
||||
for it, and if is properly installed and ready to use (headers and built
|
||||
libraries are found by compiler) it will be included in the build. The
|
||||
configure script is delivered with all features disabled and all packages
|
||||
enabled. In general, the only reason to disable a package is if a package
|
||||
exists but it is unsuitable for the build (perhaps an old version or not
|
||||
compiled with the right compilation flags).
|
||||
|
||||
Here are the optional features you can configure:
|
||||
|
||||
--enable-shared
|
||||
build the shared libraries and support for loading coder and process
|
||||
modules. Shared libraries are preferred because they allow programs
|
||||
to share common code, making the individual programs much smaller. In
|
||||
addition shared libraries are required in order for PerlMagick to be
|
||||
dynamically loaded by an installed PERL (otherwise an additional PERL
|
||||
(PerlMagick) must be installed.
|
||||
|
||||
ImageMagick built with delegates (see MAGICK PLUG-INS below) can pose
|
||||
additional challenges. If ImageMagick is built using static libraries (the
|
||||
default without --enable-shared) then delegate libraries may be built as
|
||||
either static libraries or shared libraries. However, if ImageMagick is
|
||||
built using shared libraries, then all delegate libraries must also be
|
||||
built as shared libraries. Static libraries usually have the extension
|
||||
.a, while shared libraries typically have extensions like .so, .sa, or
|
||||
.dll. Code in shared libraries normally must compiled using a special
|
||||
compiler option to produce Position Independent Code (PIC). The only
|
||||
time this not necessary is if the platform compiles code as PIC by
|
||||
default.
|
||||
|
||||
PIC compilation flags differ from vendor to vendor (gcc's is
|
||||
-fPIC). However, you must compile all shared library source with the
|
||||
same flag (for gcc use -fPIC rather than -fpic). While static libraries
|
||||
are normally created using an archive tool like ar, shared libraries
|
||||
are built using special linker or compiler options (e.g. -shared for gcc).
|
||||
|
||||
If --enable-shared is not specified, a new PERL interpreter (PerlMagick)
|
||||
is built which is statically linked against the PerlMagick extension. This
|
||||
new interpreter is installed into the same directory as the ImageMagick
|
||||
utilities. If --enable-shared is specified, the PerlMagick extension is
|
||||
built as a dynamically loadable object which is loaded into your current
|
||||
PERL interpreter at run-time. Use of dynamically-loaded extensions is
|
||||
preferable over statically linked extensions so use --enable-shared if
|
||||
possible (note that all libraries used with ImageMagick must be shared
|
||||
libraries!).
|
||||
|
||||
--disable-static
|
||||
static archive libraries (with extension .a) are not built. If you
|
||||
are building shared libraries, there is little value to building static
|
||||
libraries. Reasons to build static libraries include: 1) they can be
|
||||
easier to debug; 2) clients do not have external dependencies (i.e.
|
||||
libMagick.so); 3) building PIC versions of the delegate libraries may
|
||||
take additional expertise and effort; 4) you are unable to build shared
|
||||
libraries.
|
||||
|
||||
--disable-installed
|
||||
disable building an installed ImageMagick (default enabled).
|
||||
|
||||
By default the ImageMagick build is configured to formally install
|
||||
into a directory tree. This the most secure and reliable way to install
|
||||
ImageMagick. Use this option to configure ImageMagick so that it doesn't
|
||||
use hard-coded paths and locates support files by computing an offset path
|
||||
from the executable (or from the location specified by the MAGICK_HOME
|
||||
environment variable. The uninstalled configuration is ideal for binary
|
||||
distributions which are expected to extract and run in any location.
|
||||
|
||||
--enable-ccmalloc
|
||||
enable 'ccmalloc' memory debug support (default disabled).
|
||||
|
||||
--enable-prof
|
||||
enable 'prof' profiling support (default disabled).
|
||||
|
||||
--enable-gprof
|
||||
enable 'gprof' profiling support (default disabled).
|
||||
|
||||
--enable-gcov
|
||||
enable 'gcov' profiling support (default disabled).
|
||||
|
||||
--disable-openmp
|
||||
disable OpenMP (default enabled).
|
||||
|
||||
Certain ImageMagick algorithms, for example convolution, can achieve
|
||||
a significant speed-up with the assistance of the OpenMP API when
|
||||
running on modern dual and quad-core processors.
|
||||
|
||||
--disable-largefile
|
||||
disable support for large (64 bit) file offsets.
|
||||
|
||||
By default, ImageMagick is compiled with support for large files (>
|
||||
2GB on a 32-bit CPU) if the operating system supports large files. Some
|
||||
applications which use the ImageMagick library may also require support
|
||||
for large files. By disabling support for large files via
|
||||
--disable-largefile, dependent applications do not require special
|
||||
compilation options for large files in order to use the library.
|
||||
|
||||
Here are the optional packages you can configure:
|
||||
|
||||
--with-quantum-depth
|
||||
number of bits in a pixel quantum (default 16).
|
||||
|
||||
Use this option to specify the number of bits to use per pixel quantum
|
||||
(the size of the red, green, blue, and alpha pixel components). For
|
||||
example, --with-quantum-depth=8 builds ImageMagick using 8-bit quantums.
|
||||
Most computer display adapters use 8-bit quantums. Currently supported
|
||||
arguments are 8, 16, or 32. We recommend the default of 16 because
|
||||
some image formats support 16 bits-per-pixel. However, this option is
|
||||
important in determining the overall run-time performance of ImageMagick.
|
||||
|
||||
The number of bits in a quantum determines how many values it may
|
||||
contain. Each quantum level supports 256 times as many values as the
|
||||
previous level. The following table shows the range available for various
|
||||
quantum sizes.
|
||||
|
||||
Quantum Depth Valid Range (Decimal) Valid Range (Hex)
|
||||
8 0-255 00-FF
|
||||
16 0-65535 0000-FFFF
|
||||
32 0-4294967295 00000000-FFFFFFFF
|
||||
|
||||
Larger pixel quantums can cause ImageMagick to run more slowly and to
|
||||
require more memory. For example, using sixteen-bit pixel quantums can
|
||||
cause ImageMagick to run 15% to 50% slower (and take twice as much memory)
|
||||
than when it is built to support eight-bit pixel quantums.
|
||||
|
||||
The amount of virtual memory consumed by an image can be computed by
|
||||
the equation (5 * Quantum Depth * Rows * Columns) / 8. This an important
|
||||
consideration when resources are limited, particularly since processing
|
||||
an image may require several images to be in memory at one time. The
|
||||
following table shows memory consumption values for a 1024x768 image:
|
||||
|
||||
Quantum Depth Virtual Memory
|
||||
8 3MB
|
||||
16 8MB
|
||||
32 15MB
|
||||
|
||||
--enable-hdri
|
||||
accurately represent the wide range of intensity levels (experimental).
|
||||
|
||||
--enable-osx-universal-binary
|
||||
build a universal binary on OS X.
|
||||
|
||||
--without-modules
|
||||
disable support for dynamically loadable modules.
|
||||
|
||||
Image coders and process modules are built as loadable modules which are
|
||||
installed under the directory [prefix]/lib/ImageMagick-X.X.X/modules-QN
|
||||
(where 'N' equals 8, 16, or 32 depending on the quantum depth) in the
|
||||
subdirectories coders and filters respectively. The modules build option
|
||||
is only available in conjunction with --enable-shared. If --enable-shared
|
||||
is not also specified, support for building modules is disabled. Note that
|
||||
if --enable-shared and --disable-modules are specified, the module loader
|
||||
is active (allowing extending an installed ImageMagick by simply copying
|
||||
a module into place) but ImageMagick itself is not built using modules.
|
||||
|
||||
--with-cache
|
||||
set pixel cache threshold (defaults to available memory).
|
||||
|
||||
Specify a different image pixel cache threshold with this option. This
|
||||
sets the maximum amount of heap memory that ImageMagick is allowed to
|
||||
consume before switching to using memory-mapped temporary files to store
|
||||
raw pixel data.
|
||||
|
||||
--without-threads
|
||||
disable threads support.
|
||||
|
||||
By default, the ImageMagick library is compiled with multi-thread
|
||||
support. If this undesirable, specify --without-threads.
|
||||
|
||||
--with-frozenpaths
|
||||
enable frozen delegate paths.
|
||||
|
||||
Normally, external program names are substituted into the delegates.xml
|
||||
configuration file without full paths. Specify this option to enable
|
||||
saving full paths to programs using locations determined by configure.
|
||||
This useful for environments where programs are stored under multiple
|
||||
paths, and users may use different PATH settings than the person who
|
||||
builds ImageMagick.
|
||||
|
||||
--without-magick-plus-plus
|
||||
disable build/install of Magick++.
|
||||
|
||||
Disable building Magick++, the C++ application programming interface
|
||||
to ImageMagick. A suitable C++ compiler is required in order to build
|
||||
Magick++. Specify the CXX configure variable to select the C++ compiler
|
||||
to use (default g++), and CXXFLAGS to select the desired compiler
|
||||
optimization and debug flags (default -g -O2). Antique C++ compilers
|
||||
will normally be rejected by configure tests so specifying this option
|
||||
should only be necessary if Magick++ fails to compile.
|
||||
|
||||
--with-package-release-name
|
||||
encode this name into the shared library name (see libtools -release
|
||||
option).
|
||||
|
||||
--without-perl
|
||||
disable build/install of PerlMagick, or
|
||||
|
||||
By default, PerlMagick is conveniently compiled and installed as part
|
||||
of ImageMagick's normal configure, make, sudo make install process. When
|
||||
--without-perl is specified, you must first install ImageMagick, change to
|
||||
the PerlMagick subdirectory, build, and finally install PerlMagick. Note,
|
||||
PerlMagick is configured even if --without-perl is specified. If the
|
||||
argument --with-perl=/path/to/perl is supplied, /../path/to/perl is be
|
||||
taken as the PERL interpreter to use. This important in case the perl
|
||||
executable in your PATH is not PERL5, or is not the PERL you want to use.
|
||||
|
||||
--with-perl=PERL
|
||||
use specified Perl binary to configure PerlMagick.
|
||||
|
||||
--with-perl-options=OPTIONS
|
||||
options to pass on command-line when generating PerlMagick's Makefile
|
||||
from Makefile.PL.
|
||||
|
||||
The PerlMagick module is normally installed using the Perl interpreter's
|
||||
installation PREFIX, rather than ImageMagick's. If ImageMagick's
|
||||
installation prefix is not the same as PERL's PREFIX, then you
|
||||
may find that PerlMagick's sudo make install step tries to install
|
||||
into a directory tree that you don't have write permissions to. This
|
||||
common when PERL is delivered with the operating system or on Internet
|
||||
Service Provider (ISP) web servers. If you want PerlMagick to install
|
||||
elsewhere, then provide a PREFIX option to PERL's configuration step
|
||||
via "--with-perl-options=PREFIX=/some/place". Other options accepted by
|
||||
MakeMaker are 'LIB', 'LIBPERL_A', 'LINKTYPE', and 'OPTIMIZE'. See the
|
||||
ExtUtils::MakeMaker(3) manual page for more information on configuring
|
||||
PERL extensions.
|
||||
|
||||
--without-bzlib
|
||||
disable BZLIB support.
|
||||
|
||||
--without-dps
|
||||
disable Display Postscript support.
|
||||
|
||||
--with-fpx
|
||||
enable FlashPIX support.
|
||||
|
||||
--without-freetype
|
||||
disable TrueType support.
|
||||
|
||||
--with-gslib
|
||||
enable Ghostscript library support.
|
||||
|
||||
--without-jbig
|
||||
disable JBIG support.
|
||||
|
||||
--without-jpeg
|
||||
disable JPEG support.
|
||||
|
||||
--without-jp2
|
||||
disable JPEG v2 support.
|
||||
|
||||
--without-lcms
|
||||
disable lcms (v1.1X) support
|
||||
|
||||
--without-lcms2
|
||||
disable lcms (v2.X) support
|
||||
|
||||
--without-lzma
|
||||
disable LZMA support.
|
||||
|
||||
--without-png
|
||||
disable PNG support.
|
||||
|
||||
--without-tiff
|
||||
disable TIFF support.
|
||||
|
||||
--without-wmf
|
||||
disable WMF support.
|
||||
|
||||
--with-fontpath
|
||||
prepend to default font search path.
|
||||
|
||||
--with-gs-font-dir
|
||||
directory containing Ghostscript fonts.
|
||||
|
||||
Specify the directory containing the Ghostscript Postscript Type 1 font
|
||||
files (e.g. n022003l.pfb) so that they can be rendered using the FreeType
|
||||
library. If the font files are installed using the default Ghostscript
|
||||
installation paths (${prefix}/share/ghostscript/fonts), they should
|
||||
be discovered automagically by configure and specifying this option is
|
||||
not necessary. Specify this option if the Ghostscript fonts fail to be
|
||||
located automagically, or the location needs to be overridden.
|
||||
|
||||
--with-windows-font-dir
|
||||
directory containing MS-Windows fonts.
|
||||
|
||||
Specify the directory containing MS-Windows-compatible fonts. This not
|
||||
necessary when ImageMagick is running under MS-Windows.
|
||||
|
||||
--without-xml
|
||||
disable XML support.
|
||||
|
||||
--without-zlib
|
||||
disable ZLIB support.
|
||||
|
||||
--without-x
|
||||
don't use the X Window System.
|
||||
|
||||
By default, ImageMagick uses the X11 delegate libraries if they are
|
||||
available. When --without-x is specified, use of X11 is disabled. The
|
||||
display, animate, and import sub-commands are not included. The remaining
|
||||
sub-commands have reduced functionality such as no access to X11 fonts
|
||||
(consider using Postscript or TrueType fonts instead).
|
||||
|
||||
--with-share-path=DIR
|
||||
Alternate path to share directory (default share/ImageMagick).
|
||||
|
||||
--with-libstdc=DIR
|
||||
use libstdc++ in DIR (for GNU C++).
|
||||
|
||||
While configure is designed to ease installation of ImageMagick, it often
|
||||
discovers problems that would otherwise be encountered later when compiling
|
||||
ImageMagick. The configure script tests for headers and libraries by
|
||||
executing the compiler (CC) with the specified compilation flags (CFLAGS),
|
||||
pre-processor flags (CPPFLAGS), and linker flags (LDFLAGS). Any errors are
|
||||
logged to the file config.log. If configure fails to discover a header or
|
||||
library please review this log file to determine why, however, please be
|
||||
aware that *errors in the config.log are normal* because configure works by
|
||||
trying something and seeing if it fails. An error in config.log is only a
|
||||
problem if the test should have passed on your system.
|
||||
|
||||
Common causes of configure failures are: 1) a delegate header is not in the
|
||||
header include path (CPPFLAGS -I option); 2) a delegate library is not in
|
||||
the linker search/run path (LDFLAGS -L/-R option); 3) a delegate library is
|
||||
missing a function (old version?); or 4) compilation environment is faulty.
|
||||
|
||||
If all reasonable corrective actions have been tried and the problem appears
|
||||
be due to a flaw in the configure script, please send a bug report to the
|
||||
ImageMagick Defect Support Forum. All bug reports should contain the operating
|
||||
system type (as reported by uname -a) and the compiler/compiler-version. A
|
||||
copy of the configure script output and/or the relevant portion of config.log
|
||||
file may be valuable in order to find the problem. If you post portions
|
||||
of config.log, please also send a script of the configure output and a
|
||||
description of what you expected to see (and why) so the failure you are
|
||||
observing can be identified and resolved.
|
||||
|
||||
ImageMagick is now configured and ready to build
|
||||
|
||||
Build
|
||||
|
||||
Once ImageMagick is configured, these standard build targets are available
|
||||
from the generated make files:
|
||||
|
||||
make
|
||||
build ImageMagick.
|
||||
|
||||
sudo make install
|
||||
install ImageMagick.
|
||||
|
||||
make check
|
||||
Run tests using the installed ImageMagick (sudo make install must be
|
||||
done first). Ghostscript is a prerequisite, otherwise the EPS, PS,
|
||||
and PDF tests will fail.
|
||||
|
||||
make clean
|
||||
Remove everything in the build directory created by make.
|
||||
|
||||
make distclean
|
||||
remove everything in the build directory created by configure and
|
||||
make. This useful if you want to start over from scratch.
|
||||
|
||||
make uninstall
|
||||
Remove all files from the system which are (or would be) installed by sudo
|
||||
make install using the current configuration. Note that this target is
|
||||
imperfect for PerlMagick since Perl no longer supports an uninstall
|
||||
target.
|
||||
|
||||
In most cases you will simply want to compile ImageMagick with this command:
|
||||
|
||||
$magick> make
|
||||
|
||||
Once built, you can optionally install ImageMagick on your system as
|
||||
discussed below.
|
||||
|
||||
Install
|
||||
|
||||
Now that ImageMagick is configured and built, type:
|
||||
|
||||
$magick> make install
|
||||
|
||||
to install it.
|
||||
|
||||
By default, ImageMagick is installs binaries in /../usr/local/bin, libraries
|
||||
in /../usr/local/lib, header files in /../usr/local/include and documentation
|
||||
in /../usr/local/share. You can specify an alternative installation prefix
|
||||
other than /../usr/local by giving configure the option --prefix=PATH. This
|
||||
valuable in case you don't have privileges to install under the default
|
||||
paths or if you want to install in the system directories instead.
|
||||
|
||||
To confirm your installation of the ImageMagick distribution was successful,
|
||||
ensure that the installation directory is in your executable search path
|
||||
and type:
|
||||
|
||||
$magick> display
|
||||
|
||||
The ImageMagick logo is displayed on your X11 display.
|
||||
|
||||
To verify the ImageMagick build configuration, type:
|
||||
|
||||
$magick> identify -list configure
|
||||
|
||||
To list which image formats are supported , type:
|
||||
|
||||
$magick> identify -list format
|
||||
|
||||
For a more comprehensive test, you run the ImageMagick test suite by typing:
|
||||
|
||||
$magick> make check
|
||||
|
||||
Ghostscript is a prerequisite, otherwise the EPS, PS, and PDF tests will
|
||||
fail. Note that due to differences between the developer's environment and
|
||||
your own it is possible that a few tests may fail even though the results are
|
||||
ok. Differences between the developer's environment environment and your own
|
||||
may include the compiler, the CPU type, and the library versions used. The
|
||||
ImageMagick developers use the current release of all dependent libraries.
|
||||
|
||||
Linux-specific Build instructions
|
||||
|
||||
Download ImageMagick.src.rpm from ftp.imagemagick.org or its mirrors and
|
||||
verify the distribution against its message digest.
|
||||
|
||||
Build ImageMagick with this command:
|
||||
|
||||
$magick> rpmbuild --rebuild ImageMagick.src.rpm
|
||||
|
||||
After the build you, locate the RPMS folder and install the ImageMagick
|
||||
binary RPM distribution:
|
||||
|
||||
$magick> rpm -ivh ImageMagick-6.8.2-?.*.rpm
|
||||
|
||||
MinGW-specific Build instructions
|
||||
|
||||
Although you can download and install delegate libraries yourself, many
|
||||
are already available in the GnuWin32 distribution. Download and install
|
||||
whichever delegate libraries you require such as JPEG, PNG, TIFF, etc. Make
|
||||
sure you specify the development headers when you install a package. Next
|
||||
type,
|
||||
|
||||
$magick> tar jxvf ImageMagick-6.8.2-?.tar.bz2
|
||||
$magick> cd ImageMagick-6.8.2
|
||||
$magick> export CPPFLAGS="-Ic:/Progra~1/GnuWin32/include"
|
||||
$magick> export LDFLAGS="-Lc:/Progra~1/GnuWin32/lib"
|
||||
$magick> ./configure --without-perl
|
||||
$magick> make $magick> sudo make install
|
||||
|
||||
Dealing with Unexpected Problems
|
||||
|
||||
Chances are the download, configure, build, and install of ImageMagick went
|
||||
flawlessly as it is intended, however, certain systems and environments may
|
||||
cause one or more steps to fail. We discuss a few problems we've run across
|
||||
and how to take corrective action to ensure you have a working release
|
||||
of ImageMagick
|
||||
|
||||
Build Problems
|
||||
|
||||
If the build complains about missing dependencies (e.g. .deps/source.PLO),
|
||||
add --disable-dependency-tracking to your configure command line.
|
||||
|
||||
Some systems may fail to link at build time due to unresolved symbols. Try
|
||||
adding the LDFLAGS to the configure command line:
|
||||
|
||||
$magick> configure LDFLAGS='-L/usr/local/lib -R/usr/local/lib'
|
||||
|
||||
Dynamic Linker Run-time Bindings
|
||||
|
||||
On some systems, ImageMagick may not find its shared library, libMagick.so. Try
|
||||
running the ldconfig with the library path:
|
||||
|
||||
$magick> /sbin/ldconfig /usr/local/lib
|
||||
|
||||
Solaris and Linux systems have the ldd command which is useful to track which
|
||||
libraries ImageMagick depends on:
|
||||
|
||||
$magick> ldd `which convert`
|
||||
|
||||
Delegate Libraries
|
||||
|
||||
On occasion you may receive these warnings:
|
||||
|
||||
no decode delegate for this image format
|
||||
no encode delegate for this image format
|
||||
|
||||
This exception indicates that an external delegate library or its headers
|
||||
were not available when ImageMagick was built. To add support for the image
|
||||
format, download and install the requisite delegate library and its header
|
||||
files and reconfigure, rebuild, and reinstall ImageMagick. As an example,
|
||||
lets add support for the JPEG image format. First we install the JPEG RPMS:
|
||||
|
||||
$magick> yum install libjpeg libjpeg-devel
|
||||
|
||||
Now reconfigure, rebuild, and reinstall ImageMagick. To verify JPEG is now
|
||||
properly supported within ImageMagick, use this command:
|
||||
|
||||
$magick> identify -list format
|
||||
|
||||
You should see a mode of rw- associated with the JPEG tag. This mode means
|
||||
the image can be read or written and can only support one image per image
|
||||
file.
|
||||
|
||||
PerlMagick
|
||||
|
||||
If PerlMagick fails to link with a message similar to libperl.a is not found,
|
||||
rerun configure with the --enable-shared or --enable-shared --with-modules
|
||||
options.
|
|
@ -0,0 +1,33 @@
|
|||
VMS COMPILATION
|
||||
|
||||
You might want to check the values of certain program definitions
|
||||
before compiling. Verify the definitions in delegates.xml to suit
|
||||
your local requirements. Next, type.
|
||||
|
||||
Type
|
||||
|
||||
unzip ImageMagick-6.7.4-0.zip
|
||||
set default [.imagemagick]
|
||||
@make
|
||||
set display/create/node=node_name::
|
||||
|
||||
where node_name is the DECNET X server to contact.
|
||||
|
||||
Note : the MAKE.COM files compile every thing with /name=(as_is,short). all
|
||||
the requested graphical lib's should be compiled with this qualifier (see
|
||||
http://nchrem.tnw.tudelft/openvms for details on additional libraries
|
||||
needed). All the .olb files of the libs are expected to be in SYS$LIBRARY.
|
||||
|
||||
Edit the MAKE.COM in the top directory and [.MAGICK]CONFIG.H_VMS to
|
||||
add/remove optional graphical support.
|
||||
|
||||
Finally type:
|
||||
|
||||
display
|
||||
|
||||
Thanks to pmoreau@cenaath.cena.dgac.fr for supplying invaluable help
|
||||
as well as the VMS versions of the JPEG, PNG, TTF, and TIFF libraries.
|
||||
|
||||
Thanks to Joukj@hrem.stm.tudelft.{nl} for providing a patches to get
|
||||
ImageMagick working under OpenVMS. See
|
||||
http://nchrem.tnw.tudelft.nl/openvms/software2.html#Magick.
|
|
@ -0,0 +1,49 @@
|
|||
This document describes the requirements and instructions to build ImageMagick
|
||||
for Windows on your own machine.
|
||||
|
||||
Requirements
|
||||
|
||||
o Visual Studio 2013 (or newer)
|
||||
o Git for Windows
|
||||
o AMD APP SDK (optional
|
||||
for OpenCL support)
|
||||
|
||||
Install Visual Studio dependencies
|
||||
|
||||
To build ImageMagick with Visual Studio the following components should
|
||||
be installed:
|
||||
|
||||
o Desktop development with C++ (workload)
|
||||
o Visual C++ ATL for x86 and x64
|
||||
o Visual C++ MFC for x86 and x64
|
||||
o Windows XP support for C++ (optional if the output needs to run on Windows
|
||||
XP)
|
||||
|
||||
Naming of these components might differ between version of Visual Studio. The
|
||||
example above use the Visual Studio 2017 names.
|
||||
|
||||
Clone the dependencies
|
||||
|
||||
The ImageMagick library is build with a number of third party libraries. Run
|
||||
CloneRepositories.cmd to clone these libraries and the ImageMagick library.
|
||||
|
||||
Build configure.exe
|
||||
|
||||
One of the folders that was created in the previous step is called VisualMagick
|
||||
and this folder contains a folder called configure. This folder contains a
|
||||
solution configure.sln. Open this solution with Visual Studio and start a
|
||||
Release build of the project. This will create a file called configure.exe in
|
||||
the folder. Running this program will start a Wizard that allows configuration
|
||||
of ImageMagick and its individual components.
|
||||
|
||||
Build ImageMagick
|
||||
|
||||
Depending on which options where chosen when running configure.exe one of
|
||||
the following solutions will be created in the VisualMagick folder:
|
||||
|
||||
o VisualDynamicMT.sln (Dynamic Multi-threaded DLL runtimes)
|
||||
o VisualStaticMTD.sln (Static Multi-threaded DLL runtimes)
|
||||
o VisualStaticMT.sln (Static Multi-threaded runtimes)
|
||||
|
||||
Open the solution to start building ImageMagick. The binaries will be created
|
||||
in the VisualMagick\bin folder.
|
|
@ -0,0 +1,103 @@
|
|||
Before we get to the text of the license, lets just review what the license says in simple terms:
|
||||
|
||||
It allows you to:
|
||||
|
||||
* freely download and use ImageMagick software, in whole or in part, for personal, company internal, or commercial purposes;
|
||||
* use ImageMagick software in packages or distributions that you create;
|
||||
* link against a library under a different license;
|
||||
* link code under a different license against a library under this license;
|
||||
* merge code into a work under a different license;
|
||||
* extend patent grants to any code using code under this license;
|
||||
* and extend patent protection.
|
||||
|
||||
It forbids you to:
|
||||
|
||||
* redistribute any piece of ImageMagick-originated software without proper attribution;
|
||||
* use any marks owned by ImageMagick Studio LLC in any way that might state or imply that ImageMagick Studio LLC endorses your distribution;
|
||||
* use any marks owned by ImageMagick Studio LLC in any way that might state or imply that you created the ImageMagick software in question.
|
||||
|
||||
It requires you to:
|
||||
|
||||
* include a copy of the license in any redistribution you may make that includes ImageMagick software;
|
||||
* provide clear attribution to ImageMagick Studio LLC for any distributions that include ImageMagick software.
|
||||
|
||||
It does not require you to:
|
||||
|
||||
* include the source of the ImageMagick software itself, or of any modifications you may have made to it, in any redistribution you may assemble that includes it;
|
||||
* submit changes that you make to the software back to the ImageMagick Studio LLC (though such feedback is encouraged).
|
||||
|
||||
A few other clarifications include:
|
||||
|
||||
* ImageMagick is freely available without charge;
|
||||
* you may include ImageMagick on a DVD as long as you comply with the terms of the license;
|
||||
* you can give modified code away for free or sell it under the terms of the ImageMagick license or distribute the result under a different license, but you need to acknowledge the use of the ImageMagick software;
|
||||
* the license is compatible with the GPL V3.
|
||||
* when exporting the ImageMagick software, review its export classification.
|
||||
|
||||
Terms and Conditions for Use, Reproduction, and Distribution
|
||||
|
||||
The legally binding and authoritative terms and conditions for use, reproduction, and distribution of ImageMagick follow:
|
||||
|
||||
Copyright 1999-2021 ImageMagick Studio LLC, a non-profit organization dedicated to making software imaging solutions freely available.
|
||||
|
||||
1. Definitions.
|
||||
|
||||
License shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
Licensor shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
||||
|
||||
Legal Entity shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, control means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
You (or Your) shall mean an individual or Legal Entity exercising permissions granted by this License.
|
||||
|
||||
Source form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
||||
|
||||
Object form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
||||
|
||||
Work shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
||||
|
||||
Derivative Works shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
||||
|
||||
Contribution shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as Not a Contribution.
|
||||
|
||||
Contributor shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
||||
|
||||
* You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
||||
* You must cause any modified files to carry prominent notices stating that You changed the files; and
|
||||
* You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
||||
* If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
|
||||
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
||||
|
||||
How to Apply the License to your Work
|
||||
|
||||
To apply the ImageMagick License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information (don't include the brackets). The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the ImageMagick License (the "License"); you may not use
|
||||
this file except in compliance with the License. You may obtain a copy
|
||||
of the License at
|
||||
|
||||
https://imagemagick.org/script/license.php
|
||||
|
||||
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.
|
|
@ -0,0 +1,19 @@
|
|||
The author and maintainer of Magick++ is Bob Friesenhan
|
||||
<bfriesen@simple.dallas.tx.us>.
|
||||
|
||||
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 <BillR@corbis.com> for his assistance with
|
||||
getting Magick++ to compile under Visual C++, and for maintaining the
|
||||
Windows build environment.
|
||||
|
||||
Thanks to Albert Chin-A-Young <china@thewrittenword.com> 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 <leonardr@lazerware.com> for ensuring that
|
||||
Magick++ compiles on the Mac.
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,164 @@
|
|||
|
||||
|
||||
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 (<string>)
|
||||
* exceptions (<exception>)
|
||||
* namespaces
|
||||
* Standard Template Library (STL) (e.g. <list>, <vector>)
|
||||
|
||||
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 <Alexander.Zimmermann@fmi.uni-passau.de>
|
||||
Red Hat i386 GCC 2.95.2 Dr. Alexander Zimmermann
|
||||
Linux 7.0 <Alexander.Zimmermann@fmi.uni-passau.de>
|
||||
Red Hat i386 GCC "2.96" ???
|
||||
Linux 7.0 snapshot
|
||||
Red Hat Dr. Alexander Zimmermann
|
||||
Linux 7.Xi386 & alpha GCC 3.0 <Alexander.Zimmermann@fmi.uni-passau.de>
|
||||
SGI IRIX MIPS IRIX C++ Albert Chin-A-Young
|
||||
6.2, 6.5 7.3.1.2m <china@thewrittenword.com>
|
||||
SunOS Sun WorkShop Albert Chin-A-Young
|
||||
5.5.1 SPARC CC 5.0 <china@thewrittenword.com>
|
||||
SunOS
|
||||
5.6, 5.7,SPARC Sun Forte CC Albert Chin-A-Young
|
||||
5.8 5.3 <china@thewrittenword.com>
|
||||
HP-UX PA-RISC HP-UX aCC Albert Chin-A-Young
|
||||
11.00 A.03.30 <china@thewrittenword.com>
|
||||
Mac OS 9 PowerPC CodeWarrior Leonard Rosenthol <leonardr@digapp.com>
|
||||
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.
|
|
@ -0,0 +1,24 @@
|
|||
|
||||
Copyright 1999 - 2002 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of the source files and associated documentation
|
||||
files ("Magick++"), to deal in Magick++ without restriction,
|
||||
including without limitation of the rights to use, copy, modify,
|
||||
merge, publish, distribute, sublicense, and/or sell copies of
|
||||
Magick++, and to permit persons to whom the Magick++ is furnished
|
||||
to do so, subject to the following conditions:
|
||||
|
||||
This copyright notice shall be included in all copies or
|
||||
substantial portions of Magick++. The copyright to Magick++ is
|
||||
retained by its author and shall not be subsumed or replaced by any
|
||||
other copyright.
|
||||
|
||||
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 Bob Friesenhahn 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 Magick++ or the use or other dealings in Magick++.
|
||||
|
|
@ -0,0 +1,266 @@
|
|||
#
|
||||
# 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)/magick/libMagickCore-@MAGICK_MAJOR_VERSION@.@MAGICK_ABI_SUFFIX@.la $(top_builddir)/wand/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/ImageMagick++.pc \
|
||||
Magick++/lib/Magick++-@MAGICK_MAJOR_VERSION@.@MAGICK_ABI_SUFFIX@.pc \
|
||||
Magick++/lib/ImageMagick++-@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/ImageMagick++.pc.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/ChannelMoments.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/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++/ChannelMoments.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++/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++/ChannelMoments.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++/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/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_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
|
|
@ -0,0 +1,383 @@
|
|||
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.
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
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/.
|
|
@ -0,0 +1,99 @@
|
|||
.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
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
#!/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_BASEVERSION@ 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
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
//
|
||||
// Demonstrate using the 'analyze' process module to compute
|
||||
// image statistics.
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 2003, 2004
|
||||
//
|
||||
// Usage: analyze file...
|
||||
//
|
||||
|
||||
#include <Magick++.h>
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <list>
|
||||
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<std::string> 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<std::string>::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;
|
||||
}
|
|
@ -0,0 +1,102 @@
|
|||
//
|
||||
// Magick++ demo to generate a simple text button
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2003
|
||||
//
|
||||
|
||||
#include <Magick++.h>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
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 );
|
||||
|
||||
// Add some text
|
||||
button.fillColor( textColor );
|
||||
button.fontPointsize( fontPointSize );
|
||||
if (getenv("MAGICK_FONT") != 0)
|
||||
button.font(string(getenv("MAGICK_FONT")));
|
||||
button.annotate( text, CenterGravity );
|
||||
|
||||
// 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;
|
||||
}
|
|
@ -0,0 +1,516 @@
|
|||
// 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 <Magick++.h>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <list>
|
||||
|
||||
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");
|
||||
|
||||
list<Image> montage;
|
||||
|
||||
{
|
||||
//
|
||||
// Read model & smile image.
|
||||
//
|
||||
cout << "Read images ..." << endl;
|
||||
|
||||
Image model( srcdir + "model.miff" );
|
||||
model.label( "Magick++" );
|
||||
model.borderColor( "black" );
|
||||
model.backgroundColor( "black" );
|
||||
|
||||
Image smile( srcdir + "smile.miff" );
|
||||
smile.label( "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<Image> 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;
|
||||
example.label( "Add Noise" );
|
||||
example.addNoise( LaplacianNoise );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " add noise (blue) ..." << endl;
|
||||
example.label( "Add Noise\n(Blue Channel)" );
|
||||
example.addNoiseChannel( BlueChannel, PoissonNoise );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " annotate ..." << endl;
|
||||
example = model;
|
||||
example.label( "Annotate" );
|
||||
example.density( "72x72" );
|
||||
example.fontPointsize( 18 );
|
||||
if (getenv("MAGICK_FONT") != 0)
|
||||
example.font(string(getenv("MAGICK_FONT")));
|
||||
example.strokeColor( Color() );
|
||||
example.fillColor( "gold" );
|
||||
example.annotate( "Magick++", "+0+20", NorthGravity );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " blur ..." << endl;
|
||||
example = model;
|
||||
example.label( "Blur" );
|
||||
example.blur( 0, 1.5 );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " blur red channel ..." << endl;
|
||||
example = model;
|
||||
example.label( "Blur Channel\n(Red Channel)" );
|
||||
example.blurChannel( RedChannel, 0, 3.0 );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " border ..." << endl;
|
||||
example = model;
|
||||
example.label( "Border" );
|
||||
example.borderColor( "gold" );
|
||||
example.border( Geometry(6,6) );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " channel ..." << endl;
|
||||
example = model;
|
||||
example.label( "Channel\n(Red Channel)" );
|
||||
example.channel( RedChannel );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " charcoal ..." << endl;
|
||||
example = model;
|
||||
example.label( "Charcoal" );
|
||||
example.charcoal( );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " composite ..." << endl;
|
||||
example = model;
|
||||
example.label( "Composite" );
|
||||
example.composite( smile, "+35+65", OverCompositeOp);
|
||||
images.push_back( example );
|
||||
|
||||
cout << " contrast ..." << endl;
|
||||
example = model;
|
||||
example.label( "Contrast" );
|
||||
example.contrast( false );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " convolve ..." << endl;
|
||||
example = model;
|
||||
example.label( "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;
|
||||
example.label( "Crop" );
|
||||
example.crop( "80x80+25+50" );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " despeckle ..." << endl;
|
||||
example = model;
|
||||
example.label( "Despeckle" );
|
||||
example.despeckle( );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " draw ..." << endl;
|
||||
example = model;
|
||||
example.label( "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;
|
||||
example.label( "Detect Edges" );
|
||||
example.edge( );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " emboss ..." << endl;
|
||||
example = model;
|
||||
example.label( "Emboss" );
|
||||
example.emboss( );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " equalize ..." << endl;
|
||||
example = model;
|
||||
example.label( "Equalize" );
|
||||
example.equalize( );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " explode ..." << endl;
|
||||
example = model;
|
||||
example.label( "Explode" );
|
||||
example.backgroundColor( "#000000FF" );
|
||||
example.implode( -1 );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " flip ..." << endl;
|
||||
example = model;
|
||||
example.label( "Flip" );
|
||||
example.flip( );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " flop ..." << endl;
|
||||
example = model;
|
||||
example.label( "Flop" );
|
||||
example.flop();
|
||||
images.push_back( example );
|
||||
|
||||
cout << " frame ..." << endl;
|
||||
example = model;
|
||||
example.label( "Frame" );
|
||||
example.frame( );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " gamma ..." << endl;
|
||||
example = model;
|
||||
example.label( "Gamma" );
|
||||
example.gamma( 1.6 );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " gaussian blur ..." << endl;
|
||||
example = model;
|
||||
example.label( "Gaussian Blur" );
|
||||
example.gaussianBlur( 0.0, 1.5 );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " gaussian blur channel ..." << endl;
|
||||
example = model;
|
||||
example.label( "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" );
|
||||
gradient.label( "Gradient" );
|
||||
images.push_back( gradient );
|
||||
|
||||
cout << " grayscale ..." << endl;
|
||||
example = model;
|
||||
example.label( "Grayscale" );
|
||||
example.quantizeColorSpace( GRAYColorspace );
|
||||
example.quantize( );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " implode ..." << endl;
|
||||
example = model;
|
||||
example.label( "Implode" );
|
||||
example.implode( 0.5 );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " level ..." << endl;
|
||||
example = model;
|
||||
example.label( "Level" );
|
||||
example.level( 0.20*QuantumRange, 0.90*QuantumRange, 1.20 );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " level red channel ..." << endl;
|
||||
example = model;
|
||||
example.label( "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;
|
||||
example.label( "Median Filter" );
|
||||
example.medianFilter( );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " modulate ..." << endl;
|
||||
example = model;
|
||||
example.label( "Modulate" );
|
||||
example.modulate( 110, 110, 110 );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " monochrome ..." << endl;
|
||||
example = model;
|
||||
example.label( "Monochrome" );
|
||||
example.quantizeColorSpace( GRAYColorspace );
|
||||
example.quantizeColors( 2 );
|
||||
example.quantizeDither( false );
|
||||
example.quantize( );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " motion blur ..." << endl;
|
||||
example = model;
|
||||
example.label( "Motion Blur" );
|
||||
example.motionBlur( 0.0, 7.0,45 );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " negate ..." << endl;
|
||||
example = model;
|
||||
example.label( "Negate" );
|
||||
example.negate( );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " normalize ..." << endl;
|
||||
example = model;
|
||||
example.label( "Normalize" );
|
||||
example.normalize( );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " oil paint ..." << endl;
|
||||
example = model;
|
||||
example.label( "Oil Paint" );
|
||||
example.oilPaint( );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " ordered dither 2x2 ..." << endl;
|
||||
example = model;
|
||||
example.label( "Ordered Dither\n(2x2)" );
|
||||
example.randomThreshold( Geometry(2,2) );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " ordered dither 3x3..." << endl;
|
||||
example = model;
|
||||
example.label( "Ordered Dither\n(3x3)" );
|
||||
example.randomThreshold( Geometry(3,3) );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " ordered dither 4x4..." << endl;
|
||||
example = model;
|
||||
example.label( "Ordered Dither\n(4x4)" );
|
||||
example.randomThreshold( Geometry(4,4) );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " ordered dither red 4x4..." << endl;
|
||||
example = model;
|
||||
example.label( "Ordered Dither\n(Red 4x4)" );
|
||||
example.randomThresholdChannel( Geometry(4,4), RedChannel);
|
||||
images.push_back( example );
|
||||
|
||||
cout << " plasma ..." << endl;
|
||||
Image plasma;
|
||||
plasma.size( "130x194" );
|
||||
plasma.read( "plasma:fractal" );
|
||||
plasma.label( "Plasma" );
|
||||
images.push_back( plasma );
|
||||
|
||||
cout << " quantize ..." << endl;
|
||||
example = model;
|
||||
example.label( "Quantize" );
|
||||
example.quantize( );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " quantum operator ..." << endl;
|
||||
example = model;
|
||||
example.label( "Quantum Operator\nRed * 0.4" );
|
||||
example.quantumOperator( RedChannel,MultiplyEvaluateOperator,0.40 );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " raise ..." << endl;
|
||||
example = model;
|
||||
example.label( "Raise" );
|
||||
example.raise( );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " reduce noise ..." << endl;
|
||||
example = model;
|
||||
example.label( "Reduce Noise" );
|
||||
example.reduceNoise( 1.0 );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " resize ..." << endl;
|
||||
example = model;
|
||||
example.label( "Resize" );
|
||||
example.zoom( "50%" );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " roll ..." << endl;
|
||||
example = model;
|
||||
example.label( "Roll" );
|
||||
example.roll( "+20+10" );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " rotate ..." << endl;
|
||||
example = model;
|
||||
example.label( "Rotate" );
|
||||
example.rotate( 45 );
|
||||
example.transparent( "black" );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " scale ..." << endl;
|
||||
example = model;
|
||||
example.label( "Scale" );
|
||||
example.scale( "60%" );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " segment ..." << endl;
|
||||
example = model;
|
||||
example.label( "Segment" );
|
||||
example.segment( 0.5, 0.25 );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " shade ..." << endl;
|
||||
example = model;
|
||||
example.label( "Shade" );
|
||||
example.shade( 30, 30, false );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " sharpen ..." << endl;
|
||||
example = model;
|
||||
example.label("Sharpen");
|
||||
example.sharpen( 0.0, 1.0 );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " shave ..." << endl;
|
||||
example = model;
|
||||
example.label("Shave");
|
||||
example.shave( Geometry( 10, 10) );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " shear ..." << endl;
|
||||
example = model;
|
||||
example.label( "Shear" );
|
||||
example.shear( 45, 45 );
|
||||
example.transparent( "black" );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " spread ..." << endl;
|
||||
example = model;
|
||||
example.label( "Spread" );
|
||||
example.spread( 3 );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " solarize ..." << endl;
|
||||
example = model;
|
||||
example.label( "Solarize" );
|
||||
example.solarize( );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " swirl ..." << endl;
|
||||
example = model;
|
||||
example.backgroundColor( "#000000FF" );
|
||||
example.label( "Swirl" );
|
||||
example.swirl( 90 );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " threshold ..." << endl;
|
||||
example = model;
|
||||
example.label( "Threshold" );
|
||||
example.threshold( QuantumRange/2.0 );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " threshold random ..." << endl;
|
||||
example = model;
|
||||
example.label( "Random\nThreshold" );
|
||||
example.randomThreshold( Geometry((size_t) (0.3*QuantumRange),
|
||||
(size_t) (0.85*QuantumRange)) );
|
||||
images.push_back( example );
|
||||
|
||||
cout << " unsharp mask ..." << endl;
|
||||
example = model;
|
||||
example.label( "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;
|
||||
example.label( "Wave" );
|
||||
example.matte( 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.compose( OverCompositeOp );
|
||||
montageOpts.backgroundColor( "#ffffff" );
|
||||
montageOpts.pointSize( 18 );
|
||||
montageOpts.fillColor( "#600" );
|
||||
montageOpts.strokeColor( Color() );
|
||||
montageOpts.compose(OverCompositeOp);
|
||||
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(), matteImage( 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;
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Copyright 2004 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
|
||||
#
|
||||
# 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
|
||||
:
|
|
@ -0,0 +1,60 @@
|
|||
//
|
||||
// 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 <Magick++.h>
|
||||
#include <iostream>
|
||||
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.matte( false );
|
||||
base.write( fname );
|
||||
}
|
||||
catch( Exception &error_ )
|
||||
{
|
||||
cout << error_.what() << endl;
|
||||
}
|
||||
++arg;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
// 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 <Magick++.h>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <list>
|
||||
#include <algorithm>
|
||||
|
||||
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<Image> 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<Image> 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;
|
||||
}
|
|
@ -0,0 +1,83 @@
|
|||
// 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 <Magick++.h>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <list>
|
||||
|
||||
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<Image> 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( Geometry(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;
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,182 @@
|
|||
// 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 <Magick++.h>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
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::list<Magick::Drawable> 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::list<Magick::Coordinate> 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(DrawableDashArray(dash_array));
|
||||
drawList.push_back(DrawableStrokeColor("red"));
|
||||
drawList.push_back(DrawableStrokeWidth(1));
|
||||
drawList.push_back(DrawableLine(10,200, 54,182));
|
||||
drawList.push_back(DrawableDashArray((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::list<VPath> 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::list<Magick::Coordinate> 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 (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!"));
|
||||
|
||||
// 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;
|
||||
}
|
|
@ -0,0 +1,121 @@
|
|||
// 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 <Magick++.h>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
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::list<Coordinate> 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.penTexture( texture );
|
||||
image.draw( DrawablePolygon( poly_coord ) );
|
||||
texture.isValid( false );
|
||||
image.penTexture( 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 );
|
||||
list<Drawable> 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 );
|
||||
image.annotate( "Hello world!", "+150+20" );
|
||||
|
||||
image.fillColor( "blue" );
|
||||
image.fontPointsize( 14 );
|
||||
image.annotate( "Goodbye cruel world!", "+150+38" );
|
||||
|
||||
image.fillColor( "black" );
|
||||
image.fontPointsize( 14 );
|
||||
image.annotate( "I'm climbing the wall!", "+280+120",
|
||||
NorthWestGravity, 90.0 );
|
||||
//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;
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,191 @@
|
|||
// 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 <Magick++.h>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
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 density;
|
||||
Geometry geometry;
|
||||
Geometry resample;
|
||||
Magick::FilterTypes filter(LanczosFilter);
|
||||
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<size_t>
|
||||
(image.columns()*((double)resample.width()/density.width())+0.5),
|
||||
static_cast<size_t>
|
||||
(image.rows()*((double)resample.height()/density.height())+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;
|
||||
}
|
|
@ -0,0 +1,170 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2004
|
||||
// Copyright Dirk Lemstra 2015
|
||||
//
|
||||
// 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 <string.h>
|
||||
|
||||
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
|
||||
Lock lock(&_blobRef->_mutexLock);
|
||||
++_blobRef->_refCount;
|
||||
}
|
||||
|
||||
Magick::Blob::~Blob ()
|
||||
{
|
||||
bool doDelete=false;
|
||||
{
|
||||
Lock lock(&_blobRef->_mutexLock);
|
||||
if (--_blobRef->_refCount == 0)
|
||||
doDelete=true;
|
||||
}
|
||||
|
||||
if (doDelete)
|
||||
{
|
||||
// Delete old blob reference with associated data
|
||||
delete _blobRef;
|
||||
}
|
||||
_blobRef=0;
|
||||
}
|
||||
|
||||
Magick::Blob& Magick::Blob::operator=(const Magick::Blob& blob_)
|
||||
{
|
||||
bool
|
||||
doDelete;
|
||||
|
||||
if (this != &blob_)
|
||||
{
|
||||
{
|
||||
Lock lock(&blob_._blobRef->_mutexLock);
|
||||
++blob_._blobRef->_refCount;
|
||||
}
|
||||
doDelete=false;
|
||||
{
|
||||
Lock lock(&_blobRef->_mutexLock);
|
||||
if (--_blobRef->_refCount == 0)
|
||||
doDelete=true;
|
||||
}
|
||||
if (doDelete)
|
||||
{
|
||||
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<void*>(decoded),length,
|
||||
Magick::Blob::MallocAllocator);
|
||||
}
|
||||
|
||||
std::string Magick::Blob::base64(void)
|
||||
{
|
||||
char
|
||||
*encoded;
|
||||
|
||||
size_t
|
||||
encoded_length;
|
||||
|
||||
std::string
|
||||
result;
|
||||
|
||||
encoded_length=0;
|
||||
encoded=Base64Encode(static_cast<const unsigned char*>(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_,const size_t length_)
|
||||
{
|
||||
bool
|
||||
doDelete;
|
||||
|
||||
doDelete=false;
|
||||
{
|
||||
Lock lock( &_blobRef->_mutexLock );
|
||||
if (--_blobRef->_refCount == 0)
|
||||
doDelete=true;
|
||||
}
|
||||
if (doDelete)
|
||||
{
|
||||
// Delete old blob reference with associated data
|
||||
delete _blobRef;
|
||||
}
|
||||
|
||||
_blobRef=new Magick::BlobRef(data_,length_);
|
||||
}
|
||||
|
||||
void Magick::Blob::updateNoCopy(void* data_,const size_t length_,
|
||||
Magick::Blob::Allocator allocator_)
|
||||
{
|
||||
bool
|
||||
doDelete;
|
||||
|
||||
doDelete=false;
|
||||
{
|
||||
Lock lock(&_blobRef->_mutexLock);
|
||||
if (--_blobRef->_refCount == 0)
|
||||
doDelete=true;
|
||||
}
|
||||
|
||||
if (doDelete)
|
||||
{
|
||||
// Delete old blob reference with associated data
|
||||
delete _blobRef;
|
||||
}
|
||||
_blobRef=new Magick::BlobRef(0,0);
|
||||
_blobRef->_data=data_;
|
||||
_blobRef->_length=length_;
|
||||
_blobRef->_allocator=allocator_;
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2004
|
||||
// Copyright Dirk Lemstra 2015
|
||||
//
|
||||
// Implementation of Blob
|
||||
//
|
||||
|
||||
#define MAGICKCORE_IMPLEMENTATION 1
|
||||
#define MAGICK_PLUSPLUS_IMPLEMENTATION 1
|
||||
|
||||
#include "Magick++/Include.h"
|
||||
#include "Magick++/Thread.h"
|
||||
#include "Magick++/BlobRef.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
Magick::BlobRef::BlobRef(const void* data_,const size_t length_)
|
||||
: _data(0),
|
||||
_length(length_),
|
||||
_allocator(Magick::Blob::NewAllocator),
|
||||
_refCount(1),
|
||||
_mutexLock()
|
||||
{
|
||||
if (data_)
|
||||
{
|
||||
_data=new unsigned char[length_];
|
||||
memcpy(_data,data_,length_);
|
||||
}
|
||||
}
|
||||
|
||||
// Destructor (actually destroys data)
|
||||
Magick::BlobRef::~BlobRef(void)
|
||||
{
|
||||
if (_allocator == Magick::Blob::NewAllocator)
|
||||
{
|
||||
delete[] static_cast<unsigned char*>(_data);
|
||||
_data=0;
|
||||
}
|
||||
else if (_allocator == Magick::Blob::MallocAllocator)
|
||||
{
|
||||
_data=(void *) RelinquishMagickMemory(_data);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,187 @@
|
|||
// 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++/ChannelMoments.h"
|
||||
#include "Magick++/Exception.h"
|
||||
#include "Magick++/Image.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
Magick::ChannelMoments::ChannelMoments(void)
|
||||
: _huInvariants(8),
|
||||
_channel(UndefinedChannel),
|
||||
_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_)
|
||||
: _huInvariants(channelMoments_._huInvariants),
|
||||
_channel(channelMoments_._channel),
|
||||
_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)
|
||||
{
|
||||
}
|
||||
|
||||
Magick::ChannelMoments::ChannelMoments(const ChannelType channel_,
|
||||
const MagickCore::ChannelMoments *channelMoments_)
|
||||
: _huInvariants(),
|
||||
_channel(channel_),
|
||||
_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)
|
||||
{
|
||||
size_t
|
||||
i;
|
||||
|
||||
for (i=0; i<8; i++)
|
||||
_huInvariants.push_back(channelMoments_->I[i]);
|
||||
}
|
||||
|
||||
double Magick::ChannelMoments::centroidX(void) const
|
||||
{
|
||||
return(_centroidX);
|
||||
}
|
||||
|
||||
double Magick::ChannelMoments::centroidY(void) const
|
||||
{
|
||||
return(_centroidY);
|
||||
}
|
||||
|
||||
Magick::ChannelType 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_));
|
||||
}
|
||||
|
||||
Magick::ImageMoments::ImageMoments(void)
|
||||
: _channels()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::ImageMoments::ImageMoments(const ImageMoments &imageMoments_)
|
||||
: _channels(imageMoments_._channels)
|
||||
{
|
||||
}
|
||||
|
||||
Magick::ImageMoments::~ImageMoments(void)
|
||||
{
|
||||
}
|
||||
|
||||
Magick::ChannelMoments Magick::ImageMoments::channel(
|
||||
const ChannelType channel_) const
|
||||
{
|
||||
for (std::vector<ChannelMoments>::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=GetImageChannelMoments(image_.constImage(),exceptionInfo);
|
||||
if (channel_moments != (MagickCore::ChannelMoments *) NULL)
|
||||
{
|
||||
switch(image_.constImage()->colorspace)
|
||||
{
|
||||
case RGBColorspace:
|
||||
default:
|
||||
_channels.push_back(Magick::ChannelMoments(RedChannel,
|
||||
&channel_moments[RedChannel]));
|
||||
_channels.push_back(Magick::ChannelMoments(GreenChannel,
|
||||
&channel_moments[GreenChannel]));
|
||||
_channels.push_back(Magick::ChannelMoments(BlueChannel,
|
||||
&channel_moments[BlueChannel]));
|
||||
break;
|
||||
case CMYKColorspace:
|
||||
_channels.push_back(Magick::ChannelMoments(CyanChannel,
|
||||
&channel_moments[CyanChannel]));
|
||||
_channels.push_back(Magick::ChannelMoments(MagentaChannel,
|
||||
&channel_moments[MagentaChannel]));
|
||||
_channels.push_back(Magick::ChannelMoments(YellowChannel,
|
||||
&channel_moments[YellowChannel]));
|
||||
_channels.push_back(Magick::ChannelMoments(BlackChannel,
|
||||
&channel_moments[BlackChannel]));
|
||||
break;
|
||||
case GRAYColorspace:
|
||||
_channels.push_back(Magick::ChannelMoments(GrayChannel,
|
||||
&channel_moments[GrayChannel]));
|
||||
break;
|
||||
}
|
||||
if (image_.constImage()->matte != MagickFalse)
|
||||
_channels.push_back(Magick::ChannelMoments(AlphaChannel,
|
||||
&channel_moments[AlphaChannel]));
|
||||
if (image_.constImage()->colorspace != GRAYColorspace)
|
||||
_channels.push_back(Magick::ChannelMoments(CompositeChannels,
|
||||
&channel_moments[CompositeChannels]));
|
||||
channel_moments=(MagickCore::ChannelMoments *) RelinquishMagickMemory(
|
||||
channel_moments);
|
||||
}
|
||||
ThrowPPException(image_.quiet());
|
||||
}
|
|
@ -0,0 +1,129 @@
|
|||
// 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)
|
||||
: _name(),
|
||||
_description(),
|
||||
_mimeType(),
|
||||
_isReadable(false),
|
||||
_isWritable(false),
|
||||
_isMultiFrame(false)
|
||||
{
|
||||
}
|
||||
|
||||
Magick::CoderInfo::CoderInfo(const Magick::CoderInfo &coder_)
|
||||
{
|
||||
_name=coder_._name;
|
||||
_description=coder_._description;
|
||||
_mimeType=coder_._mimeType;
|
||||
_isReadable=coder_._isReadable;
|
||||
_isWritable=coder_._isWritable;
|
||||
_isMultiFrame=coder_._isMultiFrame;
|
||||
}
|
||||
|
||||
Magick::CoderInfo::CoderInfo(const std::string &name_)
|
||||
: _name(),
|
||||
_description(),
|
||||
_mimeType(),
|
||||
_isReadable(false),
|
||||
_isWritable(false),
|
||||
_isMultiFrame(false)
|
||||
{
|
||||
const Magick::MagickInfo
|
||||
*magickInfo;
|
||||
|
||||
GetPPException;
|
||||
magickInfo=GetMagickInfo(name_.c_str(),exceptionInfo);
|
||||
ThrowPPException(false);
|
||||
if (magickInfo == 0)
|
||||
{
|
||||
throwExceptionExplicit(OptionError,"Coder not found",name_.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
_name=std::string(magickInfo->name);
|
||||
_description=std::string(magickInfo->description);
|
||||
_mimeType=std::string(magickInfo->mime_type ? magickInfo->mime_type : "");
|
||||
_isReadable=((magickInfo->decoder == 0) ? false : true);
|
||||
_isWritable=((magickInfo->encoder == 0) ? false : true);
|
||||
_isMultiFrame=((magickInfo->adjoin == 0) ? false : true);
|
||||
}
|
||||
}
|
||||
|
||||
Magick::CoderInfo::~CoderInfo(void)
|
||||
{
|
||||
}
|
||||
|
||||
Magick::CoderInfo& Magick::CoderInfo::operator=(const CoderInfo &coder_)
|
||||
{
|
||||
// If not being set to ourself
|
||||
if (this != &coder_)
|
||||
{
|
||||
_name=coder_._name;
|
||||
_description=coder_._description;
|
||||
_mimeType=coder_._mimeType;
|
||||
_isReadable=coder_._isReadable;
|
||||
_isWritable=coder_._isWritable;
|
||||
_isMultiFrame=coder_._isMultiFrame;
|
||||
}
|
||||
return(*this);
|
||||
}
|
||||
|
||||
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::name(void) const
|
||||
{
|
||||
return(_name);
|
||||
}
|
||||
|
||||
bool Magick::CoderInfo::unregister(void) const
|
||||
{
|
||||
return(UnregisterMagickInfo(_name.c_str()) != MagickFalse);
|
||||
}
|
||||
|
||||
Magick::CoderInfo::CoderInfo(const MagickCore::MagickInfo *magickInfo_)
|
||||
: _name(std::string(magickInfo_->name ? magickInfo_->name : "")),
|
||||
_description(std::string(magickInfo_->description ? magickInfo_->description : "")),
|
||||
_mimeType(std::string(magickInfo_->mime_type ? magickInfo_->mime_type : "")),
|
||||
_isReadable(magickInfo_->decoder ? true : false),
|
||||
_isWritable(magickInfo_->encoder ? true : false),
|
||||
_isMultiFrame(magickInfo_->adjoin ? true : false)
|
||||
{
|
||||
}
|
|
@ -0,0 +1,619 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003
|
||||
// Copyright Dirk Lemstra 2014-2018
|
||||
//
|
||||
// Color Implementation
|
||||
//
|
||||
|
||||
#define MAGICKCORE_IMPLEMENTATION
|
||||
#define MAGICK_PLUSPLUS_IMPLEMENTATION 1
|
||||
|
||||
#include "Magick++/Include.h"
|
||||
#include <string>
|
||||
|
||||
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_.redQuantum()-right_.redQuantum()) < MagickEpsilon) &&
|
||||
(fabs(left_.greenQuantum()-right_.greenQuantum()) < MagickEpsilon) &&
|
||||
(fabs(left_.blueQuantum()-right_.blueQuantum()) < MagickEpsilon));
|
||||
#else
|
||||
return((left_.isValid() == right_.isValid()) &&
|
||||
(left_.redQuantum() == right_.redQuantum()) &&
|
||||
(left_.greenQuantum() == right_.greenQuantum()) &&
|
||||
(left_.blueQuantum() == right_.blueQuantum()));
|
||||
#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_.redQuantum() < right_.redQuantum())
|
||||
return(true);
|
||||
if(left_.redQuantum() > right_.redQuantum())
|
||||
return(false);
|
||||
if(left_.greenQuantum() < right_.greenQuantum())
|
||||
return(true);
|
||||
if(left_.greenQuantum() > right_.greenQuantum())
|
||||
return(false);
|
||||
if(left_.blueQuantum() < right_.blueQuantum())
|
||||
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 PixelPacket),
|
||||
_isValid(false),
|
||||
_pixelOwn(true),
|
||||
_pixelType(RGBAPixel)
|
||||
{
|
||||
initPixel();
|
||||
|
||||
_pixel->opacity=TransparentOpacity;
|
||||
}
|
||||
|
||||
Magick::Color::Color(Magick::Quantum red_,Magick::Quantum green_,
|
||||
Magick::Quantum blue_)
|
||||
: _pixel(new PixelPacket),
|
||||
_isValid(true),
|
||||
_pixelOwn(true),
|
||||
_pixelType(RGBPixel)
|
||||
{
|
||||
redQuantum(red_);
|
||||
greenQuantum(green_);
|
||||
blueQuantum(blue_);
|
||||
alphaQuantum(OpaqueOpacity);
|
||||
}
|
||||
|
||||
Magick::Color::Color(Magick::Quantum red_,Magick::Quantum green_,
|
||||
Magick::Quantum blue_,Magick::Quantum alpha_)
|
||||
: _pixel(new PixelPacket),
|
||||
_isValid(true),
|
||||
_pixelOwn(true),
|
||||
_pixelType(RGBAPixel)
|
||||
{
|
||||
redQuantum(red_);
|
||||
greenQuantum(green_);
|
||||
blueQuantum(blue_);
|
||||
alphaQuantum(alpha_);
|
||||
}
|
||||
|
||||
Magick::Color::Color(const char *x11color_)
|
||||
: _pixel(new PixelPacket),
|
||||
_isValid(true),
|
||||
_pixelOwn(true),
|
||||
_pixelType(RGBPixel)
|
||||
{
|
||||
initPixel();
|
||||
|
||||
// Use operator = implementation
|
||||
*this=x11color_;
|
||||
}
|
||||
|
||||
Magick::Color::Color(const Magick::Color &color_)
|
||||
: _pixel(new PixelPacket),
|
||||
_isValid(color_._isValid),
|
||||
_pixelOwn(true),
|
||||
_pixelType(color_._pixelType)
|
||||
{
|
||||
*_pixel=*color_._pixel;
|
||||
}
|
||||
|
||||
Magick::Color::Color(const PixelPacket &color_)
|
||||
: _pixel(new PixelPacket),
|
||||
_isValid(true),
|
||||
_pixelOwn(true),
|
||||
_pixelType(RGBPixel)
|
||||
{
|
||||
*_pixel=color_;
|
||||
|
||||
if (color_.opacity != OpaqueOpacity)
|
||||
_pixelType=RGBAPixel;
|
||||
}
|
||||
|
||||
Magick::Color::Color(const std::string &x11color_)
|
||||
: _pixel(new PixelPacket),
|
||||
_isValid(true),
|
||||
_pixelOwn(true),
|
||||
_pixelType(RGBPixel)
|
||||
{
|
||||
initPixel();
|
||||
|
||||
// Use operator = implementation
|
||||
*this=x11color_;
|
||||
}
|
||||
|
||||
Magick::Color::~Color(void)
|
||||
{
|
||||
if (_pixelOwn)
|
||||
delete _pixel;
|
||||
|
||||
_pixel=(PixelPacket *)NULL;
|
||||
}
|
||||
|
||||
const Magick::Color& Magick::Color::operator=(const char *x11color_)
|
||||
{
|
||||
*this=std::string(x11color_);
|
||||
return(*this);
|
||||
}
|
||||
|
||||
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 MagickCore::PixelPacket &color_)
|
||||
{
|
||||
*_pixel=color_;
|
||||
if (color_.opacity != OpaqueOpacity)
|
||||
_pixelType=RGBAPixel;
|
||||
else
|
||||
_pixelType=RGBPixel;
|
||||
|
||||
return(*this);
|
||||
}
|
||||
|
||||
// Set color via X11 color specification string
|
||||
const Magick::Color& Magick::Color::operator=(const std::string &x11color_)
|
||||
{
|
||||
PixelPacket
|
||||
target_color;
|
||||
|
||||
initPixel();
|
||||
GetPPException;
|
||||
if (QueryColorDatabase(x11color_.c_str(),&target_color,exceptionInfo))
|
||||
{
|
||||
redQuantum( target_color.red );
|
||||
greenQuantum( target_color.green );
|
||||
blueQuantum( target_color.blue );
|
||||
alphaQuantum( target_color.opacity );
|
||||
|
||||
if (target_color.opacity > OpaqueOpacity)
|
||||
_pixelType=RGBAPixel;
|
||||
else
|
||||
_pixelType=RGBPixel;
|
||||
}
|
||||
else
|
||||
_isValid=false;
|
||||
ThrowPPException(false);
|
||||
|
||||
return(*this);
|
||||
}
|
||||
|
||||
Magick::Color::operator std::string() const
|
||||
{
|
||||
char
|
||||
colorbuf[MaxTextExtent];
|
||||
|
||||
MagickPixelPacket
|
||||
pixel;
|
||||
|
||||
if (!isValid())
|
||||
return std::string("none");
|
||||
|
||||
pixel.colorspace=sRGBColorspace;
|
||||
pixel.matte=_pixelType == RGBAPixel ? MagickTrue : MagickFalse;
|
||||
pixel.depth=MAGICKCORE_QUANTUM_DEPTH;
|
||||
pixel.red=_pixel->red;
|
||||
pixel.green=_pixel->green;
|
||||
pixel.blue=_pixel->blue;
|
||||
pixel.opacity=_pixel->opacity;
|
||||
GetColorTuple(&pixel,MagickTrue,colorbuf);
|
||||
|
||||
return(std::string(colorbuf));
|
||||
}
|
||||
|
||||
bool Magick::Color::isValid(void) const
|
||||
{
|
||||
return(_isValid);
|
||||
}
|
||||
|
||||
void Magick::Color::isValid(bool valid_)
|
||||
{
|
||||
if (bool(valid_) == bool(isValid()))
|
||||
return;
|
||||
|
||||
if (!_pixelOwn)
|
||||
{
|
||||
_pixel=new PixelPacket;
|
||||
_pixelOwn=true;
|
||||
}
|
||||
|
||||
_isValid=valid_;
|
||||
|
||||
initPixel();
|
||||
}
|
||||
|
||||
Magick::Color::Color(PixelPacket *rep_,PixelType pixelType_)
|
||||
: _pixel(rep_),
|
||||
_isValid(true),
|
||||
_pixelOwn(false),
|
||||
_pixelType(pixelType_)
|
||||
{
|
||||
}
|
||||
|
||||
void Magick::Color::pixel(PixelPacket *rep_,PixelType pixelType_)
|
||||
{
|
||||
if (_pixelOwn)
|
||||
delete _pixel;
|
||||
|
||||
_pixel=rep_;
|
||||
_pixelOwn=false;
|
||||
_isValid=true;
|
||||
_pixelType=pixelType_;
|
||||
}
|
||||
|
||||
Magick::ColorGray::ColorGray(void)
|
||||
: Color()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::ColorGray::ColorGray(const Magick::Color & color_)
|
||||
: Color(color_)
|
||||
{
|
||||
}
|
||||
|
||||
Magick::ColorGray::ColorGray(double shade_)
|
||||
: Color(scaleDoubleToQuantum(shade_),scaleDoubleToQuantum(shade_),
|
||||
scaleDoubleToQuantum(shade_))
|
||||
{
|
||||
alphaQuantum(OpaqueOpacity);
|
||||
}
|
||||
|
||||
Magick::ColorGray::~ColorGray()
|
||||
{
|
||||
}
|
||||
|
||||
void Magick::ColorGray::shade(double shade_)
|
||||
{
|
||||
Quantum gray=scaleDoubleToQuantum(shade_);
|
||||
redQuantum(gray);
|
||||
greenQuantum(gray);
|
||||
blueQuantum(gray);
|
||||
}
|
||||
|
||||
double Magick::ColorGray::shade(void) const
|
||||
{
|
||||
return(scaleQuantumToDouble(greenQuantum()));
|
||||
}
|
||||
|
||||
Magick::ColorGray& Magick::ColorGray::operator = ( const Magick::Color& color_ )
|
||||
{
|
||||
*static_cast<Magick::Color*>(this)=color_;
|
||||
return(*this);
|
||||
}
|
||||
|
||||
Magick::ColorHSL::ColorHSL(void)
|
||||
: Color()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::ColorHSL::ColorHSL(const Magick::Color & color_)
|
||||
: Color( color_ )
|
||||
{
|
||||
}
|
||||
|
||||
Magick::ColorHSL::ColorHSL(double hue_,double saturation_,double luminosity_)
|
||||
: Color()
|
||||
{
|
||||
Quantum
|
||||
blue,
|
||||
green,
|
||||
red;
|
||||
|
||||
ConvertHSLToRGB(hue_,saturation_,luminosity_,&red,&green,&blue);
|
||||
|
||||
redQuantum(red);
|
||||
greenQuantum(green);
|
||||
blueQuantum(blue);
|
||||
alphaQuantum(OpaqueOpacity);
|
||||
}
|
||||
|
||||
Magick::ColorHSL::~ColorHSL()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::ColorHSL& Magick::ColorHSL::operator=(const Magick::Color &color_)
|
||||
{
|
||||
*static_cast<Magick::Color*>(this)=color_;
|
||||
return (*this);
|
||||
}
|
||||
|
||||
void Magick::ColorHSL::hue(double hue_)
|
||||
{
|
||||
double
|
||||
hue,
|
||||
luminosity,
|
||||
saturation;
|
||||
|
||||
Quantum
|
||||
blue,
|
||||
green,
|
||||
red;
|
||||
|
||||
ConvertRGBToHSL(redQuantum(),greenQuantum(),blueQuantum(),&hue,&saturation,
|
||||
&luminosity);
|
||||
|
||||
hue=hue_;
|
||||
|
||||
ConvertHSLToRGB(hue,saturation,luminosity,&red,&green,&blue);
|
||||
|
||||
redQuantum(red);
|
||||
greenQuantum(green);
|
||||
blueQuantum(blue);
|
||||
}
|
||||
|
||||
double Magick::ColorHSL::hue(void) const
|
||||
{
|
||||
double
|
||||
hue,
|
||||
luminosity,
|
||||
saturation;
|
||||
|
||||
ConvertRGBToHSL(redQuantum(),greenQuantum(),blueQuantum(),&hue,&saturation,
|
||||
&luminosity);
|
||||
|
||||
return(hue);
|
||||
}
|
||||
|
||||
void Magick::ColorHSL::luminosity(double luminosity_)
|
||||
{
|
||||
double
|
||||
hue,
|
||||
luminosity,
|
||||
saturation;
|
||||
|
||||
Quantum
|
||||
blue,
|
||||
green,
|
||||
red;
|
||||
|
||||
ConvertRGBToHSL(redQuantum(),greenQuantum(),blueQuantum(),&hue,&saturation,
|
||||
&luminosity);
|
||||
|
||||
luminosity=luminosity_;
|
||||
|
||||
ConvertHSLToRGB(hue,saturation,luminosity,&red,&green,&blue);
|
||||
|
||||
redQuantum(red);
|
||||
greenQuantum(green);
|
||||
blueQuantum(blue);
|
||||
}
|
||||
|
||||
double Magick::ColorHSL::luminosity(void) const
|
||||
{
|
||||
double
|
||||
hue,
|
||||
saturation,
|
||||
luminosity;
|
||||
|
||||
ConvertRGBToHSL(redQuantum(),greenQuantum(),blueQuantum(),&hue,&saturation,
|
||||
&luminosity);
|
||||
|
||||
return(luminosity);
|
||||
}
|
||||
|
||||
void Magick::ColorHSL::saturation(double saturation_)
|
||||
{
|
||||
double
|
||||
hue,
|
||||
luminosity,
|
||||
saturation;
|
||||
|
||||
Quantum
|
||||
blue,
|
||||
green,
|
||||
red;
|
||||
|
||||
ConvertRGBToHSL(redQuantum(),greenQuantum(),blueQuantum(),&hue,&saturation,
|
||||
&luminosity);
|
||||
|
||||
saturation=saturation_;
|
||||
|
||||
ConvertHSLToRGB(hue,saturation,luminosity,&red,&green,&blue);
|
||||
|
||||
redQuantum(red);
|
||||
greenQuantum(green);
|
||||
blueQuantum(blue);
|
||||
}
|
||||
|
||||
double Magick::ColorHSL::saturation(void) const
|
||||
{
|
||||
double
|
||||
hue,
|
||||
luminosity,
|
||||
saturation;
|
||||
|
||||
ConvertRGBToHSL(redQuantum(),greenQuantum(),blueQuantum(),&hue,&saturation,
|
||||
&luminosity);
|
||||
|
||||
return(saturation);
|
||||
}
|
||||
|
||||
Magick::ColorMono::ColorMono(void)
|
||||
: Color()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::ColorMono::ColorMono(bool mono_)
|
||||
: Color((mono_ ? QuantumRange : 0),
|
||||
(mono_ ? QuantumRange : 0),
|
||||
(mono_ ? QuantumRange : 0))
|
||||
{
|
||||
alphaQuantum(OpaqueOpacity);
|
||||
}
|
||||
|
||||
Magick::ColorMono::ColorMono(const Magick::Color &color_)
|
||||
: Color(color_)
|
||||
{
|
||||
}
|
||||
|
||||
Magick::ColorMono::~ColorMono()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::ColorMono& Magick::ColorMono::operator=(const Magick::Color &color_)
|
||||
{
|
||||
*static_cast<Magick::Color*>(this)=color_;
|
||||
return(*this);
|
||||
}
|
||||
|
||||
void Magick::ColorMono::mono(bool mono_)
|
||||
{
|
||||
redQuantum(mono_ ? QuantumRange : 0);
|
||||
greenQuantum(mono_ ? QuantumRange : 0);
|
||||
blueQuantum(mono_ ? QuantumRange : 0);
|
||||
}
|
||||
|
||||
bool Magick::ColorMono::mono(void) const
|
||||
{
|
||||
return(greenQuantum() == 0);
|
||||
}
|
||||
|
||||
Magick::ColorRGB::ColorRGB(void)
|
||||
: Color()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::ColorRGB::ColorRGB(const Magick::Color & color_)
|
||||
: Color(color_)
|
||||
{
|
||||
}
|
||||
|
||||
Magick::ColorRGB::ColorRGB(double red_,double green_,double blue_)
|
||||
: Color(scaleDoubleToQuantum(red_),scaleDoubleToQuantum(green_),
|
||||
scaleDoubleToQuantum(blue_))
|
||||
{
|
||||
alphaQuantum(OpaqueOpacity);
|
||||
}
|
||||
|
||||
Magick::ColorRGB::~ColorRGB(void)
|
||||
{
|
||||
}
|
||||
|
||||
Magick::ColorRGB& Magick::ColorRGB::operator=(const Magick::Color& color_)
|
||||
{
|
||||
*static_cast<Magick::Color*>(this)=color_;
|
||||
return(*this);
|
||||
}
|
||||
|
||||
Magick::ColorYUV::ColorYUV(void)
|
||||
: Color()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::ColorYUV::ColorYUV(const Magick::Color &color_)
|
||||
: Color(color_)
|
||||
{
|
||||
}
|
||||
|
||||
Magick::ColorYUV::ColorYUV(double y_,double u_,double v_)
|
||||
: Color(scaleDoubleToQuantum(y_ + 1.13980 * v_),
|
||||
scaleDoubleToQuantum(y_ - (0.39380 * u_) - (0.58050 * v_)),
|
||||
scaleDoubleToQuantum(y_ + 2.02790 * u_))
|
||||
{
|
||||
alphaQuantum(OpaqueOpacity);
|
||||
}
|
||||
|
||||
Magick::ColorYUV::~ColorYUV(void)
|
||||
{
|
||||
}
|
||||
|
||||
Magick::ColorYUV& Magick::ColorYUV::operator=(const Magick::Color &color_)
|
||||
{
|
||||
*static_cast<Magick::Color*>(this)=color_;
|
||||
return(*this);
|
||||
}
|
||||
|
||||
void Magick::ColorYUV::u(double u_)
|
||||
{
|
||||
double V = v();
|
||||
double Y = y();
|
||||
|
||||
redQuantum(scaleDoubleToQuantum(Y + 1.13980 * V ));
|
||||
greenQuantum(scaleDoubleToQuantum( Y - (0.39380 * u_) - (0.58050 * V)));
|
||||
blueQuantum(scaleDoubleToQuantum( Y + 2.02790 * u_));
|
||||
}
|
||||
|
||||
double Magick::ColorYUV::u(void) const
|
||||
{
|
||||
return scaleQuantumToDouble((-0.14740 * redQuantum()) - (0.28950 *
|
||||
greenQuantum()) + (0.43690 * blueQuantum()));
|
||||
}
|
||||
|
||||
void Magick::ColorYUV::v(double v_)
|
||||
{
|
||||
double U = u();
|
||||
double Y = y();
|
||||
|
||||
redQuantum(scaleDoubleToQuantum( Y + 1.13980 * v_ ));
|
||||
greenQuantum(scaleDoubleToQuantum( Y - (0.39380 * U) - (0.58050 * v_) ));
|
||||
blueQuantum(scaleDoubleToQuantum( Y + 2.02790 * U ));
|
||||
}
|
||||
|
||||
double Magick::ColorYUV::v(void) const
|
||||
{
|
||||
return scaleQuantumToDouble((0.61500 * redQuantum()) - (0.51500 *
|
||||
greenQuantum()) - (0.10000 * blueQuantum()));
|
||||
}
|
||||
|
||||
void Magick::ColorYUV::y(double y_)
|
||||
{
|
||||
double U = u();
|
||||
double V = v();
|
||||
|
||||
redQuantum(scaleDoubleToQuantum(y_ + 1.13980 * V));
|
||||
greenQuantum(scaleDoubleToQuantum(y_ - (0.39380 * U) - (0.58050 * V)));
|
||||
blueQuantum(scaleDoubleToQuantum(y_ + 2.02790 * U));
|
||||
}
|
||||
|
||||
double Magick::ColorYUV::y(void) const
|
||||
{
|
||||
return scaleQuantumToDouble((0.29900 * redQuantum()) + (0.58700 *
|
||||
greenQuantum()) + (0.11400 * blueQuantum()));
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,984 @@
|
|||
// 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 <string>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
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()
|
||||
{
|
||||
if (_nested != (Exception *) NULL)
|
||||
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 BlobError:
|
||||
case BlobFatalError:
|
||||
return new ErrorBlob(message);
|
||||
case BlobWarning:
|
||||
return new WarningBlob(message);
|
||||
case CacheError:
|
||||
case CacheFatalError:
|
||||
return new ErrorCache(message);
|
||||
case CacheWarning:
|
||||
return new WarningCache(message);
|
||||
case CoderError:
|
||||
case CoderFatalError:
|
||||
return new ErrorCoder(message);
|
||||
case CoderWarning:
|
||||
return new WarningCoder(message);
|
||||
case ConfigureError:
|
||||
case ConfigureFatalError:
|
||||
return new ErrorConfigure(message);
|
||||
case ConfigureWarning:
|
||||
return new WarningConfigure(message);
|
||||
case CorruptImageError:
|
||||
case CorruptImageFatalError:
|
||||
return new ErrorCorruptImage(message);
|
||||
case CorruptImageWarning:
|
||||
return new WarningCorruptImage(message);
|
||||
case DelegateError:
|
||||
case DelegateFatalError:
|
||||
return new ErrorDelegate(message);
|
||||
case DelegateWarning:
|
||||
return new WarningDelegate(message);
|
||||
case DrawError:
|
||||
case DrawFatalError:
|
||||
return new ErrorDraw(message);
|
||||
case DrawWarning:
|
||||
return new WarningDraw(message);
|
||||
case FileOpenError:
|
||||
case FileOpenFatalError:
|
||||
return new ErrorFileOpen(message);
|
||||
case FileOpenWarning:
|
||||
return new WarningFileOpen(message);
|
||||
case ImageError:
|
||||
case ImageFatalError:
|
||||
return new ErrorImage(message);
|
||||
case ImageWarning:
|
||||
return new WarningImage(message);
|
||||
case MissingDelegateError:
|
||||
case MissingDelegateFatalError:
|
||||
return new ErrorMissingDelegate(message);
|
||||
case MissingDelegateWarning:
|
||||
return new WarningMissingDelegate(message);
|
||||
case ModuleError:
|
||||
case ModuleFatalError:
|
||||
return new ErrorModule(message);
|
||||
case ModuleWarning:
|
||||
return new WarningModule(message);
|
||||
case MonitorError:
|
||||
case MonitorFatalError:
|
||||
return new ErrorMonitor(message);
|
||||
case MonitorWarning:
|
||||
return new WarningMonitor(message);
|
||||
case OptionError:
|
||||
case OptionFatalError:
|
||||
return new ErrorOption(message);
|
||||
case OptionWarning:
|
||||
return new WarningOption(message);
|
||||
case PolicyWarning:
|
||||
return new WarningPolicy(message);
|
||||
case PolicyError:
|
||||
case PolicyFatalError:
|
||||
return new ErrorPolicy(message);
|
||||
case RegistryError:
|
||||
case RegistryFatalError:
|
||||
return new ErrorRegistry(message);
|
||||
case RegistryWarning:
|
||||
return new WarningRegistry(message);
|
||||
case ResourceLimitError:
|
||||
case ResourceLimitFatalError:
|
||||
return new ErrorResourceLimit(message);
|
||||
case ResourceLimitWarning:
|
||||
return new WarningResourceLimit(message);
|
||||
case StreamError:
|
||||
case StreamFatalError:
|
||||
return new ErrorStream(message);
|
||||
case StreamWarning:
|
||||
return new WarningStream(message);
|
||||
case TypeError:
|
||||
case TypeFatalError:
|
||||
return new ErrorType(message);
|
||||
case TypeWarning:
|
||||
return new WarningType(message);
|
||||
case UndefinedException:
|
||||
default:
|
||||
return new ErrorUndefined(message);
|
||||
case XServerError:
|
||||
case XServerFatalError:
|
||||
return new ErrorXServer(message);
|
||||
case XServerWarning:
|
||||
return new WarningXServer(message);
|
||||
}
|
||||
}
|
||||
|
||||
MagickPPExport void Magick::throwExceptionExplicit(
|
||||
const ExceptionType severity_,const char* reason_,const char* description_)
|
||||
{
|
||||
// Just return if there is no reported error
|
||||
if (severity_ == 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;
|
||||
|
||||
ExceptionType
|
||||
severity;
|
||||
|
||||
size_t
|
||||
index;
|
||||
|
||||
// Just return if there is no reported error
|
||||
if (exception_->severity == UndefinedException)
|
||||
return;
|
||||
|
||||
std::string 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 BlobError:
|
||||
case BlobFatalError:
|
||||
throw ErrorBlob(message,nestedException);
|
||||
case BlobWarning:
|
||||
throw WarningBlob(message,nestedException);
|
||||
case CacheError:
|
||||
case CacheFatalError:
|
||||
throw ErrorCache(message,nestedException);
|
||||
case CacheWarning:
|
||||
throw WarningCache(message,nestedException);
|
||||
case CoderError:
|
||||
case CoderFatalError:
|
||||
throw ErrorCoder(message,nestedException);
|
||||
case CoderWarning:
|
||||
throw WarningCoder(message,nestedException);
|
||||
case ConfigureError:
|
||||
case ConfigureFatalError:
|
||||
throw ErrorConfigure(message,nestedException);
|
||||
case ConfigureWarning:
|
||||
throw WarningConfigure(message,nestedException);
|
||||
case CorruptImageError:
|
||||
case CorruptImageFatalError:
|
||||
throw ErrorCorruptImage(message,nestedException);
|
||||
case CorruptImageWarning:
|
||||
throw WarningCorruptImage(message,nestedException);
|
||||
case DelegateError:
|
||||
case DelegateFatalError:
|
||||
throw ErrorDelegate(message,nestedException);
|
||||
case DelegateWarning:
|
||||
throw WarningDelegate(message,nestedException);
|
||||
case DrawError:
|
||||
case DrawFatalError:
|
||||
throw ErrorDraw(message,nestedException);
|
||||
case DrawWarning:
|
||||
throw WarningDraw(message,nestedException);
|
||||
case FileOpenError:
|
||||
case FileOpenFatalError:
|
||||
throw ErrorFileOpen(message,nestedException);
|
||||
case FileOpenWarning:
|
||||
throw WarningFileOpen(message,nestedException);
|
||||
case ImageError:
|
||||
case ImageFatalError:
|
||||
throw ErrorImage(message,nestedException);
|
||||
case ImageWarning:
|
||||
throw WarningImage(message,nestedException);
|
||||
case MissingDelegateError:
|
||||
case MissingDelegateFatalError:
|
||||
throw ErrorMissingDelegate(message,nestedException);
|
||||
case MissingDelegateWarning:
|
||||
throw WarningMissingDelegate(message,nestedException);
|
||||
case ModuleError:
|
||||
case ModuleFatalError:
|
||||
throw ErrorModule(message,nestedException);
|
||||
case ModuleWarning:
|
||||
throw WarningModule(message,nestedException);
|
||||
case MonitorError:
|
||||
case MonitorFatalError:
|
||||
throw ErrorMonitor(message,nestedException);
|
||||
case MonitorWarning:
|
||||
throw WarningMonitor(message,nestedException);
|
||||
case OptionError:
|
||||
case OptionFatalError:
|
||||
throw ErrorOption(message,nestedException);
|
||||
case OptionWarning:
|
||||
throw WarningOption(message,nestedException);
|
||||
case PolicyWarning:
|
||||
throw WarningPolicy(message,nestedException);
|
||||
case PolicyError:
|
||||
case PolicyFatalError:
|
||||
throw ErrorPolicy(message,nestedException);
|
||||
case RegistryError:
|
||||
case RegistryFatalError:
|
||||
throw ErrorRegistry(message,nestedException);
|
||||
case RegistryWarning:
|
||||
throw WarningRegistry(message,nestedException);
|
||||
case ResourceLimitError:
|
||||
case ResourceLimitFatalError:
|
||||
throw ErrorResourceLimit(message,nestedException);
|
||||
case ResourceLimitWarning:
|
||||
throw WarningResourceLimit(message,nestedException);
|
||||
case StreamError:
|
||||
case StreamFatalError:
|
||||
throw ErrorStream(message,nestedException);
|
||||
case StreamWarning:
|
||||
throw WarningStream(message,nestedException);
|
||||
case TypeError:
|
||||
case TypeFatalError:
|
||||
throw ErrorType(message,nestedException);
|
||||
case TypeWarning:
|
||||
throw WarningType(message,nestedException);
|
||||
case UndefinedException:
|
||||
default:
|
||||
throw ErrorUndefined(message,nestedException);
|
||||
case XServerError:
|
||||
case XServerFatalError:
|
||||
throw ErrorXServer(message,nestedException);
|
||||
case XServerWarning:
|
||||
throw WarningXServer(message,nestedException);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2002, 2003
|
||||
// Copyright Dirk Lemstra 2014-2016
|
||||
//
|
||||
// Simple C++ function wrappers for ImageMagick equivalents
|
||||
//
|
||||
|
||||
#define MAGICKCORE_IMPLEMENTATION 1
|
||||
#define MAGICK_PLUSPLUS_IMPLEMENTATION 1
|
||||
|
||||
#include "Magick++/Include.h"
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
#include "Magick++/Functions.h"
|
||||
#include "Magick++/Exception.h"
|
||||
|
||||
static bool magick_initialized=false;
|
||||
|
||||
MagickPPExport void Magick::CloneString(char **destination_,
|
||||
const std::string &source_)
|
||||
{
|
||||
MagickCore::CloneString(destination_,source_.c_str());
|
||||
}
|
||||
|
||||
MagickPPExport void Magick::DisableOpenCL(void)
|
||||
{
|
||||
GetPPException;
|
||||
MagickCore::InitImageMagickOpenCL(MagickCore::MAGICK_OPENCL_OFF,NULL,NULL,
|
||||
exceptionInfo);
|
||||
ThrowPPException(false);
|
||||
}
|
||||
|
||||
MagickPPExport bool Magick::EnableOpenCL(const bool useCache_)
|
||||
{
|
||||
bool
|
||||
status;
|
||||
|
||||
GetPPException;
|
||||
if (useCache_)
|
||||
status=MagickCore::InitImageMagickOpenCL(
|
||||
MagickCore::MAGICK_OPENCL_DEVICE_SELECT_AUTO,NULL,NULL,exceptionInfo) ==
|
||||
MagickTrue;
|
||||
else
|
||||
status=MagickCore::InitImageMagickOpenCL(
|
||||
MagickCore::MAGICK_OPENCL_DEVICE_SELECT_AUTO_CLEAR_CACHE,NULL,NULL,
|
||||
exceptionInfo) == MagickTrue;
|
||||
ThrowPPException(false);
|
||||
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 void Magick::TerminateMagick(void)
|
||||
{
|
||||
if (magick_initialized)
|
||||
{
|
||||
magick_initialized=false;
|
||||
MagickCore::MagickCoreTerminus();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,488 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003
|
||||
// Copyright Dirk Lemstra 2014
|
||||
//
|
||||
// Geometry implementation
|
||||
//
|
||||
|
||||
#define MAGICKCORE_IMPLEMENTATION 1
|
||||
#define MAGICK_PLUSPLUS_IMPLEMENTATION 1
|
||||
|
||||
#include "Magick++/Include.h"
|
||||
#include <string>
|
||||
#include <ctype.h> // for isdigit
|
||||
#if !defined(MAGICKCORE_WINDOWS_SUPPORT)
|
||||
#include <strings.h>
|
||||
#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_.xNegative() == right_.xNegative()) &&
|
||||
(left_.xOff() == right_.xOff()) &&
|
||||
(left_.yNegative() == right_.yNegative()) &&
|
||||
(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),
|
||||
_xNegative(false),
|
||||
_yNegative(false),
|
||||
_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),
|
||||
_xNegative(false),
|
||||
_yNegative(false),
|
||||
_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),
|
||||
_xNegative(geometry_._xNegative),
|
||||
_yNegative(geometry_._yNegative),
|
||||
_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),
|
||||
_xNegative(false),
|
||||
_yNegative(false),
|
||||
_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_,bool xNegative_,bool yNegative_)
|
||||
: _width(width_),
|
||||
_height(height_),
|
||||
_xOff(xOff_),
|
||||
_yOff(yOff_),
|
||||
_xNegative(xNegative_),
|
||||
_yNegative(yNegative_),
|
||||
_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;
|
||||
_xNegative=geometry_._xNegative;
|
||||
_yNegative=geometry_._yNegative;
|
||||
_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[MaxTextExtent];
|
||||
|
||||
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(),MaxTextExtent);
|
||||
if (geom[0] != '-' && geom[0] != '+' && geom[0] != 'x' &&
|
||||
!isdigit(static_cast<int>(geom[0])))
|
||||
{
|
||||
pageptr=GetPageGeometry(geom);
|
||||
if (pageptr != 0)
|
||||
{
|
||||
(void) CopyMagickString(geom,pageptr,MaxTextExtent);
|
||||
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<ssize_t>(x);
|
||||
isValid(true);
|
||||
}
|
||||
|
||||
if ((flags & YValue) != 0)
|
||||
{
|
||||
_yOff=static_cast<ssize_t>(y);
|
||||
isValid(true);
|
||||
}
|
||||
|
||||
if ((flags & XNegative) != 0)
|
||||
_xNegative=true;
|
||||
|
||||
if ((flags & YNegative) != 0)
|
||||
_yNegative=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[MaxTextExtent];
|
||||
|
||||
std::string
|
||||
geometry;
|
||||
|
||||
if (!isValid())
|
||||
throwExceptionExplicit(OptionError,"Invalid geometry argument");
|
||||
|
||||
if (_width)
|
||||
{
|
||||
FormatLocaleString(buffer,MaxTextExtent,"%.20g",(double) _width);
|
||||
geometry+=buffer;
|
||||
}
|
||||
|
||||
if (_height)
|
||||
{
|
||||
FormatLocaleString(buffer,MaxTextExtent,"%.20g",(double) _height);
|
||||
geometry+='x';
|
||||
geometry+=buffer;
|
||||
}
|
||||
|
||||
if (_xOff || _yOff)
|
||||
{
|
||||
if (_xNegative)
|
||||
geometry+='-';
|
||||
else
|
||||
geometry+='+';
|
||||
|
||||
FormatLocaleString(buffer,MaxTextExtent,"%.20g",(double) _xOff);
|
||||
geometry+=buffer;
|
||||
|
||||
if (_yNegative)
|
||||
geometry+='-';
|
||||
else
|
||||
geometry+='+';
|
||||
|
||||
FormatLocaleString(buffer,MaxTextExtent,"%.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);
|
||||
}
|
||||
|
||||
Magick::Geometry::Geometry(const MagickCore::RectangleInfo &rectangle_)
|
||||
: _width(static_cast<size_t>(rectangle_.width)),
|
||||
_height(static_cast<size_t>(rectangle_.height)),
|
||||
_xOff(static_cast<ssize_t>(rectangle_.x)),
|
||||
_yOff(static_cast<ssize_t>(rectangle_.y)),
|
||||
_xNegative(rectangle_.x < 0 ? true : false),
|
||||
_yNegative(rectangle_.y < 0 ? true : false),
|
||||
_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<size_t>(rectangle_.width),
|
||||
_height=static_cast<size_t>(rectangle_.height),
|
||||
_xOff=static_cast<ssize_t>(rectangle_.x),
|
||||
_yOff=static_cast<ssize_t>(rectangle_.y),
|
||||
_xNegative=rectangle_.x < 0 ? true : false,
|
||||
_yNegative=rectangle_.y < 0 ? true : false,
|
||||
_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=(ssize_t) geometry_info.rho;
|
||||
_y=(ssize_t) 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);
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,14 @@
|
|||
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: ImageMagick++
|
||||
Description: Magick++ - C++ API for ImageMagick (ABI @MAGICK_ABI_SUFFIX@)
|
||||
Version: @PACKAGE_VERSION@
|
||||
Requires: MagickWand-@MAGICK_MAJOR_VERSION@.@MAGICK_ABI_SUFFIX@
|
||||
Libs: -L${libdir} -l${libname}
|
||||
Libs.private: -L${libdir} -l${libname} @MAGICK_LIBS@ @MATH_LIBS@
|
||||
Cflags: -I${includearchdir} -I${includedir} @MAGICK_PCFLAGS@
|
|
@ -0,0 +1,70 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002
|
||||
// Copyright Dirk Lemstra 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),
|
||||
_options(new Options),
|
||||
_refCount(1),
|
||||
_mutexLock()
|
||||
{
|
||||
_image=AcquireImage(_options->imageInfo());
|
||||
throwException(&_image->exception);
|
||||
}
|
||||
|
||||
Magick::ImageRef::ImageRef(MagickCore::Image *image_)
|
||||
: _image(image_),
|
||||
_options(new Options),
|
||||
_refCount(1),
|
||||
_mutexLock()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::ImageRef::ImageRef(MagickCore::Image *image_,const Options *options_)
|
||||
: _image(image_),
|
||||
_options(0),
|
||||
_refCount(1),
|
||||
_mutexLock()
|
||||
{
|
||||
_options=new Options(*options_);
|
||||
}
|
||||
|
||||
Magick::ImageRef::~ImageRef(void)
|
||||
{
|
||||
// Deallocate image
|
||||
if (_image != (MagickCore::Image*) NULL)
|
||||
{
|
||||
DestroyImageList(_image);
|
||||
_image=(MagickCore::Image*) NULL;
|
||||
}
|
||||
|
||||
// Deallocate image options
|
||||
delete _options;
|
||||
_options=(Options *) NULL;
|
||||
}
|
||||
|
||||
void Magick::ImageRef::image(MagickCore::Image * image_)
|
||||
{
|
||||
if (_image != (MagickCore::Image*) NULL)
|
||||
DestroyImageList(_image);
|
||||
_image=image_;
|
||||
}
|
||||
|
||||
void Magick::ImageRef::options(Magick::Options *options_)
|
||||
{
|
||||
delete _options;
|
||||
_options=options_;
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
// 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 <Magick++/Include.h>
|
||||
#include <Magick++/Functions.h>
|
||||
#include <Magick++/Image.h>
|
||||
#include <Magick++/Pixels.h>
|
||||
#include <Magick++/ResourceLimits.h>
|
||||
#include <Magick++/STL.h>
|
||||
|
||||
// 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
|
|
@ -0,0 +1,14 @@
|
|||
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} @MAGICK_LIBS@ @MATH_LIBS@
|
||||
Cflags: -I${includearchdir} -I${includedir} @MAGICK_PCFLAGS@
|
|
@ -0,0 +1,80 @@
|
|||
// 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 <string>
|
||||
|
||||
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);
|
||||
|
||||
// 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_,
|
||||
Allocator allocator_=NewAllocator);
|
||||
|
||||
private:
|
||||
BlobRef *_blobRef;
|
||||
};
|
||||
|
||||
} // namespace Magick
|
||||
|
||||
#endif // Magick_BlobRef_header
|
|
@ -0,0 +1,44 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002
|
||||
// Copyright Dirk Lemstra 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);
|
||||
|
||||
void* _data; // Blob data
|
||||
size_t _length; // Blob length
|
||||
Blob::Allocator _allocator; // Memory allocation system in use
|
||||
::ssize_t _refCount; // Reference count
|
||||
MutexLock _mutexLock; // Mutex lock
|
||||
|
||||
private:
|
||||
// Copy constructor and assignment are not supported
|
||||
BlobRef(const BlobRef&);
|
||||
BlobRef& operator=(const BlobRef&);
|
||||
};
|
||||
|
||||
} // namespace Magick
|
||||
|
||||
#endif // Magick_Blob_header
|
|
@ -0,0 +1,103 @@
|
|||
// 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 <vector>
|
||||
|
||||
namespace Magick
|
||||
{
|
||||
class Image;
|
||||
|
||||
class MagickPPExport ChannelMoments
|
||||
{
|
||||
public:
|
||||
|
||||
// Default constructor
|
||||
ChannelMoments(void);
|
||||
|
||||
// Copy constructor
|
||||
ChannelMoments(const ChannelMoments &channelMoments_);
|
||||
|
||||
// Destroy channel moments
|
||||
~ChannelMoments(void);
|
||||
|
||||
//
|
||||
// Implemementation methods
|
||||
//
|
||||
|
||||
ChannelMoments(const ChannelType channel_,
|
||||
const MagickCore::ChannelMoments *channelMoments_);
|
||||
|
||||
// X position of centroid
|
||||
double centroidX(void) const;
|
||||
|
||||
// Y position of centroid
|
||||
double centroidY(void) const;
|
||||
|
||||
// The channel
|
||||
ChannelType 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;
|
||||
|
||||
private:
|
||||
std::vector<double> _huInvariants;
|
||||
ChannelType _channel;
|
||||
double _centroidX;
|
||||
double _centroidY;
|
||||
double _ellipseAxisX;
|
||||
double _ellipseAxisY;
|
||||
double _ellipseAngle;
|
||||
double _ellipseEccentricity;
|
||||
double _ellipseIntensity;
|
||||
};
|
||||
|
||||
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 ChannelType channel_=CompositeChannels) const;
|
||||
|
||||
//
|
||||
// Implemementation methods
|
||||
//
|
||||
ImageMoments(const Image &image_);
|
||||
|
||||
private:
|
||||
std::vector<ChannelMoments> _channels;
|
||||
};
|
||||
}
|
||||
|
||||
#endif // Magick_ChannelMoments_header
|
|
@ -0,0 +1,81 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 2001, 2002
|
||||
// Copyright Dirk Lemstra 2013-2014
|
||||
//
|
||||
// CoderInfo Definition
|
||||
//
|
||||
// Container for image format support information.
|
||||
//
|
||||
|
||||
#if !defined (Magick_CoderInfo_header)
|
||||
#define Magick_CoderInfo_header 1
|
||||
|
||||
#include "Magick++/Include.h"
|
||||
#include <string>
|
||||
|
||||
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 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;
|
||||
|
||||
// Format name
|
||||
std::string name(void) const;
|
||||
|
||||
// Unregisters this coder
|
||||
bool unregister(void) const;
|
||||
|
||||
//
|
||||
// Implemementation methods
|
||||
//
|
||||
CoderInfo(const MagickCore::MagickInfo *magickInfo_);
|
||||
|
||||
private:
|
||||
std::string _name;
|
||||
std::string _description;
|
||||
std::string _mimeType;
|
||||
bool _isReadable;
|
||||
bool _isWritable;
|
||||
bool _isMultiFrame;
|
||||
};
|
||||
|
||||
} // namespace Magick
|
||||
|
||||
#endif // Magick_CoderInfo_header
|
|
@ -0,0 +1,524 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003, 2008
|
||||
//
|
||||
// Color Implementation
|
||||
//
|
||||
#if !defined (Magick_Color_header)
|
||||
#define Magick_Color_header
|
||||
|
||||
#include "Magick++/Include.h"
|
||||
#include <string>
|
||||
|
||||
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 RGB components scaled to fit Quantum
|
||||
class MagickPPExport Color
|
||||
{
|
||||
public:
|
||||
|
||||
// Default constructor
|
||||
Color(void);
|
||||
|
||||
// Construct Color using the specified RGB values
|
||||
Color(Magick::Quantum red_,Magick::Quantum green_,Magick::Quantum blue_);
|
||||
|
||||
// Construct Color using the specified RGBA values
|
||||
Color(Magick::Quantum red_,Magick::Quantum green_,Magick::Quantum blue_,Magick::Quantum alpha_);
|
||||
|
||||
// Construct Color using the specified color string
|
||||
Color(const char *x11color_);
|
||||
|
||||
// Copy constructor
|
||||
Color(const Color &color_);
|
||||
|
||||
// Construct color via ImageMagick PixelPacket
|
||||
Color(const PixelPacket &color_);
|
||||
|
||||
// Constructor Color using the specified color string
|
||||
Color(const std::string &x11color_);
|
||||
|
||||
// Destructor
|
||||
virtual ~Color(void);
|
||||
|
||||
// Assignment operator
|
||||
Color& operator=(const Color& color_);
|
||||
|
||||
// Set color via X11 color specification string
|
||||
const Color& operator=(const char *x11color);
|
||||
|
||||
// Set color via X11 color specification string
|
||||
const Color& operator=(const std::string &x11color_);
|
||||
|
||||
// Set color via ImageMagick PixelPacket
|
||||
const Color& operator=(const PixelPacket &color_);
|
||||
|
||||
// Return ImageMagick PixelPacket
|
||||
operator PixelPacket() const;
|
||||
|
||||
// Return X11 color specification string
|
||||
operator std::string() const;
|
||||
|
||||
// Scaled (to 1.0) version of alpha for use in sub-classes
|
||||
// (range opaque=0 to transparent=1.0)
|
||||
void alpha(double alpha_);
|
||||
double alpha(void) const;
|
||||
|
||||
// Alpha level (range OpaqueOpacity=0 to TransparentOpacity=QuantumRange)
|
||||
void alphaQuantum(Quantum alpha_);
|
||||
Quantum alphaQuantum(void) const;
|
||||
|
||||
// Blue color (range 0 to QuantumRange)
|
||||
void blueQuantum(Quantum blue_);
|
||||
Quantum blueQuantum (void) const;
|
||||
|
||||
// Green color (range 0 to QuantumRange)
|
||||
void greenQuantum(Quantum green_);
|
||||
Quantum greenQuantum(void) const;
|
||||
|
||||
// Does object contain valid color?
|
||||
void isValid(bool valid_);
|
||||
bool isValid(void) const;
|
||||
|
||||
// Red color (range 0 to QuantumRange)
|
||||
void redQuantum(Quantum red_);
|
||||
Quantum redQuantum (void) const;
|
||||
|
||||
//
|
||||
// Public methods beyond this point are for Magick++ use only.
|
||||
//
|
||||
|
||||
// Obtain pixel intensity as a double
|
||||
double intensity(void) const
|
||||
{
|
||||
return (0.299*(_pixel->red)+0.587*(_pixel->green)+0.114*(_pixel->blue));
|
||||
}
|
||||
|
||||
// Scale a value expressed as a double (0-1) to Quantum range (0-QuantumRange)
|
||||
static Quantum scaleDoubleToQuantum(const double double_)
|
||||
{
|
||||
return (static_cast<Magick::Quantum>(double_*QuantumRange));
|
||||
}
|
||||
|
||||
// Scale a value expressed as a Quantum (0-QuantumRange) to double range (0-1)
|
||||
#if (MAGICKCORE_QUANTUM_DEPTH < 32) && (MAGICKCORE_SIZEOF_FLOAT_T != MAGICKCORE_SIZEOF_DOUBLE || !defined(MAGICKCORE_HDRI_SUPPORT))
|
||||
static double scaleQuantumToDouble(const Quantum quantum_)
|
||||
{
|
||||
return (static_cast<double>(quantum_)/QuantumRange);
|
||||
}
|
||||
#else
|
||||
static double scaleQuantumToDouble(const double quantum_)
|
||||
{
|
||||
return (quantum_/QuantumRange);
|
||||
}
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
||||
// PixelType specifies the interpretation of PixelPacket members
|
||||
// RGBPixel:
|
||||
// Red = red;
|
||||
// Green = green;
|
||||
// Blue = blue;
|
||||
// RGBAPixel:
|
||||
// Red = red;
|
||||
// Green = green;
|
||||
// Blue = blue;
|
||||
// Alpha = opacity;
|
||||
// CYMKPixel:
|
||||
// Cyan = red
|
||||
// Yellow = green
|
||||
// Magenta = blue
|
||||
// Black(K) = opacity
|
||||
enum PixelType
|
||||
{
|
||||
RGBPixel,
|
||||
RGBAPixel,
|
||||
CYMKPixel
|
||||
};
|
||||
|
||||
// Constructor to construct with PixelPacket*
|
||||
// Used to point Color at a pixel in an image
|
||||
Color(PixelPacket *rep_,PixelType pixelType_);
|
||||
|
||||
// Set pixel
|
||||
// Used to point Color at a pixel in an image
|
||||
void pixel(PixelPacket *rep_,PixelType pixelType_);
|
||||
|
||||
// PixelPacket represents a color pixel:
|
||||
// red = red (range 0 to QuantumRange)
|
||||
// green = green (range 0 to QuantumRange)
|
||||
// blue = blue (range 0 to QuantumRange)
|
||||
// opacity = alpha (range OpaqueOpacity=0 to TransparentOpacity=QuantumRange)
|
||||
// index = PseudoColor colormap index
|
||||
PixelPacket *_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 PixelPacket representation
|
||||
void initPixel();
|
||||
};
|
||||
|
||||
//
|
||||
// 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(double shade_);
|
||||
|
||||
// Destructor
|
||||
~ColorGray();
|
||||
|
||||
void shade(double shade_);
|
||||
double shade(void) const;
|
||||
|
||||
// Assignment operator from base class
|
||||
ColorGray& operator=(const Color& color_);
|
||||
|
||||
protected:
|
||||
|
||||
// Constructor to construct with PixelPacket*
|
||||
ColorGray(PixelPacket *rep_,PixelType pixelType_);
|
||||
};
|
||||
|
||||
//
|
||||
// HSL Colorspace colors
|
||||
//
|
||||
class MagickPPExport ColorHSL: public Color
|
||||
{
|
||||
public:
|
||||
|
||||
// Default constructor
|
||||
ColorHSL(void);
|
||||
|
||||
// Copy constructor
|
||||
ColorHSL(const Color &color_);
|
||||
|
||||
// Construct ColorHSL using the specified HSL values
|
||||
ColorHSL(double hue_,double saturation_,double luminosity_);
|
||||
|
||||
// Destructor
|
||||
~ColorHSL();
|
||||
|
||||
// Assignment operator from base class
|
||||
ColorHSL& operator=(const Color& color_);
|
||||
|
||||
// Hue color
|
||||
void hue(double hue_);
|
||||
double hue(void) const;
|
||||
|
||||
// Luminosity color
|
||||
void luminosity(double luminosity_);
|
||||
double luminosity(void) const;
|
||||
|
||||
// Saturation color
|
||||
void saturation(double saturation_);
|
||||
double saturation(void) const;
|
||||
|
||||
protected:
|
||||
|
||||
// Constructor to construct with PixelPacket*
|
||||
ColorHSL(PixelPacket *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(bool mono_);
|
||||
|
||||
// Copy constructor
|
||||
ColorMono(const Color & color_);
|
||||
|
||||
// Destructor
|
||||
~ColorMono();
|
||||
|
||||
// Assignment operator from base class
|
||||
ColorMono& operator=(const Color& color_);
|
||||
|
||||
// Mono color
|
||||
void mono(bool mono_);
|
||||
bool mono(void) const;
|
||||
|
||||
protected:
|
||||
// Constructor to construct with PixelPacket*
|
||||
ColorMono(PixelPacket *rep_,PixelType pixelType_);
|
||||
};
|
||||
|
||||
//
|
||||
// RGB color
|
||||
//
|
||||
// All color arguments have a valid range of 0.0 - 1.0.
|
||||
class MagickPPExport ColorRGB: public Color
|
||||
{
|
||||
public:
|
||||
|
||||
// Default constructor
|
||||
ColorRGB(void);
|
||||
|
||||
// Copy constructor
|
||||
ColorRGB(const Color &color_);
|
||||
|
||||
// Construct ColorRGB using the specified RGB values
|
||||
ColorRGB(double red_,double green_,double blue_);
|
||||
|
||||
// Destructor
|
||||
~ColorRGB(void);
|
||||
|
||||
// Assignment operator from base class
|
||||
ColorRGB& operator=(const Color& color_);
|
||||
|
||||
// Blue color
|
||||
void blue(double blue_);
|
||||
double blue(void) const;
|
||||
|
||||
// Green color
|
||||
void green(double green_);
|
||||
double green(void) const;
|
||||
|
||||
// Red color
|
||||
void red(double red_);
|
||||
double red(void) const;
|
||||
|
||||
protected:
|
||||
|
||||
// Constructor to construct with PixelPacket*
|
||||
ColorRGB(PixelPacket *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(double y_,double u_,double v_);
|
||||
|
||||
// Destructor
|
||||
~ColorYUV(void);
|
||||
|
||||
// Assignment operator from base class
|
||||
ColorYUV& operator=(const Color& color_);
|
||||
|
||||
// Color U (0.0 through 1.0)
|
||||
void u(double u_);
|
||||
double u(void) const;
|
||||
|
||||
// Color V (-0.5 through 0.5)
|
||||
void v(double v_);
|
||||
double v(void) const;
|
||||
|
||||
// Color Y (-0.5 through 0.5)
|
||||
void y(double y_);
|
||||
double y(void) const;
|
||||
|
||||
protected:
|
||||
|
||||
// Constructor to construct with PixelInfo*
|
||||
ColorYUV(PixelPacket *rep_,PixelType pixelType_);
|
||||
};
|
||||
} // namespace Magick
|
||||
|
||||
//
|
||||
// Inlines
|
||||
//
|
||||
|
||||
//
|
||||
// Color
|
||||
//
|
||||
|
||||
inline void Magick::Color::alpha(double alpha_)
|
||||
{
|
||||
alphaQuantum(scaleDoubleToQuantum(alpha_));
|
||||
}
|
||||
inline double Magick::Color::alpha(void) const
|
||||
{
|
||||
return scaleQuantumToDouble(alphaQuantum());
|
||||
}
|
||||
|
||||
inline void Magick::Color::alphaQuantum(Magick::Quantum alpha_)
|
||||
{
|
||||
_pixel->opacity=alpha_;
|
||||
_isValid=true ;
|
||||
}
|
||||
|
||||
inline Magick::Quantum Magick::Color::alphaQuantum(void) const
|
||||
{
|
||||
return _pixel->opacity;
|
||||
}
|
||||
|
||||
inline void Magick::Color::blueQuantum(Magick::Quantum blue_)
|
||||
{
|
||||
_pixel->blue=blue_;
|
||||
_isValid=true;
|
||||
}
|
||||
|
||||
inline Magick::Quantum Magick::Color::blueQuantum(void) const
|
||||
{
|
||||
return _pixel->blue;
|
||||
}
|
||||
|
||||
inline void Magick::Color::greenQuantum(Magick::Quantum green_)
|
||||
{
|
||||
_pixel->green=green_;
|
||||
_isValid=true;
|
||||
}
|
||||
|
||||
inline Magick::Quantum Magick::Color::greenQuantum(void) const
|
||||
{
|
||||
return _pixel->green;
|
||||
}
|
||||
|
||||
inline void Magick::Color::redQuantum(Magick::Quantum red_)
|
||||
{
|
||||
_pixel->red=red_;
|
||||
_isValid=true;
|
||||
}
|
||||
|
||||
inline Magick::Quantum Magick::Color::redQuantum(void) const
|
||||
{
|
||||
return _pixel->red;
|
||||
}
|
||||
|
||||
inline void Magick::Color::initPixel()
|
||||
{
|
||||
_pixel->red=0;
|
||||
_pixel->green=0;
|
||||
_pixel->blue=0;
|
||||
_pixel->opacity=TransparentOpacity;
|
||||
}
|
||||
|
||||
inline Magick::Color::operator MagickCore::PixelPacket() const
|
||||
{
|
||||
return *_pixel;
|
||||
}
|
||||
|
||||
//
|
||||
// ColorGray
|
||||
//
|
||||
inline Magick::ColorGray::ColorGray(Magick::PixelPacket *rep_,
|
||||
Magick::Color::PixelType pixelType_)
|
||||
: Color(rep_,pixelType_)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
// ColorHSL
|
||||
//
|
||||
inline Magick::ColorHSL::ColorHSL(Magick::PixelPacket *rep_,
|
||||
Magick::Color::PixelType pixelType_)
|
||||
: Color(rep_,pixelType_)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
// ColorMono
|
||||
//
|
||||
inline Magick::ColorMono::ColorMono(Magick::PixelPacket *rep_,
|
||||
Magick::Color::PixelType pixelType_)
|
||||
: Color(rep_,pixelType_)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
// ColorRGB
|
||||
//
|
||||
inline Magick::ColorRGB::ColorRGB(Magick::PixelPacket *rep_,
|
||||
Magick::Color::PixelType pixelType_)
|
||||
: Color(rep_,pixelType_)
|
||||
{
|
||||
}
|
||||
|
||||
inline void Magick::ColorRGB::blue(double blue_)
|
||||
{
|
||||
blueQuantum(scaleDoubleToQuantum(blue_));
|
||||
}
|
||||
|
||||
inline double Magick::ColorRGB::blue(void) const
|
||||
{
|
||||
return scaleQuantumToDouble(blueQuantum());
|
||||
}
|
||||
|
||||
inline void Magick::ColorRGB::green(double green_)
|
||||
{
|
||||
greenQuantum(scaleDoubleToQuantum(green_));
|
||||
}
|
||||
|
||||
inline double Magick::ColorRGB::green(void) const
|
||||
{
|
||||
return scaleQuantumToDouble(greenQuantum());
|
||||
}
|
||||
|
||||
inline void Magick::ColorRGB::red(double red_)
|
||||
{
|
||||
redQuantum(scaleDoubleToQuantum(red_));
|
||||
}
|
||||
|
||||
inline double Magick::ColorRGB::red(void) const
|
||||
{
|
||||
return scaleQuantumToDouble(redQuantum());
|
||||
}
|
||||
|
||||
//
|
||||
// ColorYUV
|
||||
//
|
||||
|
||||
inline Magick::ColorYUV::ColorYUV(Magick::PixelPacket *rep_,
|
||||
Magick::Color::PixelType pixelType_)
|
||||
: Color(rep_,pixelType_)
|
||||
{
|
||||
}
|
||||
|
||||
#endif // Magick_Color_header
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,425 @@
|
|||
// 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 <string>
|
||||
#include <exception>
|
||||
|
||||
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
|
|
@ -0,0 +1,37 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2003
|
||||
// Copyright Dirk Lemstra 2014
|
||||
//
|
||||
// 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 <string>
|
||||
|
||||
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(const bool useCache_=true);
|
||||
|
||||
// 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);
|
||||
|
||||
// C library initialization routine
|
||||
MagickPPExport void TerminateMagick();
|
||||
}
|
||||
#endif // Magick_Functions_header
|
|
@ -0,0 +1,344 @@
|
|||
// 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 <string>
|
||||
|
||||
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,bool xNegative_=false,bool yNegative_=false);
|
||||
|
||||
// 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;
|
||||
|
||||
// Sign of X offset negative? (X origin at right)
|
||||
void xNegative(bool xNegative_);
|
||||
bool xNegative(void) const;
|
||||
|
||||
// X offset from origin
|
||||
void xOff(::ssize_t xOff_);
|
||||
::ssize_t xOff(void) const;
|
||||
|
||||
// Sign of Y offset negative? (Y origin at bottom)
|
||||
void yNegative(bool yNegative_);
|
||||
bool yNegative(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 _xNegative;
|
||||
bool _yNegative;
|
||||
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;
|
||||
};
|
||||
} // namespace Magick
|
||||
|
||||
//
|
||||
// Inlines
|
||||
//
|
||||
|
||||
inline void Magick::Geometry::aspect(bool aspect_)
|
||||
{
|
||||
_aspect=aspect_;
|
||||
}
|
||||
|
||||
inline bool Magick::Geometry::aspect(void) const
|
||||
{
|
||||
return(_aspect);
|
||||
}
|
||||
|
||||
inline void Magick::Geometry::fillArea(bool fillArea_)
|
||||
{
|
||||
_fillArea=fillArea_;
|
||||
}
|
||||
|
||||
inline bool Magick::Geometry::fillArea(void) const
|
||||
{
|
||||
return(_fillArea);
|
||||
}
|
||||
|
||||
inline void Magick::Geometry::greater(bool greater_)
|
||||
{
|
||||
_greater=greater_;
|
||||
}
|
||||
|
||||
inline bool Magick::Geometry::greater(void) const
|
||||
{
|
||||
return(_greater);
|
||||
}
|
||||
|
||||
inline void Magick::Geometry::height(size_t height_)
|
||||
{
|
||||
_height=height_;
|
||||
}
|
||||
|
||||
inline size_t Magick::Geometry::height(void) const
|
||||
{
|
||||
return(_height);
|
||||
}
|
||||
|
||||
inline void Magick::Geometry::isValid(bool isValid_)
|
||||
{
|
||||
_isValid=isValid_;
|
||||
}
|
||||
|
||||
inline bool Magick::Geometry::isValid(void) const
|
||||
{
|
||||
return(_isValid);
|
||||
}
|
||||
|
||||
inline void Magick::Geometry::less(bool less_)
|
||||
{
|
||||
_less=less_;
|
||||
}
|
||||
|
||||
inline bool Magick::Geometry::less(void) const
|
||||
{
|
||||
return(_less);
|
||||
}
|
||||
|
||||
inline void Magick::Geometry::limitPixels(bool limitPixels_)
|
||||
{
|
||||
_limitPixels=limitPixels_;
|
||||
}
|
||||
|
||||
inline bool Magick::Geometry::limitPixels(void) const
|
||||
{
|
||||
return(_limitPixels);
|
||||
}
|
||||
|
||||
inline void Magick::Geometry::width(size_t width_)
|
||||
{
|
||||
_width=width_;
|
||||
isValid(true);
|
||||
}
|
||||
|
||||
inline void Magick::Geometry::percent(bool percent_)
|
||||
{
|
||||
_percent = percent_;
|
||||
}
|
||||
|
||||
inline bool Magick::Geometry::percent(void) const
|
||||
{
|
||||
return(_percent);
|
||||
}
|
||||
|
||||
inline size_t Magick::Geometry::width(void) const
|
||||
{
|
||||
return(_width);
|
||||
}
|
||||
|
||||
inline void Magick::Geometry::xNegative(bool xNegative_)
|
||||
{
|
||||
_xNegative=xNegative_;
|
||||
}
|
||||
|
||||
inline bool Magick::Geometry::xNegative(void) const
|
||||
{
|
||||
return(_xNegative);
|
||||
}
|
||||
|
||||
inline void Magick::Geometry::xOff(::ssize_t xOff_)
|
||||
{
|
||||
_xOff=xOff_;
|
||||
}
|
||||
|
||||
inline ::ssize_t Magick::Geometry::xOff(void) const
|
||||
{
|
||||
return(_xOff);
|
||||
}
|
||||
|
||||
inline void Magick::Geometry::yNegative(bool yNegative_)
|
||||
{
|
||||
_yNegative=yNegative_;
|
||||
}
|
||||
|
||||
inline bool Magick::Geometry::yNegative(void) const
|
||||
{
|
||||
return(_yNegative);
|
||||
}
|
||||
|
||||
inline void Magick::Geometry::yOff(::ssize_t yOff_)
|
||||
{
|
||||
_yOff=yOff_;
|
||||
}
|
||||
|
||||
inline ::ssize_t Magick::Geometry::yOff(void) const
|
||||
{
|
||||
return(_yOff);
|
||||
}
|
||||
|
||||
#endif // Magick_Geometry_header
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,77 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002
|
||||
// Copyright Dirk Lemstra 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 "Magick++/Include.h"
|
||||
#include "Magick++/Thread.h"
|
||||
|
||||
namespace Magick
|
||||
{
|
||||
class Options;
|
||||
|
||||
//
|
||||
// Reference counted access to Image *
|
||||
//
|
||||
class MagickPPExport ImageRef
|
||||
{
|
||||
friend class Image;
|
||||
|
||||
private:
|
||||
|
||||
// Construct with null image and default options
|
||||
ImageRef(void);
|
||||
|
||||
// Construct with an image pointer and default options
|
||||
ImageRef(MagickCore::Image *image_);
|
||||
|
||||
// Construct with an image pointer and options
|
||||
ImageRef(MagickCore::Image *image_,const Options *options_);
|
||||
|
||||
// Destroy image and options
|
||||
~ImageRef(void);
|
||||
|
||||
// Copy constructor and assignment are not supported
|
||||
ImageRef(const ImageRef&);
|
||||
ImageRef& operator=(const ImageRef&);
|
||||
|
||||
// Retrieve image from reference
|
||||
void image(MagickCore::Image *image_);
|
||||
MagickCore::Image *&image(void);
|
||||
|
||||
// Retrieve Options from reference
|
||||
void options(Options *options_);
|
||||
Options *options(void);
|
||||
|
||||
MagickCore::Image *_image; // ImageMagick Image
|
||||
Options *_options; // User-specified options
|
||||
::ssize_t _refCount; // Reference count
|
||||
MutexLock _mutexLock; // Mutex lock
|
||||
};
|
||||
|
||||
} // end of namespace Magick
|
||||
|
||||
//
|
||||
// Inlines
|
||||
//
|
||||
|
||||
inline MagickCore::Image *&Magick::ImageRef::image(void)
|
||||
{
|
||||
return(_image);
|
||||
}
|
||||
|
||||
inline Magick::Options *Magick::ImageRef::options(void)
|
||||
{
|
||||
return(_options);
|
||||
}
|
||||
|
||||
#endif // Magick_ImageRef_header
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,373 @@
|
|||
// 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 <string>
|
||||
#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;
|
||||
|
||||
// Same as fill color
|
||||
void penColor(const Color &pen_);
|
||||
Color penColor(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;
|
||||
CompositeOperator _compose;
|
||||
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 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;
|
||||
|
||||
// Frame foreground color
|
||||
void matteColor(const Color &matteColor_);
|
||||
Color matteColor(void) const;
|
||||
|
||||
//
|
||||
// Implementation methods/members
|
||||
//
|
||||
|
||||
// Update elements in existing MontageInfo structure
|
||||
void updateMontageInfo(MagickCore::MontageInfo &montageInfo_) const;
|
||||
|
||||
private:
|
||||
|
||||
Color _borderColor;
|
||||
size_t _borderWidth;
|
||||
Geometry _frame;
|
||||
Color _matteColor;
|
||||
};
|
||||
} // namespace Magick
|
||||
|
||||
//
|
||||
// Inlines
|
||||
//
|
||||
|
||||
//
|
||||
// Implementation of Montage
|
||||
//
|
||||
|
||||
inline void Magick::Montage::backgroundColor(const Magick::Color &backgroundColor_)
|
||||
{
|
||||
_backgroundColor=backgroundColor_;
|
||||
}
|
||||
|
||||
inline Magick::Color Magick::Montage::backgroundColor(void) const
|
||||
{
|
||||
return(_backgroundColor);
|
||||
}
|
||||
|
||||
inline void Magick::Montage::compose(Magick::CompositeOperator compose_)
|
||||
{
|
||||
_compose=compose_;
|
||||
}
|
||||
|
||||
inline Magick::CompositeOperator Magick::Montage::compose(void) const
|
||||
{
|
||||
return(_compose);
|
||||
}
|
||||
|
||||
inline void Magick::Montage::fileName(const std::string &fileName_)
|
||||
{
|
||||
_fileName=fileName_;
|
||||
}
|
||||
|
||||
inline std::string Magick::Montage::fileName(void) const
|
||||
{
|
||||
return(_fileName);
|
||||
}
|
||||
|
||||
inline void Magick::Montage::fillColor(const Color &fill_)
|
||||
{
|
||||
_fill=fill_;
|
||||
}
|
||||
|
||||
inline Magick::Color Magick::Montage::fillColor(void) const
|
||||
{
|
||||
return(_fill);
|
||||
}
|
||||
|
||||
inline void Magick::Montage::font(const std::string &font_)
|
||||
{
|
||||
_font=font_;
|
||||
}
|
||||
|
||||
inline std::string Magick::Montage::font(void) const
|
||||
{
|
||||
return(_font);
|
||||
}
|
||||
|
||||
inline void Magick::Montage::geometry(const Magick::Geometry &geometry_)
|
||||
{
|
||||
_geometry=geometry_;
|
||||
}
|
||||
|
||||
inline Magick::Geometry Magick::Montage::geometry(void) const
|
||||
{
|
||||
return(_geometry);
|
||||
}
|
||||
|
||||
inline void Magick::Montage::gravity(Magick::GravityType gravity_)
|
||||
{
|
||||
_gravity=gravity_;
|
||||
}
|
||||
|
||||
inline Magick::GravityType Magick::Montage::gravity(void) const
|
||||
{
|
||||
return(_gravity);
|
||||
}
|
||||
|
||||
inline void Magick::Montage::label(const std::string &label_)
|
||||
{
|
||||
_label=label_;
|
||||
}
|
||||
|
||||
inline std::string Magick::Montage::label(void) const
|
||||
{
|
||||
return(_label);
|
||||
}
|
||||
|
||||
inline void Magick::Montage::penColor(const Color &pen_)
|
||||
{
|
||||
_fill=pen_;
|
||||
_stroke=Color("none");
|
||||
}
|
||||
|
||||
inline Magick::Color Magick::Montage::penColor(void) const
|
||||
{
|
||||
return _fill;
|
||||
}
|
||||
|
||||
inline void Magick::Montage::pointSize(size_t pointSize_)
|
||||
{
|
||||
_pointSize=pointSize_;
|
||||
}
|
||||
|
||||
inline size_t Magick::Montage::pointSize(void) const
|
||||
{
|
||||
return(_pointSize);
|
||||
}
|
||||
|
||||
inline void Magick::Montage::shadow(bool shadow_)
|
||||
{
|
||||
_shadow=shadow_;
|
||||
}
|
||||
|
||||
inline bool Magick::Montage::shadow(void) const
|
||||
{
|
||||
return(_shadow);
|
||||
}
|
||||
|
||||
inline void Magick::Montage::strokeColor(const Color &stroke_)
|
||||
{
|
||||
_stroke=stroke_;
|
||||
}
|
||||
|
||||
inline Magick::Color Magick::Montage::strokeColor(void) const
|
||||
{
|
||||
return(_stroke);
|
||||
}
|
||||
|
||||
inline void Magick::Montage::texture(const std::string &texture_)
|
||||
{
|
||||
_texture=texture_;
|
||||
}
|
||||
|
||||
inline std::string Magick::Montage::texture(void) const
|
||||
{
|
||||
return(_texture);
|
||||
}
|
||||
|
||||
inline void Magick::Montage::tile(const Geometry &tile_)
|
||||
{
|
||||
_tile=tile_;
|
||||
}
|
||||
|
||||
inline Magick::Geometry Magick::Montage::tile(void) const
|
||||
{
|
||||
return(_tile);
|
||||
}
|
||||
|
||||
inline void Magick::Montage::title(const std::string &title_)
|
||||
{
|
||||
_title=title_;
|
||||
}
|
||||
|
||||
inline std::string Magick::Montage::title(void) const
|
||||
{
|
||||
return(_title);
|
||||
}
|
||||
|
||||
inline void Magick::Montage::transparentColor(const Magick::Color &transparentColor_)
|
||||
{
|
||||
_transparentColor=transparentColor_;
|
||||
}
|
||||
|
||||
inline Magick::Color Magick::Montage::transparentColor(void) const
|
||||
{
|
||||
return(_transparentColor);
|
||||
}
|
||||
|
||||
//
|
||||
// Implementation of MontageFramed
|
||||
//
|
||||
|
||||
inline void Magick::MontageFramed::borderColor(const Magick::Color &borderColor_)
|
||||
{
|
||||
_borderColor=borderColor_;
|
||||
}
|
||||
|
||||
inline Magick::Color Magick::MontageFramed::borderColor(void) const
|
||||
{
|
||||
return(_borderColor);
|
||||
}
|
||||
|
||||
inline void Magick::MontageFramed::borderWidth(size_t borderWidth_)
|
||||
{
|
||||
_borderWidth=borderWidth_;
|
||||
}
|
||||
|
||||
inline size_t Magick::MontageFramed::borderWidth(void) const
|
||||
{
|
||||
return(_borderWidth);
|
||||
}
|
||||
|
||||
inline void Magick::MontageFramed::frameGeometry(const Magick::Geometry &frame_)
|
||||
{
|
||||
_frame=frame_;
|
||||
}
|
||||
|
||||
inline Magick::Geometry Magick::MontageFramed::frameGeometry(void) const
|
||||
{
|
||||
return(_frame);
|
||||
}
|
||||
|
||||
inline void Magick::MontageFramed::matteColor(const Magick::Color &matteColor_)
|
||||
{
|
||||
_matteColor=matteColor_;
|
||||
}
|
||||
|
||||
inline Magick::Color Magick::MontageFramed::matteColor(void) const
|
||||
{
|
||||
return(_matteColor);
|
||||
}
|
||||
|
||||
#endif // Magick_Montage_header
|
|
@ -0,0 +1,352 @@
|
|||
// 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 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 <string>
|
||||
#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();
|
||||
|
||||
// Remove pixel aliasing
|
||||
void antiAlias(bool flag_);
|
||||
bool antiAlias(void) const;
|
||||
|
||||
// Join images into a single multi-image file
|
||||
void adjoin(bool flag_);
|
||||
bool adjoin(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(double fuzz_);
|
||||
double colorFuzz(void) const;
|
||||
|
||||
// Image colorspace scheme
|
||||
void colorspaceType(ColorspaceType colorspace_);
|
||||
ColorspaceType colorspaceType(void) const;
|
||||
|
||||
// Compression type ( NoCompression, BZipCompression,
|
||||
// FaxCompression, JPEGCompression, LZWCompression,
|
||||
// RLECompression, or ZipCompression )
|
||||
void compressType(CompressionType compressType_);
|
||||
CompressionType compressType(void) const;
|
||||
|
||||
// Enable printing of debug messages from ImageMagick
|
||||
void debug(bool flag_);
|
||||
bool debug(void) const;
|
||||
|
||||
// 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;
|
||||
|
||||
// Endianness (little like Intel or big like SPARC) for image
|
||||
// formats which support endian-specific options.
|
||||
void endian(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(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(InterlaceType interlace_);
|
||||
InterlaceType interlaceType(void) const;
|
||||
|
||||
// Image format to write or read
|
||||
void magick(const std::string &magick_);
|
||||
std::string magick(void) const;
|
||||
|
||||
// Transparent color
|
||||
void matteColor(const Color &matteColor_);
|
||||
Color matteColor(void) const;
|
||||
|
||||
// Write as a monochrome image
|
||||
void monochrome(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(size_t quality_);
|
||||
size_t quality(void) const;
|
||||
|
||||
// Maximum number of colors to quantize to
|
||||
void quantizeColors(size_t colors_);
|
||||
size_t quantizeColors(void) const;
|
||||
|
||||
// Colorspace to quantize in.
|
||||
void quantizeColorSpace(ColorspaceType colorSpace_);
|
||||
ColorspaceType quantizeColorSpace(void) const;
|
||||
|
||||
// Dither image during quantization.
|
||||
void quantizeDither(bool ditherFlag_);
|
||||
bool quantizeDither(void) const;
|
||||
|
||||
// Dither method
|
||||
void quantizeDitherMethod(DitherMethod ditherMethod_);
|
||||
DitherMethod quantizeDitherMethod(void) const;
|
||||
|
||||
// Quantization tree-depth
|
||||
void quantizeTreeDepth(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(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(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(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(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(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(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(double strokeWidth_);
|
||||
double strokeWidth(void) const;
|
||||
|
||||
void subImage(size_t subImage_);
|
||||
size_t subImage(void) const;
|
||||
|
||||
// Sub-frame number to return
|
||||
void subRange(size_t subRange_);
|
||||
size_t subRange(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;
|
||||
|
||||
void tileName(const std::string &tileName_);
|
||||
std::string tileName(void) const;
|
||||
|
||||
// Origin of coordinate system to use when annotating with text or drawing
|
||||
void transformOrigin(double tx_,double ty_);
|
||||
|
||||
// Reset transformation parameters to default
|
||||
void transformReset(void);
|
||||
|
||||
// Rotation to use when annotating with text or drawing
|
||||
void transformRotation(double angle_);
|
||||
|
||||
// Scale to use when annotating with text or drawing
|
||||
void transformScale(double sx_,double sy_);
|
||||
|
||||
// Skew to use in X axis when annotating with text or drawing
|
||||
void transformSkewX(double skewx_);
|
||||
|
||||
// Skew to use in Y axis when annotating with text or drawing
|
||||
void transformSkewY(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(bool verboseFlag_);
|
||||
bool verbose(void) const;
|
||||
|
||||
void view(const std::string &view_);
|
||||
std::string view(void) const;
|
||||
|
||||
// Virtual pixel method.
|
||||
void virtualPixelMethod(VirtualPixelMethod virtual_pixel_method_);
|
||||
VirtualPixelMethod virtualPixelMethod(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
|
|
@ -0,0 +1,149 @@
|
|||
// 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.
|
||||
PixelPacket *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 PixelPacket *getConst(const ::ssize_t x_,const ::ssize_t y_,
|
||||
const size_t columns_,const size_t rows_);
|
||||
|
||||
// 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.
|
||||
PixelPacket *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);
|
||||
|
||||
// Width of view
|
||||
size_t columns(void) const;
|
||||
|
||||
// Return pixel colormap index array
|
||||
IndexPacket *indexes(void);
|
||||
|
||||
// Height of view
|
||||
size_t rows (void) const;
|
||||
|
||||
// Left ordinate of view
|
||||
::ssize_t x(void) const;
|
||||
|
||||
// Top ordinate of view
|
||||
::ssize_t y(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
|
|
@ -0,0 +1,76 @@
|
|||
// 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
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,100 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2003
|
||||
//
|
||||
// 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 <windows.h>
|
||||
#if defined(_MT)
|
||||
struct win32_mutex {
|
||||
HANDLE id;
|
||||
};
|
||||
|
||||
// This is a binary semphore -- increase for a counting semaphore
|
||||
#define MAXSEMLEN 1
|
||||
#endif // defined(_MT)
|
||||
#endif // defined(_VISUALC_)
|
||||
|
||||
#if defined(MAGICKCORE_HAVE_PTHREAD)
|
||||
# include <pthread.h>
|
||||
#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_)
|
||||
win32_mutex _mutex;
|
||||
#endif
|
||||
};
|
||||
|
||||
// Lock mutex while object is in scope
|
||||
class MagickPPExport Lock
|
||||
{
|
||||
public:
|
||||
// Construct with mutex lock (locks mutex)
|
||||
Lock( MutexLock *mutexLock_ );
|
||||
|
||||
// Destrutor (unlocks mutex)
|
||||
~Lock( void );
|
||||
private:
|
||||
|
||||
// Don't support copy constructor
|
||||
Lock ( const Lock& original_ );
|
||||
|
||||
// Don't support assignment
|
||||
Lock& operator = ( const Lock& original_ );
|
||||
|
||||
MutexLock* _mutexLock;
|
||||
};
|
||||
}
|
||||
|
||||
// Construct with mutex lock (locks mutex)
|
||||
inline Magick::Lock::Lock( MutexLock *mutexLock_ )
|
||||
: _mutexLock(mutexLock_)
|
||||
{
|
||||
_mutexLock->lock();
|
||||
}
|
||||
|
||||
// Destrutor (unlocks mutex)
|
||||
inline Magick::Lock::~Lock( void )
|
||||
{
|
||||
_mutexLock->unlock();
|
||||
_mutexLock=0;
|
||||
}
|
||||
|
||||
#endif // Magick_Thread_header
|
|
@ -0,0 +1,59 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 2001, 2002
|
||||
// Copyright Dirk Lemstra 2014
|
||||
//
|
||||
// TypeMetric Definition
|
||||
//
|
||||
// Container for font type metrics
|
||||
//
|
||||
|
||||
#if !defined (Magick_TypeMetric_header)
|
||||
#define Magick_TypeMetric_header
|
||||
|
||||
#include "Magick++/Include.h"
|
||||
|
||||
namespace Magick
|
||||
{
|
||||
class MagickPPExport TypeMetric
|
||||
{
|
||||
friend class Image;
|
||||
|
||||
public:
|
||||
|
||||
// Default constructor
|
||||
TypeMetric(void);
|
||||
|
||||
// Destructor
|
||||
~TypeMetric(void);
|
||||
|
||||
// Ascent, the distance in pixels from the text baseline to the
|
||||
// highest/upper grid coordinate used to place an outline point.
|
||||
double ascent(void) const;
|
||||
|
||||
// Descent, 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;
|
||||
|
||||
// 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
|
|
@ -0,0 +1,119 @@
|
|||
// 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 <string>
|
||||
#include <string.h>
|
||||
|
||||
#include "Magick++/Montage.h"
|
||||
#include "Magick++/Functions.h"
|
||||
|
||||
Magick::Montage::Montage(void)
|
||||
: _backgroundColor("#ffffff"),
|
||||
_compose(OverCompositeOp),
|
||||
_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::updateMontageInfo(MontageInfo &montageInfo_) const
|
||||
{
|
||||
(void) memset(&montageInfo_,0,sizeof(montageInfo_));
|
||||
|
||||
// background_color
|
||||
montageInfo_.background_color=_backgroundColor;
|
||||
// border_color
|
||||
montageInfo_.border_color=Color();
|
||||
// border_width
|
||||
montageInfo_.border_width=0;
|
||||
// filename
|
||||
if (_fileName.length() != 0)
|
||||
{
|
||||
_fileName.copy(montageInfo_.filename,MaxTextExtent-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;
|
||||
// matte_color
|
||||
montageInfo_.matte_color=Color();
|
||||
// pointsize
|
||||
montageInfo_.pointsize=_pointSize;
|
||||
// shadow
|
||||
montageInfo_.shadow=static_cast<MagickBooleanType>(_shadow ? MagickTrue :
|
||||
MagickFalse);
|
||||
// signature (validity stamp)
|
||||
montageInfo_.signature=MagickSignature;
|
||||
// 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)
|
||||
: _borderColor("#dfdfdf"),
|
||||
_borderWidth(0),
|
||||
_frame(),
|
||||
_matteColor("#bdbdbd")
|
||||
{
|
||||
}
|
||||
|
||||
Magick::MontageFramed::~MontageFramed(void)
|
||||
{
|
||||
}
|
||||
|
||||
void Magick::MontageFramed::updateMontageInfo(MontageInfo &montageInfo_) const
|
||||
{
|
||||
// Do base updates
|
||||
Montage::updateMontageInfo(montageInfo_);
|
||||
|
||||
// border_color
|
||||
montageInfo_.border_color=_borderColor;
|
||||
// border_width
|
||||
montageInfo_.border_width=_borderWidth;
|
||||
// frame
|
||||
if (_frame.isValid())
|
||||
Magick::CloneString(&montageInfo_.frame,_frame);
|
||||
// matte_color
|
||||
montageInfo_.matte_color=_matteColor;
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,194 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003
|
||||
// Copyright Dirk Lemstra 2014
|
||||
//
|
||||
// Pixels Implementation
|
||||
//
|
||||
|
||||
#define MAGICKCORE_IMPLEMENTATION 1
|
||||
#define MAGICK_PLUSPLUS_IMPLEMENTATION 1
|
||||
|
||||
#include "Magick++/Include.h"
|
||||
#include <string> // 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 != (MagickCore::CacheView *) NULL)
|
||||
_view=DestroyCacheView(_view);
|
||||
}
|
||||
|
||||
Magick::PixelPacket* 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;
|
||||
PixelPacket* pixels=GetCacheViewAuthenticPixels(_view,x_,y_,columns_,rows_,
|
||||
exceptionInfo);
|
||||
ThrowPPException(_image.quiet());
|
||||
|
||||
return pixels;
|
||||
}
|
||||
|
||||
const Magick::PixelPacket* 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 PixelPacket* pixels=GetCacheViewVirtualPixels(_view,x_,y_,columns_,
|
||||
rows_,exceptionInfo);
|
||||
ThrowPPException(_image.quiet());
|
||||
|
||||
return pixels;
|
||||
}
|
||||
|
||||
Magick::PixelPacket* 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;
|
||||
PixelPacket* 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());
|
||||
}
|
||||
|
||||
Magick::IndexPacket* Magick::Pixels::indexes (void)
|
||||
{
|
||||
IndexPacket* pixel_indexes=GetCacheViewAuthenticIndexQueue(_view);
|
||||
|
||||
if (!pixel_indexes)
|
||||
_image.throwImageException();
|
||||
|
||||
return pixel_indexes;
|
||||
}
|
||||
|
||||
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 IntegerPixel:
|
||||
case LongPixel:
|
||||
size=sizeof(unsigned int);
|
||||
break;
|
||||
case QuantumPixel:
|
||||
size=sizeof(Quantum);
|
||||
break;
|
||||
case ShortPixel:
|
||||
size=sizeof(unsigned short);
|
||||
break;
|
||||
default:
|
||||
throwExceptionExplicit(OptionError,"Invalid type");
|
||||
return;
|
||||
}
|
||||
|
||||
_length=width_*height_*map_.length();
|
||||
_size=_length*size;
|
||||
_data=AcquireMagickMemory(_size);
|
||||
|
||||
GetPPException;
|
||||
MagickCore::ExportImagePixels(image_.constImage(),x_,y_,width_,height_,
|
||||
map_.c_str(),type_,_data,exceptionInfo);
|
||||
if (exceptionInfo->severity != UndefinedException)
|
||||
relinquish();
|
||||
ThrowPPException(image_.quiet());
|
||||
}
|
||||
|
||||
void Magick::PixelData::relinquish(void) throw()
|
||||
{
|
||||
if (_data != (void *)NULL)
|
||||
_data=RelinquishMagickMemory(_data);
|
||||
_length=0;
|
||||
_size=0;
|
||||
}
|
|
@ -0,0 +1,115 @@
|
|||
// 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()
|
||||
{
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,102 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002
|
||||
// Copyright Dirk Lemstra 2017
|
||||
//
|
||||
// Implementation of thread support
|
||||
//
|
||||
|
||||
#define MAGICKCORE_IMPLEMENTATION 1
|
||||
#define MAGICK_PLUSPLUS_IMPLEMENTATION 1
|
||||
|
||||
#include "Magick++/Thread.h"
|
||||
#include "Magick++/Exception.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
// 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( OptionError, "mutex initialization failed",
|
||||
strerror(sysError) );
|
||||
}
|
||||
#else
|
||||
#if defined(_VISUALC_) && defined(_MT)
|
||||
// Win32 threads
|
||||
: _mutex()
|
||||
{
|
||||
SECURITY_ATTRIBUTES security;
|
||||
|
||||
/* Allow the semaphore to be inherited */
|
||||
security.nLength = sizeof(security);
|
||||
security.lpSecurityDescriptor = NULL;
|
||||
security.bInheritHandle = TRUE;
|
||||
|
||||
/* Create the semaphore, with initial value signaled */
|
||||
_mutex.id = ::CreateSemaphore(&security, 1, MAXSEMLEN, NULL);
|
||||
if ( _mutex.id != NULL )
|
||||
return;
|
||||
throwExceptionExplicit( 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.id);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Lock mutex
|
||||
void Magick::MutexLock::lock(void)
|
||||
{
|
||||
#if defined(MAGICKCORE_HAVE_PTHREAD)
|
||||
int sysError;
|
||||
if ( (sysError = ::pthread_mutex_lock( &_mutex )) == 0)
|
||||
return;
|
||||
throwExceptionExplicit( OptionError, "mutex lock failed",
|
||||
strerror(sysError));
|
||||
#endif
|
||||
#if defined(_MT) && defined(_VISUALC_)
|
||||
if (WaitForSingleObject(_mutex.id,INFINITE) != WAIT_FAILED)
|
||||
return;
|
||||
throwExceptionExplicit( 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( OptionError, "mutex unlock failed",
|
||||
strerror(sysError) );
|
||||
#endif
|
||||
#if defined(_MT) && defined(_VISUALC_)
|
||||
if ( ReleaseSemaphore(_mutex.id, 1, NULL) == TRUE )
|
||||
return;
|
||||
throwExceptionExplicit( OptionError, "mutex unlock failed" );
|
||||
#endif
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 2001
|
||||
// Copyright Dirk Lemstra 2014
|
||||
//
|
||||
// TypeMetric implementation
|
||||
//
|
||||
|
||||
#define MAGICKCORE_IMPLEMENTATION 1
|
||||
#define MAGICK_PLUSPLUS_IMPLEMENTATION 1
|
||||
|
||||
#include "Magick++/TypeMetric.h"
|
||||
#include <string.h>
|
||||
|
||||
|
||||
Magick::TypeMetric::TypeMetric(void)
|
||||
{
|
||||
memset(&_typeMetric,0,sizeof(_typeMetric));
|
||||
}
|
||||
|
||||
Magick::TypeMetric::~TypeMetric(void)
|
||||
{
|
||||
}
|
||||
|
||||
double Magick::TypeMetric::ascent(void) const
|
||||
{
|
||||
return(_typeMetric.ascent);
|
||||
}
|
||||
|
||||
double Magick::TypeMetric::descent(void) const
|
||||
{
|
||||
return(_typeMetric.descent);
|
||||
}
|
||||
|
||||
double Magick::TypeMetric::maxHorizontalAdvance(void) const
|
||||
{
|
||||
return(_typeMetric.max_advance);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
VERS_8.0 {
|
||||
global:
|
||||
*;
|
||||
};
|
|
@ -0,0 +1,93 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2003
|
||||
//
|
||||
// Test STL appendImages function
|
||||
//
|
||||
|
||||
#include <Magick++.h>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <list>
|
||||
#include <vector>
|
||||
|
||||
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<Image> imageList;
|
||||
readImages( &imageList, srcdir + "test_image_anim.miff" );
|
||||
|
||||
Image appended;
|
||||
|
||||
// Horizontal
|
||||
appendImages( &appended, imageList.begin(), imageList.end() );
|
||||
// appended.display();
|
||||
if (( appended.signature() != "3a90bb0bb8f69f6788ab99e9e25598a0d6c5cdbbb797f77ad68011e0a8b1689d" ) &&
|
||||
( appended.signature() != "c15fcd1e739b73638dc4e36837bdb53f7087359544664caf7b1763928129f3c7" ) &&
|
||||
( appended.signature() != "229ff72f812e5f536245dc3b4502a0bc2ab2363f67c545863a85ab91ebfbfb83" ) &&
|
||||
( appended.signature() != "b98c42c55fc4e661cb3684154256809c03c0c6b53da2738b6ce8066e1b6ddef0" ))
|
||||
{
|
||||
++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() != "d73d25ccd6011936d08b6d0d89183b7a61790544c2195269aff4db2f782ffc08" ) &&
|
||||
( appended.signature() != "0909f7ffa7c6ea410fb2ebfdbcb19d61b19c4bd271851ce3bd51662519dc2b58" ) &&
|
||||
( appended.signature() != "11b97ba6ac1664aa1c2faed4c86195472ae9cce2ed75402d975bb4ffcf1de751" ) &&
|
||||
( appended.signature() != "cae4815eeb3cb689e73b94d897a9957d3414d1d4f513e8b5e52579b05d164bfe" ))
|
||||
{
|
||||
++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;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,75 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2003
|
||||
//
|
||||
// Test STL averageImages function
|
||||
//
|
||||
|
||||
#include <Magick++.h>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <list>
|
||||
#include <vector>
|
||||
|
||||
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<Image> imageList;
|
||||
readImages( &imageList, srcdir + "test_image_anim.miff" );
|
||||
|
||||
Image averaged;
|
||||
averageImages( &averaged, imageList.begin(), imageList.end() );
|
||||
// averaged.display();
|
||||
if ( 0 && averaged.signature() != "d4b4ffb8b70c4e9b0e50445542deb26fbcdf8c393c793123cbc92fb35341e44d" &&
|
||||
averaged.signature() != "62d46d6d239b9fbd3b8ff2271aed1b5dde6303e0d5228dd8d833f61a7b012a79" &&
|
||||
averaged.signature() != "fdc76a2689d19061e1f7f6adfd79a2c04bc4608125a2cd2a1bce0d981774e13f" &&
|
||||
averaged.signature() != "66dfb88c21405a6bf582c9a542d87fd14db176aae1f34bc30b0b3e2443b49aa8" &&
|
||||
averaged.signature() != "f3bc318abc0b842c656b6545d1d7159eedb61f559a95fc5df671db7d0c0639de")
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2003
|
||||
//
|
||||
// Test STL coalesceImages function
|
||||
//
|
||||
|
||||
#include <Magick++.h>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <list>
|
||||
#include <vector>
|
||||
|
||||
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<Image> imageList;
|
||||
readImages( &imageList, srcdir + "test_image_anim.miff" );
|
||||
|
||||
list<Image> 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;
|
||||
}
|
||||
|
|
@ -0,0 +1,134 @@
|
|||
// 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 <Magick++.h>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <list>
|
||||
|
||||
using namespace std;
|
||||
|
||||
using namespace Magick;
|
||||
|
||||
int test( CoderInfo::MatchType isReadable_,
|
||||
CoderInfo::MatchType isWritable_,
|
||||
CoderInfo::MatchType isMultiFrame_ )
|
||||
{
|
||||
int result = 0;
|
||||
list<CoderInfo> coderList;
|
||||
coderInfoList( &coderList, isReadable_, isWritable_, isMultiFrame_ );
|
||||
list<CoderInfo>::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<int>(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<int>(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<int>(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;
|
||||
}
|
|
@ -0,0 +1,154 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003
|
||||
//
|
||||
// Test Magick::Color classes
|
||||
//
|
||||
|
||||
#include <Magick++.h>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
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;
|
||||
}
|
|
@ -0,0 +1,101 @@
|
|||
// 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 <Magick++.h>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#if defined(USE_VECTOR)
|
||||
# include <vector>
|
||||
# include <utility>
|
||||
#endif
|
||||
#if defined(USE_MAP)
|
||||
# include <map>
|
||||
#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<Color,size_t> histogram;
|
||||
#elif defined(USE_VECTOR)
|
||||
std::vector<std::pair<Color,size_t> > 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<Color,size_t>::const_iterator p=histogram.begin();
|
||||
#elif defined(USE_VECTOR)
|
||||
std::vector<std::pair<Color,size_t> >::const_iterator p=histogram.begin();
|
||||
#endif
|
||||
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++;
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003
|
||||
//
|
||||
// Tests for throwing exceptions
|
||||
//
|
||||
|
||||
#include <Magick++.h>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
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;
|
||||
}
|
|
@ -0,0 +1,140 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2002, 2003
|
||||
//
|
||||
// Test STL montageImages function
|
||||
//
|
||||
|
||||
#include <Magick++.h>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <list>
|
||||
#include <vector>
|
||||
|
||||
using namespace std;
|
||||
|
||||
using namespace Magick;
|
||||
|
||||
int main( int /*argc*/, char ** /*argv*/)
|
||||
{
|
||||
|
||||
// Initialize ImageMagick install location for Windows
|
||||
// InitializeMagick(*argv);
|
||||
InitializeMagick("");
|
||||
|
||||
int failures=0;
|
||||
|
||||
try {
|
||||
|
||||
string srcdir("");
|
||||
if(getenv("SRCDIR") != 0)
|
||||
srcdir = getenv("SRCDIR");
|
||||
|
||||
//
|
||||
// Test montageImages
|
||||
//
|
||||
|
||||
list<Image> imageList;
|
||||
readImages( &imageList, srcdir + "test_image_anim.miff" );
|
||||
|
||||
vector<Image> montage;
|
||||
MontageFramed montageOpts;
|
||||
|
||||
// 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.compose( OverCompositeOp );
|
||||
montageOpts.fileName( "Montage" );
|
||||
montageOpts.frameGeometry( "6x6+3+3" );
|
||||
montageOpts.geometry("50x50+2+2>");
|
||||
montageOpts.gravity( CenterGravity );
|
||||
montageOpts.penColor( "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;
|
||||
}
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2003
|
||||
//
|
||||
// Test STL morphImages function
|
||||
//
|
||||
|
||||
#include <Magick++.h>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <list>
|
||||
#include <vector>
|
||||
|
||||
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<Image> imageList;
|
||||
readImages( &imageList, srcdir + "test_image_anim.miff" );
|
||||
|
||||
list<Image> 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;
|
||||
}
|
||||
|
|
@ -0,0 +1,255 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2003
|
||||
//
|
||||
// Test reading/writing BLOBs using Magick++
|
||||
//
|
||||
|
||||
#include <Magick++.h>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
#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<char *>(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<unsigned char*>(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<char *>(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<const unsigned char*>(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<Image> 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;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,178 @@
|
|||
// 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 <Magick++.h>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <list>
|
||||
#include <vector>
|
||||
|
||||
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<Image> 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<Image> second;
|
||||
readImages(&second,"testmagick_anim_out.miff");
|
||||
|
||||
list<Image>::iterator firstIter = first.begin();
|
||||
list<Image>::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;
|
||||
}
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,22 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Copyright 2004 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
|
||||
#
|
||||
# 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..12"
|
||||
|
||||
SRCDIR=${top_srcdir}/${subdir}/
|
||||
export SRCDIR
|
||||
|
||||
cd ${subdir} || exit 1
|
||||
|
||||
for mytest in appendImages attributes averageImages coalesceImages coderInfo color colorHistogram exceptions montageImages morphImages readWriteBlob readWriteImages
|
||||
do
|
||||
./${mytest} && echo "ok" || echo "not ok"
|
||||
done
|
||||
:
|
|
@ -0,0 +1,252 @@
|
|||
IDENTIFICATION="Magick V6.9"
|
||||
GSMATCH=LEQUAL,6,9
|
||||
case_sensitive=YES
|
||||
symbol_vector=(AcquireImageInfo=PROCEDURE)
|
||||
symbol_vector=(AcquireMemory=PROCEDURE)
|
||||
symbol_vector=(AddNoiseImage=PROCEDURE)
|
||||
symbol_vector=(AllocateImage=PROCEDURE)
|
||||
symbol_vector=(AllocateString=PROCEDURE)
|
||||
symbol_vector=(AnnotateImage=PROCEDURE)
|
||||
symbol_vector=(AppendImageFormat=PROCEDURE)
|
||||
symbol_vector=(AppendImages=PROCEDURE)
|
||||
symbol_vector=(Ascii85Encode=PROCEDURE)
|
||||
symbol_vector=(Ascii85Flush=PROCEDURE)
|
||||
symbol_vector=(Ascii85Initialize=PROCEDURE)
|
||||
symbol_vector=(AverageImages=PROCEDURE)
|
||||
symbol_vector=(BlobToImage=PROCEDURE)
|
||||
symbol_vector=(BlurImage=PROCEDURE)
|
||||
symbol_vector=(BorderImage=PROCEDURE)
|
||||
symbol_vector=(CatchImageException=PROCEDURE)
|
||||
symbol_vector=(ChopImage=PROCEDURE)
|
||||
symbol_vector=(CloneImage=PROCEDURE)
|
||||
symbol_vector=(CloneImageInfo=PROCEDURE)
|
||||
symbol_vector=(CloneMontageInfo=PROCEDURE)
|
||||
symbol_vector=(CloneString=PROCEDURE)
|
||||
symbol_vector=(CloseBlob=PROCEDURE)
|
||||
symbol_vector=(CoalesceImages=PROCEDURE)
|
||||
symbol_vector=(ColorFloodfillImage=PROCEDURE)
|
||||
symbol_vector=(CompositeImage=PROCEDURE)
|
||||
symbol_vector=(ContrastImage=PROCEDURE)
|
||||
symbol_vector=(CropImage=PROCEDURE)
|
||||
symbol_vector=(CycleColormapImage=PROCEDURE)
|
||||
symbol_vector=(DeconstructImages=PROCEDURE)
|
||||
symbol_vector=(DescribeImage=PROCEDURE)
|
||||
symbol_vector=(DespeckleImage=PROCEDURE)
|
||||
symbol_vector=(DestroyImage=PROCEDURE)
|
||||
symbol_vector=(DestroyImageInfo=PROCEDURE)
|
||||
symbol_vector=(DestroyImages=PROCEDURE)
|
||||
symbol_vector=(DestroyMontageInfo=PROCEDURE)
|
||||
symbol_vector=(DrawImage=PROCEDURE)
|
||||
symbol_vector=(EdgeImage=PROCEDURE)
|
||||
symbol_vector=(EmbossImage=PROCEDURE)
|
||||
symbol_vector=(EnhanceImage=PROCEDURE)
|
||||
symbol_vector=(EOFBlob=PROCEDURE)
|
||||
symbol_vector=(EqualizeImage=PROCEDURE)
|
||||
symbol_vector=(ExpandFilename=PROCEDURE)
|
||||
symbol_vector=(ExpandFilenames=PROCEDURE)
|
||||
symbol_vector=(FlipImage=PROCEDURE)
|
||||
symbol_vector=(FlopImage=PROCEDURE)
|
||||
symbol_vector=(FormatMagickString=PROCEDURE)
|
||||
symbol_vector=(FrameImage=PROCEDURE)
|
||||
symbol_vector=(GammaImage=PROCEDURE)
|
||||
symbol_vector=(GetBlobInfo=PROCEDURE)
|
||||
symbol_vector=(GetExceptionInfo=PROCEDURE)
|
||||
symbol_vector=(GetImageInfo=PROCEDURE)
|
||||
symbol_vector=(GetImagePixels=PROCEDURE)
|
||||
symbol_vector=(GetOnePixel=PROCEDURE)
|
||||
symbol_vector=(GetMontageInfo=PROCEDURE)
|
||||
symbol_vector=(GetQuantizeInfo=PROCEDURE)
|
||||
symbol_vector=(GlobExpression=PROCEDURE)
|
||||
symbol_vector=(HuffmanDecodeImage=PROCEDURE)
|
||||
symbol_vector=(HuffmanEncodeImage=PROCEDURE)
|
||||
symbol_vector=(ImageToBlob=PROCEDURE)
|
||||
symbol_vector=(ImplodeImage=PROCEDURE)
|
||||
symbol_vector=(IsGeometry=PROCEDURE)
|
||||
symbol_vector=(IsGrayImage=PROCEDURE)
|
||||
symbol_vector=(LiberateMemory=PROCEDURE)
|
||||
symbol_vector=(ListDelegateInfo=PROCEDURE)
|
||||
symbol_vector=(ListFiles=PROCEDURE)
|
||||
symbol_vector=(ListMagickInfo=PROCEDURE)
|
||||
symbol_vector=(LocaleCompare=PROCEDURE)
|
||||
symbol_vector=(LocaleNCompare=PROCEDURE)
|
||||
symbol_vector=(LZWEncodeImage=PROCEDURE)
|
||||
symbol_vector=(MagickError=PROCEDURE)
|
||||
symbol_vector=(MagickWarning=PROCEDURE)
|
||||
symbol_vector=(MagnifyImage=PROCEDURE)
|
||||
symbol_vector=(MapImage=PROCEDURE)
|
||||
symbol_vector=(MapImages=PROCEDURE)
|
||||
symbol_vector=(MatteFloodfillImage=PROCEDURE)
|
||||
symbol_vector=(MinifyImage=PROCEDURE)
|
||||
symbol_vector=(ModulateImage=PROCEDURE)
|
||||
symbol_vector=(MogrifyImage=PROCEDURE)
|
||||
symbol_vector=(MogrifyImages=PROCEDURE)
|
||||
symbol_vector=(MontageImages=PROCEDURE)
|
||||
symbol_vector=(MorphImages=PROCEDURE)
|
||||
symbol_vector=(MosaicImages=PROCEDURE)
|
||||
symbol_vector=(MultilineCensus=PROCEDURE)
|
||||
symbol_vector=(NegateImage=PROCEDURE)
|
||||
symbol_vector=(NormalizeImage=PROCEDURE)
|
||||
symbol_vector=(OilPaintImage=PROCEDURE)
|
||||
symbol_vector=(OpaqueImage=PROCEDURE)
|
||||
symbol_vector=(OpenBlob=PROCEDURE)
|
||||
symbol_vector=(PackbitsEncodeImage=PROCEDURE)
|
||||
symbol_vector=(ParseImageGeometry=PROCEDURE)
|
||||
symbol_vector=(PingImage=PROCEDURE)
|
||||
symbol_vector=(PostscriptGeometry=PROCEDURE)
|
||||
symbol_vector=(QuantizationError=PROCEDURE)
|
||||
symbol_vector=(QuantizeImage=PROCEDURE)
|
||||
symbol_vector=(QuantizeImages=PROCEDURE)
|
||||
symbol_vector=(QueryColorDatabase=PROCEDURE)
|
||||
symbol_vector=(RaiseImage=PROCEDURE)
|
||||
symbol_vector=(ReadBlob=PROCEDURE)
|
||||
symbol_vector=(ReadImage=PROCEDURE)
|
||||
symbol_vector=(ReduceNoiseImage=PROCEDURE)
|
||||
symbol_vector=(RGBTransformImage=PROCEDURE)
|
||||
symbol_vector=(RollImage=PROCEDURE)
|
||||
symbol_vector=(RotateImage=PROCEDURE)
|
||||
symbol_vector=(SampleImage=PROCEDURE)
|
||||
symbol_vector=(ScaleImage=PROCEDURE)
|
||||
symbol_vector=(SeekBlob=PROCEDURE)
|
||||
symbol_vector=(SegmentImage=PROCEDURE)
|
||||
symbol_vector=(SetCacheThreshold=PROCEDURE)
|
||||
symbol_vector=(SetClientName=PROCEDURE)
|
||||
symbol_vector=(SetErrorHandler=PROCEDURE)
|
||||
symbol_vector=(SetImageInfo=PROCEDURE)
|
||||
symbol_vector=(SetMonitorHandler=PROCEDURE)
|
||||
symbol_vector=(SetWarningHandler=PROCEDURE)
|
||||
symbol_vector=(ShadeImage=PROCEDURE)
|
||||
symbol_vector=(SharpenImage=PROCEDURE)
|
||||
symbol_vector=(ShearImage=PROCEDURE)
|
||||
symbol_vector=(SignatureImage=PROCEDURE)
|
||||
symbol_vector=(SolarizeImage=PROCEDURE)
|
||||
symbol_vector=(SortColormapByIntensity=PROCEDURE)
|
||||
symbol_vector=(SpreadImage=PROCEDURE)
|
||||
symbol_vector=(SteganoImage=PROCEDURE)
|
||||
symbol_vector=(StereoImage=PROCEDURE)
|
||||
symbol_vector=(StringToList=PROCEDURE)
|
||||
symbol_vector=(Strip=PROCEDURE)
|
||||
symbol_vector=(SwirlImage=PROCEDURE)
|
||||
symbol_vector=(SyncImage=PROCEDURE)
|
||||
symbol_vector=(SyncImagePixels=PROCEDURE)
|
||||
symbol_vector=(TellBlob=PROCEDURE)
|
||||
symbol_vector=(TemporaryFilename=PROCEDURE)
|
||||
symbol_vector=(TextureImage=PROCEDURE)
|
||||
symbol_vector=(TransformImage=PROCEDURE)
|
||||
symbol_vector=(TransformRGBImage=PROCEDURE)
|
||||
symbol_vector=(TranslateText=PROCEDURE)
|
||||
symbol_vector=(TransparentImage=PROCEDURE)
|
||||
symbol_vector=(WriteBlob=PROCEDURE)
|
||||
symbol_vector=(WriteImage=PROCEDURE)
|
||||
symbol_vector=(XAnnotateImage=PROCEDURE)
|
||||
symbol_vector=(XBestFont=PROCEDURE)
|
||||
symbol_vector=(XBestIconSize=PROCEDURE)
|
||||
symbol_vector=(XBestPixel=PROCEDURE)
|
||||
symbol_vector=(XBestVisualInfo=PROCEDURE)
|
||||
symbol_vector=(XCheckRefreshWindows=PROCEDURE)
|
||||
symbol_vector=(XClientMessage=PROCEDURE)
|
||||
symbol_vector=(XColorBrowserWidget=PROCEDURE)
|
||||
symbol_vector=(XCommandWidget=PROCEDURE)
|
||||
symbol_vector=(XConfirmWidget=PROCEDURE)
|
||||
symbol_vector=(XConstrainWindowPosition=PROCEDURE)
|
||||
symbol_vector=(XDelay=PROCEDURE)
|
||||
symbol_vector=(XDestroyWindowColors=PROCEDURE)
|
||||
symbol_vector=(XDialogWidget=PROCEDURE)
|
||||
symbol_vector=(XDisplayImageInfo=PROCEDURE)
|
||||
symbol_vector=(XDrawImage=PROCEDURE)
|
||||
symbol_vector=(XError=PROCEDURE)
|
||||
symbol_vector=(XFileBrowserWidget=PROCEDURE)
|
||||
symbol_vector=(XFontBrowserWidget=PROCEDURE)
|
||||
symbol_vector=(XFreeResources=PROCEDURE)
|
||||
symbol_vector=(XFreeStandardColormap=PROCEDURE)
|
||||
symbol_vector=(XGetAnnotateInfo=PROCEDURE)
|
||||
symbol_vector=(XGetImportInfo=PROCEDURE)
|
||||
symbol_vector=(XGetMapInfo=PROCEDURE)
|
||||
symbol_vector=(XGetResourceClass=PROCEDURE)
|
||||
symbol_vector=(XGetResourceDatabase=PROCEDURE)
|
||||
symbol_vector=(XGetResourceInfo=PROCEDURE)
|
||||
symbol_vector=(XGetResourceInstance=PROCEDURE)
|
||||
symbol_vector=(XGetScreenDensity=PROCEDURE)
|
||||
symbol_vector=(XGetWindowColor=PROCEDURE)
|
||||
symbol_vector=(XGetWindowInfo=PROCEDURE)
|
||||
symbol_vector=(XHighlightEllipse=PROCEDURE)
|
||||
symbol_vector=(XHighlightLine=PROCEDURE)
|
||||
symbol_vector=(XHighlightRectangle=PROCEDURE)
|
||||
symbol_vector=(XImportImage=PROCEDURE)
|
||||
symbol_vector=(XInfoWidget=PROCEDURE)
|
||||
symbol_vector=(XListBrowserWidget=PROCEDURE)
|
||||
symbol_vector=(XMakeCursor=PROCEDURE)
|
||||
symbol_vector=(XMakeImage=PROCEDURE)
|
||||
symbol_vector=(XMakeMagnifyImage=PROCEDURE)
|
||||
symbol_vector=(XMakeStandardColormap=PROCEDURE)
|
||||
symbol_vector=(XMakeWindow=PROCEDURE)
|
||||
symbol_vector=(XMenuWidget=PROCEDURE)
|
||||
symbol_vector=(XNoticeWidget=PROCEDURE)
|
||||
symbol_vector=(XPreferencesWidget=PROCEDURE)
|
||||
symbol_vector=(XQueryColorDatabase=PROCEDURE)
|
||||
symbol_vector=(XQueryPosition=PROCEDURE)
|
||||
symbol_vector=(XRefreshWindow=PROCEDURE)
|
||||
symbol_vector=(XRemoteCommand=PROCEDURE)
|
||||
symbol_vector=(XRetainWindowColors=PROCEDURE)
|
||||
symbol_vector=(XSetCursorState=PROCEDURE)
|
||||
symbol_vector=(XTextViewWidget=PROCEDURE)
|
||||
symbol_vector=(XUserPreferences=PROCEDURE)
|
||||
symbol_vector=(XWindowByID=PROCEDURE)
|
||||
symbol_vector=(XWindowByName=PROCEDURE)
|
||||
symbol_vector=(XWindowByProperty=PROCEDURE)
|
||||
symbol_vector=(ZoomImage=PROCEDURE)
|
||||
symbol_vector=(AllocateImageColormap=PROCEDURE)
|
||||
symbol_vector=(GetIndexes=PROCEDURE)
|
||||
symbol_vector=(GetNumberColors=PROCEDURE)
|
||||
symbol_vector=(GetImageException=PROCEDURE)
|
||||
symbol_vector=(ThrowException=PROCEDURE)
|
||||
symbol_vector=(GetMagickVersion=PROCEDURE)
|
||||
symbol_vector=(GetExecutionPath=PROCEDURE)
|
||||
symbol_vector=(FlattenImages=PROCEDURE)
|
||||
symbol_vector=(GetImageAttribute=PROCEDURE)
|
||||
symbol_vector=(ListColorInfo=PROCEDURE)
|
||||
symbol_vector=(ListMagicInfo=PROCEDURE)
|
||||
symbol_vector=(DestroyMagick=PROCEDURE)
|
||||
symbol_vector=(InitializeMagick=PROCEDURE)
|
||||
symbol_vector=(ListTypeInfo=PROCEDURE)
|
||||
symbol_vector=(SetImageClipMask=PROCEDURE)
|
||||
symbol_vector=(SetImageType=PROCEDURE)
|
||||
symbol_vector=(SetImageOpacity=PROCEDURE)
|
||||
symbol_vector=(DestroyImageList=PROCEDURE)
|
||||
symbol_vector=(GetPageGeometry=PROCEDURE)
|
||||
symbol_vector=(WriteImages=PROCEDURE)
|
||||
symbol_vector=(PushImageList=PROCEDURE)
|
||||
symbol_vector=(GetGeometry=PROCEDURE)
|
||||
symbol_vector=(GetImageGeometry=PROCEDURE)
|
||||
symbol_vector=(CatchException=PROCEDURE)
|
||||
symbol_vector=(MagickFatalError=PROCEDURE)
|
||||
symbol_vector=(DestroyExceptionInfo=PROCEDURE)
|
||||
symbol_vector=(MontageImageCommand=PROCEDURE)
|
||||
symbol_vector=(MogrifyImageCommand=PROCEDURE)
|
||||
symbol_vector=(ConvertImageCommand=PROCEDURE)
|
||||
symbol_vector=(IdentifyImageCommand=PROCEDURE)
|
||||
symbol_vector=(CompositeImageCommand=PROCEDURE)
|
||||
symbol_vector=(GetMagickCopyright=PROCEDURE)
|
||||
symbol_vector=(SetLogEventMask=PROCEDURE)
|
||||
symbol_vector=(SetMagickResourceLimit=PROCEDURE)
|
||||
symbol_vector=(AppendImageToList=PROCEDURE)
|
||||
symbol_vector=(GetImageTotalInkDensity=PROCEDURE)
|
||||
symbol_vector=(SetLogFormat=PROCEDURE)
|
||||
symbol_vector=(ListMagickResourceInfo=PROCEDURE)
|
||||
symbol_vector=(DisplayImageCommand=PROCEDURE)
|
||||
symbol_vector=(ImportImageCommand=PROCEDURE)
|
||||
symbol_vector=(AnimateImageCommand=PROCEDURE)
|
||||
symbol_vector=(RelinquishMagickMemory=PROCEDURE)
|
||||
symbol_vector=(CompareImageCommand=PROCEDURE)
|
||||
symbol_vector=(DestroyString=PROCEDURE)
|
||||
symbol_vector=(AcquireExceptionInfo=PROCEDURE)
|
||||
symbol_vector=(MagickCoreGenesis=PROCEDURE)
|
||||
symbol_vector=(MagickCoreTerminus=PROCEDURE)
|
||||
symbol_vector=(GetElapsedTime=PROCEDURE)
|
||||
symbol_vector=(GetTimerInfo=PROCEDURE)
|
||||
symbol_vector=(GetUserTime=PROCEDURE)
|
||||
symbol_vector=(AcquireTimerInfo=PROCEDURE)
|
||||
symbol_vector=(DestroyTimerInfo=PROCEDURE)
|
||||
symbol_vector=(MagickCommandGenesis=PROCEDURE)
|
||||
symbol_vector=(GetImageOption=PROCEDURE)
|
||||
symbol_vector=(IsMagickTrue=PROCEDURE)
|
||||
sys$share:decw$xlibshr.exe/share
|
|
@ -0,0 +1,390 @@
|
|||
# Copyright 1999-2021 ImageMagick Studio LLC, a non-profit organization
|
||||
# dedicated to making software imaging solutions freely available.
|
||||
#
|
||||
# You may not use this file except in compliance with the License. You may
|
||||
# obtain a copy of the License at
|
||||
#
|
||||
# https://imagemagick.org/script/license.php
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# Copyright (C) 2003 - 2008 GraphicsMagick Group
|
||||
#
|
||||
# Top-Level Makefile for building ImageMagick.
|
||||
#
|
||||
|
||||
topincludedir = @includedir@/magick
|
||||
|
||||
AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir)
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
MODULECOMMONFLAGS = -no-undefined -export-symbols-regex ".*" -shared -module -avoid-version
|
||||
MODULECOMMONCPPFLAGS = $(AM_CPPFLAGS)
|
||||
|
||||
# Options to pass when running configure in the distcheck target.
|
||||
#
|
||||
# We want to preserve user-provided option variables so the same
|
||||
# compiler, headers, and libraries are used as for a normal build.
|
||||
DISTCHECK_CONFIGURE_FLAGS=$(DISTCHECK_CONFIG_FLAGS)
|
||||
|
||||
DISTCLEANFILES = _configs.sed magick/magick-baseconfig.h
|
||||
|
||||
## Make sure these will be cleaned even when they're not built by default.
|
||||
CLEANFILES = \
|
||||
$(WAND_CLEANFILES) \
|
||||
$(MAGICKPP_CLEANFILES) \
|
||||
$(UTILITIES_CLEANFILES) \
|
||||
$(TESTS_CLEANFILES)
|
||||
|
||||
bin_PROGRAMS = \
|
||||
$(UTILITIES_PGMS)
|
||||
|
||||
# Binary scripts
|
||||
bin_SCRIPTS = \
|
||||
$(MAGICK_BIN_SCRPTS) \
|
||||
$(WAND_BIN_SCRPTS) \
|
||||
$(MAGICKPP_SCRPTS)
|
||||
|
||||
include_HEADERS =
|
||||
|
||||
# Headers which are not installed but which are distributed
|
||||
noinst_HEADERS = \
|
||||
$(MAGICK_NOINST_HDRS)
|
||||
|
||||
if WIN32_NATIVE_BUILD
|
||||
SRCDIR='$(shell @WinPathScript@ $(srcdir)/)'
|
||||
else
|
||||
SRCDIR="$(srcdir)/"
|
||||
endif
|
||||
|
||||
# Tests with .tap extensions use the TAP protocol and TAP driver
|
||||
LOG_COMPILER = $(SHELL)
|
||||
|
||||
SH_LOG_COMPILER = $(LOG_COMPILER)
|
||||
TAP_LOG_COMPILER = $(LOG_COMPILER)
|
||||
|
||||
# Test extensions
|
||||
TEST_EXTENSIONS = .sh .tap
|
||||
|
||||
TAP_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \
|
||||
$(top_srcdir)/config/tap-driver.sh
|
||||
|
||||
# Environment parameters to be used during tests
|
||||
TESTS_ENVIRONMENT = \
|
||||
MAKE="$(MAKE)" \
|
||||
MAKEFLAGS="$(MAKEFLAGS)" \
|
||||
MEMCHECK="$(MEMCHECK)"
|
||||
|
||||
# Tests to run
|
||||
TESTS = \
|
||||
$(TESTS_TESTS) \
|
||||
$(MAGICKPP_TESTS) \
|
||||
$(WAND_TESTS) \
|
||||
$(UTILITIES_TESTS)
|
||||
|
||||
# Tests which are expected to fail
|
||||
XFAIL_TESTS = \
|
||||
$(TESTS_XFAIL_TESTS) \
|
||||
$(UTILITIES_XFAIL_TESTS)
|
||||
|
||||
TOP_EXTRA_DIST = \
|
||||
AUTHORS.txt \
|
||||
ChangeLog \
|
||||
LICENSE \
|
||||
QuickStart.txt \
|
||||
NOTICE \
|
||||
Install-mac.txt \
|
||||
Install-unix.txt \
|
||||
Install-vms.txt \
|
||||
Install-windows.txt \
|
||||
magick.sh.in \
|
||||
Magickshr.opt \
|
||||
NEWS.txt \
|
||||
README.txt \
|
||||
index.html \
|
||||
winpath.sh
|
||||
|
||||
# Additional files to distribute
|
||||
EXTRA_DIST = \
|
||||
$(TOP_EXTRA_DIST) \
|
||||
$(CONFIG_EXTRA_DIST) \
|
||||
$(MAGICK_EXTRA_DIST) \
|
||||
$(WAND_EXTRA_DIST) \
|
||||
$(MAGICKPP_EXTRA_DIST) \
|
||||
$(UTILITIES_EXTRA_DIST) \
|
||||
$(TESTS_EXTRA_DIST)
|
||||
|
||||
lib_LTLIBRARIES = $(MAGICKCORE_LIBS) $(MAGICKWAND_LIBS) $(MAGICKPP_LIBS)
|
||||
AM_LDFLAGS =
|
||||
noinst_LTLIBRARIES =
|
||||
EXTRA_LTLIBRARIES =
|
||||
BUILT_SOURCES =
|
||||
MOSTLYCLEANFILES =
|
||||
|
||||
check_PROGRAMS = \
|
||||
$(TESTS_CHECK_PGRMS) \
|
||||
$(MAGICKPP_CHECK_PGRMS) \
|
||||
$(WAND_CHECK_PGRMS)
|
||||
|
||||
include m4/Makefile.am
|
||||
include config/Makefile.am
|
||||
include coders/Makefile.am
|
||||
include magick/Makefile.am
|
||||
include filters/Makefile.am
|
||||
include wand/Makefile.am
|
||||
include Magick++/Makefile.am
|
||||
include utilities/Makefile.am
|
||||
include tests/Makefile.am
|
||||
include PerlMagick/Makefile.am
|
||||
|
||||
# Pkgconfig directory
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
|
||||
# Files to install in Pkgconfig directory
|
||||
pkgconfig_DATA = \
|
||||
$(MAGICK_PKGCONFIG) \
|
||||
$(WAND_PKGCONFIG) \
|
||||
$(MAGICKPP_PKGCONFIG)
|
||||
|
||||
# create a copy for pc file (ideally the non abi should be symlinked)
|
||||
%-@MAGICK_MAJOR_VERSION@.@MAGICK_ABI_SUFFIX@.pc: %.pc
|
||||
cp -f $^ $@
|
||||
|
||||
# Architecture independent data files installed in the package's data directory
|
||||
docdir = $(DOCUMENTATION_PATH)
|
||||
|
||||
# Manual pages to install
|
||||
if INSTALL_DOC
|
||||
man_MANS = \
|
||||
$(MAGICK_MANS) \
|
||||
$(WAND_MANS) \
|
||||
$(MAGICKPP_MANS) \
|
||||
$(UTILITIES_MANS)
|
||||
|
||||
doc_DATA = \
|
||||
LICENSE \
|
||||
ChangeLog \
|
||||
NEWS.txt
|
||||
endif
|
||||
|
||||
if MAINTAINER_MODE
|
||||
MAINTAINER_TARGETS = \
|
||||
magick-version \
|
||||
ImageMagick.spec \
|
||||
$(PERLMAGICK_MAINTAINER_TARGETS)
|
||||
endif
|
||||
|
||||
all-local: $(MAGICKPP_LOCAL_TARGETS) $(PERLMAGICK_ALL_LOCAL_TARGETS) $(MAINTAINER_TARGETS)
|
||||
|
||||
install-exec-local: $(PERLMAGICK_INSTALL_EXEC_LOCAL_TARGETS)
|
||||
|
||||
install-data-local: $(PERLMAGICK_INSTALL_DATA_LOCAL_TARGETS) $(HTML_INSTALL_DATA_TARGETS)
|
||||
|
||||
uninstall-local: $(PERLMAGICK_UNINSTALL_LOCAL_TARGETS) $(HTML_UNINSTALL_DATA_TARGETS)
|
||||
|
||||
clean-local: $(PERLMAGICK_CLEAN_LOCAL_TARGETS)
|
||||
|
||||
distclean-local: $(PERLMAGICK_DISTCLEAN_LOCAL_TARGETS)
|
||||
|
||||
maintainer-clean-local: $(PERLMAGICK_MAINTAINER_CLEAN_LOCAL_TARGETS)
|
||||
|
||||
check-local: $(PERLMAGICK_CHECK_LOCAL_TARGETS)
|
||||
|
||||
# drd: valgrind's newer thread error detector
|
||||
drd:
|
||||
$(MAKE) MEMCHECK='valgrind --tool=drd --check-stack-var=yes --var-info=yes \
|
||||
--quiet $(VALGRIND_EXTRA_OPTS)' check
|
||||
|
||||
# helgrind: valgrind's older thread error detector
|
||||
helgrind:
|
||||
$(MAKE) MEMCHECK='valgrind --tool=helgrind --error-exitcode=2 --quiet \
|
||||
$(VALGRIND_EXTRA_OPTS)' check
|
||||
|
||||
# memcheck: valgrind's memory access checker
|
||||
memcheck:
|
||||
$(MAKE) MEMCHECK='valgrind --tool=memcheck --leak-check=full --read-var-info=yes \
|
||||
--error-exitcode=2 --track-origins=yes --num-callers=12 \
|
||||
--quiet $(VALGRIND_EXTRA_OPTS)' check
|
||||
|
||||
# ptrcheck: valgrind's experimental pointer checking tool.
|
||||
ptrcheck:
|
||||
$(MAKE) MEMCHECK='valgrind --tool=exp-ptrcheck --quiet $(VALGRIND_EXTRA_OPTS)' check
|
||||
|
||||
# Non-Automake subdirectories to distribute
|
||||
DISTDIRS = images scripts www PerlMagick
|
||||
dist-hook:
|
||||
( \
|
||||
builddir=`pwd` ; \
|
||||
cd $(srcdir) && \
|
||||
( \
|
||||
for dir in $(DISTDIRS) ; do \
|
||||
find $$dir -depth -print | egrep -v '(~$$)|(/.git)|(/\.#)|(/\.deps)|(/\.git)' \
|
||||
| cpio -pdum $$builddir/$(distdir) 2> /dev/null ; \
|
||||
done \
|
||||
) \
|
||||
)
|
||||
|
||||
#
|
||||
# Additional install rules
|
||||
#
|
||||
|
||||
# Install HTML files
|
||||
pkgdocdir = $(DOCUMENTATION_PATH)
|
||||
DOCDIRSDOXYGEN = www/api/MagickCore www/api/MagickWand
|
||||
DOCDIRSMANUAL = images images/patterns www www/assets www/api www/source www/Magick++
|
||||
DOCDIRS= $(DOCDIRSMANUAL) $(DOCDIRSDOXYGEN)
|
||||
|
||||
if INSTALL_DOC
|
||||
HTML_INSTALL_DATA_TARGETS = install-data-html
|
||||
endif
|
||||
|
||||
install-data-html:
|
||||
$(mkinstalldirs) $(DESTDIR)$(pkgdocdir)
|
||||
$(INSTALL_DATA) $(srcdir)/index.html $(DESTDIR)$(pkgdocdir)
|
||||
for dir in $(DOCDIRS) ; do \
|
||||
$(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$$dir && \
|
||||
if test -d $(builddir)/$$dir ; then \
|
||||
docsrcdir=$(builddir)/$$dir; \
|
||||
else \
|
||||
docsrcdir=$(srcdir)/$$dir; \
|
||||
fi; \
|
||||
if test -d $$docsrcdir; then \
|
||||
for file in $$docsrcdir/*.* ; do \
|
||||
echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdocdir)/$$dir" ; \
|
||||
$(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgdocdir)/$$dir ; \
|
||||
done ; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
# Uninstall HTML files
|
||||
HTML_UNINSTALL_DATA_TARGETS = uninstall-data-html
|
||||
uninstall-data-html:
|
||||
rm -f $(DESTDIR)$(pkgdocdir)/index.html
|
||||
for dir in $(DOCDIRS) ; do \
|
||||
rm -f -r $(DESTDIR)$(pkgdocdir)/$$dir ; \
|
||||
done
|
||||
|
||||
# Ensure that version.h at $(srcdir)/magick/version.h is kept up to date.
|
||||
magick-version: magick/version.h
|
||||
@if test -f "$(srcdir)/VisualMagick/installer/inc/version.isx.in" ; then \
|
||||
./config.status --file="$(srcdir)/../VisualMagick/installer/inc/version.isx" 2> /dev/null ; \
|
||||
fi
|
||||
@if test -n "$(VPATH)" ; then \
|
||||
cmp magick/version.h $(srcdir)/magick/version.h > /dev/null ; \
|
||||
if test $$? -eq 1 ; then \
|
||||
echo "Updating $(srcdir)/magick/version.h ..."; \
|
||||
cp magick/version.h $(srcdir)/magick/version.h ; \
|
||||
fi ; \
|
||||
fi ; \
|
||||
touch magick-version
|
||||
|
||||
magick/version.h: $(top_srcdir)/ChangeLog $(top_srcdir)/m4/version.m4
|
||||
|
||||
# Automagically reconfigure libtool
|
||||
LIBTOOL_DEPS = @LIBTOOL_DEPS@
|
||||
libtool: $(LIBTOOL_DEPS)
|
||||
$(SHELL) ./config.status --recheck
|
||||
|
||||
# Format C API documentation
|
||||
html-local:
|
||||
# copy static file
|
||||
for dir in $(DOCDIRSMANUAL) ; do \
|
||||
$(mkinstalldirs) $(top_builddir)/$$dir ;\
|
||||
for file in $$dir/*.* ; do \
|
||||
if ! test -f $(top_builddir)/$$file; then \
|
||||
cp -p -f $(top_srcdir)/$$file $(top_builddir)/$$dir ; \
|
||||
fi; \
|
||||
done ; \
|
||||
done;
|
||||
# remove old doxygen files
|
||||
for dir in $(DOCDIRDOXYGEN) ; do \
|
||||
rm -rf $$dir || true; \
|
||||
done;
|
||||
# make doxygen doc
|
||||
$(mkinstalldirs) $(top_builddir)/www/api
|
||||
cd config && doxygen MagickCore.dox
|
||||
cd config && doxygen MagickWand.dox
|
||||
cd config && doxygen Magick++.dox
|
||||
|
||||
#
|
||||
# Build Windows source Zip and 7Zip balls
|
||||
#
|
||||
if ZIP_DELEGATE
|
||||
DIST_WINDOWS_SRC_ZIP=$(PACKAGE_NAME)-$(PACKAGE_VERSION)-windows.zip
|
||||
else
|
||||
DIST_WINDOWS_SRC_ZIP=
|
||||
endif
|
||||
if P7ZIP_DELEGATE
|
||||
DIST_WINDOWS_SRC_7ZIP=$(PACKAGE_NAME)-$(PACKAGE_VERSION)-windows.7z
|
||||
else
|
||||
DIST_WINDOWS_SRC_7ZIP=
|
||||
endif
|
||||
$(DIST_WINDOWS_SRC_ZIP) $(DIST_WINDOWS_SRC_7ZIP) windows-dist:
|
||||
if test -d $(PACKAGE_NAME)-$(PACKAGE_VERSION) ; then \
|
||||
chmod -R u+w $(PACKAGE_NAME)-$(PACKAGE_VERSION) ; \
|
||||
rm -rf $(PACKAGE_NAME)-$(PACKAGE_VERSION) ; \
|
||||
fi
|
||||
git clone -b main https://github.com/ImageMagick/ImageMagick6.git $(PACKAGE_NAME)-$(PACKAGE_VERSION)
|
||||
if ZIP_DELEGATE
|
||||
rm -f $(DIST_WINDOWS_SRC_ZIP)
|
||||
$(ZIP) -r -9 -q $(DIST_WINDOWS_SRC_ZIP) $(PACKAGE_NAME)-$(PACKAGE_VERSION)
|
||||
endif # ZIP_DELEGATE
|
||||
if P7ZIP_DELEGATE
|
||||
rm -f $(DIST_WINDOWS_SRC_7ZIP)
|
||||
$(P7ZIP) a -t7z -mx=9 $(DIST_WINDOWS_SRC_7ZIP) $(PACKAGE_NAME)-$(PACKAGE_VERSION)
|
||||
chmod 644 $(DIST_WINDOWS_SRC_7ZIP)
|
||||
endif # P7ZIP_DELEGATE
|
||||
rm -rf $(PACKAGE_NAME)-$(PACKAGE_VERSION)
|
||||
|
||||
#
|
||||
# RPM build support
|
||||
#
|
||||
if RPM_DELEGATE
|
||||
|
||||
DIST_ARCHIVE_SRPM=$(distdir).src.rpm
|
||||
.PHONY: srpm
|
||||
$(DIST_ARCHIVE_SRPM) srpm: dist-bzip2
|
||||
rm -f $(DIST_ARCHIVE_SRPM)
|
||||
$(RPM) --define="_sourcedir `pwd`" --define="_srcrpmdir `pwd`" --nodeps --bs ImageMagick.spec
|
||||
@echo ==============================================================
|
||||
@echo $(DIST_ARCHIVE_SRPM) is ready for distribution.
|
||||
@echo ==============================================================
|
||||
|
||||
RPMDIR=rpmbuild
|
||||
RPMARCH=$(MAGICK_TARGET_CPU)
|
||||
|
||||
DIST_ARCHIVE_RPM= \
|
||||
$(RPMDIR)/$(RPMARCH)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)-$(PACKAGE_PATCHLEVEL_VERSION).$(RPMARCH).rpm \
|
||||
$(RPMDIR)/$(RPMARCH)/$(PACKAGE_NAME)-c++-$(PACKAGE_VERSION)-$(PACKAGE_PATCHLEVEL_VERSION).$(RPMARCH).rpm \
|
||||
$(RPMDIR)/$(RPMARCH)/$(PACKAGE_NAME)-c++-devel-$(PACKAGE_VERSION)-$(PACKAGE_PATCHLEVEL_VERSION).$(RPMARCH).rpm \
|
||||
$(RPMDIR)/$(RPMARCH)/$(PACKAGE_NAME)-devel-$(PACKAGE_VERSION)-$(PACKAGE_PATCHLEVEL_VERSION).$(RPMARCH).rpm \
|
||||
$(RPMDIR)/$(RPMARCH)/$(PACKAGE_NAME)-perl-$(PACKAGE_VERSION)-$(PACKAGE_PATCHLEVEL_VERSION).$(RPMARCH).rpm
|
||||
|
||||
.PHONY: rpm
|
||||
rpm: dist
|
||||
rm -rf $(RPMDIR)
|
||||
$(mkinstalldirs) $(RPMDIR)
|
||||
$(mkinstalldirs) $(RPMDIR)/BUILD
|
||||
$(mkinstalldirs) $(RPMDIR)/RPMS
|
||||
$(RPM) --define="_sourcedir `pwd`" --define="_rpmdir `pwd`/$(RPMDIR)/RPMS" --define="_builddir `pwd`/$(RPMDIR)/BUILD" --nodeps -bb ImageMagick.spec
|
||||
@echo ==============================================================
|
||||
@echo $(DIST_ARCHIVE_RPM) is ready for distribution.
|
||||
@echo ==============================================================
|
||||
|
||||
else
|
||||
DIST_ARCHIVE_RPM=
|
||||
endif # RPM_DELEGATE
|
||||
|
||||
#
|
||||
# Build a validated snapshot release and move to the snapshots directory.
|
||||
#
|
||||
snapshot: distcheck
|
||||
$(MAKE) $(DIST_ARCHIVE_SRPM)
|
||||
$(MAKE) $(DIST_WINDOWS_SRC_ZIP)
|
||||
$(MAKE) $(DIST_WINDOWS_SRC_7ZIP)
|
||||
mv $(DIST_ARCHIVES) $(DIST_WINDOWS_SRC_ZIP) $(DIST_WINDOWS_SRC_7ZIP) $(DIST_ARCHIVE_SRPM) /var/ftp/pub/ImageMagick/beta/
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,33 @@
|
|||
ImageMagick version 7 has been released. We encourage you to migrate your
|
||||
workstreams to version 7. However, we recognize a significant version 6 user
|
||||
community. As such, the ImageMagick development team is committed to maintain,
|
||||
but not enhance, version 6 at least until 2028 and possibly beyond.
|
||||
|
||||
We discovered a bug in the pseudo-random generator prior to ImageMagick
|
||||
6.9.10-81, the first 3 values repeated because the random state was not
|
||||
initialized properly. As a consequence of the fix, expect a different
|
||||
numerical sequence when seeding (-seed).
|
||||
|
||||
ImageMagick best practices strongly encourages you to configure a security
|
||||
policy that best suits your local environment.
|
||||
|
||||
The ImageMagick development process ensures a stable API and ABI. Before each
|
||||
ImageMagick release, we perform a comprehensive security assessment that
|
||||
includes memory error, thread data race detection, and continuous fuzzing
|
||||
to detect and prevent security vulnerabilities.
|
||||
|
||||
As an analog to linear (RGB) and non-linear (sRGB) color colorspaces, as
|
||||
of ImageMagick 6.9.9-29, we introduce the LinearGray colorspace. Gray is
|
||||
non-linear grayscale and LinearGray is linear (e.g. -colorspace linear-gray).
|
||||
|
||||
Want more performance from ImageMagick? Try these options:
|
||||
|
||||
add more memory to your system;
|
||||
add more cores to your system;
|
||||
reduce lock contention with the tcmalloc memory allocation library;
|
||||
push large images to a solid-state drive, see large image support.
|
||||
|
||||
If these options are prohibitive, you can reduce the quality of the image
|
||||
results. The default build is Q16. If you instead use a Q8 build, you use half
|
||||
the memory The tradeoff is reduced precision. For a Q8 build of ImageMagick,
|
||||
use this configure script option: --with-quantum-depth=8.
|
|
@ -0,0 +1,240 @@
|
|||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
|
||||
1. ImageMagick copyright:
|
||||
|
||||
Copyright 1999-2021 ImageMagick Studio LLC, a non-profit organization dedicated
|
||||
to making software imaging solutions freely available.
|
||||
|
||||
You may not use this file except in compliance with the License. You may obtain
|
||||
a copy of the License at
|
||||
|
||||
https://imagemagick.org/script/license.php
|
||||
|
||||
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.
|
||||
|
||||
The full text of this license is availaible in the LICENSE file.
|
||||
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
|
||||
2. E. I. du Pont de Nemours and Company copyright (ImageMagick was originally
|
||||
developed and distributed by E. I. du Pont de Nemours and Company):
|
||||
|
||||
Copyright 1999 E. I. du Pont de Nemours and Company
|
||||
|
||||
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 E. I.
|
||||
du Pont de Nemours and Company 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 E. I. du Pont de Nemours
|
||||
and Company shall not be used in advertising or otherwise to promote the sale,
|
||||
use or other dealings in ImageMagick without prior written authorization from
|
||||
the E. I. du Pont de Nemours and Company.
|
||||
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
|
||||
3. OpenSSH copyright (this copyright is limited to magick/utility.c/
|
||||
Base64Decode() and Base64Encode(),incorporated from the OpenSSH package):
|
||||
|
||||
Copyright (c) 2000 Markus Friedl. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR \`\`AS IS\'\' AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
|
||||
4. Xfig copyright (this copyright is limited to the image patterns in
|
||||
magick/nt-base.c, incorporated from the XFig package):
|
||||
|
||||
| FIG : Facility for Interactive Generation of figures
|
||||
| Copyright (c) 1985-1988 by Supoj Sutanthavibul
|
||||
| Parts Copyright (c) 1989-2000 by Brian V. Smith
|
||||
| Parts Copyright (c) 1991 by Paul King
|
||||
|
||||
Any party obtaining a copy of these files is granted, free of charge, a full
|
||||
and unrestricted irrevocable, world-wide, paid up, royalty-free, nonexclusive
|
||||
right and license to deal in this software and documentation files (the
|
||||
"Software"), including without limitation the rights to use, copy, modify,
|
||||
merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
||||
to permit persons who receive copies from any such party to do so, with the
|
||||
only requirement being that this copyright notice remain intact.
|
||||
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
|
||||
5. ezXML copyright (This copyright is limited to code for reading XML files in
|
||||
magick/xml-tree.c, incorporated from the ezxml package):
|
||||
|
||||
Copyright 2004-2006 Aaron Voisine <aaron@voisine.org>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), 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.
|
||||
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
|
||||
6. GraphicsMagick copyright (this copyright is limited to the Windows installer
|
||||
and enhancements to the automake and autoconf configure scripts,
|
||||
incorporated from the GraphicsMagick package):
|
||||
|
||||
Copyright (C) 2002 - 2009 GraphicsMagick Group
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), 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.
|
||||
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
|
||||
7. Magick++ copyright (this copyright is limited to the Magick++ API in the
|
||||
Magick++ folder):
|
||||
|
||||
Copyright 1999 - 2002 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
the source files and associated documentation files ("Magick++"), to deal in
|
||||
Magick++ without restriction, including without limitation of the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of Magick++, and to permit persons to whom the Magick++ is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
This copyright notice shall be included in all copies or substantial portions
|
||||
of Magick++. The copyright to Magick++ is retained by its author and shall not
|
||||
be subsumed or replaced by any other copyright.
|
||||
|
||||
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 Bob Friesenhahn
|
||||
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
|
||||
Magick++ or the use or other dealings in Magick++.
|
||||
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
|
||||
8. Thatcher Ulrich copyright (ImageMagick includes two fonts,
|
||||
PerlMagick/t/ttf/input.ttf and PerlMagick/demo/Generic.ttf under this
|
||||
copyright):
|
||||
|
||||
Copyright: 2004-2007, Thatcher Ulrich <tu@tulrich.com>
|
||||
|
||||
I have placed these fonts in the Public Domain. This is all 100% my own work.
|
||||
Usage is totally unrestricted. If you want to make derivative works for any
|
||||
purpose, please go ahead.
|
||||
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
|
||||
9. Gsview copyright (ImageMagick incorporated a small portion of code from the
|
||||
gsview package to locate Ghostscript under Windows. This source code is
|
||||
distributed under the following license):
|
||||
|
||||
Copyright (C) 2000-2002, Ghostgum Software Pty Ltd. All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this file ("Software"), 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 this Software, and to permit persons to whom
|
||||
this file is furnished to do so, subject to the following conditions:
|
||||
|
||||
This Software is distributed with NO WARRANTY OF ANY KIND. No author or
|
||||
distributor accepts any responsibility for the consequences of using it, or
|
||||
for whether it serves any particular purpose or works at all, unless he or she
|
||||
says so in writing.
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
|
||||
10. Libsquish copyright (this copyright is limited to the compression used in
|
||||
coder/dds.c, incorporated from the libsquish library):
|
||||
|
||||
Copyright (c) 2006 Simon Brown si@sjbrown.co.uk
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), 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.
|
||||
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
|
||||
11. Bootstrap copyright (ImageMagick utilizes CSS for its web pages under this
|
||||
copyright):
|
||||
|
||||
Bootstrap v3.3.5 (http://getbootstrap.com)
|
||||
Copyright 2011-2015 Twitter, Inc.
|
||||
Licensed under the MIT license
|
||||
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
@ -0,0 +1,119 @@
|
|||
2021-01-16 6.9.11 Cristy <quetzlzacatenango@image...>
|
||||
* requires ImageMagick 6.9.11 or above.
|
||||
|
||||
2014-11-05 6.8.9-8 Cristy <quetzlzacatenango@image...>
|
||||
* Add support $image->Colorspace() (reference
|
||||
https://imagemagick.org/discourse-server/viewtopic.php?f=7&t=30980).
|
||||
|
||||
2014-03-18 6.8.8-9 Cristy <quetzlzacatenango@image...>
|
||||
* Quantize() arguments global and transparent switched (reference
|
||||
www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=25238).
|
||||
|
||||
2011-12-25 6.7.4-2 Cristy <quetzlzacatenango@image...>
|
||||
* Relax when PerlMagick tosses an image when an exception is thrown.
|
||||
|
||||
2011-12-20 6.7.4-1 Cristy <quetzlzacatenango@image...>
|
||||
* Use PTR2IV() and INT2PTR() macros to avoid int to ptr cast messages.
|
||||
|
||||
2011-08-25 6.7.2-0 Cristy <quetzlzacatenango@image...>
|
||||
* Fix fault for Thumbnail() with GIF animation (problem report and patch
|
||||
from Shigeki Morimoto).
|
||||
|
||||
2011-08-09 6.7.1-4 Cristy <quetzlzacatenango@image...>
|
||||
* Add a simple "ignore this type" style typemap to get past a xsubpp
|
||||
exception in recent versions of Perl.
|
||||
|
||||
2011-06-06 6.7.0-5 Cristy <quetzlzacatenango@image...>
|
||||
* Set modulate() colorspace predicated on parameter (e.g. brightness is HSB).
|
||||
|
||||
2011-01-25 6.6.7-3 Cristy <quetzlzacatenango@image...>
|
||||
* Verify color parameter is a Perl array to avoid seg fault (reference
|
||||
https://imagemagick.org/discourse-server/viewtopic.php?f=7&t=17928).
|
||||
|
||||
2010-11-11 6.6.5-6 Cristy <quetzlzacatenango@image...>
|
||||
* Check that image exists before accessing its member (reference
|
||||
https://imagemagick.org/discourse-server/viewtopic.php?f=2&t=17502).
|
||||
|
||||
2010-11-01 6.6.5-6 Cristy <quetzlzacatenango@image...>
|
||||
* The gravity attribute must set the ImageInfo gravity property (reference
|
||||
https://imagemagick.org/discourse-server/viewtopic.php?f=3&t=17282).
|
||||
|
||||
2009-12-08 6.5.8-5 <kmx@volny...>
|
||||
* A couple of minor changes to Makefile.PL to support Strawberry Perl.
|
||||
|
||||
2009-12-06 6.5.8-4 Cristy <quetzlzacatenango@image...>
|
||||
* Support the crop() gravity option.
|
||||
|
||||
2009-11-23 6.5.8-0 Cristy <quetzlzacatenango@image...>
|
||||
* Add 'dither' option to Remap().
|
||||
|
||||
2009-10-18 6.5.7-0 Cristy <quetzlzacatenango@image...>
|
||||
* Interpret gravity properly for ExtentImage().
|
||||
* Support the Modulate() method parameter, 'lightness.'
|
||||
|
||||
2009-10-08 6.5.6-10 <kmx@volny...>
|
||||
* Improve PerlMagick.PL to work with Strawberry Perl under Windows.
|
||||
|
||||
2009-08-02 6.5.4-8 Cristy <quetzlzacatenango@image...>
|
||||
* Create a image registry to track which image objects must be cloned
|
||||
when a Perl thread is created.
|
||||
|
||||
2009-06-14 6.5.3-7 Anthony Thyssen <A.Thyssen@griffith...>
|
||||
* Expand PerlMagick Composite() 'mask' merge for both compose 'displace'
|
||||
and new 'distort' mapping (absolute lookup)
|
||||
|
||||
2009-06-11 6.5.3-5 Anthony Thyssen <A.Thyssen@griffith...>
|
||||
* Fixed PerlMagick Composite() for correct merging of 'mask' image into
|
||||
the overlay image for Displacement Mapping Composition.
|
||||
|
||||
2009-06-02 6.5.3-2 Cristy <quetzlzacatenango@image...>
|
||||
* Fix filename parameter in Read() (e.g. $image->Read(filename=>'xc:white')).
|
||||
2009-04-14 6.5.1-3 Cristy <quetzlzacatenango@image...>
|
||||
* Support magick parameter for Read() (e.g.
|
||||
$im->Read( file => $fh, magick +> 'text:' )).
|
||||
|
||||
2008-11-16 6.4.4-5 Cristy <quetzlzacatenango@image...>
|
||||
* Statistics() returns normalized values.
|
||||
|
||||
2008-10-16 6.4.4-9 Michael.Kroell <michael.kroell@gmail...>
|
||||
* Check if Image::Magick::constant is defined in AUTOLOAD() function.
|
||||
|
||||
2008-06-07 6.4.1-9 Cristy <quetzlzacatenango@image...>
|
||||
* Permit settings of the form:
|
||||
$image->Set("quantum:polarity","min-is-white").
|
||||
|
||||
2008-04-07 6.4.0-5 Cristy <quetzlzacatenango@image...>
|
||||
* X11 regression test passed if the DISPLAY variable is not defined (reference
|
||||
https://imagemagick.org/discourse-server/viewtopic.php?f=3&t=10979).
|
||||
* Make regression test, x11/write.t, exit after 8 seconds as stated (reference
|
||||
https://imagemagick.org/discourse-server/viewtopic.php?f=3&t=10979).
|
||||
|
||||
2007-11-07 6.3.7-0 Cristy <quetzlzacatenango@image...>
|
||||
* Added gravity attribute to Transform() method.
|
||||
|
||||
2007-09-12 6.3.5-9 Cristy <quetzlzacatenango@image...>
|
||||
* Added GetPixel()/SetPixel() methods.
|
||||
|
||||
2007-06-22 6.3.4-2 grafman <grafman@graphcomp.com>
|
||||
* Add GetImagePixels to return C pointer for image cache.
|
||||
* Add SyncImagePixels to sync image cache.
|
||||
* Add Quantum parameter to Get API to return Quantum-Depth.
|
||||
|
||||
2007-06-21 6.3.4-1 Cristy <quetzlzacatenango@image...>
|
||||
* Add Distort.
|
||||
|
||||
2007-03-20 6.3.3-3 Cristy <quetzlzacatenango@image...>
|
||||
* Add vector-graphics parameter to the Draw() method.
|
||||
|
||||
blob length was not being set properly).
|
||||
2007-03-11 6.3.3-2 Cristy <quetzlzacatenango@image...>
|
||||
* Read(blob=>$blob) and Ping(blob=>$blob) sometimes failed because the
|
||||
blob length was not being set properly).
|
||||
|
||||
2007-01-23 cristy <cristy@virgi...>
|
||||
|
||||
* Add parameters fill-pattern and stroke-pattern to Annotate() and Draw().
|
||||
|
||||
2005-01-10 cristy <cristy@virgi...>
|
||||
* Added normalize parameter to GetPixels(). Use normalize=>'true' to return
|
||||
normalized pixel values.
|
|
@ -0,0 +1,552 @@
|
|||
Changelog
|
||||
check.sh.in
|
||||
demo/annotate.pl
|
||||
demo/button.pl
|
||||
demo/compose-specials.pl
|
||||
demo/composite.pl
|
||||
demo/demo.pl
|
||||
demo/dst.png
|
||||
demo/Generic.ttf
|
||||
demo/lsys.pl
|
||||
demo/Makefile
|
||||
demo/model.gif
|
||||
demo/piddle.pl
|
||||
demo/pink-flower.gif
|
||||
demo/pixel-fx.pl
|
||||
demo/README
|
||||
demo/red-flower.gif
|
||||
demo/shadow-text.pl
|
||||
demo/shapes.pl
|
||||
demo/single-pixels.pl
|
||||
demo/smile.gif
|
||||
demo/src.png
|
||||
demo/steganography.pl
|
||||
demo/tile.gif
|
||||
demo/tree.pl
|
||||
demo/Turtle.pm
|
||||
demo/yellow-flower.gif
|
||||
Makefile.am
|
||||
Makefile.nt
|
||||
Makefile.PL.in
|
||||
MANIFEST
|
||||
MANIFEST.SKIP
|
||||
README.txt
|
||||
t/blob.t
|
||||
t/bzlib/input.miff
|
||||
t/bzlib/read.t
|
||||
t/bzlib/write.t
|
||||
t/cgm/input.cgm
|
||||
t/cgm/read.t
|
||||
t/composite.t
|
||||
t/filter.t
|
||||
t/fpx/input_256.fpx
|
||||
t/fpx/input_bw.fpx
|
||||
t/fpx/input_grayscale.fpx
|
||||
t/fpx/input_jpeg.fpx
|
||||
t/fpx/input_truecolor.fpx
|
||||
t/fpx/read.t
|
||||
t/fpx/write.t
|
||||
t/getattribute.t
|
||||
t/hdf/input_256.hdf
|
||||
t/hdf/input_truecolor.hdf
|
||||
t/hdf/read.t
|
||||
t/hdf/write.t
|
||||
t/hpgl/input.hpgl
|
||||
t/hpgl/read.t
|
||||
t/input_16.miff
|
||||
t/input_70x46.cmyk
|
||||
t/input_70x46.gray
|
||||
t/input_70x46.rgb
|
||||
t/input_70x46.rgba
|
||||
t/input_70x46.uyvy
|
||||
t/input_70x46.yuv
|
||||
t/input.avs
|
||||
t/input.bie
|
||||
t/input.bmp
|
||||
t/input.bmp24
|
||||
t/input.dcx
|
||||
t/input.dib
|
||||
t/input.fits
|
||||
t/input.gif
|
||||
t/input.gif87
|
||||
t/input_gray_lsb_08bit.mat
|
||||
t/input_gray_lsb_double.mat
|
||||
t/input_gray_msb_08bit.mat
|
||||
t/input.ico
|
||||
t/input.im1
|
||||
t/input.im24
|
||||
t/input.im8
|
||||
t/input.mat
|
||||
t/input.miff
|
||||
t/input.mtv
|
||||
t/input_p1.pbm
|
||||
t/input_p2.pgm
|
||||
t/input_p3.ppm
|
||||
t/input_p4.pbm
|
||||
t/input_p5.pgm
|
||||
t/input_p6.ppm
|
||||
t/input.p7
|
||||
t/input_p7.p7
|
||||
t/input.pcx
|
||||
t/input.pict
|
||||
t/input.psd
|
||||
t/input_rgb_lsb_08bit.mat
|
||||
t/input.rle
|
||||
t/input.sgi
|
||||
t/input.tga
|
||||
t/input.tim
|
||||
t/input.viff
|
||||
t/input.wbmp
|
||||
t/input.wpg
|
||||
t/input.xbm
|
||||
t/input.xpm
|
||||
t/jbig/input.jbig
|
||||
t/jbig/read.t
|
||||
t/jbig/write.t
|
||||
t/jng/input_gray_idat.jng
|
||||
t/jng/input_gray_jdaa.jng
|
||||
t/jng/input_gray.jng
|
||||
t/jng/input_gray_prog_idat.jng
|
||||
t/jng/input_gray_prog_jdaa.jng
|
||||
t/jng/input_gray_prog.jng
|
||||
t/jng/input_idat.jng
|
||||
t/jng/input_jdaa.jng
|
||||
t/jng/input_prog_idat.jng
|
||||
t/jng/input_prog_jdaa.jng
|
||||
t/jng/input_prog.jng
|
||||
t/jng/input_rose.jng
|
||||
t/jng/read.t
|
||||
t/jng/write.t
|
||||
t/jpeg/input.jpg
|
||||
t/jpeg/input_plane.jpg
|
||||
t/jpeg/read.t
|
||||
t/jpeg/write.t
|
||||
t/MasterImage_70x46.ppm
|
||||
t/montage.t
|
||||
t/mpeg/input.m2v
|
||||
t/mpeg/input.mpg
|
||||
t/mpeg/read.t
|
||||
t/openjp2/input.jp2
|
||||
t/openjp2/input.jpc
|
||||
t/openjp2/read.t
|
||||
t/ping.t
|
||||
t/png/input_16.png
|
||||
t/png/input_256.png
|
||||
t/png/input_bw.png
|
||||
t/png/input.mng
|
||||
t/png/input_mono.png
|
||||
t/png/input_truecolor.png
|
||||
t/png/read-16.t
|
||||
t/png/read.t
|
||||
t/png/write-16.t
|
||||
t/png/write.t
|
||||
t/ps/input.eps
|
||||
t/ps/input.miff
|
||||
t/ps/input.ps
|
||||
t/ps/read.t
|
||||
t/ps/write.t
|
||||
t/rad/input.rad
|
||||
t/rad/read.t
|
||||
t/rad/write.t
|
||||
t/read.t
|
||||
t/reference/cgm/read.miff
|
||||
t/reference/composite/Add.miff
|
||||
t/reference/composite/Atop.miff
|
||||
t/reference/composite/Bumpmap.miff
|
||||
t/reference/composite/Clear.miff
|
||||
t/reference/composite/CopyBlue.miff
|
||||
t/reference/composite/CopyGreen.miff
|
||||
t/reference/composite/Copy.miff
|
||||
t/reference/composite/CopyOpacity.miff
|
||||
t/reference/composite/CopyRed.miff
|
||||
t/reference/composite/Difference.miff
|
||||
t/reference/composite/In.miff
|
||||
t/reference/composite/Minus.miff
|
||||
t/reference/composite/Multiply.miff
|
||||
t/reference/composite/Out.miff
|
||||
t/reference/composite/Over.miff
|
||||
t/reference/composite/Plus.miff
|
||||
t/reference/composite/Rotate.miff
|
||||
t/reference/composite/Subtract.miff
|
||||
t/reference/composite/Xor.miff
|
||||
t/reference/filter/AdaptiveThreshold.miff
|
||||
t/reference/filter/Annotate.miff
|
||||
t/reference/filter/Blur.miff
|
||||
t/reference/filter/Border.miff
|
||||
t/reference/filter/Channel.miff
|
||||
t/reference/filter/Charcoal.miff
|
||||
t/reference/filter/Chop.miff
|
||||
t/reference/filter/ColorFloodfill.miff
|
||||
t/reference/filter/Colorize.miff
|
||||
t/reference/filter/Contrast.miff
|
||||
t/reference/filter/Convolve.miff
|
||||
t/reference/filter/Crop.miff
|
||||
t/reference/filter/Despeckle.miff
|
||||
t/reference/filter/Draw.miff
|
||||
t/reference/filter/Edge.miff
|
||||
t/reference/filter/Emboss.miff
|
||||
t/reference/filter/Equalize.miff
|
||||
t/reference/filter/Flip.miff
|
||||
t/reference/filter/Flop.miff
|
||||
t/reference/filter/Frame.miff
|
||||
t/reference/filter/Gamma.miff
|
||||
t/reference/filter/GaussianBlur.miff
|
||||
t/reference/filter/Implode.miff
|
||||
t/reference/filter/Level.miff
|
||||
t/reference/filter/Magnify.miff
|
||||
t/reference/filter/MatteFloodfill.miff
|
||||
t/reference/filter/MedianFilter.miff
|
||||
t/reference/filter/Minify.miff
|
||||
t/reference/filter/Modulate.miff
|
||||
t/reference/filter/MotionBlur.miff
|
||||
t/reference/filter/Negate.miff
|
||||
t/reference/filter/Normalize.miff
|
||||
t/reference/filter/OilPaint.miff
|
||||
t/reference/filter/Opaque.miff
|
||||
t/reference/filter/Quantize.miff
|
||||
t/reference/filter/QuantizeMono.miff
|
||||
t/reference/filter/RadialBlur.miff
|
||||
t/reference/filter/Raise.miff
|
||||
t/reference/filter/ReduceNoise.miff
|
||||
t/reference/filter/Resize.miff
|
||||
t/reference/filter/Roll.miff
|
||||
t/reference/filter/Rotate.miff
|
||||
t/reference/filter/Sample.miff
|
||||
t/reference/filter/Scale.miff
|
||||
t/reference/filter/Segment.miff
|
||||
t/reference/filter/Set.miff
|
||||
t/reference/filter/Shade.miff
|
||||
t/reference/filter/Sharpen.miff
|
||||
t/reference/filter/Shave.miff
|
||||
t/reference/filter/Shear.miff
|
||||
t/reference/filter/SigmoidalContrast.miff
|
||||
t/reference/filter/Solarize.miff
|
||||
t/reference/filter/Swirl.miff
|
||||
t/reference/filter/Threshold.miff
|
||||
t/reference/filter/Trim.miff
|
||||
t/reference/filter/UnsharpMask.miff
|
||||
t/reference/filter/Wave.miff
|
||||
t/reference/jng/gray_idat_tmp.miff
|
||||
t/reference/jng/gray_jdaa_tmp.miff
|
||||
t/reference/jng/gray_prog_idat_tmp.miff
|
||||
t/reference/jng/gray_prog_jdaa_tmp.miff
|
||||
t/reference/jng/gray_prog_tmp.miff
|
||||
t/reference/jng/gray_tmp.miff
|
||||
t/reference/jng/idat_tmp.miff
|
||||
t/reference/jng/input_gray_idat.miff
|
||||
t/reference/jng/input_gray_jdaa.miff
|
||||
t/reference/jng/input_gray.miff
|
||||
t/reference/jng/input_gray_prog_idat.miff
|
||||
t/reference/jng/input_gray_prog_jdaa.miff
|
||||
t/reference/jng/input_gray_prog.miff
|
||||
t/reference/jng/input_idat.miff
|
||||
t/reference/jng/input_jdaa.miff
|
||||
t/reference/jng/input_prog_idat.miff
|
||||
t/reference/jng/input_prog_jdaa.miff
|
||||
t/reference/jng/input_prog.miff
|
||||
t/reference/jng/input_rose.miff
|
||||
t/reference/jng/jdaa_tmp.miff
|
||||
t/reference/jng/prog_idat_tmp.miff
|
||||
t/reference/jng/prog_jdaa_tmp.miff
|
||||
t/reference/jng/prog_tmp.miff
|
||||
t/reference/jng/read_gray_idat.miff
|
||||
t/reference/jng/read_gray_jdaa.miff
|
||||
t/reference/jng/read_gray.miff
|
||||
t/reference/jng/read_gray_prog_idat.miff
|
||||
t/reference/jng/read_gray_prog_jdaa.miff
|
||||
t/reference/jng/read_gray_prog.miff
|
||||
t/reference/jng/read_idat.miff
|
||||
t/reference/jng/read_jdaa.miff
|
||||
t/reference/jng/read_prog_idat.miff
|
||||
t/reference/jng/read_prog_jdaa.miff
|
||||
t/reference/jng/read_prog.miff
|
||||
t/reference/jng/write_gray_idat.miff
|
||||
t/reference/jng/write_gray_jdaa.miff
|
||||
t/reference/jng/write_gray.miff
|
||||
t/reference/jng/write_gray_prog_idat.miff
|
||||
t/reference/jng/write_gray_prog_jdaa.miff
|
||||
t/reference/jng/write_gray_prog.miff
|
||||
t/reference/jng/write_idat.miff
|
||||
t/reference/jng/write_jdaa.miff
|
||||
t/reference/jng/write_prog_idat.miff
|
||||
t/reference/jng/write_prog_jdaa.miff
|
||||
t/reference/jng/write_prog.miff
|
||||
t/reference/jpeg/read_non_interlaced.miff
|
||||
t/reference/jpeg/read_plane_interlaced.miff
|
||||
t/reference/jpeg/write_non_interlaced.miff
|
||||
t/reference/jpeg/write_plane_interlaced.miff
|
||||
t/reference/openjp2/read_jp2.miff
|
||||
t/reference/openjp2/read_jpc.miff
|
||||
t/reference/read/gradient.miff
|
||||
t/reference/read/granite.miff
|
||||
t/reference/read/input_avs.miff
|
||||
t/reference/read/input_bmp24.miff
|
||||
t/reference/read/input_bmp.miff
|
||||
t/reference/read/input_cmyk.miff
|
||||
t/reference/read/input_dcx.miff
|
||||
t/reference/read/input_dib.miff
|
||||
t/reference/read/input_fits.miff
|
||||
t/reference/read/input_gif87.miff
|
||||
t/reference/read/input_gif.miff
|
||||
t/reference/read/input_gray_lsb_08bit_mat.miff
|
||||
t/reference/read/input_gray_lsb_double_mat.miff
|
||||
t/reference/read/input_gray.miff
|
||||
t/reference/read/input_gray_msb_08bit_mat.miff
|
||||
t/reference/read/input_ico.miff
|
||||
t/reference/read/input_im1.miff
|
||||
t/reference/read/input_im24.miff
|
||||
t/reference/read/input_im8.miff
|
||||
t/reference/read/input_mat.miff
|
||||
t/reference/read/input_miff.miff
|
||||
t/reference/read/input_mtv.miff
|
||||
t/reference/read/input_null_black.miff
|
||||
t/reference/read/input_null_DarkOrange.miff
|
||||
t/reference/read/input_null_white.miff
|
||||
t/reference/read/input_p7.miff
|
||||
t/reference/read/input_pbm_p1.miff
|
||||
t/reference/read/input_pbm_p4.miff
|
||||
t/reference/read/input_pcx.miff
|
||||
t/reference/read/input_pgm_p2.miff
|
||||
t/reference/read/input_pgm_p5.miff
|
||||
t/reference/read/input_pict.miff
|
||||
t/reference/read/input_ppm_p3.miff
|
||||
t/reference/read/input_ppm_p6.miff
|
||||
t/reference/read/input_psd.miff
|
||||
t/reference/read/input_rgba.miff
|
||||
t/reference/read/input_rgb_lsb_08bit_mat.miff
|
||||
t/reference/read/input_rgb.miff
|
||||
t/reference/read/input_rle.miff
|
||||
t/reference/read/input_sgi.miff
|
||||
t/reference/read/input_tga.miff
|
||||
t/reference/read/input_tile.miff
|
||||
t/reference/read/input_tim.miff
|
||||
t/reference/read/input_uyvy.miff
|
||||
t/reference/read/input_viff.miff
|
||||
t/reference/read/input_wbmp.miff
|
||||
t/reference/read/input_wpg.miff
|
||||
t/reference/read/input_xbm.miff
|
||||
t/reference/read/input_xc_black.miff
|
||||
t/reference/read/input_xpm.miff
|
||||
t/reference/read/input_xwd.miff
|
||||
t/reference/ttf/annotate.miff
|
||||
t/reference/ttf/label.miff
|
||||
t/reference/ttf/read.miff
|
||||
t/reference/wmf/clock.miff
|
||||
t/reference/wmf/wizard.miff
|
||||
t/reference/write/cgm/read.miff
|
||||
t/reference/write/composite/Add.miff
|
||||
t/reference/write/composite/Atop.miff
|
||||
t/reference/write/composite/Bumpmap.miff
|
||||
t/reference/write/composite/Clear.miff
|
||||
t/reference/write/composite/CopyBlue.miff
|
||||
t/reference/write/composite/CopyGreen.miff
|
||||
t/reference/write/composite/Copy.miff
|
||||
t/reference/write/composite/CopyOpacity.miff
|
||||
t/reference/write/composite/CopyRed.miff
|
||||
t/reference/write/composite/Difference.miff
|
||||
t/reference/write/composite/In.miff
|
||||
t/reference/write/composite/Minus.miff
|
||||
t/reference/write/composite/Multiply.miff
|
||||
t/reference/write/composite/Out.miff
|
||||
t/reference/write/composite/Over.miff
|
||||
t/reference/write/composite/Plus.miff
|
||||
t/reference/write/composite/Rotate.miff
|
||||
t/reference/write/composite/Subtract.miff
|
||||
t/reference/write/composite/Xor.miff
|
||||
t/reference/write/filter/AdaptiveThreshold.miff
|
||||
t/reference/write/filter/Annotate.miff
|
||||
t/reference/write/filter/Blur.miff
|
||||
t/reference/write/filter/Border.miff
|
||||
t/reference/write/filter/Channel.miff
|
||||
t/reference/write/filter/Charcoal.miff
|
||||
t/reference/write/filter/Chop.miff
|
||||
t/reference/write/filter/ColorFloodfill.miff
|
||||
t/reference/write/filter/Colorize.miff
|
||||
t/reference/write/filter/Contrast.miff
|
||||
t/reference/write/filter/Convolve.miff
|
||||
t/reference/write/filter/Crop.miff
|
||||
t/reference/write/filter/Despeckle.miff
|
||||
t/reference/write/filter/Draw.miff
|
||||
t/reference/write/filter/Edge.miff
|
||||
t/reference/write/filter/Emboss.miff
|
||||
t/reference/write/filter/Equalize.miff
|
||||
t/reference/write/filter/Flip.miff
|
||||
t/reference/write/filter/Flop.miff
|
||||
t/reference/write/filter/Frame.miff
|
||||
t/reference/write/filter/Gamma.miff
|
||||
t/reference/write/filter/GaussianBlur.miff
|
||||
t/reference/write/filter/Implode.miff
|
||||
t/reference/write/filter/Level.miff
|
||||
t/reference/write/filter/Magnify.miff
|
||||
t/reference/write/filter/MatteFloodfill.miff
|
||||
t/reference/write/filter/MedianFilter.miff
|
||||
t/reference/write/filter/Minify.miff
|
||||
t/reference/write/filter/Modulate.miff
|
||||
t/reference/write/filter/MotionBlur.miff
|
||||
t/reference/write/filter/Negate.miff
|
||||
t/reference/write/filter/Normalize.miff
|
||||
t/reference/write/filter/OilPaint.miff
|
||||
t/reference/write/filter/Opaque.miff
|
||||
t/reference/write/filter/Quantize.miff
|
||||
t/reference/write/filter/RadialBlur.miff
|
||||
t/reference/write/filter/Raise.miff
|
||||
t/reference/write/filter/ReduceNoise.miff
|
||||
t/reference/write/filter/Resize.miff
|
||||
t/reference/write/filter/Roll.miff
|
||||
t/reference/write/filter/Rotate.miff
|
||||
t/reference/write/filter/Sample.miff
|
||||
t/reference/write/filter/Scale.miff
|
||||
t/reference/write/filter/Segment.miff
|
||||
t/reference/write/filter/Set.miff
|
||||
t/reference/write/filter/Shade.miff
|
||||
t/reference/write/filter/Sharpen.miff
|
||||
t/reference/write/filter/Shave.miff
|
||||
t/reference/write/filter/Shear.miff
|
||||
t/reference/write/filter/SigmoidalContrast.miff
|
||||
t/reference/write/filter/Solarize.miff
|
||||
t/reference/write/filter/Swirl.miff
|
||||
t/reference/write/filter/Threshold.miff
|
||||
t/reference/write/filter/Trim.miff
|
||||
t/reference/write/filter/UnsharpMask.miff
|
||||
t/reference/write/filter/Wave.miff
|
||||
t/reference/write/jng/gray_idat_tmp.miff
|
||||
t/reference/write/jng/gray_jdaa_tmp.miff
|
||||
t/reference/write/jng/gray_prog_idat_tmp.miff
|
||||
t/reference/write/jng/gray_prog_jdaa_tmp.miff
|
||||
t/reference/write/jng/gray_prog_tmp.miff
|
||||
t/reference/write/jng/gray_tmp.miff
|
||||
t/reference/write/jng/idat_tmp.miff
|
||||
t/reference/write/jng/input_gray_idat.miff
|
||||
t/reference/write/jng/input_gray_jdaa.miff
|
||||
t/reference/write/jng/input_gray.miff
|
||||
t/reference/write/jng/input_gray_prog_idat.miff
|
||||
t/reference/write/jng/input_gray_prog_jdaa.miff
|
||||
t/reference/write/jng/input_gray_prog.miff
|
||||
t/reference/write/jng/input_idat.miff
|
||||
t/reference/write/jng/input_jdaa.miff
|
||||
t/reference/write/jng/input_prog_idat.miff
|
||||
t/reference/write/jng/input_prog_jdaa.miff
|
||||
t/reference/write/jng/input_prog.miff
|
||||
t/reference/write/jng/input_rose.miff
|
||||
t/reference/write/jng/jdaa_tmp.miff
|
||||
t/reference/write/jng/prog_idat_tmp.miff
|
||||
t/reference/write/jng/prog_jdaa_tmp.miff
|
||||
t/reference/write/jng/prog_tmp.miff
|
||||
t/reference/write/jng/read_gray_idat.miff
|
||||
t/reference/write/jng/read_gray_jdaa.miff
|
||||
t/reference/write/jng/read_gray.miff
|
||||
t/reference/write/jng/read_gray_prog_idat.miff
|
||||
t/reference/write/jng/read_gray_prog_jdaa.miff
|
||||
t/reference/write/jng/read_gray_prog.miff
|
||||
t/reference/write/jng/read_idat.miff
|
||||
t/reference/write/jng/read_jdaa.miff
|
||||
t/reference/write/jng/read_prog_idat.miff
|
||||
t/reference/write/jng/read_prog_jdaa.miff
|
||||
t/reference/write/jng/read_prog.miff
|
||||
t/reference/write/jng/write_gray_idat.miff
|
||||
t/reference/write/jng/write_gray_jdaa.miff
|
||||
t/reference/write/jng/write_gray.miff
|
||||
t/reference/write/jng/write_gray_prog_idat.miff
|
||||
t/reference/write/jng/write_gray_prog_jdaa.miff
|
||||
t/reference/write/jng/write_gray_prog.miff
|
||||
t/reference/write/jng/write_idat.miff
|
||||
t/reference/write/jng/write_jdaa.miff
|
||||
t/reference/write/jng/write_prog_idat.miff
|
||||
t/reference/write/jng/write_prog_jdaa.miff
|
||||
t/reference/write/jng/write_prog.miff
|
||||
t/reference/write/jp2/read_jp2.miff
|
||||
t/reference/write/jp2/read_jpc.miff
|
||||
t/reference/write/jp2/read_pgx.miff
|
||||
t/reference/write/jpeg/read_non_interlaced.miff
|
||||
t/reference/write/jpeg/read_plane_interlaced.miff
|
||||
t/reference/write/jpeg/write_non_interlaced.miff
|
||||
t/reference/write/jpeg/write_plane_interlaced.miff
|
||||
t/reference/write/read/gradient.miff
|
||||
t/reference/write/read/granite.miff
|
||||
t/reference/write/read/input_avs.miff
|
||||
t/reference/write/read/input_bmp24.miff
|
||||
t/reference/write/read/input_bmp.miff
|
||||
t/reference/write/read/input_cmyk.miff
|
||||
t/reference/write/read/input_dcx.miff
|
||||
t/reference/write/read/input_dib.miff
|
||||
t/reference/write/read/input_fits.miff
|
||||
t/reference/write/read/input_gif87.miff
|
||||
t/reference/write/read/input_gif.miff
|
||||
t/reference/write/read/input_gray.miff
|
||||
t/reference/write/read/input_ico.miff
|
||||
t/reference/write/read/input_im1.miff
|
||||
t/reference/write/read/input_im24.miff
|
||||
t/reference/write/read/input_im8.miff
|
||||
t/reference/write/read/input_mat.miff
|
||||
t/reference/write/read/input_miff.miff
|
||||
t/reference/write/read/input_mtv.miff
|
||||
t/reference/write/read/input_null_black.miff
|
||||
t/reference/write/read/input_null_DarkOrange.miff
|
||||
t/reference/write/read/input_null_white.miff
|
||||
t/reference/write/read/input_p7.miff
|
||||
t/reference/write/read/input_pbm_p1.miff
|
||||
t/reference/write/read/input_pbm_p4.miff
|
||||
t/reference/write/read/input_pcx.miff
|
||||
t/reference/write/read/input_pgm_p2.miff
|
||||
t/reference/write/read/input_pgm_p5.miff
|
||||
t/reference/write/read/input_pict.miff
|
||||
t/reference/write/read/input_ppm_p3.miff
|
||||
t/reference/write/read/input_ppm_p6.miff
|
||||
t/reference/write/read/input_psd.miff
|
||||
t/reference/write/read/input_rgba.miff
|
||||
t/reference/write/read/input_rgb.miff
|
||||
t/reference/write/read/input_rle.miff
|
||||
t/reference/write/read/input_sgi.miff
|
||||
t/reference/write/read/input_tga.miff
|
||||
t/reference/write/read/input_tile.miff
|
||||
t/reference/write/read/input_tim.miff
|
||||
t/reference/write/read/input_uyvy.miff
|
||||
t/reference/write/read/input_viff.miff
|
||||
t/reference/write/read/input_wbmp.miff
|
||||
t/reference/write/read/input_wpg.miff
|
||||
t/reference/write/read/input_xbm.miff
|
||||
t/reference/write/read/input_xc_black.miff
|
||||
t/reference/write/read/input_xpm.miff
|
||||
t/reference/write/read/input_xwd.miff
|
||||
t/reference/write/ttf/annotate.miff
|
||||
t/reference/write/ttf/label.miff
|
||||
t/reference/write/ttf/read.miff
|
||||
t/reference/write/wmf/clock.miff
|
||||
t/reference/write/wmf/wizard.miff
|
||||
t/setattribute.t
|
||||
t/subroutines.pl
|
||||
t/tiff/input_16_matte.tiff
|
||||
t/tiff/input_16.tiff
|
||||
t/tiff/input_256_matte.tiff
|
||||
t/tiff/input_256_planar_contig.tiff
|
||||
t/tiff/input_256_planar_separate.tiff
|
||||
t/tiff/input_256.tiff
|
||||
t/tiff/input_gray_12bit.tiff
|
||||
t/tiff/input_gray_16bit.tiff
|
||||
t/tiff/input_gray_4bit_matte.tiff
|
||||
t/tiff/input_gray_4bit.tiff
|
||||
t/tiff/input_gray_8bit_matte.tiff
|
||||
t/tiff/input_gray_8bit.tiff
|
||||
t/tiff/input_mono.tiff
|
||||
t/tiff/input_truecolor_16.tiff
|
||||
t/tiff/input_truecolor_stripped.tiff
|
||||
t/tiff/input_truecolor.tiff
|
||||
t/tiff/input_truecolor_tiled32x32.tiff
|
||||
t/tiff/read.t
|
||||
t/tiff/write.t
|
||||
t/ttf/input.ttf
|
||||
t/ttf/read.t
|
||||
t/wmf/clock.wmf
|
||||
t/wmf/read.t
|
||||
t/wmf/wizard.wmf
|
||||
t/write.t
|
||||
t/x11/congrats.fig
|
||||
t/x11/congrats.miff
|
||||
t/x11/input.xwd
|
||||
t/x11/read.t
|
||||
t/x11/write.t
|
||||
t/xfig/input.fig
|
||||
t/xfig/read.t
|
||||
t/zlib/input.miff
|
||||
t/zlib/read.t
|
||||
t/zlib/write.t
|
|
@ -0,0 +1,16 @@
|
|||
.*\.gdbinit$
|
||||
.*core$
|
||||
/output.*$
|
||||
/test_.+_out\..+$
|
||||
Magick\.bs$
|
||||
Magick\.c$
|
||||
Magick\.o$
|
||||
\.bak$
|
||||
\.svn$
|
||||
\.old$
|
||||
^MANIFEST\.
|
||||
^MakeMaker-\d
|
||||
^Makefile$
|
||||
^blib/
|
||||
^pm_to_blib$
|
||||
~$
|
|
@ -0,0 +1,271 @@
|
|||
# Copyright 1999-2021 ImageMagick Studio LLC, a non-profit organization
|
||||
# dedicated to making software imaging solutions freely available.
|
||||
#
|
||||
# You may not use this file except in compliance with the License. You may
|
||||
# obtain a copy of the License at
|
||||
#
|
||||
# https://imagemagick.org/script/license.php
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# Exercise all regression tests:
|
||||
#
|
||||
# make test
|
||||
#
|
||||
# Exersise one regression test:
|
||||
#
|
||||
# make TEST_VERBOSE=1 TEST_FILES=t/filter.t test
|
||||
#
|
||||
|
||||
use ExtUtils::MakeMaker;
|
||||
use Config;
|
||||
use File::Spec::Functions qw/catfile catdir devnull catpath splitpath/;
|
||||
use Cwd;
|
||||
|
||||
sub AutodetectWin32gcc {
|
||||
my $wrkdir = getcwd();
|
||||
my $devnull = devnull();
|
||||
|
||||
my @incdir = ();
|
||||
my @libdir = ($wrkdir);
|
||||
my @bindir = ();
|
||||
|
||||
#try to get configuration info via identify or convert utilities
|
||||
my $conf = `identify -list Configure 2>$devnull` || `convert -list Configure 2>$devnull`;
|
||||
foreach my $line (split '\n', $conf) {
|
||||
if ($line =~ /^Path:\s+(.*)/) {
|
||||
my ($vol,$dir,$file) = splitpath($1);
|
||||
next unless $dir;
|
||||
my $dirpath = catpath( $vol, $dir);
|
||||
my (@l,@b,@i) = ( (),(),() );
|
||||
|
||||
# try to detect 'lib' dir
|
||||
push @l, catfile($dirpath,'lib');
|
||||
push @l, catfile($dirpath,'..','lib');
|
||||
push @l, catfile($dirpath,'..','..','lib');
|
||||
push @l, catfile($dirpath,'..','..','..','lib');
|
||||
foreach (@l) { push @libdir, $_ if (-d $_) };
|
||||
|
||||
# try to detect 'bin' dir
|
||||
push @b, catfile($dirpath);
|
||||
push @b, catfile($dirpath,'bin');
|
||||
push @b, catfile($dirpath,'..');
|
||||
push @b, catfile($dirpath,'..','bin');
|
||||
push @b, catfile($dirpath,'..','..');
|
||||
push @b, catfile($dirpath,'..','..','bin');
|
||||
push @b, catfile($dirpath,'..','..','..');
|
||||
push @b, catfile($dirpath,'..','..','..','bin');
|
||||
foreach (@b) { push @bindir, $_ if (-e "$_/convert.exe" || -e "$_/identify.exe") };
|
||||
|
||||
# try to detect 'include' dir
|
||||
push @i, catfile($dirpath,'include');
|
||||
push @i, catfile($dirpath,'include','ImageMagick');
|
||||
push @i, catfile($dirpath,'..','include');
|
||||
push @i, catfile($dirpath,'..','include','ImageMagick');
|
||||
push @i, catfile($dirpath,'..','..','include');
|
||||
push @i, catfile($dirpath,'..','..','include','ImageMagick');
|
||||
push @i, catfile($dirpath,'..','..','..','include');
|
||||
push @i, catfile($dirpath,'..','..','..','include','ImageMagick');
|
||||
foreach (@i) { push @incdir, $_ if (-e "$_/magick/MagickCore.h") };
|
||||
}
|
||||
};
|
||||
|
||||
foreach my $bin (@bindir) {
|
||||
opendir(my $bindir, $bin) or die qq{Cannot opendir $bin: $!};
|
||||
my @dlls = map {catfile($bin, $_)} grep /^\S*magick[^\+]\S*?\.dll$/i, readdir $bindir;
|
||||
foreach my $d (@dlls) {
|
||||
unlink "$wrkdir/libMagickCore.def", "$wrkdir/libMagickCore.a";
|
||||
system("pexports \"$d\" >\"$wrkdir/libMagickCore.def\" 2>$devnull");
|
||||
open(DEF, "<$wrkdir/libMagickCore.def");
|
||||
my @found = grep(/MagickCoreGenesis/, <DEF>); #checking if we have taken the right DLL
|
||||
close(DEF);
|
||||
next unless(@found);
|
||||
print STDERR "Gonna create 'libMagickCore.a' from '$d'\n";
|
||||
system("dlltool -D \"$d\" -d \"$wrkdir/libMagickCore.def\" -l \"$wrkdir/libMagickCore.a\" 2>$devnull");
|
||||
last if -s "$wrkdir/libMagickCore.a";
|
||||
}
|
||||
last if -s "$wrkdir/libMagickCore.a";
|
||||
}
|
||||
|
||||
unless(@incdir && @libdir && @bindir && (-s "$wrkdir/libMagickCore.a")) {
|
||||
print STDERR <<EOF
|
||||
################################### WARNING! ###################################
|
||||
# It seems that you are trying to install Perl::Magick on a MS Windows box with
|
||||
# perl + gcc compiler (e.g. strawberry perl), however we cannot find ImageMagick
|
||||
# binaries installed on your system.
|
||||
#
|
||||
# Please check the following prerequisites:
|
||||
#
|
||||
# 1) You need to have installed ImageMagick Windows binaries from
|
||||
# https://imagemagick.org/script/binary-releases.php#windows
|
||||
#
|
||||
# 2) We only support dynamic (DLL) ImageMagick binaries
|
||||
# note: it is not possible to mix 32/64-bit binaries of perl and ImageMagick
|
||||
#
|
||||
# 3) During installation select that you want to install ImageMagick's
|
||||
# development files (libraries+headers)
|
||||
#
|
||||
# 4) You also need to have ImageMagick's directory in your PATH
|
||||
# note: we are checking the presence of convert.exe and/or identify.exe tools
|
||||
#
|
||||
# 5) You might need Visual C++ Redistributable Package installed on your system
|
||||
# see instructions on ImageMagick's Binary Release webpage
|
||||
#
|
||||
# We are gonna continue, but chances for successful build are very low!
|
||||
################################################################################
|
||||
EOF
|
||||
}
|
||||
|
||||
my $inc = join ' ', map "-I\"$_\"", @incdir;
|
||||
my $lib = join ' ', map "-L\"$_\"", @libdir;
|
||||
|
||||
return ($inc, $lib);
|
||||
}
|
||||
|
||||
sub AutodetectDelegates {
|
||||
#try to get configuration info via identify or convert utilities
|
||||
my $devnull = devnull();
|
||||
my $conf = `identify -list Configure 2>$devnull` || `convert -list Configure 2>$devnull`;
|
||||
my @delegates = ();
|
||||
foreach my $line (split '\n', $conf) {
|
||||
next unless $line =~ /^DELEGATES\s+/;
|
||||
(undef, @delegates) = split /\s+/, $line;
|
||||
last;
|
||||
};
|
||||
return @delegates;
|
||||
}
|
||||
|
||||
# Compute test specification
|
||||
my $delegate_tests='t/*.t';
|
||||
my @tested_delegates = qw/bzlib djvu fftw fontconfig freetype jpeg jng openjp2 lcms png rsvg tiff x11 xml wmf zlib/;
|
||||
my @supported_delegates = AutodetectDelegates();
|
||||
# find the intersection of tested and supported delegates
|
||||
my %seen_delegates = ();
|
||||
$seen_delegates{$_}++ for @supported_delegates;
|
||||
foreach my $delegate (@tested_delegates) {
|
||||
if ( $seen_delegates{$delegate} ) {
|
||||
if ( -d "t/$delegate" ) {
|
||||
if ( defined($ENV{'DISPLAY'}) && ($^O ne 'MSWin32') ) {
|
||||
if ( defined $ENV{'DISPLAY'} ) {
|
||||
$delegate_tests .= " t/$delegate/*.t";
|
||||
}
|
||||
next;
|
||||
}
|
||||
$delegate_tests .= " t/$delegate/*.t";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# defaults for LIBS & INC & CCFLAGS params that we later pass to Writemakefile
|
||||
my $INC_magick = '-I../ -I.. -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I"' . $Config{'usrinc'} . '/ImageMagick"';
|
||||
my $LIBS_magick = '-L../magick/.libs -lMagickCore-6.Q16 -lperl -lm';
|
||||
my $CCFLAGS_magick = "$Config{'ccflags'} -I/usr/include/libxml2 -I/usr/include/libraw -I/usr/include/libpng16 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/uuid -I/usr/include/harfbuzz -I/usr/include/OpenEXR -pthread -I/usr/include/openjpeg-2.3 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/fribidi -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/uuid -pthread -fopenmp -Wall -g -O2 -mtune=amdfam10 -fexceptions -pthread -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16";
|
||||
my $LDFLAGS_magick = "-L../magick/.libs -lMagickCore-6.Q16 $Config{'ldflags'} ";
|
||||
my $LDDLFLAGS_magick = "-L../magick/.libs -lMagickCore-6.Q16 $Config{'lddlflags'} ";
|
||||
|
||||
if (($^O eq 'MSWin32') && ($Config{cc} =~ /gcc/)) {
|
||||
my($Ipaths, $Lpaths) = AutodetectWin32gcc();
|
||||
|
||||
#
|
||||
# Setup for strawberry perl.
|
||||
#
|
||||
$INC_magick = "$Ipaths";
|
||||
$LIBS_magick = "-lMagickCore-6.Q16";
|
||||
$CCFLAGS_magick = "$Config{'ccflags'}";
|
||||
$LDFLAGS_magick = "$Config{'ldflags'} $Lpaths ";
|
||||
$LDDLFLAGS_magick = "$Config{'lddlflags'} $Lpaths ";
|
||||
}
|
||||
|
||||
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
|
||||
# the contents of the Makefile that is written.
|
||||
WriteMakefile
|
||||
(
|
||||
# Module description
|
||||
'ABSTRACT' => 'ImageMagick PERL Extension',
|
||||
|
||||
# Perl module name is Image::Magick
|
||||
'NAME' => 'Image::Magick',
|
||||
|
||||
# Module author
|
||||
'AUTHOR' => 'ImageMagick Studio LLC',
|
||||
|
||||
# Module version
|
||||
'VERSION' => '6.9.11',
|
||||
|
||||
# Prerequisite version
|
||||
'PREREQ_PM' => {'parent' => '0'},
|
||||
|
||||
# Preprocessor defines
|
||||
'DEFINE' => ' -D_LARGE_FILES=1 -DHAVE_CONFIG_H', # e.g., '-DHAVE_SOMETHING'
|
||||
|
||||
# Header search specfication and preprocessor flags
|
||||
'INC' => $INC_magick,
|
||||
|
||||
# C compiler
|
||||
#'CC' => 'gcc',
|
||||
|
||||
# C pre-processor flags (e.g. -I & -D options)
|
||||
# 'CPPFLAGS' => "$Config{'cppflags'} -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 ",
|
||||
|
||||
# C compiler flags (e.g. -O -g)
|
||||
'CCFLAGS' => $CCFLAGS_magick,
|
||||
|
||||
# Linker
|
||||
#'LD' => $Config{'ld'} == $Config{'cc'} ? 'gcc' : $Config{'ld'},
|
||||
|
||||
# Linker flags for building an executable
|
||||
'LDFLAGS' => $LDFLAGS_magick,
|
||||
|
||||
# Linker flags for building a dynamically loadable module
|
||||
'LDDLFLAGS' => $LDDLFLAGS_magick,
|
||||
|
||||
# Install PerlMagick binary into ImageMagick bin directory
|
||||
'INSTALLBIN' => '/usr/bin',
|
||||
|
||||
# Library specification
|
||||
'LIBS' => [ $LIBS_magick ],
|
||||
|
||||
# Perl binary name (if a Perl binary is built)
|
||||
'MAP_TARGET' => 'PerlMagick',
|
||||
|
||||
# Let CFLAGS drive optimization flags by setting OPTIMIZE to empty
|
||||
# 'OPTIMIZE' => '',
|
||||
|
||||
# Use same compiler as ImageMagick
|
||||
'PERLMAINCC' => ' -fopenmp',
|
||||
'AR' => 'ar',
|
||||
'LD' => '',
|
||||
|
||||
# Set Perl installation prefix to ImageMagick installation prefix
|
||||
# 'PREFIX' => '/usr',
|
||||
|
||||
# Include delegate directories in tests
|
||||
test => { TESTS => $delegate_tests},
|
||||
|
||||
($Config{'archname'} =~ /-object$/i ? ('CAPI' => 'TRUE') : ()),
|
||||
|
||||
# sane version
|
||||
depend => { '$(FIRST_MAKEFILE)' => '$(VERSION_FROM)' }
|
||||
);
|
||||
|
||||
|
||||
#
|
||||
# Substitutions for "makeaperl" section.
|
||||
#
|
||||
sub MY::makeaperl {
|
||||
package MY; # so that "SUPER" works right
|
||||
my $inherited = shift->SUPER::makeaperl(@_);
|
||||
|
||||
# Stinky ExtUtils::MM_Unix likes to append its own library path to $(CC),
|
||||
# prior to any user-specified library path so that an installed library is
|
||||
# used rather than the library just built. This substitution function
|
||||
# tries to insert our library path first. Also, use the same compiler used
|
||||
# to build perlmain.c to link so that a C++ compiler may be used if
|
||||
# necessary.
|
||||
$inherited =~ s:MAP_LINKCMD\s.*\s*\$\(CC\):MAP_LINKCMD = \$(PERLMAINCC) -L/usr/lib64: ;
|
||||
$inherited;
|
||||
}
|
|
@ -0,0 +1,271 @@
|
|||
# Copyright 1999-2021 ImageMagick Studio LLC, a non-profit organization
|
||||
# dedicated to making software imaging solutions freely available.
|
||||
#
|
||||
# You may not use this file except in compliance with the License. You may
|
||||
# obtain a copy of the License at
|
||||
#
|
||||
# https://imagemagick.org/script/license.php
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# Exercise all regression tests:
|
||||
#
|
||||
# make test
|
||||
#
|
||||
# Exersise one regression test:
|
||||
#
|
||||
# make TEST_VERBOSE=1 TEST_FILES=t/filter.t test
|
||||
#
|
||||
|
||||
use ExtUtils::MakeMaker;
|
||||
use Config;
|
||||
use File::Spec::Functions qw/catfile catdir devnull catpath splitpath/;
|
||||
use Cwd;
|
||||
|
||||
sub AutodetectWin32gcc {
|
||||
my $wrkdir = getcwd();
|
||||
my $devnull = devnull();
|
||||
|
||||
my @incdir = ();
|
||||
my @libdir = ($wrkdir);
|
||||
my @bindir = ();
|
||||
|
||||
#try to get configuration info via identify or convert utilities
|
||||
my $conf = `identify -list Configure 2>$devnull` || `convert -list Configure 2>$devnull`;
|
||||
foreach my $line (split '\n', $conf) {
|
||||
if ($line =~ /^Path:\s+(.*)/) {
|
||||
my ($vol,$dir,$file) = splitpath($1);
|
||||
next unless $dir;
|
||||
my $dirpath = catpath( $vol, $dir);
|
||||
my (@l,@b,@i) = ( (),(),() );
|
||||
|
||||
# try to detect 'lib' dir
|
||||
push @l, catfile($dirpath,'lib');
|
||||
push @l, catfile($dirpath,'..','lib');
|
||||
push @l, catfile($dirpath,'..','..','lib');
|
||||
push @l, catfile($dirpath,'..','..','..','lib');
|
||||
foreach (@l) { push @libdir, $_ if (-d $_) };
|
||||
|
||||
# try to detect 'bin' dir
|
||||
push @b, catfile($dirpath);
|
||||
push @b, catfile($dirpath,'bin');
|
||||
push @b, catfile($dirpath,'..');
|
||||
push @b, catfile($dirpath,'..','bin');
|
||||
push @b, catfile($dirpath,'..','..');
|
||||
push @b, catfile($dirpath,'..','..','bin');
|
||||
push @b, catfile($dirpath,'..','..','..');
|
||||
push @b, catfile($dirpath,'..','..','..','bin');
|
||||
foreach (@b) { push @bindir, $_ if (-e "$_/convert.exe" || -e "$_/identify.exe") };
|
||||
|
||||
# try to detect 'include' dir
|
||||
push @i, catfile($dirpath,'include');
|
||||
push @i, catfile($dirpath,'include','ImageMagick');
|
||||
push @i, catfile($dirpath,'..','include');
|
||||
push @i, catfile($dirpath,'..','include','ImageMagick');
|
||||
push @i, catfile($dirpath,'..','..','include');
|
||||
push @i, catfile($dirpath,'..','..','include','ImageMagick');
|
||||
push @i, catfile($dirpath,'..','..','..','include');
|
||||
push @i, catfile($dirpath,'..','..','..','include','ImageMagick');
|
||||
foreach (@i) { push @incdir, $_ if (-e "$_/magick/MagickCore.h") };
|
||||
}
|
||||
};
|
||||
|
||||
foreach my $bin (@bindir) {
|
||||
opendir(my $bindir, $bin) or die qq{Cannot opendir $bin: $!};
|
||||
my @dlls = map {catfile($bin, $_)} grep /^\S*magick[^\+]\S*?\.dll$/i, readdir $bindir;
|
||||
foreach my $d (@dlls) {
|
||||
unlink "$wrkdir/libMagickCore.def", "$wrkdir/libMagickCore.a";
|
||||
system("pexports \"$d\" >\"$wrkdir/libMagickCore.def\" 2>$devnull");
|
||||
open(DEF, "<$wrkdir/libMagickCore.def");
|
||||
my @found = grep(/MagickCoreGenesis/, <DEF>); #checking if we have taken the right DLL
|
||||
close(DEF);
|
||||
next unless(@found);
|
||||
print STDERR "Gonna create 'libMagickCore.a' from '$d'\n";
|
||||
system("dlltool -D \"$d\" -d \"$wrkdir/libMagickCore.def\" -l \"$wrkdir/libMagickCore.a\" 2>$devnull");
|
||||
last if -s "$wrkdir/libMagickCore.a";
|
||||
}
|
||||
last if -s "$wrkdir/libMagickCore.a";
|
||||
}
|
||||
|
||||
unless(@incdir && @libdir && @bindir && (-s "$wrkdir/libMagickCore.a")) {
|
||||
print STDERR <<EOF
|
||||
################################### WARNING! ###################################
|
||||
# It seems that you are trying to install Perl::Magick on a MS Windows box with
|
||||
# perl + gcc compiler (e.g. strawberry perl), however we cannot find ImageMagick
|
||||
# binaries installed on your system.
|
||||
#
|
||||
# Please check the following prerequisites:
|
||||
#
|
||||
# 1) You need to have installed ImageMagick Windows binaries from
|
||||
# https://imagemagick.org/script/binary-releases.php#windows
|
||||
#
|
||||
# 2) We only support dynamic (DLL) ImageMagick binaries
|
||||
# note: it is not possible to mix 32/64-bit binaries of perl and ImageMagick
|
||||
#
|
||||
# 3) During installation select that you want to install ImageMagick's
|
||||
# development files (libraries+headers)
|
||||
#
|
||||
# 4) You also need to have ImageMagick's directory in your PATH
|
||||
# note: we are checking the presence of convert.exe and/or identify.exe tools
|
||||
#
|
||||
# 5) You might need Visual C++ Redistributable Package installed on your system
|
||||
# see instructions on ImageMagick's Binary Release webpage
|
||||
#
|
||||
# We are gonna continue, but chances for successful build are very low!
|
||||
################################################################################
|
||||
EOF
|
||||
}
|
||||
|
||||
my $inc = join ' ', map "-I\"$_\"", @incdir;
|
||||
my $lib = join ' ', map "-L\"$_\"", @libdir;
|
||||
|
||||
return ($inc, $lib);
|
||||
}
|
||||
|
||||
sub AutodetectDelegates {
|
||||
#try to get configuration info via identify or convert utilities
|
||||
my $devnull = devnull();
|
||||
my $conf = `identify -list Configure 2>$devnull` || `convert -list Configure 2>$devnull`;
|
||||
my @delegates = ();
|
||||
foreach my $line (split '\n', $conf) {
|
||||
next unless $line =~ /^DELEGATES\s+/;
|
||||
(undef, @delegates) = split /\s+/, $line;
|
||||
last;
|
||||
};
|
||||
return @delegates;
|
||||
}
|
||||
|
||||
# Compute test specification
|
||||
my $delegate_tests='t/*.t';
|
||||
my @tested_delegates = qw/bzlib djvu fftw fontconfig freetype jpeg jng openjp2 lcms png rsvg tiff x11 xml wmf zlib/;
|
||||
my @supported_delegates = AutodetectDelegates();
|
||||
# find the intersection of tested and supported delegates
|
||||
my %seen_delegates = ();
|
||||
$seen_delegates{$_}++ for @supported_delegates;
|
||||
foreach my $delegate (@tested_delegates) {
|
||||
if ( $seen_delegates{$delegate} ) {
|
||||
if ( -d "t/$delegate" ) {
|
||||
if ( defined($ENV{'DISPLAY'}) && ($^O ne 'MSWin32') ) {
|
||||
if ( defined $ENV{'DISPLAY'} ) {
|
||||
$delegate_tests .= " t/$delegate/*.t";
|
||||
}
|
||||
next;
|
||||
}
|
||||
$delegate_tests .= " t/$delegate/*.t";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# defaults for LIBS & INC & CCFLAGS params that we later pass to Writemakefile
|
||||
my $INC_magick = '-I../ -I@top_srcdir@ @CPPFLAGS@ -I"' . $Config{'usrinc'} . '/ImageMagick"';
|
||||
my $LIBS_magick = '-L../magick/.libs -lMagickCore-@MAGICK_MAJOR_VERSION@.@MAGICK_ABI_SUFFIX@ -lperl @MATH_LIBS@';
|
||||
my $CCFLAGS_magick = "$Config{'ccflags'} @CFLAGS@";
|
||||
my $LDFLAGS_magick = "-L../magick/.libs -lMagickCore-@MAGICK_MAJOR_VERSION@.@MAGICK_ABI_SUFFIX@ $Config{'ldflags'} @LDFLAGS@";
|
||||
my $LDDLFLAGS_magick = "-L../magick/.libs -lMagickCore-@MAGICK_MAJOR_VERSION@.@MAGICK_ABI_SUFFIX@ $Config{'lddlflags'} @LDFLAGS@";
|
||||
|
||||
if (($^O eq 'MSWin32') && ($Config{cc} =~ /gcc/)) {
|
||||
my($Ipaths, $Lpaths) = AutodetectWin32gcc();
|
||||
|
||||
#
|
||||
# Setup for strawberry perl.
|
||||
#
|
||||
$INC_magick = "$Ipaths";
|
||||
$LIBS_magick = "-lMagickCore-@MAGICK_MAJOR_VERSION@.@MAGICK_ABI_SUFFIX@";
|
||||
$CCFLAGS_magick = "$Config{'ccflags'}";
|
||||
$LDFLAGS_magick = "$Config{'ldflags'} $Lpaths ";
|
||||
$LDDLFLAGS_magick = "$Config{'lddlflags'} $Lpaths ";
|
||||
}
|
||||
|
||||
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
|
||||
# the contents of the Makefile that is written.
|
||||
WriteMakefile
|
||||
(
|
||||
# Module description
|
||||
'ABSTRACT' => 'ImageMagick PERL Extension',
|
||||
|
||||
# Perl module name is Image::Magick
|
||||
'NAME' => 'Image::Magick',
|
||||
|
||||
# Module author
|
||||
'AUTHOR' => 'ImageMagick Studio LLC',
|
||||
|
||||
# Module version
|
||||
'VERSION' => '@PACKAGE_BASE_VERSION@',
|
||||
|
||||
# Prerequisite version
|
||||
'PREREQ_PM' => {'parent' => '0'},
|
||||
|
||||
# Preprocessor defines
|
||||
'DEFINE' => '@LFS_CPPFLAGS@ @DEFS@', # e.g., '-DHAVE_SOMETHING'
|
||||
|
||||
# Header search specfication and preprocessor flags
|
||||
'INC' => $INC_magick,
|
||||
|
||||
# C compiler
|
||||
#'CC' => '@CC@',
|
||||
|
||||
# C pre-processor flags (e.g. -I & -D options)
|
||||
# 'CPPFLAGS' => "$Config{'cppflags'} @CPPFLAGS@",
|
||||
|
||||
# C compiler flags (e.g. -O -g)
|
||||
'CCFLAGS' => $CCFLAGS_magick,
|
||||
|
||||
# Linker
|
||||
#'LD' => $Config{'ld'} == $Config{'cc'} ? '@CC@' : $Config{'ld'},
|
||||
|
||||
# Linker flags for building an executable
|
||||
'LDFLAGS' => $LDFLAGS_magick,
|
||||
|
||||
# Linker flags for building a dynamically loadable module
|
||||
'LDDLFLAGS' => $LDDLFLAGS_magick,
|
||||
|
||||
# Install PerlMagick binary into ImageMagick bin directory
|
||||
'INSTALLBIN' => '@BIN_DIR@',
|
||||
|
||||
# Library specification
|
||||
'LIBS' => [ $LIBS_magick ],
|
||||
|
||||
# Perl binary name (if a Perl binary is built)
|
||||
'MAP_TARGET' => 'PerlMagick',
|
||||
|
||||
# Let CFLAGS drive optimization flags by setting OPTIMIZE to empty
|
||||
# 'OPTIMIZE' => '',
|
||||
|
||||
# Use same compiler as ImageMagick
|
||||
'PERLMAINCC' => '@PERLMAINCC@ @OPENMP_CFLAGS@',
|
||||
'AR' => '@AR@',
|
||||
'LD' => '@PERLMAINCC@',
|
||||
|
||||
# Set Perl installation prefix to ImageMagick installation prefix
|
||||
# 'PREFIX' => '@prefix@',
|
||||
|
||||
# Include delegate directories in tests
|
||||
test => { TESTS => $delegate_tests},
|
||||
|
||||
($Config{'archname'} =~ /-object$/i ? ('CAPI' => 'TRUE') : ()),
|
||||
|
||||
# sane version
|
||||
depend => { '$(FIRST_MAKEFILE)' => '$(VERSION_FROM)' }
|
||||
);
|
||||
|
||||
|
||||
#
|
||||
# Substitutions for "makeaperl" section.
|
||||
#
|
||||
sub MY::makeaperl {
|
||||
package MY; # so that "SUPER" works right
|
||||
my $inherited = shift->SUPER::makeaperl(@_);
|
||||
|
||||
# Stinky ExtUtils::MM_Unix likes to append its own library path to $(CC),
|
||||
# prior to any user-specified library path so that an installed library is
|
||||
# used rather than the library just built. This substitution function
|
||||
# tries to insert our library path first. Also, use the same compiler used
|
||||
# to build perlmain.c to link so that a C++ compiler may be used if
|
||||
# necessary.
|
||||
$inherited =~ s:MAP_LINKCMD\s.*\s*\$\(CC\):MAP_LINKCMD = \$(PERLMAINCC) -L@MAGICKCORE_PATH@: ;
|
||||
$inherited;
|
||||
}
|
|
@ -0,0 +1,138 @@
|
|||
# Copyright 1999-2021 ImageMagick Studio LLC, a non-profit organization
|
||||
# dedicated to making software imaging solutions freely available.
|
||||
#
|
||||
# You may not use this file except in compliance with the License. You may
|
||||
# obtain a copy of the License at
|
||||
#
|
||||
# https://imagemagick.org/script/license.php
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# Copyright (C) 2003 - 2008 GraphicsMagick Group
|
||||
#
|
||||
# Makefile for building PerlMagick.
|
||||
|
||||
# If source files missing, see if they can be obtained via VPATH
|
||||
|
||||
$(PERLMAGICK)/quantum/@MAGICK_ABI_SUFFIX@.xs: $(PERLMAGICK)/quantum/quantum.xs
|
||||
$(AM_V_GEN) $(LN_S) quantum.xs $@
|
||||
|
||||
$(PERLMAGICK)/quantum/@MAGICK_ABI_SUFFIX@.pm: $(PERLMAGICK)/quantum/quantum.pm
|
||||
$(AM_V_GEN) $(LN_S) quantum.pm $@
|
||||
|
||||
perl-quantum-sources: $(PERLMAGICK)/quantum/@MAGICK_ABI_SUFFIX@.xs $(PERLMAGICK)/quantum/@MAGICK_ABI_SUFFIX@.pm
|
||||
|
||||
perl-sources: perl-quantum-sources
|
||||
@if test -n "$(VPATH)" ; then \
|
||||
echo "Linking PerlMagick Sources ..." ; \
|
||||
imagemagick=`(cd $(VPATH) ; pwd)` && \
|
||||
( cd $(PERLMAGICK) && \
|
||||
sh $$imagemagick/config/lndir.sh $$imagemagick/$(PERLMAGICK) ; ) \
|
||||
fi ; \
|
||||
touch perl-sources
|
||||
|
||||
if WITH_PERL
|
||||
|
||||
PERLMAGICK=PerlMagick
|
||||
PERLMAKEMAKER=$(PERLMAGICK)/Makefile.PL
|
||||
PERLMAKEFILE=$(PERLMAGICK)/Makefile
|
||||
|
||||
PERLMAGICK_ALL_LOCAL_TARGETS = all-perl
|
||||
PERLMAGICK_INSTALL_EXEC_LOCAL_TARGETS = install-exec-perl
|
||||
PERLMAGICK_INSTALL_DATA_LOCAL_TARGETS =
|
||||
PERLMAGICK_UNINSTALL_LOCAL_TARGETS = uninstall-exec-perl
|
||||
PERLMAGICK_CLEAN_LOCAL_TARGETS = clean-perl
|
||||
PERLMAGICK_DISTCLEAN_LOCAL_TARGETS = clean-perl
|
||||
PERLMAGICK_MAINTAINER_CLEAN_LOCAL_TARGETS = distclean-local
|
||||
PERLMAGICK_TESTS = PerlMagick/check.sh
|
||||
|
||||
if WITH_PERL_DYNAMIC
|
||||
|
||||
PERLMAGICK_CHECKSCRPTS =
|
||||
|
||||
$(PERLMAKEFILE): perl-sources $(MAGICKCORE_LIBS) $(MAGICKWAND_LIBS) $(PERLMAKEMAKER)
|
||||
cd $(PERLMAGICK) && @PERL@ Makefile.PL $(PERL_MAKE_OPTIONS)
|
||||
|
||||
install-exec-perl: $(PERLMAKEFILE)
|
||||
( cd $(PERLMAGICK) && $(MAKE) CC='@CC@' && \
|
||||
$(MAKE) CC='@CC@' install )
|
||||
|
||||
all-perl: perl-sources
|
||||
|
||||
uninstall-exec-perl: $(PERLMAKEFILE)
|
||||
echo "Uninstall not supported for PerlMagick"
|
||||
|
||||
check-perl: $(PERLMAKEFILE)
|
||||
cd $(PERLMAGICK) && $(abs_top_builddir)/magick.sh $(MAKE) CC='@CC@' test
|
||||
|
||||
perl-build: $(PERLMAKEFILE)
|
||||
( cd $(PERLMAGICK) && $(MAKE) CC='@CC@' )
|
||||
|
||||
else
|
||||
if WITH_PERL_STATIC
|
||||
|
||||
PERLSTATICNAME=PerlMagick
|
||||
|
||||
PERLMAGICK_CHECKSCRPTS = perl-build
|
||||
|
||||
$(PERLMAKEFILE): perl-sources $(MAGICKCORE_LIBS) $(MAGICKWAND_LIBS) $(PERLMAKEMAKER)
|
||||
cd $(PERLMAGICK) && @PERL@ Makefile.PL MAP_TARGET=$(PERLSTATICNAME) $(PERL_MAKE_OPTIONS) && $(MAKE) Makefile ; $(MAKE) Makefile
|
||||
|
||||
$(PERLMAGICK)/$(PERLSTATICNAME): $(MAGICKCORE_LIBS) $(MAGICKWAND_LIBS) $(PERLMAKEFILE)
|
||||
( rm -f $(PERLMAGICK)/$(PERLSTATICNAME) ; cd $(PERLMAGICK) && $(MAKE) CC='@CC@' $(PERLSTATICNAME) ; $(MAKE) CC='@CC@' $(PERLSTATICNAME) )
|
||||
|
||||
all-perl: $(PERLMAGICK)/$(PERLSTATICNAME)
|
||||
|
||||
install-exec-perl: $(PERLMAGICK)/$(PERLSTATICNAME)
|
||||
rm -f "$(DESTDIR)$(BIN_DIR)/$(PERLSTATICNAME)"
|
||||
if test "x$(DESTDIR)" = "x" -o "$(PERL_SUPPORTS_DESTDIR)" = 'yes' ; then \
|
||||
( cd $(PERLMAGICK) && \
|
||||
$(MAKE) -f Makefile.aperl CC='@CC@' inst_perl MAP_TARGET=$(PERLSTATICNAME) \
|
||||
INSTALLBIN="$(BIN_DIR)" \
|
||||
) ; \
|
||||
else \
|
||||
( cd $(PERLMAGICK) && \
|
||||
$(MAKE) -f Makefile.aperl CC='@CC@' inst_perl MAP_TARGET=$(PERLSTATICNAME) \
|
||||
INSTALLBIN="$(DESTDIR)$(BIN_DIR)" PREFIX="$(DESTDIR)$(prefix)" \
|
||||
) ; \
|
||||
fi
|
||||
|
||||
uninstall-exec-perl:
|
||||
rm -f '$(DESTDIR)$(BIN_DIR)/$(PERLSTATICNAME)'
|
||||
|
||||
check-perl: $(PERLMAGICK)/$(PERLSTATICNAME)
|
||||
cd $(PERLMAGICK) && $(abs_top_builddir)/magick.sh $(MAKE) -f Makefile.aperl CC='@CC@' test
|
||||
|
||||
perl-build: $(PERLMAGICK)/$(PERLSTATICNAME)
|
||||
|
||||
endif # WITH_PERL_STATIC
|
||||
endif # WTIH_PERL_DYNAMIC
|
||||
|
||||
|
||||
clean-perl:
|
||||
(cd $(PERLMAGICK) && \
|
||||
( if test -f Makefile.old ; then $(MAKE) -f Makefile.old CC='@CC@' clean ; fi ) ; \
|
||||
( if test -f Makefile ; then $(MAKE) CC='@CC@' clean ; fi ) ; \
|
||||
( if test -f Makefile ; then $(MAKE) CC='@CC@' clean ; fi ) ; \
|
||||
rm -f Makefile.old PerlMagick ; \
|
||||
rm -f t/output* t/jng/*_tmp.jng t/*/output* ; \
|
||||
rm -f quantum/@MAGICK_ABI_SUFFIX@.xs;\
|
||||
rm -f quantum/@MAGICK_ABI_SUFFIX@.pm;\
|
||||
rm -f Magick.pm;)
|
||||
rm -f perl-sources
|
||||
|
||||
distclean-perl: clean-perl
|
||||
|
||||
else
|
||||
# Satisfy makefile requirements if not building PERL
|
||||
all-perl:
|
||||
install-exec-perl:
|
||||
uninstall-exec-perl:
|
||||
check-perl:
|
||||
clean-perl:
|
||||
distclean-perl:
|
||||
endif # WITH_PERL
|
|
@ -0,0 +1,169 @@
|
|||
# Copyright (C) 1999-2021 ImageMagick Studio LLC
|
||||
#
|
||||
# This program is covered by multiple licenses, which are described in
|
||||
# LICENSE. You should have received a copy of LICENSE with this
|
||||
# package; otherwise see https://imagemagick.org/script/license.php.
|
||||
#
|
||||
# Makefile for building PerlMagick under Windows
|
||||
#
|
||||
#
|
||||
#
|
||||
use ExtUtils::MakeMaker;
|
||||
use Config;
|
||||
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
|
||||
# the contents of the Makefile that is written.
|
||||
#
|
||||
# NOTE: The current ActiveState binary distribution does not completely setup
|
||||
# the values in C:/Perl/lib/Config.pm. You must manually modify the values of
|
||||
# libpth to add the VisualC++ library path. It should look similar to one of
|
||||
# the following examples in order to work properly.
|
||||
#
|
||||
# Random developer
|
||||
# libpth='"C:\Perl\lib\CORE" "D:\DevStudio\VC98\lib"'
|
||||
#
|
||||
# Visual Studio 6.0 default install:
|
||||
# libpth='"C:\Program Files\Microsoft Visual Studio\VC98\lib" "C:\Perl\lib\CORE"'
|
||||
#
|
||||
# Visual Studio 7.0 default install:
|
||||
# libpth='"C:\Program Files\Microsoft Visual Studio .NET\vc7\lib" "C:\Perl\lib\CORE"'
|
||||
#
|
||||
# Visual Studio 7.1 default install:
|
||||
# libpth='"C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib" "C:\Perl\lib\CORE"'
|
||||
#
|
||||
# Visual Studio 9.0 default install (C:\Perl\lib\Config.pm):
|
||||
# libpth='"C:\Program Files\Microsoft Visual Studio 9.0\VC\lib" "C:\Perl\lib\CORE"'
|
||||
#
|
||||
WriteMakefile(
|
||||
'ABSTRACT' => 'ImageMagick PERL Extension',
|
||||
'AUTHOR' => 'ImageMagick Studio',
|
||||
'NAME' => 'Image::Magick',
|
||||
'VERSION_FROM' => 'Magick.pm', # finds $VERSION
|
||||
'LIBS' => ['-L..\..\VisualMagick\lib -L..\..\VisualMagick\bin -lCORE_RL_magick_.lib -lCORE_DB_magick_.lib'],
|
||||
'DEFINE' => '-D_VISUALC_ -D_WINDOWS', # e.g., '-DHAVE_SOMETHING'
|
||||
'INC' => '-I.. -I..\xlib\include',
|
||||
'BINARY_LOCATION' => 'x86/Image-Magick.tar.gz',
|
||||
'dist' => {ZIP => "zip.exe", ZIPFLAGS=>"-r"},
|
||||
'clean' => {FILES => "Image-Magick.ppd Image-Magick.tar.gz PerlMagick.zip " },
|
||||
($Config{'archname'} =~ /-object$/i ? ('CAPI' => 'TRUE') : ()),
|
||||
);
|
||||
|
||||
#
|
||||
# Add a targets for building ActiveState ppm distribution modules
|
||||
# Dylan Beattie <dylan@zepler.org>, April 2002
|
||||
#
|
||||
# Requires tar, gzip, and zip. This produces PerlMagick.zip
|
||||
# Get GNU tar and gzip from http://sourceware.cygnus.com/
|
||||
# Get Win32 command line PKZIP from http://www.pkware.com/
|
||||
# and rename PKZIP.EXE to ZIP.EXE and PKUNZIP.EXE to UNZIP.EXE
|
||||
# Make sure tar.exe, gzip.exe and zip.exe are in your system path
|
||||
#
|
||||
# 'nmake ppm' will include only the PerlMagick module
|
||||
# 'nmake ppm-full' also includes all ImageMagick DLLs and MGK files
|
||||
|
||||
sub MY::postamble
|
||||
{
|
||||
'
|
||||
Image-Magick.tar.gz: ppd pure_all #htmlifypods manifypods
|
||||
if exist Image-Magick.tar.gz del Image-Magick.tar.gz
|
||||
if exist Image-Magick.tar del Image-Magick.tar
|
||||
$(TAR) $(TARFLAGS) Image-Magick.tar blib
|
||||
$(COMPRESS) -q Image-Magick.tar
|
||||
|
||||
release: Image-Magick.tar.gz
|
||||
|
||||
ppm: ppd pure_all htmlifypods manifypods
|
||||
if exist PerlMagick.zip del PerlMagick.zip
|
||||
$(TAR) $(TARFLAGS) Image-Magick.tar blib
|
||||
$(COMPRESS) -q Image-Magick.tar
|
||||
if exist x86 del x86 /f /q
|
||||
if exist x86 rd x86
|
||||
md x86
|
||||
copy Image-Magick.tar$(SUFFIX) x86
|
||||
del Image-Magick.tar$(SUFFIX)
|
||||
if exist ppm-readme.txt copy ppm-readme.txt readme
|
||||
$(ZIP) $(ZIPFLAGS) PerlMagick.zip readme Image-Magick.ppd x86/Image-Magick.tar$(SUFFIX)
|
||||
del x86\Image-Magick.tar$(SUFFIX)
|
||||
rd x86
|
||||
|
||||
ppm-full: ppd pure_all htmlifypods manifypods
|
||||
if exist PerlMagick-full.zip del PerlMagick-full.zip
|
||||
copy ..\..\VisualMagick\bin\*.dll blib\arch\auto\Image\Magick
|
||||
copy ..\..\VisualMagick\bin\*.xml blib\arch\auto\Image\Magick
|
||||
$(TAR) $(TARFLAGS) Image-Magick.tar blib
|
||||
$(COMPRESS) -q Image-Magick.tar
|
||||
if exist x86 del x86 /f /q
|
||||
if exist x86 rd x86
|
||||
md x86
|
||||
copy Image-Magick.tar$(SUFFIX) x86
|
||||
del Image-Magick.tar$(SUFFIX)
|
||||
if exist ppm-readme.txt copy ppm-readme.txt readme
|
||||
$(ZIP) $(ZIPFLAGS) PerlMagick-full.zip readme Image-Magick.ppd x86/Image-Magick.tar$(SUFFIX)
|
||||
del x86\Image-Magick.tar$(SUFFIX)
|
||||
rd x86
|
||||
'
|
||||
}
|
||||
|
||||
#
|
||||
# Modify the MakeMaker test fragment
|
||||
#
|
||||
sub MY::test
|
||||
{
|
||||
#
|
||||
# List any ImageMagick features derived from add-on libraries
|
||||
# or programs you would like to test.
|
||||
#
|
||||
# Valid choices are:
|
||||
#
|
||||
# Feature Formats Tested Prerequisites
|
||||
# ======= ====================== ======================================
|
||||
# bzlib BZip compression BZip library
|
||||
# cgm CGM format 'ralcgm' program
|
||||
# hdf HDF format HDF library
|
||||
# jbig JBIG format JBIG library
|
||||
# jpeg JPEG format JPEG library
|
||||
# mpeg MPEG format 'ffmpeg' program
|
||||
# png PNG format PNG and Zlib libraries
|
||||
# ps Postscript format 'gs' program and/or DPS library
|
||||
# rad Radiance format 'ra_ppm' program
|
||||
# tiff TIFF format TIFF library
|
||||
# ttf TrueType font format FreeType library
|
||||
# x X11 support X-windows libraries and server
|
||||
# xfig Xfig format 'transfig' program
|
||||
# zlib Zip compression Zlib library
|
||||
#
|
||||
my @DELEGATES = qw/ bzlib cgm jbig jpeg mpeg png ps tiff wmf x xfig zlib/;
|
||||
|
||||
package MY; # so that "SUPER" works right
|
||||
my $inherited = shift->SUPER::test(@_);
|
||||
my $delegate_tests=
|
||||
" t/setattribute.t" .
|
||||
" t/getattribute.t" .
|
||||
" t/filter.t" .
|
||||
" t/read.t" .
|
||||
" t/ping.t" .
|
||||
" t/montage.t" .
|
||||
" t/write.t" .
|
||||
" t/hpgl/read.t" .
|
||||
" t/jbig/read.t" .
|
||||
" t/jbig/write.t" .
|
||||
" t/jng/read.t" .
|
||||
" t/jng/write.t" .
|
||||
" t/openjp2/read.t" .
|
||||
" t/jpeg/read.t" .
|
||||
" t/jpeg/write.t" .
|
||||
" t/png/read.t" .
|
||||
" t/png/write.t" .
|
||||
" t/ps/read.t" .
|
||||
" t/ps/write.t" .
|
||||
" t/tiff/read.t" .
|
||||
" t/tiff/write.t" .
|
||||
" t/ttf/read.t" .
|
||||
" t/wmf/read.t" .
|
||||
" t/zlib/read.t" .
|
||||
" t/zlib/write.t";
|
||||
if ( defined $ENV{'DISPLAY'} ) {
|
||||
$delegate_tests .= " t/x11/write.t t/x11/read.t";
|
||||
}
|
||||
$inherited =~ s:^TEST_FILES =.*:TEST_FILES = ${delegate_tests}:m;
|
||||
$inherited;
|
||||
}
|
|
@ -0,0 +1,137 @@
|
|||
Introduction
|
||||
|
||||
PerlMagick, is an objected-oriented Perl interface to ImageMagick.
|
||||
Use the module to read, manipulate, or write an image or image sequence
|
||||
from within a Perl script. This makes it suitable for Web CGI scripts. You
|
||||
must have ImageMagick 6.8.11 or above installed on your system for this
|
||||
module to work properly.
|
||||
|
||||
See
|
||||
|
||||
https://imagemagick.org/script/perl-magick.php
|
||||
|
||||
for additional information about PerlMagick. If you have problems, go to
|
||||
|
||||
https://github.com/ImageMagick/ImageMagick6/discussions
|
||||
|
||||
for help. For instructions about installing ImageMagick, see
|
||||
|
||||
https://imagemagick.org/
|
||||
|
||||
|
||||
Installation
|
||||
|
||||
Get the PerlMagick distribution and type the following:
|
||||
|
||||
gunzip ImageMagick-6.9.11-58.tar.gz
|
||||
tar xvf ImageMagick-6.9.11
|
||||
|
||||
Follow the ImageMagick installation instructions in INSTALL-unix.txt
|
||||
then type
|
||||
|
||||
cd PerlMagick
|
||||
|
||||
Next, edit Makefile.PL and change LIBS and INC to include the appropriate
|
||||
path information to the required libMagick library. You will also need
|
||||
library search paths (-L) to JPEG, PNG, TIFF, etc. libraries if they were
|
||||
included with your installed version of ImageMagick. If an extension
|
||||
library is built as a shared library but not installed in the system's
|
||||
default library search path, you may need to add run-path information
|
||||
(often -R or -rpath) corresponding to the equivalent library search
|
||||
path option so that the library can be located at run-time.
|
||||
|
||||
To create and install the dymamically-loaded version of PerlMagick
|
||||
(the preferred way), execute
|
||||
|
||||
perl Makefile.PL
|
||||
make
|
||||
make install
|
||||
|
||||
To create and install a new 'perl' executable (replacing your existing
|
||||
PERL interpreter!) with PerlMagick statically linked (but other libraries
|
||||
linked statically or dynamically according to system linker default),
|
||||
execute
|
||||
|
||||
perl Makefile.PL
|
||||
make perl
|
||||
make -f Makefile.aperl inst_perl
|
||||
|
||||
or to create and install a new PERL interpreter with a different name
|
||||
than 'perl' (e.g. 'PerlMagick') and with PerlMagick statically linked
|
||||
|
||||
perl Makefile.PL MAP_TARGET=PerlMagick
|
||||
make PerlMagick
|
||||
make -f Makefile.aperl inst_perl
|
||||
|
||||
See the ExtUtils::MakeMaker(3) manual page for more information on
|
||||
building PERL extensions (like PerlMagick).
|
||||
|
||||
For Windows systems, type
|
||||
|
||||
perl Makefile.nt
|
||||
nmake install
|
||||
|
||||
For Unix, you typically need to be root to install the software.
|
||||
There are ways around this. Consult the Perl manual pages for more
|
||||
information. You are now ready to utilize the PerlMagick routines from
|
||||
within your Perl scripts.
|
||||
|
||||
Installation - Win32 Strawberry perl
|
||||
|
||||
On Win32 Strawberry perl the prefered way of installing PerlMagick is the
|
||||
following:
|
||||
|
||||
1) Download and install ImageMagick Windows binaries from
|
||||
https://imagemagick.org/script/binary-releases.php#windows
|
||||
|
||||
2) You HAVE TO choose dynamic (DLL) ImageMagick binaries. Note: it is not
|
||||
possible to mix 32/64bit binaries of perl and ImageMagick
|
||||
|
||||
3) During installation select that you want to install ImageMagick's
|
||||
development files (libraries+headers)
|
||||
|
||||
4) You NEED TO have ImageMagick's directory in your PATH. Note: we are
|
||||
checking the presence of convert.exe or identify.exe tools
|
||||
|
||||
5) You might need Visual C++ Redistributable Package installed on your
|
||||
system. See instructions on ImageMagick's Binary Release webpage.
|
||||
|
||||
6) If you have all prerequisites 1)...5) you can simply install
|
||||
ImageMagick by running: cpan -i Image::Magick
|
||||
|
||||
|
||||
Testing PerlMagick
|
||||
|
||||
Before PerlMagick is installed, you may want to execute
|
||||
|
||||
make test
|
||||
|
||||
to verify that PERL can load the PerlMagick extension ok. Chances are
|
||||
some of the tests will fail if you do not have the proper delegates
|
||||
installed for formats like JPEG, TIFF, etc.
|
||||
|
||||
To see a number of PerlMagick demonstration scripts, type
|
||||
|
||||
cd demo
|
||||
make
|
||||
|
||||
|
||||
Example Perl Magick Script
|
||||
|
||||
Here is an example script to get you started:
|
||||
|
||||
#!/usr/bin/perl
|
||||
use Image::Magick;
|
||||
|
||||
$q = Image::Magick->new;
|
||||
$x = $q->Read("model.gif", "logo.gif", "rose.gif");
|
||||
warn "$x" if $x;
|
||||
|
||||
$x = $q->Crop(geom=>'100x100+100+100');
|
||||
warn "$x" if $x;
|
||||
|
||||
$x = $q->Write("x.gif");
|
||||
warn "$x" if $x;
|
||||
|
||||
The script reads three images, crops them, and writes a single image
|
||||
as a GIF animation sequence.
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue