- Reorder folders and cleaning
- Subdir patches now is puredata. The pd bin file must be here - externals is now a subdir in puredata - The dir tcl now is a subdir in in the libremediaserver root folder - Deleted binaries files from the repository - Deleted ImagicMagick++ sources
This commit is contained in:
parent
39cb7800f7
commit
8b111d44a5
2228 changed files with 8 additions and 989802 deletions
BIN
externals/coll.pd_linux
vendored
BIN
externals/coll.pd_linux
vendored
Binary file not shown.
BIN
externals/counter.pd_linux
vendored
BIN
externals/counter.pd_linux
vendored
Binary file not shown.
BIN
externals/expr.pd_linux
vendored
BIN
externals/expr.pd_linux
vendored
Binary file not shown.
BIN
externals/fileselector.pd_linux
vendored
BIN
externals/fileselector.pd_linux
vendored
Binary file not shown.
BIN
externals/gate.pd_linux
vendored
BIN
externals/gate.pd_linux
vendored
Binary file not shown.
BIN
externals/list2symbol.pd_linux
vendored
BIN
externals/list2symbol.pd_linux
vendored
Binary file not shown.
BIN
externals/oggread~.pd_linux
vendored
BIN
externals/oggread~.pd_linux
vendored
Binary file not shown.
BIN
externals/ola2pd.pd_linux
vendored
BIN
externals/ola2pd.pd_linux
vendored
Binary file not shown.
BIN
externals/prepend.pd_linux
vendored
BIN
externals/prepend.pd_linux
vendored
Binary file not shown.
BIN
externals/split.pd_linux
vendored
BIN
externals/split.pd_linux
vendored
Binary file not shown.
BIN
pd
BIN
pd
Binary file not shown.
|
@ -1,135 +0,0 @@
|
|||
Cristy is the principal architect of ImageMagick and still maintains the
|
||||
ImageMagick distribution.
|
||||
|
||||
We acknowledge the substantial contributions to the ImageMagick project by
|
||||
these gifted individuals (listed in alphabetical order):
|
||||
|
||||
Kelly Bergougnoux
|
||||
Authored the Cineon image coder (based on the existing DPX source).
|
||||
|
||||
Rod Bogart and John W. Peterson, University of Utah
|
||||
Image compositing is loosely based on rlecomp of the Utah Raster Toolkit.
|
||||
|
||||
Nathan Brown
|
||||
Original author of the JP2 coder.
|
||||
|
||||
Mike Chiarappa
|
||||
Created a Borland C++ Builder 6.0 build environment for ImageMagick.
|
||||
|
||||
Thomas R Crimmins
|
||||
Inventor of the eight hull algorithm used for speckle reduction.
|
||||
|
||||
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.
|
||||
|
||||
Michael Halle, Spatial Imaging Group at MIT
|
||||
Contributed the initial implementation of Alan Paeth's image rotation
|
||||
algorithm.
|
||||
|
||||
David Harr
|
||||
Contributed (with Leonard Rosenthol) dash pattern, linecap stroking
|
||||
algorithm, and minor rendering improvements.
|
||||
|
||||
Christopher R. Hawks
|
||||
Authored the PALM coder.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
David Pensak, E. I. du Pont de Nemours and Company
|
||||
For providing the computing environment that made developing ImageMagick
|
||||
possible.
|
||||
|
||||
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.
|
||||
|
||||
Glenn Randers-Pehrson
|
||||
Contributed significantly to the utilities. Authored support for JNG,
|
||||
MNG, and PNG formats. Provided significant support for the BMP format.
|
||||
Significant improvements to the documentation, including creating a
|
||||
documentation authoring environment based on the <imdoc> format.
|
||||
|
||||
Paul Raveling, USC Information Sciences Institute
|
||||
The spatial subdivision color reduction algorithm is based on his Img
|
||||
software.
|
||||
|
||||
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.
|
||||
|
||||
Alvy Ray Smith and Eric Ray Lyons
|
||||
HWB color transform and algorithm.
|
||||
|
||||
Michael Still and IBM developer Works
|
||||
For the excellant article, "Graphics from the command line". First
|
||||
published by IBM DeveloperWorks.
|
||||
|
||||
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
|
||||
http://www.imagemagick.org/Usage/.
|
||||
|
||||
Milan Votava
|
||||
Contributed support for Wireless BitMap, used in WAP - Wireless Access
|
||||
Protocol.
|
||||
|
||||
Fred Weinhaus
|
||||
Contributed support and documentation for the discrete Fourier transform.
|
||||
Also provides scripts that perform some out-of-the ordinary image
|
||||
processing operations @ http://www.fmwconcepts.com/imagemagick/.
|
||||
|
||||
Alexander Zimmermann
|
||||
Responsible for the ImageMagick Linux binary distributions for many years.
|
||||
His efforts are very much appreciated.
|
File diff suppressed because it is too large
Load diff
|
@ -1,313 +0,0 @@
|
|||
%global VERSION @PACKAGE_VERSION@
|
||||
%global Patchlevel @PACKAGE_RELEASE@
|
||||
|
||||
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: http://www.imagemagick.org/script/license.php
|
||||
Url: http://www.imagemagick.org/
|
||||
Source0: http://www.imagemagick.org/download/%{name}/%{name}-%{VERSION}-%{Patchlevel}.tar.bz2
|
||||
|
||||
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, jasper-devel, libtool-ltdl-devel
|
||||
BuildRequires: libX11-devel, libXext-devel, libXt-devel
|
||||
BuildRequires: lcms-devel, libxml2-devel, librsvg2-devel, OpenEXR-devel
|
||||
|
||||
%description
|
||||
ImageMagick is a software suite to create, edit, and compose bitmap images. It
|
||||
can read, convert and write images in a variety of formats (about 100)
|
||||
including DPX, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG,
|
||||
and TIFF. Use ImageMagick to translate, flip, mirror, rotate, scale, 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 programming
|
||||
language. Choose from these interfaces: G2F (Ada), MagickCore (C), MagickWand
|
||||
(C), ChMagick (Ch), Magick++ (C++), JMagick (Java), L-Magick (Lisp), nMagick
|
||||
(Neko/haXe), PascalMagick (Pascal), PerlMagick (Perl), MagickWand for PHP
|
||||
(PHP), PythonMagick (Python), RMagick (Ruby), or TclMagick (Tcl/TK). With a
|
||||
language interface, use ImageMagick to modify or create images automagically
|
||||
and dynamically.
|
||||
|
||||
ImageMagick is free software delivered as a ready-to-run binary distribution
|
||||
or as source code that you may freely use, copy, modify, and distribute in
|
||||
both open and proprietary applications. It is distributed under an Apache
|
||||
2.0-style license, approved by the OSI.
|
||||
|
||||
The ImageMagick development process ensures a stable API and ABI. Before
|
||||
each ImageMagick release, we perform a comprehensive security assessment that
|
||||
includes memory and thread error detection to help prevent exploits.ImageMagick
|
||||
is free software delivered as a ready-to-run binary distribution or as source
|
||||
code that you may freely use, copy, modify, and distribute in both open and
|
||||
proprietary applications. It is distributed under an Apache 2.0-style license,
|
||||
approved by the OSI.
|
||||
|
||||
|
||||
%package devel
|
||||
Summary: Library links and header files for ImageMagick application development
|
||||
Group: Development/Libraries
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: libX11-devel, libXext-devel, libXt-devel
|
||||
Requires: ghostscript-devel
|
||||
Requires: bzip2-devel
|
||||
Requires: freetype-devel
|
||||
Requires: libtiff-devel
|
||||
Requires: libjpeg-devel
|
||||
Requires: lcms-devel
|
||||
Requires: jasper-devel
|
||||
Requires: pkgconfig
|
||||
|
||||
%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 djvu
|
||||
Summary: DjVu plugin for ImageMagick
|
||||
Group: Applications/Multimedia
|
||||
Requires: %{name} = %{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:
|
||||
http://www.imagemagick.org/.
|
||||
|
||||
|
||||
%package perl
|
||||
Summary: ImageMagick perl bindings
|
||||
Group: System Environment/Libraries
|
||||
Requires: %{name} = %{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} = %{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++ = %{version}-%{release}
|
||||
Requires: %{name}-devel = %{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}
|
||||
sed -i 's/libltdl.la/libltdl.so/g' configure
|
||||
iconv -f ISO-8859-1 -t UTF-8 README.txt > README.txt.tmp
|
||||
touch -r README.txt README.txt.tmp
|
||||
mv README.txt.tmp README.txt
|
||||
# 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-gslib \
|
||||
--with-wmf \
|
||||
--with-lcms \
|
||||
--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
|
||||
# Disable rpath
|
||||
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
|
||||
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
|
||||
# Do *NOT* use %%{?_smp_mflags}, this causes PerlMagick to be silently misbuild
|
||||
make
|
||||
|
||||
|
||||
%install
|
||||
rm -rf %{buildroot}
|
||||
|
||||
make 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 755 %{buildroot}%{perl_vendorarch}/auto/Image/Magick/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
|
||||
%ifarch x86_64 s390x ia64 ppc64 alpha sparc64
|
||||
%define wordsize 64
|
||||
%else
|
||||
%define wordsize 32
|
||||
%endif
|
||||
|
||||
mv %{buildroot}%{_includedir}/%{name}/magick/magick-config.h \
|
||||
%{buildroot}%{_includedir}/%{name}/magick/magick-config-%{wordsize}.h
|
||||
|
||||
cat >%{buildroot}%{_includedir}/%{name}/magick/magick-config.h <<EOF
|
||||
#ifndef IMAGEMAGICK_MULTILIB
|
||||
#define IMAGEMAGICK_MULTILIB
|
||||
|
||||
#include <bits/wordsize.h>
|
||||
|
||||
#if __WORDSIZE == 32
|
||||
# include "magick-config-32.h"
|
||||
#elif __WORDSIZE == 64
|
||||
# include "magick-config-64.h"
|
||||
#else
|
||||
# error "unexpected value for __WORDSIZE macro"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
EOF
|
||||
|
||||
%clean
|
||||
rm -rf %{buildroot}
|
||||
|
||||
%post -p /sbin/ldconfig
|
||||
|
||||
%post c++ -p /sbin/ldconfig
|
||||
|
||||
%postun -p /sbin/ldconfig
|
||||
|
||||
%postun c++ -p /sbin/ldconfig
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%doc QuickStart.txt ChangeLog Platforms.txt
|
||||
%doc README.txt LICENSE NOTICE AUTHORS.txt NEWS.txt
|
||||
%{_libdir}/libMagickCore*so*
|
||||
%{_libdir}/libMagickWand*so*
|
||||
%{_bindir}/[a-z]*
|
||||
%{_libdir}/%{name}-%{VERSION}
|
||||
%{_datadir}/%{name}-%{VERSION}
|
||||
%{_mandir}/man[145]/[a-z]*
|
||||
%{_mandir}/man1/%{name}.*
|
||||
%exclude %{_libdir}/%{name}-%{VERSION}/modules-Q16/coders/djvu.*
|
||||
%{_sysconfdir}/%{name}
|
||||
|
||||
%files devel
|
||||
%defattr(-,root,root,-)
|
||||
%{_bindir}/MagickCore-config
|
||||
%{_bindir}/Magick-config
|
||||
%{_bindir}/MagickWand-config
|
||||
%{_bindir}/Wand-config
|
||||
%{_libdir}/libMagickCore*so*
|
||||
%{_libdir}/libMagickWand*so*
|
||||
%{_libdir}/pkgconfig/MagickCore*.pc
|
||||
%{_libdir}/pkgconfig/ImageMagick*.pc
|
||||
%{_libdir}/pkgconfig/MagickWand*.pc
|
||||
%{_libdir}/pkgconfig/Wand*.pc
|
||||
%dir %{_includedir}/%{name}
|
||||
%{_includedir}/%{name}/magick
|
||||
%{_includedir}/%{name}/wand
|
||||
%{_mandir}/man1/Magick-config.*
|
||||
%{_mandir}/man1/MagickCore-config.*
|
||||
%{_mandir}/man1/Wand-config.*
|
||||
%{_mandir}/man1/MagickWand-config.*
|
||||
|
||||
%files djvu
|
||||
%defattr(-,root,root,-)
|
||||
%{_libdir}/%{name}-%{version}/modules-Q16/coders/djvu.*
|
||||
|
||||
%files doc
|
||||
%defattr(-,root,root,-)
|
||||
%doc %{_datadir}/doc/%{name}-%{VERSION}
|
||||
%doc LICENSE
|
||||
|
||||
%files c++
|
||||
%defattr(-,root,root,-)
|
||||
%doc Magick++/AUTHORS Magick++/ChangeLog Magick++/NEWS Magick++/README
|
||||
%doc www/Magick++/COPYING
|
||||
%{_libdir}/libMagick++*so*
|
||||
|
||||
%files c++-devel
|
||||
%defattr(-,root,root,-)
|
||||
%doc Magick++/examples
|
||||
%{_bindir}/Magick++-config
|
||||
%{_includedir}/%{name}/Magick++
|
||||
%{_includedir}/%{name}/Magick++.h
|
||||
%{_libdir}/libMagick++*so*
|
||||
%{_libdir}/pkgconfig/Magick++*.pc
|
||||
%{_libdir}/pkgconfig/ImageMagick++*.pc
|
||||
%{_mandir}/man1/Magick++-config.*
|
||||
|
||||
%files perl -f perl-pkg-files
|
||||
%defattr(-,root,root,-)
|
||||
%{_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.
|
|
@ -1,53 +0,0 @@
|
|||
Mac OS X-specific Build instructions
|
||||
|
||||
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.
|
||||
|
||||
Install the latest Xcode from Apple.
|
||||
|
||||
Use the port command to install any delegate libraries you require, for example:
|
||||
|
||||
$magick> sudo port install jpeg
|
||||
|
||||
Now lets 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 --with-x=yes \
|
||||
--x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib/ \
|
||||
--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.
|
||||
|
||||
To test the ImageMagick GUI, in a new shell, type:
|
||||
|
||||
$magick> display -display :0
|
|
@ -1,658 +0,0 @@
|
|||
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 it 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.7.5
|
||||
$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 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 wand 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.
|
|
@ -1,33 +0,0 @@
|
|||
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.
|
|
@ -1,403 +0,0 @@
|
|||
Download & Unpack
|
||||
|
||||
Building ImageMagick source for Windows requires a modern version of Microsoft
|
||||
Visual Studio IDE. Users have reported success with the Borland C++ compiler
|
||||
as well. If you don't have a compiler you can still install a self-installing
|
||||
binary release.
|
||||
|
||||
Download ImageMagick-windows.zip from ftp.imagemagick.org or its mirrors
|
||||
and verify the distribution against its message digest.
|
||||
|
||||
You can unpack the distribution with WinZip or type the following from any
|
||||
MS-DOS Command Prompt window:
|
||||
|
||||
$magick> unzip ImageMagick-windows.zip
|
||||
|
||||
Now that you have the ImageMagick Windows source distribution unpacked,
|
||||
let's configure it.
|
||||
|
||||
Configure
|
||||
|
||||
These instructions are specific to building ImageMagick with the Visual
|
||||
Studio under Windows XP, Win2K, or Windows 98. ImageMagick does not include
|
||||
any workspace (DSW) or project files (DSP) except for those included with
|
||||
third party libraries. Instead, there is a configure program that must be
|
||||
built and run which creates the Visual Studio workspaces for ImageMagick. The
|
||||
Visual Studio system provides four different types of runtime environments
|
||||
that must match across all application, library, and dynamic-library (DLL)
|
||||
code that is built. The configure program creates a set of build files that
|
||||
are consistent for a specific runtime selection listed here:
|
||||
|
||||
1. Dynamic Multi-threaded DLL runtimes (VisualDynamicMT).
|
||||
2. Static Single-threaded runtimes (VisualStaticST).
|
||||
3. Static Multi-threaded runtimes (VisualStaticMT).
|
||||
4. Static Multi-threaded DLL runtimes (VisualStaticMTDLL).
|
||||
|
||||
In addition to these runtimes, the VisualMagick build environment allows
|
||||
you to select whether to include the X11 libraries in the build or not. X11
|
||||
DLLs and headers are provided with the VisualMagick build environment. Most
|
||||
Windows users are probably not interested in using X11, so you might prefer
|
||||
to build without X11 support. Since the animate, display, and import program
|
||||
depends on the X11 delegate libraries, these programs will no work if you
|
||||
choose not to include X11 support.
|
||||
|
||||
This leads to five different possible build options. The default binary
|
||||
distribution is built using the Dynamic Multi-threaded DLL (VisualDynamicMT)
|
||||
option with the X11 libraries included. This results in an X11 compatible
|
||||
build using all DLL's for everything and multi-threaded support (the only
|
||||
option for DLL's).
|
||||
|
||||
To create a workspace for your requirements, simply go to the
|
||||
VisualMagick\configure folder and open the configure.dsw workspace (for
|
||||
Visual Studio 6) or configure.sln (for Visual Studio 7 or 8). Set the build
|
||||
configuration to Release.
|
||||
|
||||
Build and execute the configure program and follow the on-screen
|
||||
instructions. You should not change any of the defaults unless you have a
|
||||
specific reason to do so.
|
||||
|
||||
The configure program has a button entitled:
|
||||
|
||||
Edit "magick_config.h"
|
||||
|
||||
Click on this button to bring up magick-config.h in Windows Notepad. Review and
|
||||
optionally change any preprocessor defines in ImageMagick's magick_config.h
|
||||
file to suit your needs. This file is copied to magick\magick_config.h. You
|
||||
may safely open magick\magick_config.h, modify it, and recompile without
|
||||
re-running the configure program. In fact, using Notepad to edit the copied
|
||||
file may be preferable since it preserves the original magick_config.h file.
|
||||
|
||||
Key user defines in magick_config.h include:
|
||||
|
||||
MAGICKCORE_QUANTUM_DEPTH (default 16)
|
||||
Specify the depth of the pixel component depth (8, 16, or 32). A value of 8
|
||||
uses half the memory than 16 and may run 30% faster, but provides 256 times
|
||||
less color resolution than a value of 16. We recommend a quantum depth
|
||||
of 16 because 16-bit images are becoming more prevalent on the Internet.
|
||||
|
||||
MAGICKCORE_INSTALLED_SUPPORT (default undefined)
|
||||
Define to build a ImageMagick which uses registry settings or embedded
|
||||
paths to locate installed components (coder modules and configuration
|
||||
files). The default is to look for all files in the same directory as
|
||||
the executable. You will wand to define this value if you intend on
|
||||
installing ImageMagick on your system.
|
||||
|
||||
ProvideDllMain (default defined)
|
||||
Define to include a DllMain() function ensures that the ImageMagick
|
||||
DLL is properly initialized without participation from dependent
|
||||
applications. This avoids the requirement to invoke IntializeMagick()
|
||||
from dependent applications is only useful for DLL builds.
|
||||
|
||||
ImageMagick is now configured and ready to build.
|
||||
|
||||
The default build is WIN32. For 64-bit, open a newly created static solution
|
||||
and enter Configuration Manager. Add a x64 configuration, copying the
|
||||
configuration from WIn32. Be sure that it adds the configuration to all the
|
||||
projects. Now compile.
|
||||
|
||||
Build
|
||||
|
||||
After creating your build environment, proceed to open the DSW (or SLN)
|
||||
workspace in the VisualMagick folder. In the DSW file choose the All project
|
||||
to make it the active project. Set the build configuration to the desired one
|
||||
(Debug, or Release) and clean and build:
|
||||
|
||||
1. Right click on the All project and select Set As Active Project
|
||||
2. Select "Build=>Clean Solution"
|
||||
3. Select "Build=>Build Solution"
|
||||
|
||||
The clean step is necessary in order to make sure that all of the target
|
||||
support libraries are updated with any patches needed to get them to compile
|
||||
properly under Visual Studio.
|
||||
|
||||
After a successful build, all of the required files that are needed to run
|
||||
any of the command line tools are located in the VisualMagick\bin folder. This
|
||||
includes EXE, DLL libraries, and ImageMagick configuration files. You should
|
||||
be able to test the build directly from this directory without having to
|
||||
move anything to any of the global SYSTEM or SYSTEM32 areas in the operating
|
||||
system installation.
|
||||
|
||||
The Visual Studio distribution of ImageMagick comes with the Magick++
|
||||
C++ wrapper by default. This add-on layer has a large number of demo
|
||||
and test files that can be found in ImageMagick\Magick++\demo, and
|
||||
ImageMagick\Magick++\tests. There are also a variety of tests that use the
|
||||
straight C API as well in ImageMagick\tests.
|
||||
|
||||
All of these programs are not configured to be built in the default workspace
|
||||
created by the configure program. You can cause all of these demos and test
|
||||
programs to be built by checking the box in configure that says:
|
||||
|
||||
Include all demo and test programs
|
||||
|
||||
In addition, there is another related checkbox (checked by default) that
|
||||
causes all generated project files to be created standalone so that they
|
||||
can be copied to other areas of you system.
|
||||
|
||||
This the checkbox:
|
||||
|
||||
Generate all utility projects with full paths rather then relative paths.
|
||||
|
||||
Visual Studio uses a concept of dependencies that tell it what other
|
||||
components need to be build when a particular project is being build. This
|
||||
mechanism is also used to ensure that components link properly. In my normal
|
||||
development environment, I want to be able to make changes and debug the
|
||||
system as a whole, so I like and NEED to use dependencies. However, most end
|
||||
users don't want to work this way.
|
||||
|
||||
Instead they really just want to build the package and then get down to
|
||||
business working on their application. The solution is to make all the utility
|
||||
projects (UTIL_xxxx_yy_exe.dsp) use full absolute paths to all the things they
|
||||
need. This way the projects stand on their own and can actually be copied
|
||||
and used as templates to get a particular custom application compiling with
|
||||
little effort.
|
||||
|
||||
With this feature enabled, you should be able to nab a copy of
|
||||
|
||||
VisualMagick\utilities\UTIL_convert_xxx_exe.dsp (for C) or
|
||||
VisualMagick\Magick++\demo\UTIL_demo_xxx_exe.dsp (for C++)
|
||||
|
||||
and pop it into Notepad, modify it (carefully) to your needs and be on your
|
||||
way to happy compiling and linking.
|
||||
|
||||
You can feel free to pick any of the standard utilities, tests, or demo
|
||||
programs as the basis for a new program by copying the project and the source
|
||||
and hacking away.
|
||||
|
||||
The choice of what to use as a starting point is very easy.
|
||||
|
||||
For straight C API command line applications use something from:
|
||||
|
||||
ImageMagick\tests or
|
||||
ImageMagick\utilities (source code) or
|
||||
ImageMagick\VisualMagick\tests or
|
||||
ImageMagick\Visualmagick\utilities (project - DSP)
|
||||
|
||||
For C++ and Magick++ command line applications use something from:
|
||||
|
||||
ImageMagick\Magick++\tests or ImageMagick\Magick++\demo (source code) or
|
||||
ImageMagick\VisualMagick\Magick++\tests or
|
||||
ImageMagick\VisualMagick\Magick++\demo (project - DSP)
|
||||
|
||||
For C++ and Magick++ and MFC windows applications use:
|
||||
|
||||
ImageMagick\contrib\win32\MFC\NtMagick (source code) or
|
||||
ImageMagick\VisualMagick\contrib\win32\MFC\NtMagick (project - DSP)
|
||||
|
||||
The ImageMagick distribution is very modular. The default configuration is
|
||||
there to get you rolling, but you need to make some serious choices when
|
||||
you wish to change things around.
|
||||
|
||||
The default options are all targeted at having all the components in one place
|
||||
(e.g. the bin directory of the VisualMagick build tree). These components
|
||||
may be copied to another folder (such as to another computer).
|
||||
|
||||
The folder containing the executables and DLLs should contain the following
|
||||
files:
|
||||
|
||||
1. magic.xml
|
||||
2. delegates.xml
|
||||
3. modules.xml
|
||||
4. colors.xml
|
||||
|
||||
among others.
|
||||
|
||||
The bin folder should contains all EXE's and DLL's as well as the very
|
||||
important modules.xml file.
|
||||
|
||||
With this default setup, you can use any of the command line tools and run
|
||||
scripts as normal. You can actually get by quite nicely this way by doing
|
||||
something like pushd e:\xxx\yyy\bin in any scripts you write to execute out
|
||||
of this directory.
|
||||
|
||||
By default the core of ImageMagick on Win32 always looks in the place were
|
||||
the exe program is run from in order to find all of the files as well as
|
||||
the DLL's it needs.
|
||||
|
||||
ENVIRONMENT VARIABLES
|
||||
|
||||
You can use the System control panel to allow you to add and delete what
|
||||
is in any of the environment variables. You can even have user specific
|
||||
environment variables if you wish.
|
||||
|
||||
PATH
|
||||
|
||||
This environmental variable sets the default list of places were Windows
|
||||
looks for EXE's and DLL's. Windows CMD shell seems to look in the current
|
||||
directory first no matter what, which may make it unnecessary to update the
|
||||
PATH. If you wish to run any of utilities from another location then you
|
||||
must add the path to your bin directory in. For instance, to do this for
|
||||
the default build environment like I do, you might add:
|
||||
|
||||
C:\ImageMagick\VisualMagick\bin
|
||||
MAGICK_HOME
|
||||
|
||||
If all you do is modify the PATH variable, the first problem you will run into
|
||||
is that ImageMagick may not be able to find any of its modules. Modules are
|
||||
all the IM_MOD*.DLL files you see in the distribution. There is one of these
|
||||
for each and every file format that ImageMagick supports. This environment
|
||||
variable tells the system were to look for these DLL's. The compiled in
|
||||
default is execution path - which says - look in the same place that the
|
||||
application is running in. If you are running from somewhere other then bin
|
||||
- this will no longer work and you must use this variable. If you elect to
|
||||
leave the modules in the same place as the EXE's (a good idea) then you can
|
||||
simply set this to the same place as you did the PATH variable. In my case:
|
||||
|
||||
C:\ImageMagick\coders
|
||||
|
||||
This also the place were ImageMagick expects to find the colors.xml,
|
||||
delegates.xml, magic.xml, modules.xml, and type.xml files.
|
||||
|
||||
One cool thing about the modules build of ImageMagick is that you can now
|
||||
leave out file formats and lighten you load. If all you ever need is GIF and
|
||||
JPEG, then simply drop all the other DLL's into the local trash can and get
|
||||
on with your life.
|
||||
|
||||
Always keep the XC format, since ImageMagick uses it internally.
|
||||
|
||||
You can elect to changes these things the good old hard-coded way. This
|
||||
define is applicable in magick-config.h:
|
||||
|
||||
#define MagickConfigurePath "C:\\ImageMagick\\"
|
||||
|
||||
To view any image in a Microsoft window, type
|
||||
|
||||
$magick> convert image.ext win:
|
||||
|
||||
Make sure Ghostscript is installed, otherwise, you will be unable to convert
|
||||
or view a Postscript document, and Postscript standard fonts will not be
|
||||
available.
|
||||
|
||||
You may use any standard web browser (e.g. Internet Explorer) to browse the
|
||||
ImageMagick documentation.
|
||||
|
||||
The Win2K executables will work under Windows 98.
|
||||
|
||||
ImageMagick is now configured and built. You can optionally install it on
|
||||
your system as discussed below.
|
||||
|
||||
If you are looking to install the ImageMagick COM+ object, see Installing
|
||||
the ImageMagickObject COM+ Component.
|
||||
|
||||
Install
|
||||
|
||||
You can run ImageMagick command line utilities directly from the
|
||||
VisualMagick\bin folder, however, in most cases you may want the convenience
|
||||
of an installer script. ImageMagick provides Inno Setup scripts for this
|
||||
purpose. Note, you must define MAGICKCORE_INSTALLED_SUPPORT at configure
|
||||
time to utilize the installer scripts.
|
||||
|
||||
To get started building a self-installing ImageMagick executable, go to
|
||||
VisualMagick\installer folder and click on a script that matches your build
|
||||
environment. Press F9 to build and install ImageMagick. The default location
|
||||
is C:Program Files\ImageMagick-6.?.?\Q?. The exact folder name depends
|
||||
on the ImageMagick version and quantum depth. Once installed, ImageMagick
|
||||
command line utilities and libraries are available to the MS Command Prompt,
|
||||
web scripts, or to meet your development needs.
|
||||
|
||||
Create a Self-Installing Binary Distribution
|
||||
|
||||
Prerequisites
|
||||
|
||||
1. Download and install Inno Setup 5.
|
||||
2. Download and install ActiveState ActivePerl @
|
||||
http://www.activestate.com/activeperl/downloads/.
|
||||
|
||||
Run the Configure Wizard
|
||||
|
||||
1. Double-click on VisualMagick/configure/configure.sln to build the
|
||||
configure wizard.
|
||||
2. Select Rebuild All and launch the configure wizard.
|
||||
3. Uncheck Use X11 Stubs and check Build demo and test programs.
|
||||
4. Click on Edit magick_config.h and define MAGICKCORE_INSTALLED_SUPPORT.
|
||||
5. Complete the configure wizard screens to create the ImageMagick Visual
|
||||
C++ workspace.
|
||||
|
||||
Build ImageMagick
|
||||
|
||||
1. Double-click on VisualMagick/VisualDynamicMT.sln to launch the
|
||||
ImageMagick Visual workspace.
|
||||
2. Set the active configuration to Win32 Release.
|
||||
3. Select Rebuild All to build the ImageMagick binary distribution.
|
||||
|
||||
Build ImageMagickObject
|
||||
|
||||
1. Launch the MS-DOS Command Prompt application and move to the
|
||||
contrib\win32\ATL7\ImageMagickObject folder.
|
||||
2. Build ImageMagickObject with these commands:
|
||||
|
||||
$magick> BuildImageMagickObject clean
|
||||
$magick> BuildImageMagickObject release
|
||||
|
||||
Build PerlMagick
|
||||
|
||||
1. Launch the MS-DOS Command Prompt application and move to the PerlMagick
|
||||
folder.
|
||||
2. Build PerlMagick with these commands:
|
||||
|
||||
$magick> perl Makefile.nt
|
||||
$magick> nmake release
|
||||
|
||||
Create the Self-installing ImageMagick Binary Distribution
|
||||
|
||||
1. Double-click on VisualMagick/installer/im-dll-Q16.iss to launch the
|
||||
Inno Setup 5 wizard.
|
||||
2. Select File->Compile.
|
||||
|
||||
Install the Binary Distribution
|
||||
|
||||
1. Double-click on VisualMagick/bin/ImageMagick-6.8.2-0-Q16-x86-dll.exe
|
||||
to launch the ImageMagick binary distribution.
|
||||
2. Complete the installer screens to install ImageMagick on your system.
|
||||
|
||||
Test the Binary Distribution
|
||||
|
||||
1. Launch the MS-DOS Command Prompt application and move to the PerlMagick
|
||||
folder and type
|
||||
|
||||
$magick> nmake test
|
||||
|
||||
2. Move to the VisualMagick/tests folder and type
|
||||
|
||||
$magick> validate
|
||||
|
||||
3. Move to the VisualMagick/Magick++/tests folder and type
|
||||
|
||||
$magick> run_tests.bat
|
||||
|
||||
4. Move to the VisualMagick/Magick++/demo folder and type
|
||||
|
||||
$magick> run_demos.bat
|
||||
|
||||
If all the tests pass without complaint, the ImageMagick self-install binary
|
||||
distribution is ready for use.
|
||||
|
||||
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.
|
||||
|
||||
If the compiler generates an error or if it quits unexpectedly, go to the
|
||||
Visual Studio web site and look for Visual Studio service packs. Chances
|
||||
are, after you download and install all the Visual Studio service packs,
|
||||
ImageMagick will compile and build as expected.
|
||||
|
||||
Building Your Custom Project
|
||||
|
||||
The Windows binary distribution includes a number of demo projects that
|
||||
you can use as a template for your own custom project. For example,
|
||||
start with the Button project, generally located in the c:/Program
|
||||
Files/ImageMagick-6.8.2-0/Magick++_demos folder. If not, be sure to select
|
||||
Configuration Properties->C/C++->Preprocessor and set these definitions:
|
||||
|
||||
NDEBUG
|
||||
WIN32
|
||||
_CONSOLE
|
||||
_VISUALC_
|
||||
NeedFunctionPrototypes
|
||||
_DLL
|
||||
_MAGICKMOD_
|
||||
|
||||
|
|
@ -1,103 +0,0 @@
|
|||
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-2013 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 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
|
||||
|
||||
http://www.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.
|
|
@ -1,19 +0,0 @@
|
|||
The author and maintainer of Magick++ is Bob Friesenhan
|
||||
<bfriesen@simple.dallas.tx.us>.
|
||||
|
||||
Many thanks to John 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
|
@ -1,164 +0,0 @@
|
|||
|
||||
|
||||
Installing Magick++
|
||||
|
||||
General
|
||||
|
||||
In order to compile Magick++ you must have access to a standard C++
|
||||
implementation. The author uses gcc 3.1 (GNU C++) which is available under
|
||||
UNIX and under the Cygwin UNIX-emulation environment for Windows. Standards
|
||||
compliant commercial C++ compilers should also work fine. Most modern C++
|
||||
compilers for Microsoft Windows or the Mac should work (project files are
|
||||
provided for Microsoft Visual C++ 6.0).
|
||||
|
||||
It was decided that Magick++ will be around for the long-haul, so its API
|
||||
definition depends on valuable C++ features which should be common in all
|
||||
current and future C++ compilers. The compiler must support the following
|
||||
C++ standard features:
|
||||
|
||||
* templates
|
||||
* static constructors
|
||||
* C++-style casts (e.g. static_cast)
|
||||
* bool type
|
||||
* string class (<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 John 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.
|
|
@ -1,24 +0,0 @@
|
|||
|
||||
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++.
|
||||
|
|
@ -1,234 +0,0 @@
|
|||
#
|
||||
# Top Makefile for Magick++
|
||||
#
|
||||
# Copyright Bob Friesenhahn, 1999, 2000, 2002, 2004, 2008
|
||||
#
|
||||
|
||||
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
|
||||
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/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/STL.cpp \
|
||||
Magick++/lib/Thread.cpp \
|
||||
Magick++/lib/TypeMetric.cpp \
|
||||
Magick++/lib/Magick++.h \
|
||||
Magick++/lib/Magick++/Blob.h \
|
||||
Magick++/lib/Magick++/BlobRef.h \
|
||||
Magick++/lib/Magick++/CoderInfo.h \
|
||||
Magick++/lib/Magick++/Color.h \
|
||||
Magick++/lib/Magick++/Drawable.h \
|
||||
Magick++/lib/Magick++/Exception.h \
|
||||
Magick++/lib/Magick++/Functions.h \
|
||||
Magick++/lib/Magick++/Geometry.h \
|
||||
Magick++/lib/Magick++/Image.h \
|
||||
Magick++/lib/Magick++/ImageRef.h \
|
||||
Magick++/lib/Magick++/Include.h \
|
||||
Magick++/lib/Magick++/Montage.h \
|
||||
Magick++/lib/Magick++/Options.h \
|
||||
Magick++/lib/Magick++/Pixels.h \
|
||||
Magick++/lib/Magick++/STL.h \
|
||||
Magick++/lib/Magick++/Thread.h \
|
||||
Magick++/lib/Magick++/TypeMetric.h
|
||||
|
||||
magickpptopincdir = $(INCLUDE_PATH)
|
||||
magickpptopinc_HEADERS = $(MAGICKPP_TOP_INCHEADERS)
|
||||
|
||||
MAGICKPP_TOP_INCHEADERS_OPT = \
|
||||
Magick++/lib/Magick++.h
|
||||
|
||||
magickppincdir = $(INCLUDE_PATH)/Magick++
|
||||
|
||||
magickppinc_HEADERS = $(MAGICKPP_INCHEADERS)
|
||||
|
||||
MAGICKPP_INCHEADERS_OPT = \
|
||||
Magick++/lib/Magick++/Blob.h \
|
||||
Magick++/lib/Magick++/CoderInfo.h \
|
||||
Magick++/lib/Magick++/Color.h \
|
||||
Magick++/lib/Magick++/Drawable.h \
|
||||
Magick++/lib/Magick++/Exception.h \
|
||||
Magick++/lib/Magick++/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++/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 \
|
||||
$(MAGICK_LIBRARY_CURRENT):$(MAGICK_LIBRARY_REVISION):$(MAGICK_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_button_SOURCES = Magick++/demo/button.cpp
|
||||
Magick___demo_button_LDADD = $(MAGICKPP_LDADD)
|
||||
|
||||
Magick___demo_demo_SOURCES = Magick++/demo/demo.cpp
|
||||
Magick___demo_demo_LDADD = $(MAGICKPP_LDADD)
|
||||
|
||||
Magick___demo_detrans_SOURCES = Magick++/demo/detrans.cpp
|
||||
Magick___demo_detrans_LDADD = $(MAGICKPP_LDADD)
|
||||
|
||||
Magick___demo_flip_SOURCES = Magick++/demo/flip.cpp
|
||||
Magick___demo_flip_LDADD = $(MAGICKPP_LDADD)
|
||||
|
||||
Magick___demo_gravity_SOURCES = Magick++/demo/gravity.cpp
|
||||
Magick___demo_gravity_LDADD = $(MAGICKPP_LDADD)
|
||||
|
||||
Magick___demo_piddle_SOURCES = Magick++/demo/piddle.cpp
|
||||
Magick___demo_piddle_LDADD = $(MAGICKPP_LDADD)
|
||||
|
||||
Magick___demo_shapes_SOURCES = Magick++/demo/shapes.cpp
|
||||
Magick___demo_shapes_LDADD = $(MAGICKPP_LDADD)
|
||||
|
||||
Magick___demo_zoom_SOURCES = Magick++/demo/zoom.cpp
|
||||
Magick___demo_zoom_LDADD = $(MAGICKPP_LDADD)
|
||||
|
||||
Magick___tests_appendImages_SOURCES = Magick++/tests/appendImages.cpp
|
||||
Magick___tests_appendImages_LDADD = $(MAGICKPP_LDADD)
|
||||
|
||||
Magick___tests_attributes_SOURCES = Magick++/tests/attributes.cpp
|
||||
Magick___tests_attributes_LDADD = $(MAGICKPP_LDADD)
|
||||
|
||||
Magick___tests_averageImages_SOURCES = Magick++/tests/averageImages.cpp
|
||||
Magick___tests_averageImages_LDADD = $(MAGICKPP_LDADD)
|
||||
|
||||
Magick___tests_coalesceImages_SOURCES = Magick++/tests/coalesceImages.cpp
|
||||
Magick___tests_coalesceImages_LDADD = $(MAGICKPP_LDADD)
|
||||
|
||||
Magick___tests_coderInfo_SOURCES = Magick++/tests/coderInfo.cpp
|
||||
Magick___tests_coderInfo_LDADD = $(MAGICKPP_LDADD)
|
||||
|
||||
Magick___tests_color_SOURCES = Magick++/tests/color.cpp
|
||||
Magick___tests_color_LDADD = $(MAGICKPP_LDADD)
|
||||
|
||||
Magick___tests_colorHistogram_SOURCES = Magick++/tests/colorHistogram.cpp
|
||||
Magick___tests_colorHistogram_LDADD = $(MAGICKPP_LDADD)
|
||||
|
||||
Magick___tests_exceptions_SOURCES = Magick++/tests/exceptions.cpp
|
||||
Magick___tests_exceptions_LDADD = $(MAGICKPP_LDADD)
|
||||
|
||||
Magick___tests_montageImages_SOURCES = Magick++/tests/montageImages.cpp
|
||||
Magick___tests_montageImages_LDADD = $(MAGICKPP_LDADD)
|
||||
|
||||
Magick___tests_morphImages_SOURCES = Magick++/tests/morphImages.cpp
|
||||
Magick___tests_morphImages_LDADD = $(MAGICKPP_LDADD)
|
||||
|
||||
Magick___tests_readWriteBlob_SOURCES = Magick++/tests/readWriteBlob.cpp
|
||||
Magick___tests_readWriteBlob_LDADD = $(MAGICKPP_LDADD)
|
||||
|
||||
Magick___tests_readWriteImages_SOURCES = Magick++/tests/readWriteImages.cpp
|
||||
Magick___tests_readWriteImages_LDADD = $(MAGICKPP_LDADD)
|
||||
|
||||
|
||||
MAGICKPP_LOCAL_TARGETS = www/Magick++/NEWS.html www/Magick++/ChangeLog.html
|
||||
|
|
@ -1,383 +0,0 @@
|
|||
This file records noteworthy changes in Magick++.
|
||||
|
||||
(5.5.2)
|
||||
* Added adaptiveThreshold() method.
|
||||
* Added colorMapSize() method.
|
||||
* Added DrawablePushClipPath, DrawablePopClipPath, and DrawableClipPath.
|
||||
|
||||
(5.5.1)
|
||||
* Fixed a Color memory allocation problem which became evident when
|
||||
using the Magick++ DLL.
|
||||
* Completed implementation of Image textEncoding() method. Oops!
|
||||
|
||||
(5.4.9)
|
||||
* Added the Image textEncoding() method and an encoding option to
|
||||
DrawableText to support specifying "UTF-8" (Unicode) text encoding.
|
||||
* Added the Image compare() method to support comparing two similar
|
||||
images and obtaining error values.
|
||||
* Magick++ compiles as a DLL under Visual C++ 7.0.
|
||||
|
||||
(5.4.8)
|
||||
* The image type() method now also specifies the output image type
|
||||
to use while writing.
|
||||
* Added a profile() method to Image to support adding, removing,
|
||||
and retrieving named embedded application profiles.
|
||||
* Magick++ compiles as a DLL under Visual C++ 6.0.
|
||||
|
||||
(5.4.7)
|
||||
* No changes to report.
|
||||
|
||||
(5.4.6)
|
||||
* Magick++ library no longer depends on C++ iostreams APIs.
|
||||
* Added DrawableTextUnderColor class to set text underbox color.
|
||||
|
||||
(5.4.5)
|
||||
* Drawable classes have been re-written to use ImageMagick's draw.h
|
||||
APIs.
|
||||
* Fixed a nasty bug when reporting some forms of errors. The bug
|
||||
was causing an exception in error.c.
|
||||
* Template API implementation cleanup.
|
||||
* Rationalized some parameter types.
|
||||
* New method, Pixels::getConst() to obtain read-only pixels.
|
||||
* DrawableDashArray() prefers an array of type 'double' rather than
|
||||
'unsigned int'. Please use the new form.
|
||||
* Composite images are output as embedded inlined Base64 when
|
||||
preparing MVG data.
|
||||
* Blob class supports encoding and decoding Base64 data.
|
||||
* New method, Image::ping to ping a Blob.
|
||||
|
||||
(5.4.4)
|
||||
* Fixed a bug in DrawableDashArray.
|
||||
* Numerous consistency improvements based on findings from Gimpel lint.
|
||||
* Added endian method to Image, and endianImage class to STL.h in
|
||||
order to support setting endian option for formats which support
|
||||
the notion (e.g. TIFF).
|
||||
* DrawableCompositeImage was not working. Now it does.
|
||||
|
||||
(5.4.3)
|
||||
* Support selecting fonts via font-family, font-style, font-weight,
|
||||
and font-stretch via the DrawableFont class.
|
||||
* CoderInfo API change. MatchType is scoped to CoderInfo class.
|
||||
* Bugfix for Magick::Exception memory leak.
|
||||
* Bugfix for DrawableGravity class (had stopped working).
|
||||
* Bugfix for Image antiAlias() method (wasn't working).
|
||||
* Reimplemented image registration code (which passes image via
|
||||
DrawableCompositeImage).
|
||||
|
||||
(5.4.2)
|
||||
* TypeMetric class revamped to match current ImageMagick type metrics
|
||||
definition.
|
||||
* Fixed possible stack corruption on some architectures when returning
|
||||
Color as a string.
|
||||
* DrawableCompositeImage can be constructed based on an Image in memory
|
||||
rather than just a filename.
|
||||
* Added Drawable objects (DrawablePushPattern & DrawablePopPattern)
|
||||
for definining arbitrary named patterns to be used for stroke and fill.
|
||||
* Added Image strokePattern() and fillPattern() methods for specifying
|
||||
image to use while drawing stroked object outlines and while filling
|
||||
objects, respectively.
|
||||
|
||||
(5.4.1)
|
||||
* Fixed memory leak in Image::draw().
|
||||
|
||||
* Automagically cleans up ImageMagick allocations prior to process
|
||||
exit to avoid annoying memory leak tools.
|
||||
|
||||
(5.4.0)
|
||||
* Fixed bug when scaling from Quantum to double in derived Color classes.
|
||||
|
||||
* Pass all input parameter strings as 'const std::string &' in Color class.
|
||||
|
||||
* Added support for obtaining pixel indexes.
|
||||
|
||||
* Implemented support for read-only pixels and pixel indexes.
|
||||
|
||||
* Added Image boundingBox() method to return smallest bounding box
|
||||
enclosing non-border pixels.
|
||||
|
||||
(5.3.9)
|
||||
* New class, CoderInfo, to return information for a specified image
|
||||
format as well as the coderInfoList() template function to return
|
||||
the list of coders which match a specification.
|
||||
|
||||
* User now may tell Blob updateNoCopy() what memory system (C or C++)
|
||||
the memory was allocated from. Used to assume the C++ allocator.
|
||||
This resolves a bug on some platforms (e.g. Windows).
|
||||
|
||||
* Added Image 'opacity' method (and STL opacityImage()) to set, or
|
||||
attenuate, image opacity.
|
||||
|
||||
* Added Image 'type' method (and STL typeImage()) to set image
|
||||
representation type.
|
||||
|
||||
* Image depth method now adjusts pixels to match specified image depth,
|
||||
and reports depth based on current image pixels.
|
||||
|
||||
(5.3.8)
|
||||
* New class 'TypeMetric' to contain font type metrics.
|
||||
|
||||
* New Image method 'fontTypeMetrics()' to obtain font type metrics.
|
||||
|
||||
* Image colorMap method automatically extends the colormap if index
|
||||
is past the end of the current colormap.
|
||||
|
||||
* Added clipMask method to add a clip mask to the current
|
||||
image. Prevents modification to image pixels wherever the
|
||||
associated clip mask image is tranparent.
|
||||
|
||||
* Documented methods which were added previously, but left
|
||||
undocumented.
|
||||
|
||||
(5.3.7)
|
||||
* No changes.
|
||||
|
||||
(5.3.6)
|
||||
* Adjusted parameters to 'edge' and 'medianFilter' to match
|
||||
equivalent libMagick functions.
|
||||
* Fixed a Montage bug which was not allowing color options to be unset.
|
||||
* Montage defaults are no longer taken from first Image in list.
|
||||
* Magick++ demo output looks like PerlMagick demo output again.
|
||||
|
||||
(5.3.5)
|
||||
* Default radius and sigma parameters were changed on the blur,
|
||||
charcoal, emboss, and sharpen methods to match ImageMagick defaults.
|
||||
* Fixes to Magick++ demos to restore appearance.
|
||||
* Added shave method for shaving edges from image (a form of crop).
|
||||
|
||||
(5.3.1-5.3.4)
|
||||
* No changes.
|
||||
|
||||
(5.3.0)
|
||||
* Released with ImageMagick 5.3.0
|
||||
* Bug fix. Under certain conditions, several annotation options
|
||||
were being reset.
|
||||
|
||||
(5.2.9)
|
||||
* Released with ImageMagick 5.2.9
|
||||
* Added fillRule method to Image class.
|
||||
|
||||
(5.2.8)
|
||||
* Released with ImageMagick 5.2.8
|
||||
* Added 'fill' and 'stroke' methods to Montage class.
|
||||
* Added 'erase' and 'strokeAntiAlias' methods to Image class.
|
||||
* Renamed Image class 'layer' method to 'channel'.
|
||||
* Support supplying composition rule to DrawableCompositeImage.
|
||||
|
||||
(5.2.7)
|
||||
* Released with ImageMagick 5.2.7
|
||||
* Added convolve and unsharpmask methods to Image.
|
||||
* Added deconstructImages and mosaicImages template functions.
|
||||
* Fixed handling of geometry parameter to annotate method.
|
||||
|
||||
(5.2.6)
|
||||
* Released with ImageMagick 5.2.6.
|
||||
* Added support for a SVG-style dash array and dash offset
|
||||
parameters (for drawing dashed lines).
|
||||
* Added support for setting the shape to be used at the end of open
|
||||
subpaths when they are stroked.
|
||||
* Added support for setting the shape to be used at the corners of
|
||||
paths (or other vector shapes) when they are stroked.
|
||||
* Added support for setting extension limit for miter joins.
|
||||
* Rotate text the proper way using an affine transform.
|
||||
|
||||
(5.2.5)
|
||||
* Released with ImageMagick 5.2.5.
|
||||
* Completely re-wrote drawable object classes in order to support
|
||||
all current ImageMagick drawing capabilities using a list-based paradigm.
|
||||
New drawing capabilities include coordinate transformations and the
|
||||
currently undocumented (but quite powerful) path capabilities.
|
||||
|
||||
(5.2.4)
|
||||
* Released with ImageMagick 5.2.4.
|
||||
* Magick++ is now built by the regular ImageMagick build process.
|
||||
when --with-magick_plus_plus is specified to configure.
|
||||
* Fixed bug with setting text drawing options.
|
||||
* Fixed API bug with colorize. Options adjusted to match ImageMagick
|
||||
API change (API change was long ago).
|
||||
* Library compiles using Sun Workshop 5.0 compiler. Linkage problems with
|
||||
some demos/tests due to libtool-related compiler/linker bug.
|
||||
* Compiles using Sun Forte 6.0 compiler.
|
||||
|
||||
(5.2.3)
|
||||
* Switched to new release numbering (match ImageMagick release number)
|
||||
* Released with ImageMagick 5.2.3.
|
||||
* Fixed bug in which the Image read method was not reporting
|
||||
warnings (only errors).
|
||||
* Parameter changes to blur, charcoal, emboss, and sharpen methods
|
||||
of the Image class to match equivalent ImageMagick API changes.
|
||||
* Parameter changes to blurImage, charcoalImage, embossImage, and
|
||||
sharpenImage STL functions in order to match equivalent ImageMagick
|
||||
API changes.
|
||||
|
||||
(0.9.5)
|
||||
* Released with ImageMagick 5.2.2.
|
||||
|
||||
(0.9.4)
|
||||
* Released with ImageMagick 5.2.1.
|
||||
* Bugfix to the Pixels GetIndexes() method.
|
||||
* Adapted to ImageMagick 5.2.1's revised matte channel interpretation.
|
||||
|
||||
(0.9.3)
|
||||
* Released with ImageMagick 5.2
|
||||
* New class 'Pixels' to support low-level pixel access in image. New
|
||||
API supports multiple pixel views into the same image. Number of
|
||||
available pixel views limited to the number of image rows + 1.
|
||||
* Dramatically improved performance for text annotation and drawing.
|
||||
* Fix text annotation bug which did not allow spaces in annotation text.
|
||||
* Added gaussianBlurImage() method.
|
||||
* Fixed bug in floodFillTexture().
|
||||
* Re-worked error reporting methodology to use re-entrant error
|
||||
reporting rather than the previous method (based on call-backs)
|
||||
which required thread specific data.
|
||||
* Should be thread-safe under Win32 now.
|
||||
|
||||
(0.9.2)
|
||||
* Released with ImageMagick 5.1.1
|
||||
* Should be thread-safe when used with POSIX threads (pthreads).
|
||||
* Added methods getPixels, setPixels, syncPixels, readPixels, and
|
||||
writePixels, in order to provide low-level access to Image pixels.
|
||||
* Bugfix: size method was setting Options size, but not Image rows
|
||||
and columns.
|
||||
|
||||
(0.9.1)
|
||||
* Released with ImageMagick 5.1.0
|
||||
* Added additional constructors, read, and write methods for BLOBs
|
||||
to make BLOBs easier to use.
|
||||
* Added the medianFilter() method to Image.
|
||||
* Renamed transformColorSpace() to colorSpace() and added a
|
||||
colorSpace() accessor method.
|
||||
* Renamed psPageSize() to page(), which now properly returns the
|
||||
actual attribute from the image, rather than the image options.
|
||||
This is important in order to manipulate GIF animations.
|
||||
* Bug fixes.
|
||||
|
||||
(0.9)
|
||||
* Ported to ImageMagick 5.0.
|
||||
* BLOB sizes are now specified using size_t type.
|
||||
* Rotate() no longer accepts sharpen or crop options.
|
||||
* Shear() No longer accepts a crop option.
|
||||
* FontPointsize() now takes a double.
|
||||
* The condense, uncondense, and condensed methods have been removed
|
||||
since ImageMagick 5.0 no longer uses run-length encoding.
|
||||
* The quantizeError method has been removed since it never worked.
|
||||
* The cacheThreshold method is added to set the threshold of
|
||||
ImageMagick's image cache.
|
||||
|
||||
(0.8.9)
|
||||
* Released with ImageMagick 4.2.9
|
||||
* Blob reference counting was totally broken, leading to a memory
|
||||
leak if it was used. Fixed by starting reference count from one
|
||||
rather than zero.
|
||||
|
||||
(0.8.8)
|
||||
* Fixed a Image constructor bug when constructing from a Blob
|
||||
|
||||
(0.8.7)
|
||||
* Bugfix: condensed() was returning wrong state.
|
||||
|
||||
(0.8.6)
|
||||
* Color is now based on ImageMagick's RunlengthPacket structure (via a
|
||||
pointer) so that it may eventually be used to represent an image
|
||||
pixel. This is currently a work in progress.
|
||||
|
||||
(0.8.5)
|
||||
* Headers are now installed under prefix/include/Magick++ on Unix
|
||||
systems with the exception that Magick++.h is installed under
|
||||
prefix/include as it was before. Programs which include Magick++.h
|
||||
(the documented approach) should not be impacted.
|
||||
* Image constructors to construct an image from a BLOB.
|
||||
* Image read and write methods to decode and encode images stored in a
|
||||
BLOB. This allows reading/writing image "files" from/to memory rather
|
||||
than a traditional file.
|
||||
|
||||
(0.8.4)
|
||||
* New mapImages algorithm maps a sequence of images to the colormap of
|
||||
a provided image.
|
||||
* New quantizeImages algorithm computes and applies a common colormap
|
||||
to a sequence of images.
|
||||
|
||||
(0.8.3)
|
||||
* Ported to ImageMagick 4.2.6.
|
||||
* Blob supports default constructor.
|
||||
* New Blob method updateNoCopy() to support efficient initialization by
|
||||
derived class.
|
||||
|
||||
(0.8.2)
|
||||
* Uses libtool 1.3 to build library under Unix and Cygwin (static lib only).
|
||||
* Added Blob class to support supplying formatted binary data to methods.
|
||||
* Added support for setting ICC and IPTC profiles from a binary BLOB.
|
||||
* Added support for transformations of image data to/from alternate
|
||||
colorspace (e.g. CYMK).
|
||||
* Added support for 'pinging' an image (get image dimensions/size quickly).
|
||||
* Added 'uncondense' method to de-compress in-memory image data.
|
||||
* Added support for annotation using rotated text.
|
||||
|
||||
(0.8.1)
|
||||
* Added support for setting alpha in Magick::Color
|
||||
* Set/get color alpha in Magick::Image::pixelColor() for DirectClass images.
|
||||
|
||||
(0.8)
|
||||
* Transitioned to Beta
|
||||
* Improved Microsoft Visual C++ build environment.
|
||||
|
||||
(0.7.4)
|
||||
* Added animateImages() and displayImages() to MagickSTL.h.
|
||||
* Added function objects to support setting image attributes.
|
||||
|
||||
(0.7.3)
|
||||
* Image::penTexture() now takes Image reference rather than
|
||||
Image pointer. Set Image to invalid using isValid(false)
|
||||
to unset texture.
|
||||
* Attribute methods that take Color, Geometry, Image, or string
|
||||
arguments may now unset the attribute by setting the state of
|
||||
the object to invalid using isValid(false), or the empty string
|
||||
(in the case of string). This allows full control over ImageMagick
|
||||
attributes which are stored as C strings which may be set to NULL.
|
||||
* Updated for ImageMagick 4.2.1
|
||||
|
||||
(0.7.2)
|
||||
* Added STL function object support for all Image manipulation
|
||||
methods to support operating on all or part of the images
|
||||
stored in an STL container.
|
||||
|
||||
(0.7.1)
|
||||
* Added Coordinate class and methods in Drawable to support x,y
|
||||
coordinates.
|
||||
* Changed coordinate parameters from unsigned int to double in Drawable.
|
||||
* Changed polygon methods in Drawable to use STL list argument.
|
||||
* Added STL list based draw method to Image.
|
||||
* Changed Exception heirarchy to support Warning and Error sub-classes.
|
||||
Most exception class names have changed.
|
||||
|
||||
(0.7)
|
||||
* Updated for ImageMagick 4.2.0
|
||||
* Added support for flood-filling and drawing with texture.
|
||||
* Montage supported.
|
||||
* Oodles of bugs fixed.
|
||||
* Implemented image attribute tests.
|
||||
* Implemented PerlMagick 'demo' and 'shapes' demo programs in Magick++.
|
||||
* Some parameters re-ordered due to experience from writing demo programs.
|
||||
|
||||
(0.6)
|
||||
* Initial support for integrating image-list oriented operations with
|
||||
STL containers.
|
||||
|
||||
(0.5)
|
||||
* Compiles and runs under Unix using egcs release 1.1 or later.
|
||||
* Compiles and runs under Windows using Visual C++ 5.X or later.
|
||||
* Users of Magick++ API are not exposed to ImageMagick headers.
|
||||
* Magick++ API is namespaced under "Magick".
|
||||
* "Magick" prefix removed from object names.
|
||||
* User options are now completely contained within Image object.
|
||||
There is no longer a MagickOptions parameter to some methods.
|
||||
|
||||
(0.1)
|
||||
* All ImageMagick operations which operate on individual images are
|
||||
supported.
|
||||
* Image objects have value semantics, avoid unnecessary image
|
||||
copies through the use of reference counting, and may be compared
|
||||
via standard operators.
|
||||
* Geometry, color, annotations, and user-options are supported by
|
||||
separate classes.
|
||||
* Errors are reported synchronously via C++ exceptions.
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
|
||||
This is Magick++, the object-oriented C++ API to the ImageMagick
|
||||
image-processing library, the most comprehensive open-source image
|
||||
processing solution available. Read the release notes for Magick++.
|
||||
|
||||
Magick++ supports an object model which is inspired by PerlMagick.
|
||||
Magick++ executes faster than PerlMagick since it is accessed from a
|
||||
compiled language rather than from a scripting language. This makes it more
|
||||
suitable for Web CGI programs which must start-up and execute quickly.
|
||||
Images support implicit reference counting so that copy constructors and
|
||||
assignment incur almost no cost. The cost of actually copying an image (if
|
||||
necessary) is done just before modification and this copy is managed
|
||||
automatically by Magick++. De-referenced copies are automatically deleted.
|
||||
The image objects support value (rather than pointer) semantics so it is
|
||||
trivial to support multiple generations of an image in memory at one time.
|
||||
|
||||
Magick++ provides integrated support for the Standard Template Library (STL)
|
||||
so that the powerful containers available (e.g. deque, vector, list, and
|
||||
map) can be used to write programs similar to those possible with PERL &
|
||||
PerlMagick. STL-compatable template versions of ImageMagick's list-style
|
||||
operations are provided so that operations may be performed on multiple
|
||||
images stored in STL containers.
|
||||
|
||||
Documentation
|
||||
|
||||
Detailed documentation are provided for all Magick++ classes, class methods,
|
||||
and template functions which comprise the API.
|
||||
|
||||
Obtaining Magick++
|
||||
|
||||
Magick++ is included as part of ImageMagick source releases and may be
|
||||
retrieved via ftp or Subversion.
|
||||
|
||||
Installation
|
||||
|
||||
Once you have the sources available, follow these detailed installation
|
||||
instructions for UNIX and Windows.
|
||||
|
||||
Usage
|
||||
|
||||
A helper script named Magick++-config is installed under Unix which assists
|
||||
with recalling compilation options required to compile and link programs
|
||||
which use Magick++. For example, the following command will compile and
|
||||
link the source file example.cpp to produce the executable example (notice
|
||||
that quotes are backward quotes):
|
||||
|
||||
c++ `Magick++-config --cxxflags --cppflags --ldflags --libs` \
|
||||
-o example example.cpp
|
||||
|
||||
Windows users may get started by manually editing a project file for one of
|
||||
the Magick++ demo programs.
|
||||
|
||||
Reporting Bugs
|
||||
|
||||
Please report any bugs via the Magick++ Bug Tracking System at
|
||||
http://www.imagemagick.org/discourse-server/.
|
||||
|
||||
Related Packages
|
||||
|
||||
Users who are interested in displaying their images at video game rates on a
|
||||
wide number of platforms and graphic environments (e.g. Windows, X11, BeOS,
|
||||
and Linux/CGI) may want to try PtcMagick, which provides a simple interface
|
||||
between Magick++ and OpenPTC.
|
|
@ -1,99 +0,0 @@
|
|||
.ad l
|
||||
.nh
|
||||
.TH Magick++-Config 1 "2 May 2002" "ImageMagick"
|
||||
.SH NAME
|
||||
Magick++-config \- get information about the installed version of Magick++
|
||||
.SH SYNOPSIS
|
||||
.B Magick++-config
|
||||
.B [--cppflags]
|
||||
.B [--cxxflags]
|
||||
.B [--exec-prefix]
|
||||
.B [--ldflags]
|
||||
.B [--libs]
|
||||
.B [--prefix]
|
||||
.B [--version]
|
||||
.SH DESCRIPTION
|
||||
.B Magick++-config
|
||||
prints the compiler and linker flags required to compile and link programs
|
||||
that use the
|
||||
.BR ImageMagick
|
||||
C++ Application Programmer Interface (known as
|
||||
.BR Magick++
|
||||
).
|
||||
.SH EXAMPLES
|
||||
To print the version of the installed distribution of
|
||||
.BR Magick++ ,
|
||||
use:
|
||||
|
||||
.nf
|
||||
Magick++-config \-\-version
|
||||
.fi
|
||||
|
||||
To compile a program that calls the
|
||||
.BR ImageMagick
|
||||
C++ Application Programmer Interface, use:
|
||||
|
||||
.nf
|
||||
c++ `Magick++-config \-\-cxxflags \-\-cppflags \-\-ldflags \-\-libs` program.cpp
|
||||
.fi
|
||||
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B \-\-cppflags
|
||||
Print the preprocessor flags that are needed to find the
|
||||
.B ImageMagick
|
||||
C and C++ include files and defines to ensures that the ImageMagick data structures match between
|
||||
your program and the installed libraries.
|
||||
.TP
|
||||
.B \-\-cxxflags
|
||||
Print the compiler flags that were used to compile
|
||||
.BR libMagick++ .
|
||||
.TP
|
||||
.B \-\-exec-prefix
|
||||
Print the directory under which target specific binaries and executables are installed.
|
||||
.TP
|
||||
.B \-\-ldflags
|
||||
Print the linker flags that are needed to link with the
|
||||
.B libMagick++
|
||||
library.
|
||||
.TP
|
||||
.B \-\-libs
|
||||
Print the linker flags that are needed to link a program with
|
||||
.BR libMagick++ .
|
||||
.TP
|
||||
.B \-\-prefix
|
||||
Print the directory under which the package is installed.
|
||||
.TP
|
||||
.B \-\-version
|
||||
Print the version of the
|
||||
.B ImageMagick
|
||||
distribution to standard output.
|
||||
.SH COPYRIGHT
|
||||
Copyright (C) 2000 ImageMagick Studio LLC, a non-profit organization dedicated
|
||||
to making software imaging solutions freely available.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files ("ImageMagick"),
|
||||
to deal in ImageMagick without restriction, including without limitation
|
||||
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
and/or sell copies of ImageMagick, and to permit persons to whom the
|
||||
ImageMagick is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of ImageMagick.
|
||||
|
||||
The software is provided "as is", without warranty of any kind, express or
|
||||
implied, including but not limited to the warranties of merchantability,
|
||||
fitness for a particular purpose and noninfringement. In no event shall
|
||||
ImageMagick Studio be liable for any claim, damages or other liability,
|
||||
whether in an action of contract, tort or otherwise, arising from, out of
|
||||
or in connection with ImageMagick or the use or other dealings in
|
||||
ImageMagick.
|
||||
|
||||
Except as contained in this notice, the name of the ImageMagick Studio
|
||||
shall not be used in advertising or otherwise to promote the sale, use or
|
||||
other dealings in ImageMagick without prior written authorization from the
|
||||
ImageMagick Studio.
|
||||
.SH AUTHORS
|
||||
Bob Friesenhahn, ImageMagick Studio
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Configure options script for re-calling Magick+ compilation options
|
||||
# required to use the Magick++ library.
|
||||
#
|
||||
#
|
||||
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
|
||||
usage='Usage: Magick++-config [--cppflags] [--cxxflags] [--exec-prefix] [--ldflags] [--libs] [--prefix] [--version]
|
||||
|
||||
For example, "magick.cpp" may be compiled to produce "magick" as follows:
|
||||
|
||||
"c++ -o magick magick.cpp `Magick++-config --cppflags --cxxflags --ldflags --libs`"'
|
||||
|
||||
if test $# -eq 0; then
|
||||
echo "${usage}" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
while test $# -gt 0; do
|
||||
case "$1" in
|
||||
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
|
||||
*) optarg= ;;
|
||||
esac
|
||||
case $1 in
|
||||
--prefix=*)
|
||||
prefix=$optarg
|
||||
;;
|
||||
--prefix)
|
||||
echo $prefix
|
||||
;;
|
||||
--exec-prefix=*)
|
||||
exec_prefix=$optarg
|
||||
;;
|
||||
--exec-prefix)
|
||||
echo $exec_prefix
|
||||
;;
|
||||
--version)
|
||||
echo '@PACKAGE_VERSION@ Q@QUANTUM_DEPTH@ @MAGICK_HDRI@'
|
||||
;;
|
||||
--cflags)
|
||||
pkg-config --cflags Magick++
|
||||
;;
|
||||
--cxxflags)
|
||||
pkg-config --cflags Magick++
|
||||
;;
|
||||
--cppflags)
|
||||
pkg-config --cflags Magick++
|
||||
;;
|
||||
--ldflags)
|
||||
pkg-config --libs Magick++
|
||||
;;
|
||||
--libs)
|
||||
pkg-config --libs Magick++
|
||||
;;
|
||||
*)
|
||||
echo "${usage}" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
//
|
||||
// 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;
|
||||
}
|
|
@ -1,100 +0,0 @@
|
|||
//
|
||||
// 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 );
|
||||
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;
|
||||
}
|
|
@ -1,520 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003
|
||||
//
|
||||
// Simple demo program for Magick++
|
||||
//
|
||||
// Concept and algorithms lifted from PerlMagick demo script written
|
||||
// by John Christy.
|
||||
//
|
||||
// Max run-time size 60MB (as compared with 95MB for PerlMagick) under SPARC Solaris
|
||||
//
|
||||
|
||||
#include <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");
|
||||
|
||||
// Common font to use.
|
||||
string font = "Helvetica";
|
||||
|
||||
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 );
|
||||
example.font( 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(), fontImage( font ) );
|
||||
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.font( font );
|
||||
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;
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
#!/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 ${executable}_${filter}_out.miff && echo "ok" || echo "not ok"
|
||||
done
|
||||
:
|
|
@ -1,60 +0,0 @@
|
|||
//
|
||||
// Replace transparency in an image with a solid color using Magick++
|
||||
//
|
||||
// Useful to see how a transparent image looks on a particular
|
||||
// background color, or to create a similar looking effect without
|
||||
// transparency.
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 2000
|
||||
//
|
||||
// Usage: detrans color file...
|
||||
//
|
||||
|
||||
#include <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;
|
||||
}
|
|
@ -1,60 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2003
|
||||
//
|
||||
// Demonstration of unary function-object based operations
|
||||
//
|
||||
// Reads the multi-frame file "smile_anim.miff" and writes a
|
||||
// flipped and morphed version to "flip_out.miff".
|
||||
//
|
||||
|
||||
#include <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;
|
||||
}
|
|
@ -1,83 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 2000, 2001, 2003
|
||||
//
|
||||
// Demo of text annotation with gravity. Produces an animation showing
|
||||
// the effect of rotated text assize_t with various gravity specifications.
|
||||
//
|
||||
// After running demo program, run 'animate gravity_out.miff' if you
|
||||
// are using X-Windows to see an animated result.
|
||||
//
|
||||
// Concept and algorithms lifted from PerlMagick demo script written
|
||||
// by John Christy.
|
||||
//
|
||||
|
||||
#include <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.
|
@ -1,175 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2002, 2003
|
||||
//
|
||||
// PerlMagick "piddle" demo re-implemented using Magick++ methods.
|
||||
// The PerlMagick "piddle" demo is written by John 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
|
||||
//
|
||||
drawList.push_back(DrawableStrokeColor("red"));
|
||||
drawList.push_back(DrawableStrokeWidth(1));
|
||||
drawList.push_back(DrawableLine(10,200, 20,190));
|
||||
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
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;
|
||||
}
|
|
@ -1,119 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2002, 2003
|
||||
//
|
||||
// GD/PerlMagick example using Magick++ methods.
|
||||
//
|
||||
// Concept and algorithms lifted from PerlMagick demo script
|
||||
//
|
||||
|
||||
#include <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" );
|
||||
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.
|
@ -1,191 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 2001, 2002, 2003
|
||||
//
|
||||
// Resize image using specified resize algorithm with Magick++ API
|
||||
//
|
||||
// Usage: zoom [-density resolution] [-filter algorithm] [-geometry geometry]
|
||||
// [-resample resolution] input_file output_file
|
||||
//
|
||||
|
||||
#include <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;
|
||||
}
|
|
@ -1,169 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2004
|
||||
//
|
||||
// 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>
|
||||
|
||||
//
|
||||
// Implementation of Magick::Blob
|
||||
//
|
||||
|
||||
// Default constructor
|
||||
Magick::Blob::Blob ( void )
|
||||
: _blobRef(new Magick::BlobRef( 0, 0 ))
|
||||
{
|
||||
}
|
||||
|
||||
// Construct with data
|
||||
Magick::Blob::Blob ( const void* data_, size_t length_ )
|
||||
: _blobRef(new Magick::BlobRef( data_, length_ ))
|
||||
{
|
||||
}
|
||||
|
||||
// Copy constructor (reference counted)
|
||||
Magick::Blob::Blob ( const Magick::Blob& blob_ )
|
||||
: _blobRef(blob_._blobRef)
|
||||
{
|
||||
// Increase reference count
|
||||
Lock( &_blobRef->_mutexLock );
|
||||
++_blobRef->_refCount;
|
||||
}
|
||||
|
||||
// Destructor (reference counted)
|
||||
Magick::Blob::~Blob ()
|
||||
{
|
||||
bool doDelete = false;
|
||||
{
|
||||
Lock( &_blobRef->_mutexLock );
|
||||
if ( --_blobRef->_refCount == 0 )
|
||||
doDelete = true;
|
||||
}
|
||||
|
||||
if ( doDelete )
|
||||
{
|
||||
// Delete old blob reference with associated data
|
||||
delete _blobRef;
|
||||
}
|
||||
_blobRef=0;
|
||||
}
|
||||
|
||||
// Assignment operator (reference counted)
|
||||
Magick::Blob& Magick::Blob::operator= ( const Magick::Blob& blob_ )
|
||||
{
|
||||
if(this != &blob_)
|
||||
{
|
||||
{
|
||||
Lock( &blob_._blobRef->_mutexLock );
|
||||
++blob_._blobRef->_refCount;
|
||||
}
|
||||
bool doDelete = false;
|
||||
{
|
||||
Lock( &_blobRef->_mutexLock );
|
||||
if ( --_blobRef->_refCount == 0 )
|
||||
doDelete = true;
|
||||
}
|
||||
if ( doDelete )
|
||||
{
|
||||
delete _blobRef;
|
||||
}
|
||||
_blobRef = blob_._blobRef;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
// Update object contents from Base64-encoded string representation.
|
||||
void Magick::Blob::base64 ( const std::string base64_ )
|
||||
{
|
||||
size_t length;
|
||||
|
||||
unsigned char *decoded =
|
||||
Base64Decode( base64_.c_str(), &length );
|
||||
|
||||
if(decoded)
|
||||
updateNoCopy( static_cast<void*>(decoded), length,
|
||||
Magick::Blob::MallocAllocator );
|
||||
}
|
||||
|
||||
// Return Base64-encoded string representation.
|
||||
std::string Magick::Blob::base64 ( void )
|
||||
{
|
||||
size_t encoded_length = 0;
|
||||
|
||||
char *encoded =
|
||||
Base64Encode(static_cast<const unsigned char*>(data()), length(), &encoded_length);
|
||||
|
||||
if(encoded)
|
||||
{
|
||||
std::string result(encoded,encoded_length);
|
||||
encoded=(char *) RelinquishMagickMemory(encoded);
|
||||
return result;
|
||||
}
|
||||
|
||||
return std::string();
|
||||
}
|
||||
|
||||
// Update object contents, making a copy of the supplied data.
|
||||
// Any existing data in the object is deallocated.
|
||||
void Magick::Blob::update ( const void* data_, size_t length_ )
|
||||
{
|
||||
bool doDelete = false;
|
||||
{
|
||||
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_ );
|
||||
}
|
||||
|
||||
// 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.
|
||||
void Magick::Blob::updateNoCopy ( void* data_, size_t length_,
|
||||
Magick::Blob::Allocator allocator_ )
|
||||
{
|
||||
bool doDelete = false;
|
||||
{
|
||||
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_;
|
||||
}
|
||||
|
||||
// Obtain pointer to data
|
||||
const void* Magick::Blob::data( void ) const
|
||||
{
|
||||
return _blobRef->_data;
|
||||
}
|
||||
|
||||
// Obtain data length
|
||||
size_t Magick::Blob::length( void ) const
|
||||
{
|
||||
return _blobRef->_length;
|
||||
}
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2004
|
||||
//
|
||||
// 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>
|
||||
|
||||
//
|
||||
// Implementation of Magick::BlobRef
|
||||
//
|
||||
|
||||
// Construct with data, making private copy of data
|
||||
Magick::BlobRef::BlobRef ( const void* data_,
|
||||
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);
|
||||
}
|
||||
}
|
|
@ -1,122 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 2001, 2002
|
||||
//
|
||||
// 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;
|
||||
|
||||
// Default constructor
|
||||
Magick::CoderInfo::CoderInfo ( void )
|
||||
: _name(),
|
||||
_description(),
|
||||
_isReadable(false),
|
||||
_isWritable(false),
|
||||
_isMultiFrame(false)
|
||||
{
|
||||
}
|
||||
|
||||
// Copy constructor
|
||||
Magick::CoderInfo::CoderInfo ( const Magick::CoderInfo &coder_ )
|
||||
{
|
||||
_name = coder_._name;
|
||||
_description = coder_._description;
|
||||
_isReadable = coder_._isReadable;
|
||||
_isWritable = coder_._isWritable;
|
||||
_isMultiFrame = coder_._isMultiFrame;
|
||||
}
|
||||
|
||||
Magick::CoderInfo::CoderInfo ( const std::string &name_ )
|
||||
: _name(),
|
||||
_description(),
|
||||
_isReadable(false),
|
||||
_isWritable(false),
|
||||
_isMultiFrame(false)
|
||||
{
|
||||
ExceptionInfo exceptionInfo;
|
||||
GetExceptionInfo( &exceptionInfo );
|
||||
const Magick::MagickInfo *magickInfo = GetMagickInfo( name_.c_str(), &exceptionInfo );
|
||||
throwException( exceptionInfo );
|
||||
(void) DestroyExceptionInfo( &exceptionInfo );
|
||||
if( magickInfo == 0 )
|
||||
{
|
||||
throwExceptionExplicit(OptionError, "Coder not found", name_.c_str() );
|
||||
}
|
||||
else
|
||||
{
|
||||
_name = string(magickInfo->name);
|
||||
_description = string(magickInfo->description);
|
||||
_isReadable = ((magickInfo->decoder == 0) ? false : true);
|
||||
_isWritable = ((magickInfo->encoder == 0) ? false : true);
|
||||
_isMultiFrame = ((magickInfo->adjoin == 0) ? false : true);
|
||||
}
|
||||
}
|
||||
|
||||
Magick::CoderInfo::~CoderInfo ( void )
|
||||
{
|
||||
// Nothing to do
|
||||
}
|
||||
|
||||
// Format name
|
||||
std::string Magick::CoderInfo::name( void ) const
|
||||
{
|
||||
return _name;
|
||||
}
|
||||
|
||||
// Format description
|
||||
std::string Magick::CoderInfo::description( void ) const
|
||||
{
|
||||
return _description;
|
||||
}
|
||||
|
||||
// Format is readable
|
||||
bool Magick::CoderInfo::isReadable( void ) const
|
||||
{
|
||||
return _isReadable;
|
||||
}
|
||||
|
||||
// Format is writeable
|
||||
bool Magick::CoderInfo::isWritable( void ) const
|
||||
{
|
||||
return _isWritable;
|
||||
}
|
||||
|
||||
// Format supports multiple frames
|
||||
bool Magick::CoderInfo::isMultiFrame( void ) const
|
||||
{
|
||||
return _isMultiFrame;
|
||||
}
|
||||
|
||||
// Assignment operator
|
||||
Magick::CoderInfo& Magick::CoderInfo::operator= (const CoderInfo &coder_ )
|
||||
{
|
||||
// If not being set to ourself
|
||||
if (this != &coder_)
|
||||
{
|
||||
_name = coder_._name;
|
||||
_description = coder_._description;
|
||||
_isReadable = coder_._isReadable;
|
||||
_isWritable = coder_._isWritable;
|
||||
_isMultiFrame = coder_._isMultiFrame;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
// Construct from MagickCore::MagickInfo*
|
||||
Magick::CoderInfo::CoderInfo ( const MagickCore::MagickInfo *magickInfo_ )
|
||||
: _name(string(magickInfo_->name ? magickInfo_->name : "")),
|
||||
_description(string(magickInfo_->description ? magickInfo_->description : "")),
|
||||
_isReadable(magickInfo_->decoder ? true : false),
|
||||
_isWritable(magickInfo_->encoder ? true : false),
|
||||
_isMultiFrame(magickInfo_->adjoin ? true : false)
|
||||
{
|
||||
// Nothing more to do
|
||||
}
|
|
@ -1,695 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003
|
||||
//
|
||||
// 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"
|
||||
|
||||
//
|
||||
// Color operator fuctions
|
||||
//
|
||||
int Magick::operator == ( const Magick::Color& left_,
|
||||
const Magick::Color& right_ )
|
||||
{
|
||||
return ( ( left_.isValid() == right_.isValid() ) &&
|
||||
( left_.redQuantum() == right_.redQuantum() ) &&
|
||||
( left_.greenQuantum() == right_.greenQuantum() ) &&
|
||||
( left_.blueQuantum() == right_.blueQuantum() )
|
||||
);
|
||||
}
|
||||
int Magick::operator != ( const Magick::Color& left_,
|
||||
const Magick::Color& right_ )
|
||||
{
|
||||
return ( ! (left_ == right_) );
|
||||
}
|
||||
int Magick::operator > ( const Magick::Color& left_,
|
||||
const Magick::Color& right_ )
|
||||
{
|
||||
return ( !( left_ < right_ ) && ( left_ != right_ ) );
|
||||
}
|
||||
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;
|
||||
}
|
||||
int Magick::operator >= ( const Magick::Color& left_,
|
||||
const Magick::Color& right_ )
|
||||
{
|
||||
return ( ( left_ > right_ ) || ( left_ == right_ ) );
|
||||
}
|
||||
int Magick::operator <= ( const Magick::Color& left_,
|
||||
const Magick::Color& right_ )
|
||||
{
|
||||
return ( ( left_ < right_ ) || ( left_ == right_ ) );
|
||||
}
|
||||
|
||||
//
|
||||
// Color Implementation
|
||||
//
|
||||
|
||||
// Default constructor
|
||||
Magick::Color::Color ( void )
|
||||
: _pixel(new PixelPacket),
|
||||
_pixelOwn(true),
|
||||
_isValid(false),
|
||||
_pixelType(RGBPixel)
|
||||
{
|
||||
initPixel();
|
||||
}
|
||||
|
||||
// Construct from RGB
|
||||
Magick::Color::Color ( Quantum red_,
|
||||
Quantum green_,
|
||||
Quantum blue_ )
|
||||
: _pixel(new PixelPacket),
|
||||
_pixelOwn(true),
|
||||
_isValid(true),
|
||||
_pixelType(RGBPixel)
|
||||
{
|
||||
redQuantum ( red_ );
|
||||
greenQuantum ( green_ );
|
||||
blueQuantum ( blue_ );
|
||||
alphaQuantum ( OpaqueOpacity );
|
||||
}
|
||||
|
||||
// Construct from RGBA
|
||||
Magick::Color::Color ( Quantum red_,
|
||||
Quantum green_,
|
||||
Quantum blue_,
|
||||
Quantum alpha_ )
|
||||
: _pixel(new PixelPacket),
|
||||
_pixelOwn(true),
|
||||
_isValid(true),
|
||||
_pixelType(RGBAPixel)
|
||||
{
|
||||
redQuantum ( red_ );
|
||||
greenQuantum ( green_ );
|
||||
blueQuantum ( blue_ );
|
||||
alphaQuantum ( alpha_ );
|
||||
}
|
||||
|
||||
// Copy constructor
|
||||
Magick::Color::Color ( const Magick::Color & color_ )
|
||||
: _pixel( new PixelPacket ),
|
||||
_pixelOwn( true ),
|
||||
_isValid( color_._isValid ),
|
||||
_pixelType( color_._pixelType )
|
||||
{
|
||||
*_pixel = *color_._pixel;
|
||||
}
|
||||
|
||||
// Construct from color expressed as C++ string
|
||||
Magick::Color::Color ( const std::string &x11color_ )
|
||||
: _pixel(new PixelPacket),
|
||||
_pixelOwn(true),
|
||||
_isValid(true),
|
||||
_pixelType(RGBPixel)
|
||||
{
|
||||
initPixel();
|
||||
|
||||
// Use operator = implementation
|
||||
*this = x11color_;
|
||||
}
|
||||
|
||||
// Construct from color expressed as C string
|
||||
Magick::Color::Color ( const char * x11color_ )
|
||||
: _pixel(new PixelPacket),
|
||||
_pixelOwn(true),
|
||||
_isValid(true),
|
||||
_pixelType(RGBPixel)
|
||||
{
|
||||
initPixel();
|
||||
|
||||
// Use operator = implementation
|
||||
*this = x11color_;
|
||||
}
|
||||
|
||||
// Construct color via ImageMagick PixelPacket
|
||||
Magick::Color::Color ( const PixelPacket &color_ )
|
||||
: _pixel(new PixelPacket),
|
||||
_pixelOwn(true), // We allocated this pixel
|
||||
_isValid(true),
|
||||
_pixelType(RGBPixel) // RGB pixel by default
|
||||
{
|
||||
*_pixel = color_;
|
||||
|
||||
if ( color_.opacity != OpaqueOpacity )
|
||||
_pixelType = RGBAPixel;
|
||||
}
|
||||
|
||||
// Protected constructor to construct with PixelPacket*
|
||||
// Used to point Color at a pixel.
|
||||
Magick::Color::Color ( PixelPacket* rep_, PixelType pixelType_ )
|
||||
: _pixel(rep_),
|
||||
_pixelOwn(false),
|
||||
_isValid(true),
|
||||
_pixelType(pixelType_)
|
||||
{
|
||||
}
|
||||
|
||||
// Destructor
|
||||
Magick::Color::~Color( void )
|
||||
{
|
||||
if ( _pixelOwn )
|
||||
delete _pixel;
|
||||
_pixel=0;
|
||||
}
|
||||
|
||||
// Assignment operator
|
||||
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;
|
||||
}
|
||||
|
||||
// Set color via X11 color specification string
|
||||
const Magick::Color& Magick::Color::operator = ( const std::string &x11color_ )
|
||||
{
|
||||
initPixel();
|
||||
PixelPacket target_color;
|
||||
ExceptionInfo exception;
|
||||
GetExceptionInfo( &exception );
|
||||
if ( QueryColorDatabase( x11color_.c_str(), &target_color, &exception ) )
|
||||
{
|
||||
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;
|
||||
throwException(exception);
|
||||
}
|
||||
(void) DestroyExceptionInfo( &exception );
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
// Set color via X11 color specification C string
|
||||
const Magick::Color& Magick::Color::operator = ( const char * x11color_ )
|
||||
{
|
||||
*this = std::string(x11color_);
|
||||
return *this;
|
||||
}
|
||||
|
||||
// Return X11 color specification string
|
||||
Magick::Color::operator std::string() const
|
||||
{
|
||||
if ( !isValid() )
|
||||
return std::string("none");
|
||||
|
||||
char colorbuf[MaxTextExtent];
|
||||
|
||||
MagickPixelPacket
|
||||
pixel;
|
||||
|
||||
pixel.colorspace=RGBColorspace;
|
||||
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);
|
||||
}
|
||||
|
||||
// Set color via ImageMagick PixelPacket
|
||||
const Magick::Color& Magick::Color::operator= ( const MagickCore::PixelPacket &color_ )
|
||||
{
|
||||
*_pixel = color_;
|
||||
if ( color_.opacity != OpaqueOpacity )
|
||||
_pixelType = RGBAPixel;
|
||||
else
|
||||
_pixelType = RGBPixel;
|
||||
return *this;
|
||||
}
|
||||
|
||||
// Set pixel
|
||||
// Used to point Color at a pixel in an image
|
||||
void Magick::Color::pixel ( PixelPacket* rep_, PixelType pixelType_ )
|
||||
{
|
||||
if ( _pixelOwn )
|
||||
delete _pixel;
|
||||
_pixel = rep_;
|
||||
_pixelOwn = false;
|
||||
_isValid = true;
|
||||
_pixelType = pixelType_;
|
||||
}
|
||||
|
||||
// Does object contain valid color?
|
||||
bool Magick::Color::isValid ( void ) const
|
||||
{
|
||||
return( _isValid );
|
||||
}
|
||||
void Magick::Color::isValid ( bool valid_ )
|
||||
{
|
||||
if ( (valid_ && isValid()) || (!valid_ && !isValid()) )
|
||||
return;
|
||||
|
||||
if ( !_pixelOwn )
|
||||
{
|
||||
_pixel = new PixelPacket;
|
||||
_pixelOwn = true;
|
||||
}
|
||||
|
||||
_isValid=valid_;
|
||||
|
||||
initPixel();
|
||||
}
|
||||
|
||||
//
|
||||
// ColorHSL Implementation
|
||||
//
|
||||
|
||||
Magick::ColorHSL::ColorHSL ( double hue_,
|
||||
double saturation_,
|
||||
double luminosity_ )
|
||||
: Color ()
|
||||
{
|
||||
Quantum red, green, blue;
|
||||
|
||||
ConvertHSLToRGB ( hue_,
|
||||
saturation_,
|
||||
luminosity_,
|
||||
&red,
|
||||
&green,
|
||||
&blue );
|
||||
|
||||
redQuantum ( red );
|
||||
greenQuantum ( green );
|
||||
blueQuantum ( blue );
|
||||
alphaQuantum ( OpaqueOpacity );
|
||||
}
|
||||
|
||||
// Null constructor
|
||||
Magick::ColorHSL::ColorHSL ( )
|
||||
: Color ()
|
||||
{
|
||||
}
|
||||
|
||||
// Copy constructor from base class
|
||||
Magick::ColorHSL::ColorHSL ( const Magick::Color & color_ )
|
||||
: Color( color_ )
|
||||
{
|
||||
}
|
||||
|
||||
// Destructor
|
||||
Magick::ColorHSL::~ColorHSL ( )
|
||||
{
|
||||
// Nothing to do
|
||||
}
|
||||
|
||||
void Magick::ColorHSL::hue ( double hue_ )
|
||||
{
|
||||
double hue_val, saturation_val, luminosity_val;
|
||||
ConvertRGBToHSL ( redQuantum(),
|
||||
greenQuantum(),
|
||||
blueQuantum(),
|
||||
&hue_val,
|
||||
&saturation_val,
|
||||
&luminosity_val );
|
||||
|
||||
hue_val = hue_;
|
||||
|
||||
Quantum red, green, blue;
|
||||
ConvertHSLToRGB ( hue_val,
|
||||
saturation_val,
|
||||
luminosity_val,
|
||||
&red,
|
||||
&green,
|
||||
&blue
|
||||
);
|
||||
|
||||
redQuantum ( red );
|
||||
greenQuantum ( green );
|
||||
blueQuantum ( blue );
|
||||
}
|
||||
|
||||
double Magick::ColorHSL::hue ( void ) const
|
||||
{
|
||||
double hue_val, saturation_val, luminosity_val;
|
||||
ConvertRGBToHSL ( redQuantum(),
|
||||
greenQuantum(),
|
||||
blueQuantum(),
|
||||
&hue_val,
|
||||
&saturation_val,
|
||||
&luminosity_val );
|
||||
return hue_val;
|
||||
}
|
||||
|
||||
void Magick::ColorHSL::saturation ( double saturation_ )
|
||||
{
|
||||
double hue_val, saturation_val, luminosity_val;
|
||||
ConvertRGBToHSL ( redQuantum(),
|
||||
greenQuantum(),
|
||||
blueQuantum(),
|
||||
&hue_val,
|
||||
&saturation_val,
|
||||
&luminosity_val );
|
||||
|
||||
saturation_val = saturation_;
|
||||
|
||||
Quantum red, green, blue;
|
||||
ConvertHSLToRGB ( hue_val,
|
||||
saturation_val,
|
||||
luminosity_val,
|
||||
&red,
|
||||
&green,
|
||||
&blue
|
||||
);
|
||||
|
||||
redQuantum ( red );
|
||||
greenQuantum ( green );
|
||||
blueQuantum ( blue );
|
||||
}
|
||||
|
||||
double Magick::ColorHSL::saturation ( void ) const
|
||||
{
|
||||
double hue_val, saturation_val, luminosity_val;
|
||||
ConvertRGBToHSL ( redQuantum(),
|
||||
greenQuantum(),
|
||||
blueQuantum(),
|
||||
&hue_val,
|
||||
&saturation_val,
|
||||
&luminosity_val );
|
||||
return saturation_val;
|
||||
}
|
||||
|
||||
void Magick::ColorHSL::luminosity ( double luminosity_ )
|
||||
{
|
||||
double hue_val, saturation_val, luminosity_val;
|
||||
ConvertRGBToHSL ( redQuantum(),
|
||||
greenQuantum(),
|
||||
blueQuantum(),
|
||||
&hue_val,
|
||||
&saturation_val,
|
||||
&luminosity_val );
|
||||
|
||||
luminosity_val = luminosity_;
|
||||
|
||||
Quantum red, green, blue;
|
||||
ConvertHSLToRGB ( hue_val,
|
||||
saturation_val,
|
||||
luminosity_val,
|
||||
&red,
|
||||
&green,
|
||||
&blue
|
||||
);
|
||||
|
||||
redQuantum ( red );
|
||||
greenQuantum ( green );
|
||||
blueQuantum ( blue );
|
||||
}
|
||||
|
||||
double Magick::ColorHSL::luminosity ( void ) const
|
||||
{
|
||||
double hue_val, saturation_val, luminosity_val;
|
||||
ConvertRGBToHSL ( redQuantum(),
|
||||
greenQuantum(),
|
||||
blueQuantum(),
|
||||
&hue_val,
|
||||
&saturation_val,
|
||||
&luminosity_val );
|
||||
return luminosity_val;
|
||||
}
|
||||
|
||||
// Assignment from base class
|
||||
Magick::ColorHSL& Magick::ColorHSL::operator = ( const Magick::Color& color_ )
|
||||
{
|
||||
*static_cast<Magick::Color*>(this) = color_;
|
||||
return *this;
|
||||
}
|
||||
|
||||
//
|
||||
// ColorGray Implementation
|
||||
//
|
||||
Magick::ColorGray::ColorGray ( double shade_ )
|
||||
: Color ( scaleDoubleToQuantum( shade_ ),
|
||||
scaleDoubleToQuantum( shade_ ),
|
||||
scaleDoubleToQuantum( shade_ ) )
|
||||
{
|
||||
alphaQuantum ( OpaqueOpacity );
|
||||
}
|
||||
|
||||
// Null constructor
|
||||
Magick::ColorGray::ColorGray ( void )
|
||||
: Color ()
|
||||
{
|
||||
}
|
||||
|
||||
// Copy constructor from base class
|
||||
Magick::ColorGray::ColorGray ( const Magick::Color & color_ )
|
||||
: Color( color_ )
|
||||
{
|
||||
}
|
||||
|
||||
// Destructor
|
||||
Magick::ColorGray::~ColorGray ()
|
||||
{
|
||||
// Nothing to do
|
||||
}
|
||||
|
||||
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() );
|
||||
}
|
||||
|
||||
// Assignment from base class
|
||||
Magick::ColorGray& Magick::ColorGray::operator = ( const Magick::Color& color_ )
|
||||
{
|
||||
*static_cast<Magick::Color*>(this) = color_;
|
||||
return *this;
|
||||
}
|
||||
|
||||
//
|
||||
// ColorMono Implementation
|
||||
//
|
||||
Magick::ColorMono::ColorMono ( bool mono_ )
|
||||
: Color ( ( mono_ ? QuantumRange : 0 ),
|
||||
( mono_ ? QuantumRange : 0 ),
|
||||
( mono_ ? QuantumRange : 0 ) )
|
||||
{
|
||||
alphaQuantum ( OpaqueOpacity );
|
||||
}
|
||||
|
||||
// Null constructor
|
||||
Magick::ColorMono::ColorMono ( void )
|
||||
: Color ()
|
||||
{
|
||||
}
|
||||
|
||||
// Copy constructor from base class
|
||||
Magick::ColorMono::ColorMono ( const Magick::Color & color_ )
|
||||
: Color( color_ )
|
||||
{
|
||||
}
|
||||
|
||||
// Destructor
|
||||
Magick::ColorMono::~ColorMono ()
|
||||
{
|
||||
// Nothing to do
|
||||
}
|
||||
|
||||
void Magick::ColorMono::mono ( bool mono_ )
|
||||
{
|
||||
redQuantum ( mono_ ? QuantumRange : 0 );
|
||||
greenQuantum ( mono_ ? QuantumRange : 0 );
|
||||
blueQuantum ( mono_ ? QuantumRange : 0 );
|
||||
}
|
||||
|
||||
bool Magick::ColorMono::mono ( void ) const
|
||||
{
|
||||
if ( greenQuantum() )
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
// Assignment from base class
|
||||
Magick::ColorMono& Magick::ColorMono::operator = ( const Magick::Color& color_ )
|
||||
{
|
||||
*static_cast<Magick::Color*>(this) = color_;
|
||||
return *this;
|
||||
}
|
||||
|
||||
//
|
||||
// ColorRGB Implementation
|
||||
//
|
||||
|
||||
// Construct from red, green, and blue, components
|
||||
Magick::ColorRGB::ColorRGB ( double red_,
|
||||
double green_,
|
||||
double blue_ )
|
||||
: Color ( scaleDoubleToQuantum(red_),
|
||||
scaleDoubleToQuantum(green_),
|
||||
scaleDoubleToQuantum(blue_) )
|
||||
{
|
||||
alphaQuantum ( OpaqueOpacity );
|
||||
}
|
||||
// Null constructor
|
||||
Magick::ColorRGB::ColorRGB ( void )
|
||||
: Color ()
|
||||
{
|
||||
}
|
||||
// Copy constructor from base class
|
||||
Magick::ColorRGB::ColorRGB ( const Magick::Color & color_ )
|
||||
: Color( color_ )
|
||||
{
|
||||
}
|
||||
// Destructor
|
||||
Magick::ColorRGB::~ColorRGB ( void )
|
||||
{
|
||||
// Nothing to do
|
||||
}
|
||||
|
||||
// Assignment from base class
|
||||
Magick::ColorRGB& Magick::ColorRGB::operator = ( const Magick::Color& color_ )
|
||||
{
|
||||
*static_cast<Magick::Color*>(this) = color_;
|
||||
return *this;
|
||||
}
|
||||
|
||||
//
|
||||
// ColorYUV Implementation
|
||||
//
|
||||
|
||||
// R = Y +1.13980*V
|
||||
// G = Y-0.39380*U-0.58050*V
|
||||
// B = Y+2.02790*U
|
||||
//
|
||||
// U and V, normally -0.5 through 0.5, must be normalized to the range 0
|
||||
// through QuantumRange.
|
||||
//
|
||||
// Y = 0.29900*R+0.58700*G+0.11400*B
|
||||
// U = -0.14740*R-0.28950*G+0.43690*B
|
||||
// V = 0.61500*R-0.51500*G-0.10000*B
|
||||
//
|
||||
// U and V, normally -0.5 through 0.5, are normalized to the range 0
|
||||
// through QuantumRange. Note that U = 0.493*(B-Y), V = 0.877*(R-Y).
|
||||
//
|
||||
|
||||
// Construct from color components
|
||||
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 );
|
||||
}
|
||||
// Null constructor
|
||||
Magick::ColorYUV::ColorYUV ( void )
|
||||
: Color ()
|
||||
{
|
||||
}
|
||||
// Copy constructor from base class
|
||||
Magick::ColorYUV::ColorYUV ( const Magick::Color & color_ )
|
||||
: Color( color_ )
|
||||
{
|
||||
}
|
||||
// Destructor
|
||||
Magick::ColorYUV::~ColorYUV ( void )
|
||||
{
|
||||
// Nothing to do
|
||||
}
|
||||
|
||||
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()));
|
||||
}
|
||||
|
||||
// Assignment from base class
|
||||
Magick::ColorYUV& Magick::ColorYUV::operator = ( const Magick::Color& color_ )
|
||||
{
|
||||
*static_cast<Magick::Color*>(this) = color_;
|
||||
return *this;
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,563 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003
|
||||
//
|
||||
// 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"
|
||||
|
||||
// Construct with message string
|
||||
Magick::Exception::Exception( const std::string& what_ )
|
||||
: std::exception(),
|
||||
_what(what_)
|
||||
{
|
||||
}
|
||||
|
||||
// Copy constructor
|
||||
Magick::Exception::Exception( const Magick::Exception& original_ )
|
||||
: exception(original_),
|
||||
_what(original_._what)
|
||||
{
|
||||
}
|
||||
|
||||
// Assignment operator
|
||||
Magick::Exception& Magick::Exception::operator= (const Magick::Exception& original_ )
|
||||
{
|
||||
if(this != &original_)
|
||||
{
|
||||
this->_what = original_._what;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
// Return message string
|
||||
/*virtual*/ const char* Magick::Exception::what( ) const throw()
|
||||
{
|
||||
return _what.c_str();
|
||||
}
|
||||
|
||||
/* Destructor */
|
||||
/*virtual*/ Magick::Exception::~Exception ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
// Warnings
|
||||
//
|
||||
|
||||
Magick::Warning::Warning ( const std::string& what_ )
|
||||
: Exception(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::Warning::~Warning ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::WarningUndefined::WarningUndefined ( const std::string& what_ )
|
||||
: Warning(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::WarningUndefined::~WarningUndefined ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::WarningBlob::WarningBlob ( const std::string& what_ )
|
||||
: Warning(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::WarningBlob::~WarningBlob ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::WarningCache::WarningCache ( const std::string& what_ )
|
||||
: Warning(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::WarningCache::~WarningCache ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::WarningCoder::WarningCoder ( const std::string& what_ )
|
||||
: Warning(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::WarningCoder::~WarningCoder ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::WarningConfigure::WarningConfigure ( const std::string& what_ )
|
||||
: Warning(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::WarningConfigure::~WarningConfigure ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::WarningCorruptImage::WarningCorruptImage ( const std::string& what_ )
|
||||
: Warning(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::WarningCorruptImage::~WarningCorruptImage ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::WarningDelegate::WarningDelegate ( const std::string& what_ )
|
||||
: Warning(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::WarningDelegate::~WarningDelegate ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::WarningDraw::WarningDraw ( const std::string& what_ )
|
||||
: Warning(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::WarningDraw::~WarningDraw ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::WarningFileOpen::WarningFileOpen ( const std::string& what_ )
|
||||
: Warning(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::WarningFileOpen::~WarningFileOpen ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::WarningImage::WarningImage ( const std::string& what_ )
|
||||
: Warning(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::WarningImage::~WarningImage ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::WarningMissingDelegate::WarningMissingDelegate ( const std::string& what_ )
|
||||
: Warning(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::WarningMissingDelegate::~WarningMissingDelegate ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::WarningModule::WarningModule ( const std::string& what_ )
|
||||
: Warning(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::WarningModule::~WarningModule ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::WarningMonitor::WarningMonitor ( const std::string& what_ )
|
||||
: Warning(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::WarningMonitor::~WarningMonitor ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::WarningOption::WarningOption ( const std::string& what_ )
|
||||
: Warning(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::WarningOption::~WarningOption ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::WarningRegistry::WarningRegistry ( const std::string& what_ )
|
||||
: Warning(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::WarningRegistry::~WarningRegistry ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::WarningResourceLimit::WarningResourceLimit ( const std::string& what_ )
|
||||
: Warning(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::WarningResourceLimit::~WarningResourceLimit ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::WarningStream::WarningStream ( const std::string& what_ )
|
||||
: Warning(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::WarningStream::~WarningStream ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::WarningType::WarningType ( const std::string& what_ )
|
||||
: Warning(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::WarningType::~WarningType ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::WarningXServer::WarningXServer ( const std::string& what_ )
|
||||
: Warning(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::WarningXServer::~WarningXServer ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
// Errors
|
||||
//
|
||||
|
||||
Magick::Error::Error ( const std::string& what_ )
|
||||
: Exception(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::Error::~Error ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::ErrorUndefined::ErrorUndefined ( const std::string& what_ )
|
||||
: Error(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::ErrorUndefined::~ErrorUndefined ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::ErrorBlob::ErrorBlob ( const std::string& what_ )
|
||||
: Error(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::ErrorBlob::~ErrorBlob ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::ErrorCache::ErrorCache ( const std::string& what_ )
|
||||
: Error(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::ErrorCache::~ErrorCache ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::ErrorCoder::ErrorCoder ( const std::string& what_ )
|
||||
: Error(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::ErrorCoder::~ErrorCoder ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::ErrorConfigure::ErrorConfigure ( const std::string& what_ )
|
||||
: Error(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::ErrorConfigure::~ErrorConfigure ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::ErrorCorruptImage::ErrorCorruptImage ( const std::string& what_ )
|
||||
: Error(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::ErrorCorruptImage::~ErrorCorruptImage ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::ErrorDelegate::ErrorDelegate ( const std::string& what_ )
|
||||
: Error(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::ErrorDelegate::~ErrorDelegate ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::ErrorDraw::ErrorDraw ( const std::string& what_ )
|
||||
: Error(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::ErrorDraw::~ErrorDraw ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::ErrorFileOpen::ErrorFileOpen ( const std::string& what_ )
|
||||
: Error(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::ErrorFileOpen::~ErrorFileOpen ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::ErrorImage::ErrorImage ( const std::string& what_ )
|
||||
: Error(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::ErrorImage::~ErrorImage ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::ErrorMissingDelegate::ErrorMissingDelegate ( const std::string& what_ )
|
||||
: Error(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::ErrorMissingDelegate::~ErrorMissingDelegate ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::ErrorModule::ErrorModule ( const std::string& what_ )
|
||||
: Error(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::ErrorModule::~ErrorModule ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::ErrorMonitor::ErrorMonitor ( const std::string& what_ )
|
||||
: Error(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::ErrorMonitor::~ErrorMonitor ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::ErrorOption::ErrorOption ( const std::string& what_ )
|
||||
: Error(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::ErrorOption::~ErrorOption ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::ErrorRegistry::ErrorRegistry ( const std::string& what_ )
|
||||
: Error(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::ErrorRegistry::~ErrorRegistry ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::ErrorResourceLimit::ErrorResourceLimit ( const std::string& what_ )
|
||||
: Error(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::ErrorResourceLimit::~ErrorResourceLimit ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::ErrorStream::ErrorStream ( const std::string& what_ )
|
||||
: Error(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::ErrorStream::~ErrorStream ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::ErrorType::ErrorType ( const std::string& what_ )
|
||||
: Error(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::ErrorType::~ErrorType ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
Magick::ErrorXServer::ErrorXServer ( const std::string& what_ )
|
||||
: Error(what_)
|
||||
{
|
||||
}
|
||||
|
||||
/*virtual*/ Magick::ErrorXServer::~ErrorXServer ( ) throw ()
|
||||
{
|
||||
}
|
||||
|
||||
// Format and throw exception
|
||||
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;
|
||||
|
||||
ExceptionInfo exception;
|
||||
|
||||
GetExceptionInfo( &exception );
|
||||
ThrowException( &exception, severity_, reason_, description_ );
|
||||
throwException( exception );
|
||||
(void) DestroyExceptionInfo( &exception );
|
||||
}
|
||||
|
||||
// Throw C++ exception
|
||||
MagickPPExport void Magick::throwException( ExceptionInfo &exception_ )
|
||||
{
|
||||
// Just return if there is no reported error
|
||||
if ( exception_.severity == UndefinedException )
|
||||
return;
|
||||
|
||||
// Format error message ImageMagick-style
|
||||
std::string message = SetClientName(0);
|
||||
if ( exception_.reason != 0 )
|
||||
{
|
||||
message += std::string(": ");
|
||||
message += std::string(exception_.reason);
|
||||
}
|
||||
|
||||
if ( exception_.description != 0 )
|
||||
message += " (" + std::string(exception_.description) + ")";
|
||||
|
||||
ExceptionType severity = exception_.severity;
|
||||
MagickBooleanType relinquish = exception_.relinquish;
|
||||
DestroyExceptionInfo( &exception_ );
|
||||
if (relinquish)
|
||||
GetExceptionInfo( &exception_ );
|
||||
|
||||
switch ( severity )
|
||||
{
|
||||
// Warnings
|
||||
case ResourceLimitWarning :
|
||||
throw WarningResourceLimit( message );
|
||||
case TypeWarning :
|
||||
throw WarningType( message );
|
||||
case OptionWarning :
|
||||
throw WarningOption( message );
|
||||
case DelegateWarning :
|
||||
throw WarningDelegate( message );
|
||||
case MissingDelegateWarning :
|
||||
throw WarningMissingDelegate( message );
|
||||
case CorruptImageWarning :
|
||||
throw WarningCorruptImage( message );
|
||||
case FileOpenWarning :
|
||||
throw WarningFileOpen( message );
|
||||
case BlobWarning :
|
||||
throw WarningBlob ( message );
|
||||
case StreamWarning :
|
||||
throw WarningStream ( message );
|
||||
case CacheWarning :
|
||||
throw WarningCache ( message );
|
||||
case CoderWarning :
|
||||
throw WarningCoder ( message );
|
||||
case ModuleWarning :
|
||||
throw WarningModule( message );
|
||||
case DrawWarning :
|
||||
throw WarningDraw( message );
|
||||
case ImageWarning :
|
||||
throw WarningImage( message );
|
||||
case XServerWarning :
|
||||
throw WarningXServer( message );
|
||||
case MonitorWarning :
|
||||
throw WarningMonitor( message );
|
||||
case RegistryWarning :
|
||||
throw WarningRegistry( message );
|
||||
case ConfigureWarning :
|
||||
throw WarningConfigure( message );
|
||||
// Errors
|
||||
case ResourceLimitError :
|
||||
case ResourceLimitFatalError :
|
||||
throw ErrorResourceLimit( message );
|
||||
case TypeError :
|
||||
case TypeFatalError :
|
||||
throw ErrorType( message );
|
||||
case OptionError :
|
||||
case OptionFatalError :
|
||||
throw ErrorOption( message );
|
||||
case DelegateError :
|
||||
case DelegateFatalError :
|
||||
throw ErrorDelegate( message );
|
||||
case MissingDelegateError :
|
||||
case MissingDelegateFatalError :
|
||||
throw ErrorMissingDelegate( message );
|
||||
case CorruptImageError :
|
||||
case CorruptImageFatalError :
|
||||
throw ErrorCorruptImage( message );
|
||||
case FileOpenError :
|
||||
case FileOpenFatalError :
|
||||
throw ErrorFileOpen( message );
|
||||
case BlobError :
|
||||
case BlobFatalError :
|
||||
throw ErrorBlob ( message );
|
||||
case StreamError :
|
||||
case StreamFatalError :
|
||||
throw ErrorStream ( message );
|
||||
case CacheError :
|
||||
case CacheFatalError :
|
||||
throw ErrorCache ( message );
|
||||
case CoderError :
|
||||
case CoderFatalError :
|
||||
throw ErrorCoder ( message );
|
||||
case ModuleError :
|
||||
case ModuleFatalError :
|
||||
throw ErrorModule ( message );
|
||||
case DrawError :
|
||||
case DrawFatalError :
|
||||
throw ErrorDraw ( message );
|
||||
case ImageError :
|
||||
case ImageFatalError :
|
||||
throw ErrorImage ( message );
|
||||
case XServerError :
|
||||
case XServerFatalError :
|
||||
throw ErrorXServer ( message );
|
||||
case MonitorError :
|
||||
case MonitorFatalError :
|
||||
throw ErrorMonitor ( message );
|
||||
case RegistryError :
|
||||
case RegistryFatalError :
|
||||
throw ErrorRegistry ( message );
|
||||
case ConfigureError :
|
||||
case ConfigureFatalError :
|
||||
throw ErrorConfigure ( message );
|
||||
case UndefinedException :
|
||||
default :
|
||||
throw ErrorUndefined( message );
|
||||
}
|
||||
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2002, 2003
|
||||
//
|
||||
// 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"
|
||||
|
||||
// Clone C++ string as allocated C string, de-allocating any existing string
|
||||
void Magick::CloneString( char **destination_, const std::string &source_ )
|
||||
{
|
||||
MagickCore::CloneString( destination_, source_.c_str() );
|
||||
}
|
|
@ -1,359 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003
|
||||
//
|
||||
// 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"
|
||||
|
||||
#define AbsoluteValue(x) ((x) < 0 ? -(x) : (x))
|
||||
|
||||
int Magick::operator == ( const Magick::Geometry& left_,
|
||||
const Magick::Geometry& right_ )
|
||||
{
|
||||
return (
|
||||
( left_.isValid() == right_.isValid() ) &&
|
||||
( left_.width() == right_.width() ) &&
|
||||
( left_.height() == right_.height() ) &&
|
||||
( left_.xOff() == right_.xOff() ) &&
|
||||
( left_.yOff() == right_.yOff() ) &&
|
||||
( left_.xNegative() == right_.xNegative() ) &&
|
||||
( left_.yNegative() == right_.yNegative() ) &&
|
||||
( left_.percent() == right_.percent() ) &&
|
||||
( left_.aspect() == right_.aspect() ) &&
|
||||
( left_.greater() == right_.greater() ) &&
|
||||
( left_.less() == right_.less() )
|
||||
);
|
||||
}
|
||||
int Magick::operator != ( const Magick::Geometry& left_,
|
||||
const Magick::Geometry& right_ )
|
||||
{
|
||||
return ( ! (left_ == right_) );
|
||||
}
|
||||
int Magick::operator > ( const Magick::Geometry& left_,
|
||||
const Magick::Geometry& right_ )
|
||||
{
|
||||
return ( !( left_ < right_ ) && ( left_ != right_ ) );
|
||||
}
|
||||
int Magick::operator < ( const Magick::Geometry& left_,
|
||||
const Magick::Geometry& right_ )
|
||||
{
|
||||
return (
|
||||
( left_.width() * left_.height() )
|
||||
<
|
||||
( right_.width() * right_.height() )
|
||||
);
|
||||
}
|
||||
int Magick::operator >= ( const Magick::Geometry& left_,
|
||||
const Magick::Geometry& right_ )
|
||||
{
|
||||
return ( ( left_ > right_ ) || ( left_ == right_ ) );
|
||||
}
|
||||
int Magick::operator <= ( const Magick::Geometry& left_,
|
||||
const Magick::Geometry& right_ )
|
||||
{
|
||||
return ( ( left_ < right_ ) || ( left_ == right_ ) );
|
||||
}
|
||||
|
||||
// Construct using parameterized arguments
|
||||
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 )
|
||||
{
|
||||
}
|
||||
|
||||
// Assignment from C++ string
|
||||
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 )
|
||||
{
|
||||
*this = geometry_; // Use assignment operator
|
||||
}
|
||||
|
||||
|
||||
// Assignment from C character string
|
||||
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 )
|
||||
{
|
||||
*this = geometry_; // Use assignment operator
|
||||
}
|
||||
|
||||
// Copy constructor
|
||||
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 )
|
||||
{
|
||||
}
|
||||
|
||||
// Default constructor
|
||||
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 )
|
||||
{
|
||||
}
|
||||
|
||||
/* virtual */ Magick::Geometry::~Geometry ( void )
|
||||
{
|
||||
// Nothing to do
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
// Set value via geometry string
|
||||
/* virtual */ const Magick::Geometry&
|
||||
Magick::Geometry::operator = ( const std::string &geometry_ )
|
||||
{
|
||||
char
|
||||
geom[MaxTextExtent];
|
||||
|
||||
// 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])))
|
||||
{
|
||||
char *pageptr = GetPageGeometry( geom );
|
||||
if ( pageptr != 0 )
|
||||
{
|
||||
(void) CopyMagickString(geom,pageptr,MaxTextExtent);
|
||||
pageptr=(char *) RelinquishMagickMemory( pageptr );
|
||||
}
|
||||
}
|
||||
|
||||
ssize_t x = 0;
|
||||
ssize_t y = 0;
|
||||
size_t width_val = 0;
|
||||
size_t height_val = 0;
|
||||
ssize_t 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;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
// Set value via geometry C string
|
||||
/* virtual */ const Magick::Geometry& Magick::Geometry::operator = ( const char * geometry_ )
|
||||
{
|
||||
*this = std::string(geometry_);
|
||||
return *this;
|
||||
}
|
||||
|
||||
// Return geometry string
|
||||
Magick::Geometry::operator std::string() const
|
||||
{
|
||||
if (!isValid())
|
||||
{
|
||||
throwExceptionExplicit( OptionError, "Invalid geometry argument" );
|
||||
}
|
||||
|
||||
string geometry;
|
||||
char buffer[MaxTextExtent];
|
||||
|
||||
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 += '<';
|
||||
|
||||
return geometry;
|
||||
}
|
||||
|
||||
// Construct from RectangleInfo
|
||||
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)
|
||||
{
|
||||
}
|
||||
|
||||
// Return an ImageMagick RectangleInfo struct
|
||||
Magick::Geometry::operator MagickCore::RectangleInfo() const
|
||||
{
|
||||
RectangleInfo rectangle;
|
||||
rectangle.width = _width;
|
||||
rectangle.height = _height;
|
||||
_xNegative ? rectangle.x = static_cast<ssize_t>(0-_xOff) : rectangle.x = static_cast<ssize_t>(_xOff);
|
||||
_yNegative ? rectangle.y = static_cast<ssize_t>(0-_yOff) : rectangle.y = static_cast<ssize_t>(_yOff);
|
||||
return rectangle;
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,12 +0,0 @@
|
|||
prefix=/usr/local
|
||||
exec_prefix=${prefix}
|
||||
libdir=${exec_prefix}/lib
|
||||
includedir=${prefix}/include/ImageMagick
|
||||
|
||||
|
||||
Name: ImageMagick++
|
||||
Version: 6.8.3
|
||||
Description: Magick++ - C++ API for ImageMagick (ABI @MAGICK_ABISUFFIX@)
|
||||
Requires: ImageMagick
|
||||
Libs: -L${libdir} -lMagick++6-Q16
|
||||
Cflags: -I${includedir}
|
|
@ -1,12 +0,0 @@
|
|||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@/ImageMagick
|
||||
|
||||
|
||||
Name: ImageMagick++
|
||||
Version: @PACKAGE_VERSION@
|
||||
Description: Magick++ - C++ API for ImageMagick (ABI @MAGICK_ABISUFFIX@)
|
||||
Requires: ImageMagick
|
||||
Libs: -L${libdir} -lMagick++@MAGICK_MAJOR_VERSION@-@MAGICK_ABI_SUFFIX@
|
||||
Cflags: -I${includedir}
|
|
@ -1,104 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002
|
||||
//
|
||||
// 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"
|
||||
|
||||
// Construct with an image and default options
|
||||
Magick::ImageRef::ImageRef ( MagickCore::Image * image_ )
|
||||
: _image(image_),
|
||||
_options(new Options),
|
||||
_id(-1),
|
||||
_refCount(1),
|
||||
_mutexLock()
|
||||
{
|
||||
}
|
||||
|
||||
// Construct with an image and options
|
||||
// Inserts Image* in image, but copies Options into image.
|
||||
Magick::ImageRef::ImageRef ( MagickCore::Image * image_,
|
||||
const Options * options_ )
|
||||
: _image(image_),
|
||||
_options(0),
|
||||
_id(-1),
|
||||
_refCount(1),
|
||||
_mutexLock()
|
||||
{
|
||||
_options = new Options( *options_ );
|
||||
}
|
||||
|
||||
// Default constructor
|
||||
Magick::ImageRef::ImageRef ( void )
|
||||
: _image(0),
|
||||
_options(new Options),
|
||||
_id(-1),
|
||||
_refCount(1),
|
||||
_mutexLock()
|
||||
{
|
||||
// Allocate default image
|
||||
_image = AcquireImage( _options->imageInfo() );
|
||||
|
||||
// Test for error and throw exception (like throwImageException())
|
||||
throwException(_image->exception);
|
||||
}
|
||||
|
||||
// Destructor
|
||||
Magick::ImageRef::~ImageRef( void )
|
||||
{
|
||||
// Unregister image (if still registered)
|
||||
if( _id > -1 )
|
||||
{
|
||||
char id[MaxTextExtent];
|
||||
sprintf(id,"%.20g",(double) _id);
|
||||
DeleteImageRegistry( id );
|
||||
_id=-1;
|
||||
}
|
||||
|
||||
// Deallocate image
|
||||
if ( _image )
|
||||
{
|
||||
DestroyImageList( _image );
|
||||
_image = 0;
|
||||
}
|
||||
|
||||
// Deallocate image options
|
||||
delete _options;
|
||||
_options = 0;
|
||||
}
|
||||
|
||||
// Assign image to reference
|
||||
void Magick::ImageRef::image ( MagickCore::Image * image_ )
|
||||
{
|
||||
if(_image)
|
||||
DestroyImageList( _image );
|
||||
_image = image_;
|
||||
}
|
||||
|
||||
// Assign options to reference
|
||||
void Magick::ImageRef::options ( Magick::Options * options_ )
|
||||
{
|
||||
delete _options;
|
||||
_options = options_;
|
||||
}
|
||||
|
||||
// Assign registration id to reference
|
||||
void Magick::ImageRef::id ( const ssize_t id_ )
|
||||
{
|
||||
if( _id > -1 )
|
||||
{
|
||||
char id[MaxTextExtent];
|
||||
sprintf(id,"%.20g",(double) _id);
|
||||
DeleteImageRegistry( id );
|
||||
}
|
||||
_id = id_;
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
prefix=/usr/local
|
||||
exec_prefix=${prefix}
|
||||
libdir=${exec_prefix}/lib
|
||||
includedir=${prefix}/include/ImageMagick
|
||||
|
||||
|
||||
Name: Magick++
|
||||
Version: 6.8.3
|
||||
Description: Magick++ - C++ API for ImageMagick
|
||||
Requires: ImageMagick
|
||||
Libs: -L${libdir} -lMagick++6-Q16
|
||||
Cflags: -I${includedir}
|
|
@ -1,14 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000
|
||||
//
|
||||
// Simplified includes for Magick++.
|
||||
// Inclusion of this header is sufficient to use all Magick++ APIs.
|
||||
//
|
||||
#ifndef MagickPlusPlus_Header
|
||||
#include <Magick++/Include.h>
|
||||
#include <Magick++/Image.h>
|
||||
#include <Magick++/Pixels.h>
|
||||
#include <Magick++/STL.h>
|
||||
#define MagickPlusPlus_Header
|
||||
#endif // MagickPlusPlus_Header
|
|
@ -1,12 +0,0 @@
|
|||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@/ImageMagick
|
||||
|
||||
|
||||
Name: Magick++
|
||||
Version: @PACKAGE_VERSION@
|
||||
Description: Magick++ - C++ API for ImageMagick
|
||||
Requires: ImageMagick
|
||||
Libs: -L${libdir} -lMagick++@MAGICK_MAJOR_VERSION@-@MAGICK_ABI_SUFFIX@
|
||||
Cflags: -I${includedir}
|
|
@ -1,82 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002
|
||||
//
|
||||
// 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_, 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 );
|
||||
|
||||
// Update object contents, making a copy of the supplied data.
|
||||
// Any existing data in the object is deallocated.
|
||||
void update ( const void* data_, 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_, size_t length_,
|
||||
Allocator allocator_ = NewAllocator );
|
||||
|
||||
// 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;
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
BlobRef * _blobRef;
|
||||
};
|
||||
|
||||
} // namespace Magick
|
||||
|
||||
#endif // Magick_BlobRef_header
|
|
@ -1,46 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002
|
||||
//
|
||||
// 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:
|
||||
// There are no public methods in this class
|
||||
|
||||
// Construct with data, making private copy of data
|
||||
BlobRef ( const void* data_, size_t length_ );
|
||||
|
||||
// Destructor (actually destroys data)
|
||||
~BlobRef ( void );
|
||||
|
||||
private:
|
||||
// Copy constructor and assignment are not supported
|
||||
BlobRef (const BlobRef&);
|
||||
BlobRef& operator= (const BlobRef&);
|
||||
|
||||
public:
|
||||
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
|
||||
};
|
||||
|
||||
} // namespace Magick
|
||||
|
||||
#endif // Magick_Blob_header
|
|
@ -1,79 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 2001, 2002
|
||||
//
|
||||
// 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 );
|
||||
|
||||
// Format name
|
||||
std::string name( void ) const;
|
||||
|
||||
// Format description
|
||||
std::string description( void ) const;
|
||||
|
||||
// Format is readable
|
||||
bool isReadable( void ) const;
|
||||
|
||||
// Format is writeable
|
||||
bool isWritable( void ) const;
|
||||
|
||||
// Format supports multiple frames
|
||||
bool isMultiFrame( void ) const;
|
||||
|
||||
// Assignment operator
|
||||
CoderInfo& operator= (const CoderInfo &coder_ );
|
||||
|
||||
//
|
||||
// Implemementation methods
|
||||
//
|
||||
CoderInfo ( const MagickCore::MagickInfo *magickInfo_ );
|
||||
|
||||
private:
|
||||
|
||||
std::string _name;
|
||||
std::string _description;
|
||||
bool _isReadable;
|
||||
bool _isWritable;
|
||||
bool _isMultiFrame;
|
||||
|
||||
};
|
||||
} // namespace Magick
|
||||
|
||||
//
|
||||
// Inlines
|
||||
//
|
||||
|
||||
|
||||
#endif // Magick_CoderInfo_header
|
|
@ -1,464 +0,0 @@
|
|||
// 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
|
||||
int MagickPPExport operator == ( const Magick::Color& left_, const Magick::Color& right_ );
|
||||
int MagickPPExport operator != ( const Magick::Color& left_, const Magick::Color& right_ );
|
||||
int MagickPPExport operator > ( const Magick::Color& left_, const Magick::Color& right_ );
|
||||
int MagickPPExport operator < ( const Magick::Color& left_, const Magick::Color& right_ );
|
||||
int MagickPPExport operator >= ( const Magick::Color& left_, const Magick::Color& right_ );
|
||||
int MagickPPExport operator <= ( const Magick::Color& left_, const Magick::Color& right_ );
|
||||
|
||||
// Base color class stores RGB components scaled to fit Quantum
|
||||
class MagickPPExport Color
|
||||
{
|
||||
public:
|
||||
Color ( Quantum red_,
|
||||
Quantum green_,
|
||||
Quantum blue_ );
|
||||
Color ( Quantum red_,
|
||||
Quantum green_,
|
||||
Quantum blue_,
|
||||
Quantum alpha_ );
|
||||
Color ( const std::string &x11color_ );
|
||||
Color ( const char * x11color_ );
|
||||
Color ( void );
|
||||
virtual ~Color ( void );
|
||||
Color ( const Color & color_ );
|
||||
|
||||
// Red color (range 0 to QuantumRange)
|
||||
void redQuantum ( Quantum red_ );
|
||||
Quantum redQuantum ( void ) const;
|
||||
|
||||
// Green color (range 0 to QuantumRange)
|
||||
void greenQuantum ( Quantum green_ );
|
||||
Quantum greenQuantum ( void ) const;
|
||||
|
||||
// Blue color (range 0 to QuantumRange)
|
||||
void blueQuantum ( Quantum blue_ );
|
||||
Quantum blueQuantum ( void ) const;
|
||||
|
||||
// Alpha level (range OpaqueOpacity=0 to TransparentOpacity=QuantumRange)
|
||||
void alphaQuantum ( Quantum alpha_ );
|
||||
Quantum alphaQuantum ( void ) 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;
|
||||
|
||||
// Does object contain valid color?
|
||||
void isValid ( bool valid_ );
|
||||
bool isValid ( void ) const;
|
||||
|
||||
// Set color via X11 color specification string
|
||||
const Color& operator= ( const std::string &x11color_ );
|
||||
const Color& operator= ( const char * x11color_ );
|
||||
|
||||
// Assignment operator
|
||||
Color& operator= ( const Color& color_ );
|
||||
|
||||
// Return X11 color specification string
|
||||
/* virtual */ operator std::string() const;
|
||||
|
||||
// Return ImageMagick PixelPacket
|
||||
operator PixelPacket() const;
|
||||
|
||||
// Construct color via ImageMagick PixelPacket
|
||||
Color ( const PixelPacket &color_ );
|
||||
|
||||
// Set color via ImageMagick PixelPacket
|
||||
const Color& operator= ( const PixelPacket &color_ );
|
||||
|
||||
//
|
||||
// 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 < 64)
|
||||
static double scaleQuantumToDouble( const Quantum quantum_ )
|
||||
{
|
||||
return (static_cast<double>(quantum_)/QuantumRange);
|
||||
}
|
||||
#endif
|
||||
static double scaleQuantumToDouble( const double quantum_ )
|
||||
{
|
||||
return (quantum_/QuantumRange);
|
||||
}
|
||||
|
||||
|
||||
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:
|
||||
|
||||
// Common initializer for PixelPacket representation
|
||||
void initPixel();
|
||||
|
||||
// Set true if we allocated pixel
|
||||
bool _pixelOwn;
|
||||
|
||||
// Set true if pixel is "valid"
|
||||
bool _isValid;
|
||||
|
||||
// Color type supported by _pixel
|
||||
PixelType _pixelType;
|
||||
|
||||
};
|
||||
|
||||
//
|
||||
// HSL Colorspace colors
|
||||
//
|
||||
class MagickPPExport ColorHSL : public Color
|
||||
{
|
||||
public:
|
||||
ColorHSL ( double hue_, double saturation_, double luminosity_ );
|
||||
ColorHSL ( void );
|
||||
ColorHSL ( const Color & color_ );
|
||||
/* virtual */ ~ColorHSL ( );
|
||||
|
||||
void hue ( double hue_ );
|
||||
double hue ( void ) const;
|
||||
|
||||
void saturation ( double saturation_ );
|
||||
double saturation ( void ) const;
|
||||
|
||||
void luminosity ( double luminosity_ );
|
||||
double luminosity ( void ) const;
|
||||
|
||||
// Assignment operator from base class
|
||||
ColorHSL& operator= ( const Color& color_ );
|
||||
|
||||
protected:
|
||||
// Constructor to construct with PixelPacket*
|
||||
ColorHSL ( PixelPacket* rep_, PixelType pixelType_ );
|
||||
};
|
||||
|
||||
//
|
||||
// Grayscale RGB color
|
||||
//
|
||||
// Grayscale is simply RGB with equal parts of red, green, and blue
|
||||
// All double arguments have a valid range of 0.0 - 1.0.
|
||||
class MagickPPExport ColorGray : public Color
|
||||
{
|
||||
public:
|
||||
ColorGray ( double shade_ );
|
||||
ColorGray ( void );
|
||||
ColorGray ( const Color & color_ );
|
||||
/* virtual */ ~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_ );
|
||||
};
|
||||
|
||||
//
|
||||
// Monochrome color
|
||||
//
|
||||
// Color arguments are constrained to 'false' (black pixel) and 'true'
|
||||
// (white pixel)
|
||||
class MagickPPExport ColorMono : public Color
|
||||
{
|
||||
public:
|
||||
ColorMono ( bool mono_ );
|
||||
ColorMono ( void );
|
||||
ColorMono ( const Color & color_ );
|
||||
/* virtual */ ~ColorMono ();
|
||||
|
||||
void mono ( bool mono_ );
|
||||
bool mono ( void ) const;
|
||||
|
||||
// Assignment operator from base class
|
||||
ColorMono& operator= ( const Color& color_ );
|
||||
|
||||
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:
|
||||
ColorRGB ( double red_, double green_, double blue_ );
|
||||
ColorRGB ( void );
|
||||
ColorRGB ( const Color & color_ );
|
||||
/* virtual */ ~ColorRGB ( void );
|
||||
|
||||
void red ( double red_ );
|
||||
double red ( void ) const;
|
||||
|
||||
void green ( double green_ );
|
||||
double green ( void ) const;
|
||||
|
||||
void blue ( double blue_ );
|
||||
double blue ( void ) const;
|
||||
|
||||
// Assignment operator from base class
|
||||
ColorRGB& operator= ( const Color& color_ );
|
||||
|
||||
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:
|
||||
ColorYUV ( double y_, double u_, double v_ );
|
||||
ColorYUV ( void );
|
||||
ColorYUV ( const Color & color_ );
|
||||
/* virtual */ ~ColorYUV ( void );
|
||||
|
||||
void u ( double u_ );
|
||||
double u ( void ) const;
|
||||
|
||||
void v ( double v_ );
|
||||
double v ( void ) const;
|
||||
|
||||
void y ( double y_ );
|
||||
double y ( void ) const;
|
||||
|
||||
// Assignment operator from base class
|
||||
ColorYUV& operator= ( const Color& color_ );
|
||||
|
||||
protected:
|
||||
// Constructor to construct with PixelPacket*
|
||||
ColorYUV ( PixelPacket* rep_, PixelType pixelType_ );
|
||||
};
|
||||
} // namespace Magick
|
||||
|
||||
//
|
||||
// Inlines
|
||||
//
|
||||
|
||||
//
|
||||
// Color
|
||||
//
|
||||
|
||||
// Common initializer for PixelPacket representation
|
||||
// Initialized transparent black
|
||||
inline void Magick::Color::initPixel()
|
||||
{
|
||||
_pixel->red = 0;
|
||||
_pixel->green = 0;
|
||||
_pixel->blue = 0;
|
||||
_pixel->opacity = TransparentOpacity;
|
||||
}
|
||||
|
||||
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::greenQuantum ( Magick::Quantum green_ )
|
||||
{
|
||||
_pixel->green = green_;
|
||||
_isValid = true;
|
||||
}
|
||||
|
||||
inline Magick::Quantum Magick::Color::greenQuantum ( void ) const
|
||||
{
|
||||
return _pixel->green;
|
||||
}
|
||||
|
||||
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::alphaQuantum ( Magick::Quantum alpha_ )
|
||||
{
|
||||
_pixel->opacity = alpha_;
|
||||
_isValid = true ;
|
||||
}
|
||||
|
||||
inline Magick::Quantum Magick::Color::alphaQuantum ( void ) const
|
||||
{
|
||||
return _pixel->opacity;
|
||||
}
|
||||
|
||||
// Return ImageMagick PixelPacket struct based on color.
|
||||
inline Magick::Color::operator MagickCore::PixelPacket () const
|
||||
{
|
||||
return *_pixel;
|
||||
}
|
||||
|
||||
// Scaled version of alpha for use in sub-classes
|
||||
inline void Magick::Color::alpha ( double alpha_ )
|
||||
{
|
||||
alphaQuantum( scaleDoubleToQuantum(alpha_) );
|
||||
}
|
||||
inline double Magick::Color::alpha ( void ) const
|
||||
{
|
||||
return scaleQuantumToDouble( alphaQuantum() );
|
||||
}
|
||||
|
||||
//
|
||||
// ColorHSL
|
||||
//
|
||||
inline Magick::ColorHSL::ColorHSL ( Magick::PixelPacket* rep_,
|
||||
Magick::Color::PixelType pixelType_ )
|
||||
: Color( rep_, pixelType_ )
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
// ColorGray
|
||||
//
|
||||
inline Magick::ColorGray::ColorGray ( 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::red ( double red_ )
|
||||
{
|
||||
redQuantum( scaleDoubleToQuantum(red_) );
|
||||
}
|
||||
|
||||
inline double Magick::ColorRGB::red ( void ) const
|
||||
{
|
||||
return scaleQuantumToDouble( redQuantum() );
|
||||
}
|
||||
|
||||
inline void Magick::ColorRGB::green ( double green_ )
|
||||
{
|
||||
greenQuantum( scaleDoubleToQuantum(green_) );
|
||||
}
|
||||
|
||||
inline double Magick::ColorRGB::green ( void ) const
|
||||
{
|
||||
return scaleQuantumToDouble( greenQuantum() );
|
||||
}
|
||||
|
||||
inline void Magick::ColorRGB::blue ( double blue_ )
|
||||
{
|
||||
blueQuantum( scaleDoubleToQuantum(blue_) );
|
||||
}
|
||||
|
||||
inline double Magick::ColorRGB::blue ( void ) const
|
||||
{
|
||||
return scaleQuantumToDouble( blueQuantum() );
|
||||
}
|
||||
|
||||
//
|
||||
// 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
|
@ -1,336 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003
|
||||
//
|
||||
// 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:
|
||||
Exception( const std::string& what_ );
|
||||
Exception( const Exception& original_ );
|
||||
Exception& operator= (const Exception& original_ );
|
||||
virtual const char* what () const throw();
|
||||
virtual ~Exception ( ) throw ();
|
||||
|
||||
private:
|
||||
std::string _what;
|
||||
};
|
||||
|
||||
//
|
||||
// Warnings
|
||||
//
|
||||
|
||||
class MagickPPExport Warning : public Exception
|
||||
{
|
||||
public:
|
||||
explicit Warning ( const std::string& what_ );
|
||||
~Warning() throw ();
|
||||
};
|
||||
|
||||
class MagickPPExport WarningUndefined : public Warning
|
||||
{
|
||||
public:
|
||||
explicit WarningUndefined ( const std::string& what_ );
|
||||
~WarningUndefined() throw ();
|
||||
};
|
||||
|
||||
class MagickPPExport WarningBlob: public Warning
|
||||
{
|
||||
public:
|
||||
explicit WarningBlob ( const std::string& what_ );
|
||||
~WarningBlob() throw ();
|
||||
};
|
||||
|
||||
class MagickPPExport WarningCache: public Warning
|
||||
{
|
||||
public:
|
||||
explicit WarningCache ( const std::string& what_ );
|
||||
~WarningCache() throw ();
|
||||
};
|
||||
|
||||
class MagickPPExport WarningCoder: public Warning
|
||||
{
|
||||
public:
|
||||
explicit WarningCoder ( const std::string& what_ );
|
||||
~WarningCoder() throw ();
|
||||
};
|
||||
|
||||
class MagickPPExport WarningConfigure: public Warning
|
||||
{
|
||||
public:
|
||||
explicit WarningConfigure ( const std::string& what_ );
|
||||
~WarningConfigure() throw ();
|
||||
};
|
||||
|
||||
class MagickPPExport WarningCorruptImage: public Warning
|
||||
{
|
||||
public:
|
||||
explicit WarningCorruptImage ( const std::string& what_ );
|
||||
~WarningCorruptImage() throw ();
|
||||
};
|
||||
|
||||
class MagickPPExport WarningDelegate : public Warning
|
||||
{
|
||||
public:
|
||||
explicit WarningDelegate ( const std::string& what_ );
|
||||
~WarningDelegate() throw ();
|
||||
};
|
||||
|
||||
class MagickPPExport WarningDraw : public Warning
|
||||
{
|
||||
public:
|
||||
explicit WarningDraw ( const std::string& what_ );
|
||||
~WarningDraw() throw ();
|
||||
};
|
||||
|
||||
class MagickPPExport WarningFileOpen: public Warning
|
||||
{
|
||||
public:
|
||||
explicit WarningFileOpen ( const std::string& what_ );
|
||||
~WarningFileOpen() throw ();
|
||||
};
|
||||
|
||||
class MagickPPExport WarningImage: public Warning
|
||||
{
|
||||
public:
|
||||
explicit WarningImage ( const std::string& what_ );
|
||||
~WarningImage() throw ();
|
||||
};
|
||||
|
||||
class MagickPPExport WarningMissingDelegate : public Warning
|
||||
{
|
||||
public:
|
||||
explicit WarningMissingDelegate ( const std::string& what_ );
|
||||
~WarningMissingDelegate() throw ();
|
||||
};
|
||||
|
||||
class MagickPPExport WarningModule : public Warning
|
||||
{
|
||||
public:
|
||||
explicit WarningModule ( const std::string& what_ );
|
||||
~WarningModule() throw ();
|
||||
};
|
||||
|
||||
class MagickPPExport WarningMonitor : public Warning
|
||||
{
|
||||
public:
|
||||
explicit WarningMonitor ( const std::string& what_ );
|
||||
~WarningMonitor() throw ();
|
||||
};
|
||||
|
||||
class MagickPPExport WarningOption : public Warning
|
||||
{
|
||||
public:
|
||||
explicit WarningOption ( const std::string& what_ );
|
||||
~WarningOption() throw ();
|
||||
};
|
||||
|
||||
class MagickPPExport WarningRegistry : public Warning
|
||||
{
|
||||
public:
|
||||
explicit WarningRegistry ( const std::string& what_ );
|
||||
~WarningRegistry() throw ();
|
||||
};
|
||||
|
||||
class MagickPPExport WarningResourceLimit : public Warning
|
||||
{
|
||||
public:
|
||||
explicit WarningResourceLimit ( const std::string& what_ );
|
||||
~WarningResourceLimit() throw ();
|
||||
};
|
||||
|
||||
class MagickPPExport WarningStream : public Warning
|
||||
{
|
||||
public:
|
||||
explicit WarningStream ( const std::string& what_ );
|
||||
~WarningStream() throw ();
|
||||
};
|
||||
|
||||
class MagickPPExport WarningType : public Warning
|
||||
{
|
||||
public:
|
||||
explicit WarningType ( const std::string& what_ );
|
||||
~WarningType() throw ();
|
||||
};
|
||||
|
||||
class MagickPPExport WarningXServer : public Warning
|
||||
{
|
||||
public:
|
||||
explicit WarningXServer ( const std::string& what_ );
|
||||
~WarningXServer() throw ();
|
||||
};
|
||||
|
||||
//
|
||||
// Error exceptions
|
||||
//
|
||||
|
||||
class MagickPPExport Error : public Exception
|
||||
{
|
||||
public:
|
||||
explicit Error ( const std::string& what_ );
|
||||
~Error() throw ();
|
||||
};
|
||||
|
||||
class MagickPPExport ErrorUndefined : public Error
|
||||
{
|
||||
public:
|
||||
explicit ErrorUndefined ( const std::string& what_ );
|
||||
~ErrorUndefined() throw ();
|
||||
};
|
||||
|
||||
class MagickPPExport ErrorBlob: public Error
|
||||
{
|
||||
public:
|
||||
explicit ErrorBlob ( const std::string& what_ );
|
||||
~ErrorBlob() throw ();
|
||||
};
|
||||
|
||||
class MagickPPExport ErrorCache: public Error
|
||||
{
|
||||
public:
|
||||
explicit ErrorCache ( const std::string& what_ );
|
||||
~ErrorCache() throw ();
|
||||
};
|
||||
|
||||
class MagickPPExport ErrorCoder: public Error
|
||||
{
|
||||
public:
|
||||
explicit ErrorCoder ( const std::string& what_ );
|
||||
~ErrorCoder() throw ();
|
||||
};
|
||||
|
||||
class MagickPPExport ErrorConfigure: public Error
|
||||
{
|
||||
public:
|
||||
explicit ErrorConfigure ( const std::string& what_ );
|
||||
~ErrorConfigure() throw ();
|
||||
};
|
||||
|
||||
class MagickPPExport ErrorCorruptImage: public Error
|
||||
{
|
||||
public:
|
||||
explicit ErrorCorruptImage ( const std::string& what_ );
|
||||
~ErrorCorruptImage() throw ();
|
||||
};
|
||||
|
||||
class MagickPPExport ErrorDelegate : public Error
|
||||
{
|
||||
public:
|
||||
explicit ErrorDelegate ( const std::string& what_ );
|
||||
~ErrorDelegate() throw ();
|
||||
};
|
||||
|
||||
class MagickPPExport ErrorDraw : public Error
|
||||
{
|
||||
public:
|
||||
explicit ErrorDraw ( const std::string& what_ );
|
||||
~ErrorDraw() throw ();
|
||||
};
|
||||
|
||||
class MagickPPExport ErrorFileOpen: public Error
|
||||
{
|
||||
public:
|
||||
explicit ErrorFileOpen ( const std::string& what_ );
|
||||
~ErrorFileOpen() throw ();
|
||||
};
|
||||
|
||||
class MagickPPExport ErrorImage: public Error
|
||||
{
|
||||
public:
|
||||
explicit ErrorImage ( const std::string& what_ );
|
||||
~ErrorImage() throw ();
|
||||
};
|
||||
|
||||
class MagickPPExport ErrorMissingDelegate : public Error
|
||||
{
|
||||
public:
|
||||
explicit ErrorMissingDelegate ( const std::string& what_ );
|
||||
~ErrorMissingDelegate() throw ();
|
||||
};
|
||||
|
||||
class MagickPPExport ErrorModule : public Error
|
||||
{
|
||||
public:
|
||||
explicit ErrorModule ( const std::string& what_ );
|
||||
~ErrorModule() throw ();
|
||||
};
|
||||
|
||||
class MagickPPExport ErrorMonitor : public Error
|
||||
{
|
||||
public:
|
||||
explicit ErrorMonitor ( const std::string& what_ );
|
||||
~ErrorMonitor() throw ();
|
||||
};
|
||||
|
||||
class MagickPPExport ErrorOption : public Error
|
||||
{
|
||||
public:
|
||||
explicit ErrorOption ( const std::string& what_ );
|
||||
~ErrorOption() throw ();
|
||||
};
|
||||
|
||||
class MagickPPExport ErrorRegistry : public Error
|
||||
{
|
||||
public:
|
||||
explicit ErrorRegistry ( const std::string& what_ );
|
||||
~ErrorRegistry() throw ();
|
||||
};
|
||||
|
||||
class MagickPPExport ErrorResourceLimit : public Error
|
||||
{
|
||||
public:
|
||||
explicit ErrorResourceLimit ( const std::string& what_ );
|
||||
~ErrorResourceLimit() throw ();
|
||||
};
|
||||
|
||||
class MagickPPExport ErrorStream : public Error
|
||||
{
|
||||
public:
|
||||
explicit ErrorStream ( const std::string& what_ );
|
||||
~ErrorStream() throw ();
|
||||
};
|
||||
|
||||
class MagickPPExport ErrorType : public Error
|
||||
{
|
||||
public:
|
||||
explicit ErrorType ( const std::string& what_ );
|
||||
~ErrorType() throw ();
|
||||
};
|
||||
|
||||
class MagickPPExport ErrorXServer : public Error
|
||||
{
|
||||
public:
|
||||
explicit ErrorXServer ( const std::string& what_ );
|
||||
~ErrorXServer() throw ();
|
||||
};
|
||||
|
||||
//
|
||||
// No user-serviceable components beyond this point.
|
||||
//
|
||||
|
||||
// Throw exception based on raw data
|
||||
extern MagickPPExport void throwExceptionExplicit( const MagickCore::ExceptionType severity_,
|
||||
const char* reason_,
|
||||
const char* description_ = 0 );
|
||||
|
||||
// Thow exception based on ImageMagick's ExceptionInfo
|
||||
extern MagickPPExport void throwException( MagickCore::ExceptionInfo &exception_ );
|
||||
|
||||
} // namespace Magick
|
||||
|
||||
#endif // Magick_Exception_header
|
|
@ -1,20 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2003
|
||||
//
|
||||
// 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
|
||||
{
|
||||
void MagickPPExport CloneString( char **destination_, const std::string &source_ );
|
||||
|
||||
}
|
||||
#endif // Magick_Functions_header
|
|
@ -1,241 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002
|
||||
//
|
||||
// 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
|
||||
int MagickPPExport operator == ( const Magick::Geometry& left_, const Magick::Geometry& right_ );
|
||||
int MagickPPExport operator != ( const Magick::Geometry& left_, const Magick::Geometry& right_ );
|
||||
int MagickPPExport operator > ( const Magick::Geometry& left_, const Magick::Geometry& right_ );
|
||||
int MagickPPExport operator < ( const Magick::Geometry& left_, const Magick::Geometry& right_ );
|
||||
int MagickPPExport operator >= ( const Magick::Geometry& left_, const Magick::Geometry& right_ );
|
||||
int MagickPPExport operator <= ( const Magick::Geometry& left_, const Magick::Geometry& right_ );
|
||||
|
||||
class MagickPPExport Geometry
|
||||
{
|
||||
public:
|
||||
|
||||
Geometry ( size_t width_,
|
||||
size_t height_,
|
||||
::ssize_t xOff_ = 0,
|
||||
::ssize_t yOff_ = 0,
|
||||
bool xNegative_ = false,
|
||||
bool yNegative_ = false );
|
||||
Geometry ( const std::string &geometry_ );
|
||||
Geometry ( const char * geometry_ );
|
||||
Geometry ( const Geometry &geometry_ );
|
||||
Geometry ( );
|
||||
~Geometry ( void );
|
||||
|
||||
// Width
|
||||
void width ( size_t width_ );
|
||||
size_t width ( void ) const;
|
||||
|
||||
// Height
|
||||
void height ( size_t height_ );
|
||||
size_t height ( void ) const;
|
||||
|
||||
// X offset from origin
|
||||
void xOff ( ::ssize_t xOff_ );
|
||||
::ssize_t xOff ( void ) const;
|
||||
|
||||
// Y offset from origin
|
||||
void yOff ( ::ssize_t yOff_ );
|
||||
::ssize_t yOff ( void ) const;
|
||||
|
||||
// Sign of X offset negative? (X origin at right)
|
||||
void xNegative ( bool xNegative_ );
|
||||
bool xNegative ( void ) const;
|
||||
|
||||
// Sign of Y offset negative? (Y origin at bottom)
|
||||
void yNegative ( bool yNegative_ );
|
||||
bool yNegative ( void ) const;
|
||||
|
||||
// Width and height are expressed as percentages
|
||||
void percent ( bool percent_ );
|
||||
bool percent ( void ) const;
|
||||
|
||||
// Resize without preserving aspect ratio (!)
|
||||
void aspect ( bool aspect_ );
|
||||
bool aspect ( void ) const;
|
||||
|
||||
// Resize if image is greater than size (>)
|
||||
void greater ( bool greater_ );
|
||||
bool greater ( void ) const;
|
||||
|
||||
// Resize if image is less than size (<)
|
||||
void less ( bool less_ );
|
||||
bool less ( void ) const;
|
||||
|
||||
// Does object contain valid geometry?
|
||||
void isValid ( bool isValid_ );
|
||||
bool isValid ( void ) const;
|
||||
|
||||
// Set via geometry string
|
||||
const Geometry& operator = ( const std::string &geometry_ );
|
||||
const Geometry& operator = ( const char * geometry_ );
|
||||
|
||||
// Assignment operator
|
||||
Geometry& operator= ( const Geometry& Geometry_ );
|
||||
|
||||
// Return geometry string
|
||||
operator std::string() const;
|
||||
|
||||
//
|
||||
// Public methods below this point are for Magick++ use only.
|
||||
//
|
||||
|
||||
// Construct from RectangleInfo
|
||||
Geometry ( 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; // Re-size only if larger than geometry (>)
|
||||
bool _less; // Re-size only if smaller than geometry (<)
|
||||
};
|
||||
} // namespace Magick
|
||||
|
||||
//
|
||||
// Inlines
|
||||
//
|
||||
|
||||
// Does object contain valid geometry?
|
||||
inline void Magick::Geometry::isValid ( bool isValid_ )
|
||||
{
|
||||
_isValid = isValid_;
|
||||
}
|
||||
|
||||
inline bool Magick::Geometry::isValid ( void ) const
|
||||
{
|
||||
return _isValid;
|
||||
}
|
||||
|
||||
// Width
|
||||
inline void Magick::Geometry::width ( size_t width_ )
|
||||
{
|
||||
_width = width_;
|
||||
isValid( true );
|
||||
}
|
||||
inline size_t Magick::Geometry::width ( void ) const
|
||||
{
|
||||
return _width;
|
||||
}
|
||||
|
||||
// Height
|
||||
inline void Magick::Geometry::height ( size_t height_ )
|
||||
{
|
||||
_height = height_;
|
||||
}
|
||||
inline size_t Magick::Geometry::height ( void ) const
|
||||
{
|
||||
return _height;
|
||||
}
|
||||
|
||||
// X offset from origin
|
||||
inline void Magick::Geometry::xOff ( ::ssize_t xOff_ )
|
||||
{
|
||||
_xOff = xOff_;
|
||||
}
|
||||
inline ::ssize_t Magick::Geometry::xOff ( void ) const
|
||||
{
|
||||
return _xOff;
|
||||
}
|
||||
|
||||
// Y offset from origin
|
||||
inline void Magick::Geometry::yOff ( ::ssize_t yOff_ )
|
||||
{
|
||||
_yOff = yOff_;
|
||||
}
|
||||
inline ::ssize_t Magick::Geometry::yOff ( void ) const
|
||||
{
|
||||
return _yOff;
|
||||
}
|
||||
|
||||
// Sign of X offset negative? (X origin at right)
|
||||
inline void Magick::Geometry::xNegative ( bool xNegative_ )
|
||||
{
|
||||
_xNegative = xNegative_;
|
||||
}
|
||||
inline bool Magick::Geometry::xNegative ( void ) const
|
||||
{
|
||||
return _xNegative;
|
||||
}
|
||||
|
||||
// Sign of Y offset negative? (Y origin at bottom)
|
||||
inline void Magick::Geometry::yNegative ( bool yNegative_ )
|
||||
{
|
||||
_yNegative = yNegative_;
|
||||
}
|
||||
inline bool Magick::Geometry::yNegative ( void ) const
|
||||
{
|
||||
return _yNegative;
|
||||
}
|
||||
|
||||
// Interpret width & height as percentages (%)
|
||||
inline void Magick::Geometry::percent ( bool percent_ )
|
||||
{
|
||||
_percent = percent_;
|
||||
}
|
||||
inline bool Magick::Geometry::percent ( void ) const
|
||||
{
|
||||
return _percent;
|
||||
}
|
||||
|
||||
// Resize without preserving aspect ratio (!)
|
||||
inline void Magick::Geometry::aspect ( bool aspect_ )
|
||||
{
|
||||
_aspect = aspect_;
|
||||
}
|
||||
inline bool Magick::Geometry::aspect ( void ) const
|
||||
{
|
||||
return _aspect;
|
||||
}
|
||||
|
||||
// Resize if image is greater than size (>)
|
||||
inline void Magick::Geometry::greater ( bool greater_ )
|
||||
{
|
||||
_greater = greater_;
|
||||
}
|
||||
inline bool Magick::Geometry::greater ( void ) const
|
||||
{
|
||||
return _greater;
|
||||
}
|
||||
|
||||
// Resize if image is less than size (<)
|
||||
inline void Magick::Geometry::less ( bool less_ )
|
||||
{
|
||||
_less = less_;
|
||||
}
|
||||
inline bool Magick::Geometry::less ( void ) const
|
||||
{
|
||||
return _less;
|
||||
}
|
||||
|
||||
|
||||
#endif // Magick_Geometry_header
|
File diff suppressed because it is too large
Load diff
|
@ -1,80 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002
|
||||
//
|
||||
// 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 an image pointer and default options
|
||||
ImageRef ( MagickCore::Image * image_ );
|
||||
// Construct with an image pointer and options
|
||||
ImageRef ( MagickCore::Image * image_, const Options * options_ );
|
||||
// Construct with null image and default options
|
||||
ImageRef ( void );
|
||||
// Destroy image and options
|
||||
~ImageRef ( void );
|
||||
|
||||
// Copy constructor and assignment are not supported
|
||||
ImageRef(const ImageRef&);
|
||||
ImageRef& operator=(const ImageRef&);
|
||||
|
||||
void image ( MagickCore::Image * image_ );
|
||||
MagickCore::Image *& image ( void );
|
||||
|
||||
void options ( Options * options_ );
|
||||
Options * options ( void );
|
||||
|
||||
void id ( const ::ssize_t id_ );
|
||||
::ssize_t id ( void ) const;
|
||||
|
||||
MagickCore::Image * _image; // ImageMagick Image
|
||||
Options * _options; // User-specified options
|
||||
::ssize_t _id; // Registry ID (-1 if not registered)
|
||||
::ssize_t _refCount; // Reference count
|
||||
MutexLock _mutexLock;// Mutex lock
|
||||
};
|
||||
|
||||
} // end of namespace Magick
|
||||
|
||||
//
|
||||
// Inlines
|
||||
//
|
||||
|
||||
// Retrieve image from reference
|
||||
inline MagickCore::Image *& Magick::ImageRef::image ( void )
|
||||
{
|
||||
return _image;
|
||||
}
|
||||
|
||||
// Retrieve Options from reference
|
||||
inline Magick::Options * Magick::ImageRef::options ( void )
|
||||
{
|
||||
return _options;
|
||||
}
|
||||
|
||||
// Retrieve registration id from reference
|
||||
inline ::ssize_t Magick::ImageRef::id ( void ) const
|
||||
{
|
||||
return _id;
|
||||
}
|
||||
|
||||
#endif // Magick_ImageRef_header
|
|
@ -1,965 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002
|
||||
//
|
||||
// Inclusion of ImageMagick headers (with namespace magic)
|
||||
|
||||
#ifndef Magick_Include_header
|
||||
#define Magick_Include_header
|
||||
|
||||
#if !defined(_MAGICK_CONFIG_H)
|
||||
# define _MAGICK_CONFIG_H
|
||||
# if !defined(vms) && !defined(macintosh)
|
||||
# include "magick/magick-config.h"
|
||||
# else
|
||||
# include "magick-config.h"
|
||||
# endif
|
||||
# undef inline // Remove possible definition from config.h
|
||||
# undef class
|
||||
#endif
|
||||
|
||||
// Needed for stdio FILE
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include <math.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#if defined(__BORLANDC__)
|
||||
# include <vcl.h> /* Borland C++ Builder 4.0 requirement */
|
||||
#endif // defined(__BORLANDC__)
|
||||
|
||||
//
|
||||
// Include ImageMagick headers into namespace "MagickCore". If
|
||||
// MAGICKCORE_IMPLEMENTATION is defined, include ImageMagick development
|
||||
// headers. This scheme minimizes the possibility of conflict with
|
||||
// user code.
|
||||
//
|
||||
namespace MagickCore
|
||||
{
|
||||
#include <magick/MagickCore.h>
|
||||
#include <wand/MagickWand.h>
|
||||
#undef inline // Remove possible definition from config.h
|
||||
|
||||
#undef class
|
||||
}
|
||||
|
||||
//
|
||||
// Provide appropriate DLL imports/exports for Visual C++,
|
||||
// Borland C++Builder and MinGW builds.
|
||||
//
|
||||
#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__)
|
||||
# define MagickCplusPlusDLLSupported
|
||||
#endif
|
||||
#if defined(MagickCplusPlusDLLSupported)
|
||||
# if defined(_MT) && defined(_DLL) && !defined(_LIB) && !defined(STATIC_MAGICK)
|
||||
//
|
||||
// In a native Windows build, the following defines are used:
|
||||
//
|
||||
// _MT = Multithreaded
|
||||
// _DLL = Using code is part of a DLL
|
||||
// _LIB = Using code is being built as a library.
|
||||
// _MAGICKMOD_ = Build uses loadable modules (Magick++ does not care about this)
|
||||
//
|
||||
// In the case where ImageMagick is built as a static library but the
|
||||
// using code is dynamic, STATIC_MAGICK may be defined in the project to
|
||||
// override triggering dynamic library behavior.
|
||||
//
|
||||
# if defined(_VISUALC_)
|
||||
# define MagickDLLExplicitTemplate
|
||||
# pragma warning( disable: 4273 ) /* Disable the stupid dll linkage warnings */
|
||||
# pragma warning( disable: 4251 )
|
||||
# endif
|
||||
# if !defined(MAGICKCORE_IMPLEMENTATION)
|
||||
# if defined(__GNUC__)
|
||||
# define MagickPPExport __attribute__ ((dllimport))
|
||||
# else
|
||||
# define MagickPPExport __declspec(dllimport)
|
||||
# endif
|
||||
# define MagickPPPrivate extern __declspec(dllimport)
|
||||
# if defined(_VISUALC_)
|
||||
# pragma message( "Magick++ lib DLL import" )
|
||||
# endif
|
||||
# else
|
||||
# if defined(__BORLANDC__) || defined(__MINGW32__)
|
||||
# define MagickPPExport __declspec(dllexport)
|
||||
# define MagickPPPrivate __declspec(dllexport)
|
||||
# if defined(__BORLANDC__)
|
||||
# pragma message( "BCBMagick++ lib DLL export" )
|
||||
# endif
|
||||
# else
|
||||
# if defined(__GNUC__)
|
||||
# define MagickPPExport __attribute__ ((dllexport))
|
||||
# else
|
||||
# define MagickPPExport __declspec(dllexport)
|
||||
# endif
|
||||
# define MagickPPPrivate extern __declspec(dllexport)
|
||||
# endif
|
||||
# if defined(_VISUALC_)
|
||||
# pragma message( "Magick++ lib DLL export" )
|
||||
# endif
|
||||
# endif
|
||||
# else
|
||||
# define MagickPPExport
|
||||
# define MagickPPPrivate
|
||||
# if defined(_VISUALC_)
|
||||
# pragma message( "Magick++ lib static interface" )
|
||||
# endif
|
||||
# endif
|
||||
#else
|
||||
# if __GNUC__ >= 4
|
||||
# define MagickPPExport __attribute__ ((visibility ("default")))
|
||||
# define MagickPPPrivate __attribute__ ((visibility ("hidden")))
|
||||
# else
|
||||
# define MagickPPExport
|
||||
# define MagickPPPrivate
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(WIN32) && defined(_VISUALC_)
|
||||
# pragma warning(disable : 4996) /* function deprecation warnings */
|
||||
#endif
|
||||
|
||||
//
|
||||
// Import ImageMagick symbols and types which are used as part of the
|
||||
// Magick++ API definition into namespace "Magick".
|
||||
//
|
||||
namespace Magick
|
||||
{
|
||||
// The datatype for an RGB component
|
||||
using MagickCore::Quantum;
|
||||
using MagickCore::MagickRealType;
|
||||
using MagickCore::MagickSizeType;
|
||||
|
||||
// Boolean types
|
||||
using MagickCore::MagickBooleanType;
|
||||
using MagickCore::MagickFalse;
|
||||
using MagickCore::MagickTrue;
|
||||
|
||||
// Image class types
|
||||
using MagickCore::ClassType;
|
||||
using MagickCore::UndefinedClass;
|
||||
using MagickCore::DirectClass;
|
||||
using MagickCore::PseudoClass;
|
||||
|
||||
// Channel types
|
||||
using MagickCore::ChannelType;
|
||||
using MagickCore::UndefinedChannel;
|
||||
using MagickCore::RedChannel;
|
||||
using MagickCore::CyanChannel;
|
||||
using MagickCore::GreenChannel;
|
||||
using MagickCore::MagentaChannel;
|
||||
using MagickCore::BlueChannel;
|
||||
using MagickCore::YellowChannel;
|
||||
using MagickCore::OpacityChannel;
|
||||
using MagickCore::BlackChannel;
|
||||
using MagickCore::MatteChannel;
|
||||
using MagickCore::DefaultChannels;
|
||||
using MagickCore::AllChannels;
|
||||
|
||||
// Color-space types
|
||||
using MagickCore::CMYKColorspace;
|
||||
using MagickCore::ColorspaceType;
|
||||
using MagickCore::GRAYColorspace;
|
||||
using MagickCore::HSLColorspace;
|
||||
using MagickCore::HWBColorspace;
|
||||
using MagickCore::LogColorspace;
|
||||
using MagickCore::OHTAColorspace;
|
||||
using MagickCore::Rec601LumaColorspace;
|
||||
using MagickCore::Rec709LumaColorspace;
|
||||
using MagickCore::RGBColorspace;
|
||||
using MagickCore::sRGBColorspace;
|
||||
using MagickCore::TransparentColorspace;
|
||||
using MagickCore::UndefinedColorspace;
|
||||
using MagickCore::XYZColorspace;
|
||||
using MagickCore::YCbCrColorspace;
|
||||
using MagickCore::YCCColorspace;
|
||||
using MagickCore::YIQColorspace;
|
||||
using MagickCore::YPbPrColorspace;
|
||||
using MagickCore::YUVColorspace;
|
||||
|
||||
// Composition operations
|
||||
using MagickCore::AddCompositeOp;
|
||||
using MagickCore::AtopCompositeOp;
|
||||
using MagickCore::BlendCompositeOp;
|
||||
using MagickCore::BumpmapCompositeOp;
|
||||
using MagickCore::ClearCompositeOp;
|
||||
using MagickCore::ColorizeCompositeOp;
|
||||
using MagickCore::CompositeOperator;
|
||||
using MagickCore::CopyBlueCompositeOp;
|
||||
using MagickCore::CopyCompositeOp;
|
||||
using MagickCore::CopyCyanCompositeOp;
|
||||
using MagickCore::CopyGreenCompositeOp;
|
||||
using MagickCore::CopyMagentaCompositeOp;
|
||||
using MagickCore::CopyOpacityCompositeOp;
|
||||
using MagickCore::CopyRedCompositeOp;
|
||||
using MagickCore::CopyYellowCompositeOp;
|
||||
using MagickCore::DarkenCompositeOp;
|
||||
using MagickCore::DifferenceCompositeOp;
|
||||
using MagickCore::DisplaceCompositeOp;
|
||||
using MagickCore::DissolveCompositeOp;
|
||||
using MagickCore::DstOverCompositeOp;
|
||||
using MagickCore::ExclusionCompositeOp;
|
||||
using MagickCore::HardLightCompositeOp;
|
||||
using MagickCore::HueCompositeOp;
|
||||
using MagickCore::InCompositeOp;
|
||||
using MagickCore::LightenCompositeOp;
|
||||
using MagickCore::LuminizeCompositeOp;
|
||||
using MagickCore::MinusCompositeOp;
|
||||
using MagickCore::ModulateCompositeOp;
|
||||
using MagickCore::MultiplyCompositeOp;
|
||||
using MagickCore::NoCompositeOp;
|
||||
using MagickCore::OutCompositeOp;
|
||||
using MagickCore::OverCompositeOp;
|
||||
using MagickCore::OverlayCompositeOp;
|
||||
using MagickCore::PlusCompositeOp;
|
||||
using MagickCore::SaturateCompositeOp;
|
||||
using MagickCore::ScreenCompositeOp;
|
||||
using MagickCore::SoftLightCompositeOp;
|
||||
using MagickCore::SubtractCompositeOp;
|
||||
using MagickCore::ThresholdCompositeOp;
|
||||
using MagickCore::UndefinedCompositeOp;
|
||||
using MagickCore::XorCompositeOp;
|
||||
using MagickCore::CopyBlackCompositeOp;
|
||||
|
||||
// Compression algorithms
|
||||
using MagickCore::CompressionType;
|
||||
using MagickCore::UndefinedCompression;
|
||||
using MagickCore::NoCompression;
|
||||
using MagickCore::BZipCompression;
|
||||
using MagickCore::FaxCompression;
|
||||
using MagickCore::Group4Compression;
|
||||
using MagickCore::JPEGCompression;
|
||||
using MagickCore::LZMACompression;
|
||||
using MagickCore::LZWCompression;
|
||||
using MagickCore::RLECompression;
|
||||
using MagickCore::ZipCompression;
|
||||
|
||||
// Dispose methods
|
||||
using MagickCore::DisposeType;
|
||||
using MagickCore::UndefinedDispose;
|
||||
using MagickCore::NoneDispose;
|
||||
using MagickCore::BackgroundDispose;
|
||||
using MagickCore::PreviousDispose;
|
||||
|
||||
// Distort methods
|
||||
using MagickCore::DistortImageMethod;
|
||||
using MagickCore::UndefinedDistortion;
|
||||
using MagickCore::AffineDistortion;
|
||||
using MagickCore::AffineProjectionDistortion;
|
||||
using MagickCore::ScaleRotateTranslateDistortion;
|
||||
using MagickCore::PerspectiveDistortion;
|
||||
using MagickCore::PerspectiveProjectionDistortion;
|
||||
using MagickCore::BilinearDistortion;
|
||||
using MagickCore::PolynomialDistortion;
|
||||
using MagickCore::ArcDistortion;
|
||||
using MagickCore::PolarDistortion;
|
||||
using MagickCore::DePolarDistortion;
|
||||
using MagickCore::BarrelDistortion;
|
||||
using MagickCore::BarrelInverseDistortion;
|
||||
using MagickCore::ShepardsDistortion;
|
||||
using MagickCore::SentinelDistortion;
|
||||
|
||||
// Endian options
|
||||
using MagickCore::EndianType;
|
||||
using MagickCore::UndefinedEndian;
|
||||
using MagickCore::LSBEndian;
|
||||
using MagickCore::MSBEndian;
|
||||
|
||||
// Evaluate options
|
||||
using MagickCore::UndefinedEvaluateOperator;
|
||||
using MagickCore::AddEvaluateOperator;
|
||||
using MagickCore::AndEvaluateOperator;
|
||||
using MagickCore::DivideEvaluateOperator;
|
||||
using MagickCore::LeftShiftEvaluateOperator;
|
||||
using MagickCore::MaxEvaluateOperator;
|
||||
using MagickCore::MinEvaluateOperator;
|
||||
using MagickCore::MultiplyEvaluateOperator;
|
||||
using MagickCore::OrEvaluateOperator;
|
||||
using MagickCore::RightShiftEvaluateOperator;
|
||||
using MagickCore::SetEvaluateOperator;
|
||||
using MagickCore::SubtractEvaluateOperator;
|
||||
using MagickCore::XorEvaluateOperator;
|
||||
using MagickCore::MagickEvaluateOperator;
|
||||
|
||||
// Fill rules
|
||||
using MagickCore::FillRule;
|
||||
using MagickCore::UndefinedRule;
|
||||
using MagickCore::EvenOddRule;
|
||||
using MagickCore::NonZeroRule;
|
||||
|
||||
// Filter types
|
||||
using MagickCore::FilterTypes;
|
||||
using MagickCore::UndefinedFilter;
|
||||
using MagickCore::PointFilter;
|
||||
using MagickCore::BoxFilter;
|
||||
using MagickCore::TriangleFilter;
|
||||
using MagickCore::HermiteFilter;
|
||||
using MagickCore::HanningFilter;
|
||||
using MagickCore::HammingFilter;
|
||||
using MagickCore::BlackmanFilter;
|
||||
using MagickCore::GaussianFilter;
|
||||
using MagickCore::QuadraticFilter;
|
||||
using MagickCore::CubicFilter;
|
||||
using MagickCore::CatromFilter;
|
||||
using MagickCore::MitchellFilter;
|
||||
using MagickCore::JincFilter;
|
||||
using MagickCore::SincFilter;
|
||||
using MagickCore::SincFastFilter;
|
||||
using MagickCore::KaiserFilter;
|
||||
using MagickCore::WelshFilter;
|
||||
using MagickCore::ParzenFilter;
|
||||
using MagickCore::BohmanFilter;
|
||||
using MagickCore::BartlettFilter;
|
||||
using MagickCore::LagrangeFilter;
|
||||
using MagickCore::LanczosFilter;
|
||||
using MagickCore::LanczosSharpFilter;
|
||||
using MagickCore::Lanczos2Filter;
|
||||
using MagickCore::Lanczos2SharpFilter;
|
||||
using MagickCore::RobidouxFilter;
|
||||
using MagickCore::SentinelFilter;
|
||||
|
||||
// Bit gravity
|
||||
using MagickCore::GravityType;
|
||||
using MagickCore::ForgetGravity;
|
||||
using MagickCore::NorthWestGravity;
|
||||
using MagickCore::NorthGravity;
|
||||
using MagickCore::NorthEastGravity;
|
||||
using MagickCore::WestGravity;
|
||||
using MagickCore::CenterGravity;
|
||||
using MagickCore::EastGravity;
|
||||
using MagickCore::SouthWestGravity;
|
||||
using MagickCore::SouthGravity;
|
||||
using MagickCore::SouthEastGravity;
|
||||
using MagickCore::StaticGravity;
|
||||
|
||||
// Image types
|
||||
using MagickCore::ImageType;
|
||||
using MagickCore::UndefinedType;
|
||||
using MagickCore::BilevelType;
|
||||
using MagickCore::GrayscaleType;
|
||||
using MagickCore::GrayscaleMatteType;
|
||||
using MagickCore::PaletteType;
|
||||
using MagickCore::PaletteMatteType;
|
||||
using MagickCore::TrueColorType;
|
||||
using MagickCore::TrueColorMatteType;
|
||||
using MagickCore::ColorSeparationType;
|
||||
using MagickCore::ColorSeparationMatteType;
|
||||
using MagickCore::OptimizeType;
|
||||
|
||||
// Interlace types
|
||||
using MagickCore::InterlaceType;
|
||||
using MagickCore::UndefinedInterlace;
|
||||
using MagickCore::NoInterlace;
|
||||
using MagickCore::LineInterlace;
|
||||
using MagickCore::PlaneInterlace;
|
||||
using MagickCore::PartitionInterlace;
|
||||
|
||||
// Layer method
|
||||
using MagickCore::ImageLayerMethod;
|
||||
using MagickCore::UndefinedLayer;
|
||||
using MagickCore::CoalesceLayer;
|
||||
using MagickCore::CompareAnyLayer;
|
||||
using MagickCore::CompareClearLayer;
|
||||
using MagickCore::CompareOverlayLayer;
|
||||
using MagickCore::DisposeLayer;
|
||||
using MagickCore::OptimizeLayer;
|
||||
using MagickCore::OptimizeImageLayer;
|
||||
using MagickCore::OptimizePlusLayer;
|
||||
using MagickCore::OptimizeTransLayer;
|
||||
using MagickCore::RemoveDupsLayer;
|
||||
using MagickCore::RemoveZeroLayer;
|
||||
using MagickCore::CompositeLayer;
|
||||
using MagickCore::MergeLayer;
|
||||
using MagickCore::FlattenLayer;
|
||||
using MagickCore::MosaicLayer;
|
||||
using MagickCore::TrimBoundsLayer;
|
||||
|
||||
// Line cap types
|
||||
using MagickCore::LineCap;
|
||||
using MagickCore::UndefinedCap;
|
||||
using MagickCore::ButtCap;
|
||||
using MagickCore::RoundCap;
|
||||
using MagickCore::SquareCap;
|
||||
|
||||
// Line join types
|
||||
using MagickCore::LineJoin;
|
||||
using MagickCore::UndefinedJoin;
|
||||
using MagickCore::MiterJoin;
|
||||
using MagickCore::RoundJoin;
|
||||
using MagickCore::BevelJoin;
|
||||
|
||||
// Noise types
|
||||
using MagickCore::NoiseType;
|
||||
using MagickCore::UniformNoise;
|
||||
using MagickCore::GaussianNoise;
|
||||
using MagickCore::MultiplicativeGaussianNoise;
|
||||
using MagickCore::ImpulseNoise;
|
||||
using MagickCore::LaplacianNoise;
|
||||
using MagickCore::PoissonNoise;
|
||||
|
||||
// Orientation types
|
||||
using MagickCore::OrientationType;
|
||||
using MagickCore::UndefinedOrientation;
|
||||
using MagickCore::TopLeftOrientation;
|
||||
using MagickCore::TopRightOrientation;
|
||||
using MagickCore::BottomRightOrientation;
|
||||
using MagickCore::BottomLeftOrientation;
|
||||
using MagickCore::LeftTopOrientation;
|
||||
using MagickCore::RightTopOrientation;
|
||||
using MagickCore::RightBottomOrientation;
|
||||
using MagickCore::LeftBottomOrientation;
|
||||
|
||||
// Paint methods
|
||||
using MagickCore::PaintMethod;
|
||||
using MagickCore::PointMethod;
|
||||
using MagickCore::ReplaceMethod;
|
||||
using MagickCore::FloodfillMethod;
|
||||
using MagickCore::FillToBorderMethod;
|
||||
using MagickCore::ResetMethod;
|
||||
|
||||
// Preview types. Not currently used by Magick++
|
||||
using MagickCore::PreviewType;
|
||||
using MagickCore::UndefinedPreview;
|
||||
using MagickCore::RotatePreview;
|
||||
using MagickCore::ShearPreview;
|
||||
using MagickCore::RollPreview;
|
||||
using MagickCore::HuePreview;
|
||||
using MagickCore::SaturationPreview;
|
||||
using MagickCore::BrightnessPreview;
|
||||
using MagickCore::GammaPreview;
|
||||
using MagickCore::SpiffPreview;
|
||||
using MagickCore::DullPreview;
|
||||
using MagickCore::GrayscalePreview;
|
||||
using MagickCore::QuantizePreview;
|
||||
using MagickCore::DespecklePreview;
|
||||
using MagickCore::ReduceNoisePreview;
|
||||
using MagickCore::AddNoisePreview;
|
||||
using MagickCore::SharpenPreview;
|
||||
using MagickCore::BlurPreview;
|
||||
using MagickCore::ThresholdPreview;
|
||||
using MagickCore::EdgeDetectPreview;
|
||||
using MagickCore::SpreadPreview;
|
||||
using MagickCore::SolarizePreview;
|
||||
using MagickCore::ShadePreview;
|
||||
using MagickCore::RaisePreview;
|
||||
using MagickCore::SegmentPreview;
|
||||
using MagickCore::SwirlPreview;
|
||||
using MagickCore::ImplodePreview;
|
||||
using MagickCore::WavePreview;
|
||||
using MagickCore::OilPaintPreview;
|
||||
using MagickCore::CharcoalDrawingPreview;
|
||||
using MagickCore::JPEGPreview;
|
||||
|
||||
// Quantum types
|
||||
using MagickCore::QuantumType;
|
||||
using MagickCore::IndexQuantum;
|
||||
using MagickCore::GrayQuantum;
|
||||
using MagickCore::IndexAlphaQuantum;
|
||||
using MagickCore::GrayAlphaQuantum;
|
||||
using MagickCore::RedQuantum;
|
||||
using MagickCore::CyanQuantum;
|
||||
using MagickCore::GreenQuantum;
|
||||
using MagickCore::YellowQuantum;
|
||||
using MagickCore::BlueQuantum;
|
||||
using MagickCore::MagentaQuantum;
|
||||
using MagickCore::AlphaQuantum;
|
||||
using MagickCore::BlackQuantum;
|
||||
using MagickCore::RGBQuantum;
|
||||
using MagickCore::RGBAQuantum;
|
||||
using MagickCore::CMYKQuantum;
|
||||
|
||||
// Rendering intents
|
||||
using MagickCore::RenderingIntent;
|
||||
using MagickCore::UndefinedIntent;
|
||||
using MagickCore::SaturationIntent;
|
||||
using MagickCore::PerceptualIntent;
|
||||
using MagickCore::AbsoluteIntent;
|
||||
using MagickCore::RelativeIntent;
|
||||
|
||||
// Resource types
|
||||
using MagickCore::MemoryResource;
|
||||
|
||||
// Resolution units
|
||||
using MagickCore::ResolutionType;
|
||||
using MagickCore::UndefinedResolution;
|
||||
using MagickCore::PixelsPerInchResolution;
|
||||
using MagickCore::PixelsPerCentimeterResolution;
|
||||
|
||||
// PixelPacket structure
|
||||
using MagickCore::PixelPacket;
|
||||
|
||||
// IndexPacket type
|
||||
using MagickCore::IndexPacket;
|
||||
|
||||
// Sparse Color methods
|
||||
using MagickCore::SparseColorMethod;
|
||||
using MagickCore::UndefinedColorInterpolate;
|
||||
using MagickCore::BarycentricColorInterpolate;
|
||||
using MagickCore::BilinearColorInterpolate;
|
||||
using MagickCore::PolynomialColorInterpolate;
|
||||
using MagickCore::ShepardsColorInterpolate;
|
||||
using MagickCore::VoronoiColorInterpolate;
|
||||
|
||||
// Statistic type
|
||||
using MagickCore::MedianStatistic;
|
||||
using MagickCore::NonpeakStatistic;
|
||||
|
||||
// StorageType type
|
||||
using MagickCore::StorageType;
|
||||
using MagickCore::CharPixel;
|
||||
using MagickCore::ShortPixel;
|
||||
using MagickCore::IntegerPixel;
|
||||
using MagickCore::FloatPixel;
|
||||
using MagickCore::DoublePixel;
|
||||
|
||||
// StretchType type
|
||||
using MagickCore::StretchType;
|
||||
using MagickCore::NormalStretch;
|
||||
using MagickCore::UltraCondensedStretch;
|
||||
using MagickCore::ExtraCondensedStretch;
|
||||
using MagickCore::CondensedStretch;
|
||||
using MagickCore::SemiCondensedStretch;
|
||||
using MagickCore::SemiExpandedStretch;
|
||||
using MagickCore::ExpandedStretch;
|
||||
using MagickCore::ExtraExpandedStretch;
|
||||
using MagickCore::UltraExpandedStretch;
|
||||
using MagickCore::AnyStretch;
|
||||
|
||||
// StyleType type
|
||||
using MagickCore::StyleType;
|
||||
using MagickCore::NormalStyle;
|
||||
using MagickCore::ItalicStyle;
|
||||
using MagickCore::ObliqueStyle;
|
||||
using MagickCore::AnyStyle;
|
||||
|
||||
// Decoration types
|
||||
using MagickCore::DecorationType;
|
||||
using MagickCore::NoDecoration;
|
||||
using MagickCore::UnderlineDecoration;
|
||||
using MagickCore::OverlineDecoration;
|
||||
using MagickCore::LineThroughDecoration;
|
||||
|
||||
// Virtual pixel methods
|
||||
using MagickCore::VirtualPixelMethod;
|
||||
using MagickCore::UndefinedVirtualPixelMethod;
|
||||
using MagickCore::BackgroundVirtualPixelMethod;
|
||||
using MagickCore::DitherVirtualPixelMethod;
|
||||
using MagickCore::EdgeVirtualPixelMethod;
|
||||
using MagickCore::MirrorVirtualPixelMethod;
|
||||
using MagickCore::RandomVirtualPixelMethod;
|
||||
using MagickCore::TileVirtualPixelMethod;
|
||||
using MagickCore::TransparentVirtualPixelMethod;
|
||||
using MagickCore::MaskVirtualPixelMethod;
|
||||
using MagickCore::BlackVirtualPixelMethod;
|
||||
using MagickCore::GrayVirtualPixelMethod;
|
||||
using MagickCore::WhiteVirtualPixelMethod;
|
||||
using MagickCore::HorizontalTileVirtualPixelMethod;
|
||||
using MagickCore::VerticalTileVirtualPixelMethod;
|
||||
using MagickCore::HorizontalTileEdgeVirtualPixelMethod;
|
||||
using MagickCore::VerticalTileEdgeVirtualPixelMethod;
|
||||
using MagickCore::CheckerTileVirtualPixelMethod;
|
||||
|
||||
#if defined(MAGICKCORE_IMPLEMENTATION)
|
||||
//
|
||||
// ImageMagick symbols used in implementation code
|
||||
//
|
||||
using MagickCore::AcquireCacheView;
|
||||
using MagickCore::AcquireExceptionInfo;
|
||||
using MagickCore::GetCacheViewVirtualPixels;
|
||||
using MagickCore::AcquireImage;
|
||||
using MagickCore::GetVirtualPixels;
|
||||
using MagickCore::AcquireKernelInfo;
|
||||
using MagickCore::AcquireMagickMemory;
|
||||
using MagickCore::AcquireQuantumInfo;
|
||||
using MagickCore::AcquireString;
|
||||
using MagickCore::AcquireStringInfo;
|
||||
using MagickCore::AdaptiveBlurImage;
|
||||
using MagickCore::AdaptiveThresholdImage;
|
||||
using MagickCore::AddNoiseImage;
|
||||
using MagickCore::AddNoiseImageChannel;
|
||||
using MagickCore::AffineMatrix;
|
||||
using MagickCore::AffineTransformImage;
|
||||
using MagickCore::AnnotateImage;
|
||||
using MagickCore::AspectValue;
|
||||
using MagickCore::Base64Decode;
|
||||
using MagickCore::Base64Encode;
|
||||
using MagickCore::BilevelImage;
|
||||
using MagickCore::BlobError;
|
||||
using MagickCore::BlobFatalError;
|
||||
using MagickCore::BlobToImage;
|
||||
using MagickCore::BlobWarning;
|
||||
using MagickCore::BlurImage;
|
||||
using MagickCore::BlurImageChannel;
|
||||
using MagickCore::BorderImage;
|
||||
using MagickCore::CacheError;
|
||||
using MagickCore::CacheFatalError;
|
||||
using MagickCore::CacheWarning;
|
||||
using MagickCore::CharcoalImage;
|
||||
using MagickCore::ChopImage;
|
||||
using MagickCore::ClearMagickException;
|
||||
using MagickCore::CloneDrawInfo;
|
||||
using MagickCore::CloneImage;
|
||||
using MagickCore::CloneImageInfo;
|
||||
using MagickCore::CloneQuantizeInfo;
|
||||
using MagickCore::CoderError;
|
||||
using MagickCore::CoderFatalError;
|
||||
using MagickCore::CoderWarning;
|
||||
using MagickCore::ColorDecisionListImage;
|
||||
using MagickCore::ColorizeImage;
|
||||
using MagickCore::ColorMatrixImage;
|
||||
using MagickCore::ColorPacket;
|
||||
using MagickCore::CompositeImage;
|
||||
using MagickCore::ConfigureError;
|
||||
using MagickCore::ConfigureFatalError;
|
||||
using MagickCore::ConfigureWarning;
|
||||
using MagickCore::ConstituteImage;
|
||||
using MagickCore::ContrastImage;
|
||||
using MagickCore::ConvertHSLToRGB;
|
||||
using MagickCore::ConvertRGBToHSL;
|
||||
using MagickCore::ConvolveImage;
|
||||
using MagickCore::CopyMagickString;
|
||||
using MagickCore::CorruptImageError;
|
||||
using MagickCore::CorruptImageFatalError;
|
||||
using MagickCore::CorruptImageWarning;
|
||||
using MagickCore::CropImage;
|
||||
using MagickCore::CycleColormapImage;
|
||||
using MagickCore::DeconstructImages;
|
||||
using MagickCore::DelegateError;
|
||||
using MagickCore::DelegateFatalError;
|
||||
using MagickCore::DelegateWarning;
|
||||
using MagickCore::DeleteImageOption;
|
||||
using MagickCore::DeleteImageRegistry;
|
||||
using MagickCore::DespeckleImage;
|
||||
using MagickCore::DestroyCacheView;
|
||||
using MagickCore::DestroyDrawInfo;
|
||||
using MagickCore::DestroyDrawingWand;
|
||||
using MagickCore::DestroyExceptionInfo;
|
||||
using MagickCore::DestroyImageInfo;
|
||||
using MagickCore::DestroyImageList;
|
||||
using MagickCore::DestroyKernelInfo;
|
||||
using MagickCore::DestroyMagickWand;
|
||||
using MagickCore::DestroyPixelWand;
|
||||
using MagickCore::DestroyQuantizeInfo;
|
||||
using MagickCore::DestroyQuantumInfo;
|
||||
using MagickCore::DestroyStringInfo;
|
||||
using MagickCore::DisplayImages;
|
||||
using MagickCore::DistortImage;
|
||||
using MagickCore::DrawAffine;
|
||||
using MagickCore::DrawAllocateWand;
|
||||
using MagickCore::DrawAnnotation;
|
||||
using MagickCore::DrawArc;
|
||||
using MagickCore::DrawBezier;
|
||||
using MagickCore::DrawCircle;
|
||||
using MagickCore::DrawColor;
|
||||
using MagickCore::DrawComment;
|
||||
using MagickCore::DrawComposite;
|
||||
using MagickCore::DrawEllipse;
|
||||
using MagickCore::DrawError;
|
||||
using MagickCore::DrawFatalError;
|
||||
using MagickCore::DrawImage;
|
||||
using MagickCore::DrawInfo;
|
||||
using MagickCore::DrawingWand;
|
||||
using MagickCore::DrawLine;
|
||||
using MagickCore::DrawMatte;
|
||||
using MagickCore::DrawPathClose;
|
||||
using MagickCore::DrawPathCurveToAbsolute;
|
||||
using MagickCore::DrawPathCurveToQuadraticBezierAbsolute;
|
||||
using MagickCore::DrawPathCurveToQuadraticBezierRelative;
|
||||
using MagickCore::DrawPathCurveToQuadraticBezierSmoothAbsolute;
|
||||
using MagickCore::DrawPathCurveToQuadraticBezierSmoothRelative;
|
||||
using MagickCore::DrawPathCurveToRelative;
|
||||
using MagickCore::DrawPathCurveToSmoothAbsolute;
|
||||
using MagickCore::DrawPathCurveToSmoothRelative;
|
||||
using MagickCore::DrawPathEllipticArcAbsolute;
|
||||
using MagickCore::DrawPathEllipticArcRelative;
|
||||
using MagickCore::DrawPathFinish;
|
||||
using MagickCore::DrawPathLineToAbsolute;
|
||||
using MagickCore::DrawPathLineToHorizontalAbsolute;
|
||||
using MagickCore::DrawPathLineToHorizontalRelative;
|
||||
using MagickCore::DrawPathLineToRelative;
|
||||
using MagickCore::DrawPathLineToVerticalAbsolute;
|
||||
using MagickCore::DrawPathLineToVerticalRelative;
|
||||
using MagickCore::DrawPathMoveToAbsolute;
|
||||
using MagickCore::DrawPathMoveToRelative;
|
||||
using MagickCore::DrawPathStart;
|
||||
using MagickCore::DrawPoint;
|
||||
using MagickCore::DrawPolygon;
|
||||
using MagickCore::DrawPolyline;
|
||||
using MagickCore::DrawPopClipPath;
|
||||
using MagickCore::DrawPopDefs;
|
||||
using MagickCore::DrawPopPattern;
|
||||
using MagickCore::DrawPushClipPath;
|
||||
using MagickCore::DrawPushDefs;
|
||||
using MagickCore::DrawPushPattern;
|
||||
using MagickCore::DrawRectangle;
|
||||
using MagickCore::DrawRender;
|
||||
using MagickCore::DrawRotate;
|
||||
using MagickCore::DrawRoundRectangle;
|
||||
using MagickCore::DrawScale;
|
||||
using MagickCore::DrawSetClipPath;
|
||||
using MagickCore::DrawSetClipRule;
|
||||
using MagickCore::DrawSetClipUnits;
|
||||
using MagickCore::DrawSetFillColor;
|
||||
using MagickCore::DrawSetFillOpacity;
|
||||
using MagickCore::DrawSetFillPatternURL;
|
||||
using MagickCore::DrawSetFillRule;
|
||||
using MagickCore::DrawSetFont;
|
||||
using MagickCore::DrawSetFontFamily;
|
||||
using MagickCore::DrawSetFontSize;
|
||||
using MagickCore::DrawSetFontStretch;
|
||||
using MagickCore::DrawSetFontStyle;
|
||||
using MagickCore::DrawSetFontWeight;
|
||||
using MagickCore::DrawSetGravity;
|
||||
using MagickCore::DrawSetStrokeAntialias;
|
||||
using MagickCore::DrawSetStrokeColor;
|
||||
using MagickCore::DrawSetStrokeDashArray;
|
||||
using MagickCore::DrawSetStrokeDashOffset;
|
||||
using MagickCore::DrawSetStrokeLineCap;
|
||||
using MagickCore::DrawSetStrokeLineJoin;
|
||||
using MagickCore::DrawSetStrokeMiterLimit;
|
||||
using MagickCore::DrawSetStrokeOpacity;
|
||||
using MagickCore::DrawSetStrokePatternURL;
|
||||
using MagickCore::DrawSetStrokeWidth;
|
||||
using MagickCore::DrawSetTextAntialias;
|
||||
using MagickCore::DrawSetTextDecoration;
|
||||
using MagickCore::DrawSetTextEncoding;
|
||||
using MagickCore::DrawSetTextUnderColor;
|
||||
using MagickCore::DrawSetViewbox;
|
||||
using MagickCore::DrawSkewX;
|
||||
using MagickCore::DrawSkewY;
|
||||
using MagickCore::DrawTranslate;
|
||||
using MagickCore::DrawWarning;
|
||||
using MagickCore::EdgeImage;
|
||||
using MagickCore::EmbossImage;
|
||||
using MagickCore::EnhanceImage;
|
||||
using MagickCore::EqualizeImage;
|
||||
using MagickCore::EvaluateImage;
|
||||
using MagickCore::EvaluateImageChannel;
|
||||
using MagickCore::ExceptionInfo;
|
||||
using MagickCore::ExceptionType;
|
||||
using MagickCore::ExportImagePixels;
|
||||
using MagickCore::ExportQuantumPixels;
|
||||
using MagickCore::ExtentImage;
|
||||
using MagickCore::FileOpenError;
|
||||
using MagickCore::FileOpenFatalError;
|
||||
using MagickCore::FileOpenWarning;
|
||||
using MagickCore::FlipImage;
|
||||
using MagickCore::FloodfillPaintImage;
|
||||
using MagickCore::FlopImage;
|
||||
using MagickCore::FormatLocaleString;
|
||||
using MagickCore::ForwardFourierTransformImage;
|
||||
using MagickCore::FrameImage;
|
||||
using MagickCore::FrameInfo;
|
||||
using MagickCore::FxImageChannel;
|
||||
using MagickCore::GammaImage;
|
||||
using MagickCore::GammaImage;
|
||||
using MagickCore::GaussianBlurImage;
|
||||
using MagickCore::GaussianBlurImageChannel;
|
||||
using MagickCore::GetAffineMatrix;
|
||||
using MagickCore::GetAuthenticIndexQueue;
|
||||
using MagickCore::GetBlobSize;
|
||||
using MagickCore::GetCacheViewException;
|
||||
using MagickCore::GetCacheViewAuthenticIndexQueue;
|
||||
using MagickCore::GetCacheViewAuthenticPixels;
|
||||
using MagickCore::GetColorTuple;
|
||||
using MagickCore::GetDrawInfo;
|
||||
using MagickCore::GetExceptionInfo;
|
||||
using MagickCore::GetGeometry;
|
||||
using MagickCore::GetImageBoundingBox;
|
||||
using MagickCore::GetImageChannelDepth;
|
||||
using MagickCore::GetImageChannelMean;
|
||||
using MagickCore::GetImageChannelKurtosis;
|
||||
using MagickCore::GetImageChannelRange;
|
||||
using MagickCore::GetImageClipMask;
|
||||
using MagickCore::GetImageDepth;
|
||||
using MagickCore::GetImageInfo;
|
||||
using MagickCore::GetImageInfoFile;
|
||||
using MagickCore::GetImageOption;
|
||||
using MagickCore::GetAuthenticPixels;
|
||||
using MagickCore::GetImageProfile;
|
||||
using MagickCore::GetImageProperty;
|
||||
using MagickCore::GetImageQuantizeError;
|
||||
using MagickCore::GetImageType;
|
||||
using MagickCore::GetMagickInfo;
|
||||
using MagickCore::GetMagickPixelPacket;
|
||||
using MagickCore::GetNumberColors;
|
||||
using MagickCore::GetPageGeometry;
|
||||
using MagickCore::GetQuantizeInfo;
|
||||
using MagickCore::GetStringInfoDatum;
|
||||
using MagickCore::GetStringInfoLength;
|
||||
using MagickCore::GetTypeMetrics;
|
||||
using MagickCore::GetVirtualIndexQueue;
|
||||
using MagickCore::GetImageVirtualPixelMethod;
|
||||
using MagickCore::GlobExpression;
|
||||
using MagickCore::GravityAdjustGeometry;
|
||||
using MagickCore::GreaterValue;
|
||||
using MagickCore::HaldClutImage;
|
||||
using MagickCore::HeightValue;
|
||||
using MagickCore::ImageError;
|
||||
using MagickCore::ImageFatalError;
|
||||
using MagickCore::ImageInfo;
|
||||
using MagickCore::ImageRegistryType;
|
||||
using MagickCore::ImageToBlob;
|
||||
using MagickCore::ImagesToBlob;
|
||||
using MagickCore::ImageWarning;
|
||||
using MagickCore::ImplodeImage;
|
||||
using MagickCore::ImportQuantumPixels;
|
||||
using MagickCore::InverseFourierTransformImage;
|
||||
using MagickCore::InvokeDynamicImageFilter;
|
||||
using MagickCore::IsEventLogging;
|
||||
using MagickCore::IsGeometry;
|
||||
using MagickCore::IsImagesEqual;
|
||||
using MagickCore::KernelInfo;
|
||||
using MagickCore::LessValue;
|
||||
using MagickCore::LevelImage;
|
||||
using MagickCore::LevelImageChannel;
|
||||
using MagickCore::LocaleCompare;
|
||||
using MagickCore::LogMagickEvent;
|
||||
using MagickCore::MagickCoreTerminus;
|
||||
using MagickCore::MagickInfo;
|
||||
using MagickCore::MagickPixelPacket;
|
||||
using MagickCore::MagickToMime;
|
||||
using MagickCore::MagickWand;
|
||||
using MagickCore::MagnifyImage;
|
||||
using MagickCore::MergeImageLayers;
|
||||
using MagickCore::MinifyImage;
|
||||
using MagickCore::MissingDelegateError;
|
||||
using MagickCore::MissingDelegateFatalError;
|
||||
using MagickCore::MissingDelegateWarning;
|
||||
using MagickCore::ModulateImage;
|
||||
using MagickCore::ModuleError;
|
||||
using MagickCore::ModuleFatalError;
|
||||
using MagickCore::ModuleWarning;
|
||||
using MagickCore::MonitorError;
|
||||
using MagickCore::MonitorFatalError;
|
||||
using MagickCore::MonitorWarning;
|
||||
using MagickCore::MontageInfo;
|
||||
using MagickCore::MotionBlurImage;
|
||||
using MagickCore::NegateImage;
|
||||
using MagickCore::NewMagickWandFromImage;
|
||||
using MagickCore::NewPixelWand;
|
||||
using MagickCore::NoiseType;
|
||||
using MagickCore::NormalizeImage;
|
||||
using MagickCore::NoValue;
|
||||
using MagickCore::OilPaintImage;
|
||||
using MagickCore::OpaquePaintImage;
|
||||
using MagickCore::OptionError;
|
||||
using MagickCore::OptionFatalError;
|
||||
using MagickCore::OptionWarning;
|
||||
using MagickCore::ParseMetaGeometry;
|
||||
using MagickCore::PercentValue;
|
||||
using MagickCore::PingBlob;
|
||||
using MagickCore::PingImage;
|
||||
using MagickCore::PixelSetQuantumColor;
|
||||
using MagickCore::PixelWand;
|
||||
using MagickCore::PointInfo;
|
||||
using MagickCore::PopDrawingWand;
|
||||
using MagickCore::ProfileImage;
|
||||
using MagickCore::ProfileInfo;
|
||||
using MagickCore::PushDrawingWand;
|
||||
using MagickCore::QuantizeImage;
|
||||
using MagickCore::QuantizeInfo;
|
||||
using MagickCore::QuantumInfo;
|
||||
using MagickCore::QueryColorDatabase;
|
||||
using MagickCore::QueryMagickColor;
|
||||
using MagickCore::QueueAuthenticPixels;
|
||||
using MagickCore::QueueCacheViewAuthenticPixels;
|
||||
using MagickCore::RaiseImage;
|
||||
using MagickCore::RandomThresholdImageChannel;
|
||||
using MagickCore::ReadImage;
|
||||
using MagickCore::RectangleInfo;
|
||||
using MagickCore::RegisterMagickInfo;
|
||||
using MagickCore::RegistryError;
|
||||
using MagickCore::RegistryFatalError;
|
||||
using MagickCore::RegistryType;
|
||||
using MagickCore::RegistryWarning;
|
||||
using MagickCore::RelinquishMagickMemory;
|
||||
using MagickCore::RemapImage;
|
||||
using MagickCore::ResizeImage;
|
||||
using MagickCore::ResizeMagickMemory;
|
||||
using MagickCore::ResourceLimitError;
|
||||
using MagickCore::ResourceLimitFatalError;
|
||||
using MagickCore::ResourceLimitWarning;
|
||||
using MagickCore::RollImage;
|
||||
using MagickCore::RotateImage;
|
||||
using MagickCore::SampleImage;
|
||||
using MagickCore::ScaleImage;
|
||||
using MagickCore::SegmentImage;
|
||||
using MagickCore::SeparateImageChannel;
|
||||
using MagickCore::SetClientName;
|
||||
using MagickCore::SetGeometry;
|
||||
using MagickCore::SetImageBackgroundColor;
|
||||
using MagickCore::SetImageChannelDepth;
|
||||
using MagickCore::SetImageClipMask;
|
||||
using MagickCore::SetImageDepth;
|
||||
using MagickCore::SetImageExtent;
|
||||
using MagickCore::SetImageInfo;
|
||||
using MagickCore::SetImageInfoFile;
|
||||
using MagickCore::SetImageOpacity;
|
||||
using MagickCore::SetImageOption;
|
||||
using MagickCore::SetImageProfile;
|
||||
using MagickCore::SetImageProperty;
|
||||
using MagickCore::SetImageRegistry;
|
||||
using MagickCore::SetImageType;
|
||||
using MagickCore::SetLogEventMask;
|
||||
using MagickCore::SetMagickInfo;
|
||||
using MagickCore::SetMagickResourceLimit;
|
||||
using MagickCore::SetStringInfoDatum;
|
||||
using MagickCore::SetImageVirtualPixelMethod;
|
||||
using MagickCore::ShadeImage;
|
||||
using MagickCore::SharpenImage;
|
||||
using MagickCore::SharpenImageChannel;
|
||||
using MagickCore::ShaveImage;
|
||||
using MagickCore::ShearImage;
|
||||
using MagickCore::SigmoidalContrastImageChannel;
|
||||
using MagickCore::SignatureImage;
|
||||
using MagickCore::SolarizeImage;
|
||||
using MagickCore::SparseColorImage;
|
||||
using MagickCore::SpliceImage;
|
||||
using MagickCore::SpreadImage;
|
||||
using MagickCore::StatisticImage;
|
||||
using MagickCore::SteganoImage;
|
||||
using MagickCore::StereoImage;
|
||||
using MagickCore::StreamError;
|
||||
using MagickCore::StreamFatalError;
|
||||
using MagickCore::StreamWarning;
|
||||
using MagickCore::StringInfo;
|
||||
using MagickCore::StripImage;
|
||||
using MagickCore::SwirlImage;
|
||||
using MagickCore::SyncCacheViewAuthenticPixels;
|
||||
using MagickCore::SyncImage;
|
||||
using MagickCore::SyncAuthenticPixels;
|
||||
using MagickCore::TextureImage;
|
||||
using MagickCore::ThrowException;
|
||||
using MagickCore::TransformImage;
|
||||
using MagickCore::TransformImageColorspace;
|
||||
using MagickCore::TransparentPaintImage;
|
||||
using MagickCore::TransparentPaintImageChroma;
|
||||
using MagickCore::TrimImage;
|
||||
using MagickCore::TypeError;
|
||||
using MagickCore::TypeFatalError;
|
||||
using MagickCore::TypeWarning;
|
||||
using MagickCore::UndefinedException;
|
||||
using MagickCore::UndefinedRegistryType;
|
||||
using MagickCore::UnregisterMagickInfo;
|
||||
using MagickCore::UnsharpMaskImage;
|
||||
using MagickCore::UnsharpMaskImageChannel;
|
||||
using MagickCore::CacheView;
|
||||
using MagickCore::WaveImage;
|
||||
using MagickCore::WidthValue;
|
||||
using MagickCore::WriteImage;
|
||||
using MagickCore::XNegative;
|
||||
using MagickCore::XServerError;
|
||||
using MagickCore::XServerFatalError;
|
||||
using MagickCore::XServerWarning;
|
||||
using MagickCore::XValue;
|
||||
using MagickCore::YNegative;
|
||||
using MagickCore::YValue;
|
||||
|
||||
#endif // MAGICKCORE_IMPLEMENTATION
|
||||
|
||||
}
|
||||
|
||||
#endif // Magick_Include_header
|
|
@ -1,339 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003
|
||||
//
|
||||
// Definition of Montage class used to specify montage options.
|
||||
//
|
||||
|
||||
#if !defined(Magick_Montage_header)
|
||||
#define Magick_Montage_header
|
||||
|
||||
#include "Magick++/Include.h"
|
||||
#include <string>
|
||||
#include "Magick++/Color.h"
|
||||
#include "Magick++/Geometry.h"
|
||||
|
||||
//
|
||||
// Basic (Un-framed) Montage
|
||||
//
|
||||
namespace Magick
|
||||
{
|
||||
class MagickPPExport Montage
|
||||
{
|
||||
public:
|
||||
Montage( void );
|
||||
virtual ~Montage( void );
|
||||
|
||||
void backgroundColor ( const Color &backgroundColor_ );
|
||||
Color backgroundColor ( void ) const;
|
||||
|
||||
void compose ( CompositeOperator compose_ );
|
||||
CompositeOperator compose ( void ) const;
|
||||
|
||||
void fileName( const std::string &fileName_ );
|
||||
std::string fileName( void ) const;
|
||||
|
||||
void fillColor ( const Color &fill_ );
|
||||
Color fillColor ( void ) const;
|
||||
|
||||
void font ( const std::string &font_ );
|
||||
std::string font ( void ) const;
|
||||
|
||||
void geometry ( const Geometry &geometry_ );
|
||||
Geometry geometry ( void ) const;
|
||||
|
||||
void gravity ( GravityType gravity_ );
|
||||
GravityType gravity ( void ) const;
|
||||
|
||||
// Apply as attribute to all images before 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;
|
||||
|
||||
void pointSize ( size_t pointSize_ );
|
||||
size_t pointSize ( void ) const;
|
||||
|
||||
void shadow ( bool shadow_ );
|
||||
bool shadow ( void ) const;
|
||||
|
||||
void strokeColor ( const Color &stroke_ );
|
||||
Color strokeColor ( void ) const;
|
||||
|
||||
void texture ( const std::string &texture_ );
|
||||
std::string texture ( void ) const;
|
||||
|
||||
void tile ( const Geometry &tile_ );
|
||||
Geometry tile ( void ) const;
|
||||
|
||||
void title ( const std::string &title_ );
|
||||
std::string title ( void ) const;
|
||||
|
||||
// Apply to montage with TransparentPaintImage()
|
||||
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;
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
Color _backgroundColor; // Color that thumbnails are composed on
|
||||
CompositeOperator _compose; // Composition algorithm to use (e.g. ReplaceCompositeOp)
|
||||
std::string _fileName; // Filename to save montages to
|
||||
Color _fill; // Fill color
|
||||
std::string _font; // Label font
|
||||
Geometry _geometry; // Thumbnail width & height plus border width & height
|
||||
GravityType _gravity; // Thumbnail position (e.g. SouthWestGravity)
|
||||
std::string _label; // Thumbnail label (applied to image prior to montage)
|
||||
size_t _pointSize; // Font point size
|
||||
bool _shadow; // Enable drop-shadows on thumbnails
|
||||
Color _stroke; // Outline color
|
||||
std::string _texture; // Background texture image
|
||||
Geometry _tile; // Thumbnail rows and colmns
|
||||
std::string _title; // Montage title
|
||||
Color _transparentColor; // Transparent color
|
||||
};
|
||||
|
||||
//
|
||||
// Montage With Frames (Extends Basic Montage)
|
||||
//
|
||||
class MagickPPExport MontageFramed : public Montage
|
||||
{
|
||||
public:
|
||||
MontageFramed ( void );
|
||||
/* virtual */ ~MontageFramed ( void );
|
||||
|
||||
void borderColor ( const Color &borderColor_ );
|
||||
Color borderColor ( void ) const;
|
||||
|
||||
void borderWidth ( size_t borderWidth_ );
|
||||
size_t borderWidth ( void ) const;
|
||||
|
||||
void frameGeometry ( const Geometry &frame_ );
|
||||
Geometry frameGeometry ( void ) const;
|
||||
|
||||
void matteColor ( const Color &matteColor_ );
|
||||
Color matteColor ( void ) const;
|
||||
|
||||
//
|
||||
// Implementation methods/members
|
||||
//
|
||||
|
||||
// Update elements in existing MontageInfo structure
|
||||
/* virtual */ void updateMontageInfo ( MagickCore::MontageInfo &montageInfo_ ) const;
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
|
||||
Color _borderColor; // Frame border color
|
||||
size_t _borderWidth; // Pixels between thumbnail and surrounding frame
|
||||
Geometry _frame; // Frame geometry (width & height frame thickness)
|
||||
Color _matteColor; // Frame foreground color
|
||||
};
|
||||
} // 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;
|
||||
}
|
||||
|
||||
// Apply as attribute to all images before doing montage
|
||||
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;
|
||||
}
|
||||
|
||||
// Applied after the fact to montage with TransparentPaintImage()
|
||||
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
|
|
@ -1,299 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003
|
||||
//
|
||||
// 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:
|
||||
Options( void );
|
||||
Options( const Options& options_ );
|
||||
~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 point size
|
||||
void fontPointsize ( double pointSize_ );
|
||||
double fontPointsize ( 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;
|
||||
|
||||
// Quantization tree-depth
|
||||
void quantizeTreeDepth ( size_t treeDepth_ );
|
||||
size_t quantizeTreeDepth ( 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;
|
||||
|
||||
// Annotation text encoding (e.g. "UTF-16")
|
||||
void textEncoding ( const std::string &encoding_ );
|
||||
std::string textEncoding ( void ) const;
|
||||
|
||||
void tileName ( const std::string &tileName_ );
|
||||
std::string tileName ( void ) const;
|
||||
|
||||
// Image representation type
|
||||
void type ( const ImageType type_ );
|
||||
ImageType type ( 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_ );
|
||||
|
||||
// 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_ );
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
|
||||
// Assignment not supported
|
||||
Options& operator= ( const Options& );
|
||||
|
||||
MagickCore::ImageInfo* _imageInfo;
|
||||
MagickCore::QuantizeInfo* _quantizeInfo;
|
||||
MagickCore::DrawInfo* _drawInfo;
|
||||
};
|
||||
} // namespace Magick
|
||||
|
||||
#endif // Magick_Options_header
|
|
@ -1,127 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002
|
||||
//
|
||||
// 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_ );
|
||||
|
||||
// Transfers the image view pixels to the image.
|
||||
void sync ( void );
|
||||
|
||||
// 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_ );
|
||||
|
||||
// Return pixel colormap index array
|
||||
IndexPacket* indexes ( void );
|
||||
|
||||
// Left ordinate of view
|
||||
::ssize_t x ( void ) const;
|
||||
|
||||
// Top ordinate of view
|
||||
::ssize_t y ( void ) const;
|
||||
|
||||
// Width of view
|
||||
size_t columns ( void ) const;
|
||||
|
||||
// Height of view
|
||||
size_t rows ( void ) const;
|
||||
|
||||
#if 0
|
||||
// Transfer one or more pixel components from a buffer or file
|
||||
// into the image pixel view of an image. Used to support image
|
||||
// decoders.
|
||||
void decode ( const QuantumType quantum_,
|
||||
const unsigned char *source_ )
|
||||
{
|
||||
MagickCore::ReadPixelCache( _image.image(), quantum_, source_ );
|
||||
}
|
||||
|
||||
// Transfer one or more pixel components from the image pixel
|
||||
// view to a buffer or file. Used to support image encoders.
|
||||
void encode ( const QuantumType quantum_,
|
||||
const unsigned char *destination_ )
|
||||
{
|
||||
MagickCore::WritePixelCache( _image.image(), quantum_, destination_ );
|
||||
}
|
||||
#endif
|
||||
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
|
||||
MagickCore:: ExceptionInfo _exception; // Any thrown exception
|
||||
|
||||
}; // class Pixels
|
||||
|
||||
} // 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
|
File diff suppressed because it is too large
Load diff
|
@ -1,100 +0,0 @@
|
|||
// 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
|
|
@ -1,57 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 2001, 2002
|
||||
//
|
||||
// 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:
|
||||
|
||||
TypeMetric ( void );
|
||||
~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;
|
||||
|
||||
// Text width in pixels.
|
||||
double textWidth ( void ) const;
|
||||
|
||||
// Text height in pixels.
|
||||
double textHeight ( void ) const;
|
||||
|
||||
// Maximum horizontal advance in pixels.
|
||||
double maxHorizontalAdvance ( void ) const;
|
||||
|
||||
//
|
||||
// Public methods below this point are for Magick++ use only.
|
||||
//
|
||||
|
||||
private:
|
||||
MagickCore::TypeMetric _typeMetric;
|
||||
};
|
||||
} // namespace Magick
|
||||
|
||||
//
|
||||
// Inlines
|
||||
//
|
||||
|
||||
|
||||
#endif // Magick_TypeMetric_header
|
|
@ -1,135 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003
|
||||
//
|
||||
// Implementation of Montage
|
||||
//
|
||||
|
||||
#define MAGICKCORE_IMPLEMENTATION 1
|
||||
#define MAGICK_PLUSPLUS_IMPLEMENTATION 1
|
||||
|
||||
#include "Magick++/Include.h"
|
||||
#include <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 )
|
||||
{
|
||||
// Nothing to do
|
||||
}
|
||||
|
||||
Magick::MontageFramed::MontageFramed ( void )
|
||||
: _borderColor("#dfdfdf"),
|
||||
_borderWidth(0),
|
||||
_frame(),
|
||||
_matteColor("#bdbdbd")
|
||||
{
|
||||
}
|
||||
|
||||
/* virtual */ Magick::MontageFramed::~MontageFramed ( void )
|
||||
{
|
||||
// Nothing to do
|
||||
}
|
||||
|
||||
void Magick::Montage::updateMontageInfo ( MontageInfo &montageInfo_ ) const
|
||||
{
|
||||
|
||||
memset(&montageInfo_,0,sizeof(MontageInfo));
|
||||
|
||||
// background_color
|
||||
montageInfo_.background_color = _backgroundColor;
|
||||
// border_color
|
||||
montageInfo_.border_color = Color();
|
||||
// border_width
|
||||
montageInfo_.border_width = 0;
|
||||
// filename
|
||||
_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 );
|
||||
else
|
||||
montageInfo_.font=(char *) RelinquishMagickMemory(montageInfo_.font);
|
||||
// frame
|
||||
montageInfo_.frame=(char *) montageInfo_.frame;
|
||||
// geometry
|
||||
if ( _geometry.isValid() )
|
||||
Magick::CloneString( &montageInfo_.geometry, _geometry );
|
||||
else
|
||||
montageInfo_.geometry=(char *)
|
||||
RelinquishMagickMemory(montageInfo_.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 );
|
||||
else
|
||||
montageInfo_.texture=(char *) RelinquishMagickMemory(montageInfo_.texture);
|
||||
// tile
|
||||
if ( _tile.isValid() )
|
||||
Magick::CloneString( &montageInfo_.tile, _tile );
|
||||
else
|
||||
montageInfo_.tile=(char *) RelinquishMagickMemory(montageInfo_.tile);
|
||||
// title
|
||||
if ( _title.length() != 0 )
|
||||
Magick::CloneString( &montageInfo_.title, _title );
|
||||
else
|
||||
montageInfo_.title=(char *) RelinquishMagickMemory(montageInfo_.title);
|
||||
}
|
||||
|
||||
//
|
||||
// Implementation of MontageFramed
|
||||
//
|
||||
|
||||
/* virtual */ 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 );
|
||||
else
|
||||
montageInfo_.frame=(char *) RelinquishMagickMemory(montageInfo_.frame);
|
||||
// matte_color
|
||||
montageInfo_.matte_color = _matteColor;
|
||||
}
|
|
@ -1,867 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003
|
||||
//
|
||||
// Implementation of Options
|
||||
//
|
||||
// A wrapper around DrawInfo, ImageInfo, and QuantizeInfo
|
||||
//
|
||||
|
||||
#define MAGICKCORE_IMPLEMENTATION 1
|
||||
#define MAGICK_PLUSPLUS_IMPLEMENTATION 1
|
||||
|
||||
#include "Magick++/Include.h"
|
||||
#include <string>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "Magick++/Options.h"
|
||||
#include "Magick++/Functions.h"
|
||||
#include "Magick++/Exception.h"
|
||||
|
||||
#define MagickPI 3.14159265358979323846264338327950288419716939937510
|
||||
#define DegreesToRadians(x) (MagickPI*(x)/180.0)
|
||||
|
||||
// Constructor
|
||||
Magick::Options::Options( void )
|
||||
: _imageInfo(static_cast<ImageInfo*>(AcquireMagickMemory(sizeof(ImageInfo)))),
|
||||
_quantizeInfo(static_cast<QuantizeInfo*>(AcquireMagickMemory(sizeof(QuantizeInfo)))),
|
||||
_drawInfo(static_cast<DrawInfo*>(AcquireMagickMemory( sizeof(DrawInfo))))
|
||||
{
|
||||
// Initialize image info with defaults
|
||||
GetImageInfo( _imageInfo );
|
||||
|
||||
// Initialize quantization info
|
||||
GetQuantizeInfo( _quantizeInfo );
|
||||
|
||||
// Initialize drawing info
|
||||
GetDrawInfo( _imageInfo, _drawInfo );
|
||||
}
|
||||
|
||||
// Copy constructor
|
||||
Magick::Options::Options( const Magick::Options& options_ )
|
||||
: _imageInfo(CloneImageInfo( options_._imageInfo )),
|
||||
_quantizeInfo(CloneQuantizeInfo(options_._quantizeInfo)),
|
||||
_drawInfo(CloneDrawInfo(_imageInfo, options_._drawInfo))
|
||||
{
|
||||
}
|
||||
|
||||
// Construct using raw structures
|
||||
Magick::Options::Options( const MagickCore::ImageInfo* imageInfo_,
|
||||
const MagickCore::QuantizeInfo* quantizeInfo_,
|
||||
const MagickCore::DrawInfo* drawInfo_ )
|
||||
: _imageInfo(0),
|
||||
_quantizeInfo(0),
|
||||
_drawInfo(0)
|
||||
{
|
||||
_imageInfo = CloneImageInfo(imageInfo_);
|
||||
_quantizeInfo = CloneQuantizeInfo(quantizeInfo_);
|
||||
_drawInfo = CloneDrawInfo(imageInfo_,drawInfo_);
|
||||
}
|
||||
|
||||
// Destructor
|
||||
Magick::Options::~Options()
|
||||
{
|
||||
// Destroy image info
|
||||
_imageInfo =DestroyImageInfo( _imageInfo );
|
||||
_imageInfo=0;
|
||||
|
||||
// Destroy quantization info
|
||||
_quantizeInfo =DestroyQuantizeInfo( _quantizeInfo );
|
||||
_quantizeInfo=0;
|
||||
|
||||
// Destroy drawing info
|
||||
_drawInfo =DestroyDrawInfo( _drawInfo );
|
||||
_drawInfo=0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Methods for setting image attributes
|
||||
*
|
||||
*/
|
||||
|
||||
// Anti-alias Postscript and TrueType fonts (default true)
|
||||
void Magick::Options::antiAlias( bool flag_ )
|
||||
{
|
||||
_drawInfo->text_antialias = static_cast<MagickBooleanType>
|
||||
(flag_ ? MagickTrue : MagickFalse);
|
||||
}
|
||||
bool Magick::Options::antiAlias( void ) const
|
||||
{
|
||||
return static_cast<bool>(_drawInfo->text_antialias);
|
||||
}
|
||||
|
||||
void Magick::Options::adjoin ( bool flag_ )
|
||||
{
|
||||
_imageInfo->adjoin = static_cast<MagickBooleanType>
|
||||
(flag_ ? MagickTrue : MagickFalse);
|
||||
}
|
||||
bool Magick::Options::adjoin ( void ) const
|
||||
{
|
||||
return static_cast<bool>(_imageInfo->adjoin);
|
||||
}
|
||||
|
||||
void Magick::Options::backgroundColor ( const Magick::Color &color_ )
|
||||
{
|
||||
_imageInfo->background_color = color_;
|
||||
}
|
||||
Magick::Color Magick::Options::backgroundColor ( void ) const
|
||||
{
|
||||
return Magick::Color( _imageInfo->background_color );
|
||||
}
|
||||
|
||||
void Magick::Options::backgroundTexture ( const std::string &backgroundTexture_ )
|
||||
{
|
||||
if ( backgroundTexture_.length() == 0 )
|
||||
_imageInfo->texture=(char *) RelinquishMagickMemory(_imageInfo->texture);
|
||||
else
|
||||
Magick::CloneString( &_imageInfo->texture, backgroundTexture_ );
|
||||
}
|
||||
std::string Magick::Options::backgroundTexture ( void ) const
|
||||
{
|
||||
if ( _imageInfo->texture )
|
||||
return std::string( _imageInfo->texture );
|
||||
else
|
||||
return std::string();
|
||||
}
|
||||
|
||||
void Magick::Options::borderColor ( const Color &color_ )
|
||||
{
|
||||
_imageInfo->border_color = color_;
|
||||
_drawInfo->border_color = color_;
|
||||
}
|
||||
Magick::Color Magick::Options::borderColor ( void ) const
|
||||
{
|
||||
return Magick::Color( _imageInfo->border_color );
|
||||
}
|
||||
|
||||
// Text bounding-box base color
|
||||
void Magick::Options::boxColor ( const Magick::Color &boxColor_ )
|
||||
{
|
||||
_drawInfo->undercolor = boxColor_;
|
||||
}
|
||||
Magick::Color Magick::Options::boxColor ( void ) const
|
||||
{
|
||||
return Magick::Color( _drawInfo->undercolor );
|
||||
}
|
||||
|
||||
void Magick::Options::colorspaceType ( Magick::ColorspaceType colorspace_ )
|
||||
{
|
||||
_imageInfo->colorspace = colorspace_;
|
||||
}
|
||||
Magick::ColorspaceType Magick::Options::colorspaceType ( void ) const
|
||||
{
|
||||
return static_cast<Magick::ColorspaceType>(_imageInfo->colorspace);
|
||||
}
|
||||
|
||||
void Magick::Options::compressType ( CompressionType compressType_ )
|
||||
{
|
||||
_imageInfo->compression = compressType_;
|
||||
}
|
||||
Magick::CompressionType Magick::Options::compressType ( void ) const
|
||||
{
|
||||
return static_cast<Magick::CompressionType>(_imageInfo->compression);
|
||||
}
|
||||
|
||||
void Magick::Options::colorFuzz ( double fuzz_ )
|
||||
{
|
||||
_imageInfo->fuzz = fuzz_;
|
||||
}
|
||||
double Magick::Options::colorFuzz ( void ) const
|
||||
{
|
||||
return _imageInfo->fuzz;
|
||||
}
|
||||
|
||||
// Enable printing of debug messages from ImageMagick
|
||||
void Magick::Options::debug ( bool flag_ )
|
||||
{
|
||||
if(flag_)
|
||||
{
|
||||
SetLogEventMask("All");
|
||||
}
|
||||
else
|
||||
{
|
||||
SetLogEventMask("None");
|
||||
}
|
||||
}
|
||||
bool Magick::Options::debug ( void ) const
|
||||
{
|
||||
if( IsEventLogging() )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void Magick::Options::density ( const Magick::Geometry &density_ )
|
||||
{
|
||||
if ( !density_.isValid() )
|
||||
_imageInfo->density=(char *) RelinquishMagickMemory(_imageInfo->density);
|
||||
else
|
||||
Magick::CloneString( &_imageInfo->density, density_ );
|
||||
}
|
||||
Magick::Geometry Magick::Options::density ( void ) const
|
||||
{
|
||||
if ( _imageInfo->density )
|
||||
return Geometry( _imageInfo->density );
|
||||
|
||||
return Geometry();
|
||||
}
|
||||
|
||||
void Magick::Options::depth ( size_t depth_ )
|
||||
{
|
||||
_imageInfo->depth = depth_;
|
||||
}
|
||||
size_t Magick::Options::depth ( void ) const
|
||||
{
|
||||
return _imageInfo->depth;
|
||||
}
|
||||
|
||||
// Endianness (little like Intel or big like SPARC) for image
|
||||
// formats which support endian-specific options.
|
||||
void Magick::Options::endian ( Magick::EndianType endian_ )
|
||||
{
|
||||
_imageInfo->endian = endian_;
|
||||
}
|
||||
Magick::EndianType Magick::Options::endian ( void ) const
|
||||
{
|
||||
return _imageInfo->endian;
|
||||
}
|
||||
|
||||
void Magick::Options::file ( FILE *file_ )
|
||||
{
|
||||
SetImageInfoFile( _imageInfo, file_ );
|
||||
}
|
||||
FILE *Magick::Options::file ( void ) const
|
||||
{
|
||||
return GetImageInfoFile( _imageInfo );
|
||||
}
|
||||
|
||||
void Magick::Options::fileName ( const std::string &fileName_ )
|
||||
{
|
||||
fileName_.copy( _imageInfo->filename, MaxTextExtent-1 );
|
||||
_imageInfo->filename[ fileName_.length() ] = 0;
|
||||
}
|
||||
std::string Magick::Options::fileName ( void ) const
|
||||
{
|
||||
return std::string( _imageInfo->filename );
|
||||
}
|
||||
|
||||
// Color to use when drawing inside an object
|
||||
void Magick::Options::fillColor ( const Magick::Color &fillColor_ )
|
||||
{
|
||||
_drawInfo->fill = fillColor_;
|
||||
if (fillColor_ == Magick::Color())
|
||||
fillPattern((const MagickCore::Image*) NULL);
|
||||
}
|
||||
Magick::Color Magick::Options::fillColor ( void ) const
|
||||
{
|
||||
return _drawInfo->fill;
|
||||
}
|
||||
// Pattern image to use when filling objects
|
||||
void Magick::Options::fillPattern ( const MagickCore::Image *fillPattern_ )
|
||||
{
|
||||
if ( _drawInfo->fill_pattern )
|
||||
{
|
||||
DestroyImageList( _drawInfo->fill_pattern );
|
||||
_drawInfo->fill_pattern = 0;
|
||||
}
|
||||
if ( fillPattern_ )
|
||||
{
|
||||
ExceptionInfo exceptionInfo;
|
||||
GetExceptionInfo( &exceptionInfo );
|
||||
_drawInfo->fill_pattern =
|
||||
CloneImage( const_cast<MagickCore::Image*>(fillPattern_),
|
||||
0,
|
||||
0,
|
||||
static_cast<MagickBooleanType>(MagickTrue),
|
||||
&exceptionInfo );
|
||||
throwException( exceptionInfo );
|
||||
(void) DestroyExceptionInfo( &exceptionInfo );
|
||||
}
|
||||
}
|
||||
const MagickCore::Image* Magick::Options::fillPattern ( void ) const
|
||||
{
|
||||
return _drawInfo->fill_pattern;
|
||||
}
|
||||
|
||||
// Rule to use when filling drawn objects
|
||||
void Magick::Options::fillRule ( const Magick::FillRule &fillRule_ )
|
||||
{
|
||||
_drawInfo->fill_rule = fillRule_;
|
||||
}
|
||||
Magick::FillRule Magick::Options::fillRule ( void ) const
|
||||
{
|
||||
return _drawInfo->fill_rule;
|
||||
}
|
||||
|
||||
void Magick::Options::font ( const std::string &font_ )
|
||||
{
|
||||
if ( font_.length() == 0 )
|
||||
{
|
||||
_imageInfo->font=(char *) RelinquishMagickMemory(_imageInfo->font);
|
||||
_drawInfo->font=(char *) RelinquishMagickMemory(_drawInfo->font);
|
||||
}
|
||||
else
|
||||
{
|
||||
Magick::CloneString( &_imageInfo->font, font_ );
|
||||
Magick::CloneString( &_drawInfo->font, font_ );
|
||||
}
|
||||
}
|
||||
std::string Magick::Options::font ( void ) const
|
||||
{
|
||||
if ( _imageInfo->font )
|
||||
return std::string( _imageInfo->font );
|
||||
|
||||
return std::string();
|
||||
}
|
||||
|
||||
void Magick::Options::fontPointsize ( double pointSize_ )
|
||||
{
|
||||
_imageInfo->pointsize = pointSize_;
|
||||
_drawInfo->pointsize = pointSize_;
|
||||
}
|
||||
double Magick::Options::fontPointsize ( void ) const
|
||||
{
|
||||
return _imageInfo->pointsize;
|
||||
}
|
||||
|
||||
std::string Magick::Options::format ( void ) const
|
||||
{
|
||||
ExceptionInfo exception;
|
||||
|
||||
const MagickInfo * magick_info = 0;
|
||||
GetExceptionInfo(&exception);
|
||||
if ( *_imageInfo->magick != '\0' )
|
||||
magick_info = GetMagickInfo( _imageInfo->magick , &exception);
|
||||
throwException( exception );
|
||||
(void) DestroyExceptionInfo( &exception );
|
||||
|
||||
if (( magick_info != 0 ) &&
|
||||
( *magick_info->description != '\0' ))
|
||||
return std::string( magick_info->description );
|
||||
|
||||
return std::string();
|
||||
}
|
||||
|
||||
void Magick::Options::interlaceType ( Magick::InterlaceType interlace_ )
|
||||
{
|
||||
_imageInfo->interlace = interlace_;
|
||||
}
|
||||
Magick::InterlaceType Magick::Options::interlaceType ( void ) const
|
||||
{
|
||||
return static_cast<Magick::InterlaceType>(_imageInfo->interlace);
|
||||
}
|
||||
|
||||
void Magick::Options::magick ( const std::string &magick_ )
|
||||
{
|
||||
ExceptionInfo exception;
|
||||
|
||||
FormatLocaleString( _imageInfo->filename, MaxTextExtent, "%.1024s:", magick_.c_str() );
|
||||
GetExceptionInfo(&exception);
|
||||
SetImageInfo( _imageInfo, 1, &exception);
|
||||
if ( *_imageInfo->magick == '\0' )
|
||||
throwExceptionExplicit( OptionWarning, "Unrecognized image format",
|
||||
magick_.c_str() );
|
||||
(void) DestroyExceptionInfo( &exception );
|
||||
}
|
||||
std::string Magick::Options::magick ( void ) const
|
||||
{
|
||||
if ( _imageInfo->magick && *_imageInfo->magick )
|
||||
return std::string( _imageInfo->magick );
|
||||
|
||||
return std::string();
|
||||
}
|
||||
|
||||
void Magick::Options::matteColor ( const Magick::Color &matteColor_ )
|
||||
{
|
||||
_imageInfo->matte_color = matteColor_;
|
||||
}
|
||||
Magick::Color Magick::Options::matteColor ( void ) const
|
||||
{
|
||||
return Magick::Color( _imageInfo->matte_color );
|
||||
}
|
||||
|
||||
void Magick::Options::monochrome ( bool monochromeFlag_ )
|
||||
{
|
||||
_imageInfo->monochrome = (MagickBooleanType) monochromeFlag_;
|
||||
}
|
||||
bool Magick::Options::monochrome ( void ) const
|
||||
{
|
||||
return static_cast<bool>(_imageInfo->monochrome);
|
||||
}
|
||||
|
||||
void Magick::Options::page ( const Magick::Geometry &pageSize_ )
|
||||
{
|
||||
if ( !pageSize_.isValid() )
|
||||
_imageInfo->page=(char *) RelinquishMagickMemory(_imageInfo->page);
|
||||
else
|
||||
Magick::CloneString( &_imageInfo->page, pageSize_ );
|
||||
}
|
||||
Magick::Geometry Magick::Options::page ( void ) const
|
||||
{
|
||||
if ( _imageInfo->page )
|
||||
return Geometry( _imageInfo->page );
|
||||
|
||||
return Geometry();
|
||||
}
|
||||
|
||||
void Magick::Options::quality ( size_t quality_ )
|
||||
{
|
||||
_imageInfo->quality = quality_;
|
||||
}
|
||||
size_t Magick::Options::quality ( void ) const
|
||||
{
|
||||
return _imageInfo->quality;
|
||||
}
|
||||
|
||||
void Magick::Options::quantizeColors ( size_t colors_ )
|
||||
{
|
||||
_quantizeInfo->number_colors = colors_;
|
||||
}
|
||||
size_t Magick::Options::quantizeColors ( void ) const
|
||||
{
|
||||
return _quantizeInfo->number_colors;
|
||||
}
|
||||
|
||||
void Magick::Options::quantizeColorSpace ( Magick::ColorspaceType colorSpace_ )
|
||||
{
|
||||
_quantizeInfo->colorspace = colorSpace_;
|
||||
}
|
||||
Magick::ColorspaceType Magick::Options::quantizeColorSpace ( void ) const
|
||||
{
|
||||
return static_cast<Magick::ColorspaceType>(_quantizeInfo->colorspace);
|
||||
}
|
||||
|
||||
void Magick::Options::quantizeDither ( bool ditherFlag_ )
|
||||
{
|
||||
_imageInfo->dither = (MagickBooleanType) ditherFlag_;
|
||||
_quantizeInfo->dither = (MagickBooleanType) ditherFlag_;
|
||||
}
|
||||
bool Magick::Options::quantizeDither ( void ) const
|
||||
{
|
||||
return static_cast<bool>(_imageInfo->dither);
|
||||
}
|
||||
|
||||
void Magick::Options::quantizeTreeDepth ( size_t treeDepth_ )
|
||||
{
|
||||
_quantizeInfo->tree_depth = treeDepth_;
|
||||
}
|
||||
size_t Magick::Options::quantizeTreeDepth ( void ) const
|
||||
{
|
||||
return _quantizeInfo->tree_depth;
|
||||
}
|
||||
|
||||
void Magick::Options::resolutionUnits ( Magick::ResolutionType resolutionUnits_ )
|
||||
{
|
||||
_imageInfo->units = resolutionUnits_;
|
||||
}
|
||||
Magick::ResolutionType Magick::Options::resolutionUnits ( void ) const
|
||||
{
|
||||
return static_cast<Magick::ResolutionType>(_imageInfo->units);
|
||||
}
|
||||
|
||||
void Magick::Options::samplingFactor ( const std::string &samplingFactor_ )
|
||||
{
|
||||
if ( samplingFactor_.length() == 0 )
|
||||
_imageInfo->sampling_factor=(char *) RelinquishMagickMemory(_imageInfo->sampling_factor);
|
||||
else
|
||||
Magick::CloneString( &_imageInfo->sampling_factor, samplingFactor_ );
|
||||
}
|
||||
std::string Magick::Options::samplingFactor ( void ) const
|
||||
{
|
||||
if ( _imageInfo->sampling_factor )
|
||||
return std::string( _imageInfo->sampling_factor );
|
||||
|
||||
return std::string();
|
||||
}
|
||||
|
||||
void Magick::Options::size ( const Geometry &geometry_ )
|
||||
{
|
||||
_imageInfo->size=(char *) RelinquishMagickMemory(_imageInfo->size);
|
||||
|
||||
if ( geometry_.isValid() )
|
||||
Magick::CloneString( &_imageInfo->size, geometry_ );
|
||||
}
|
||||
Magick::Geometry Magick::Options::size ( void ) const
|
||||
{
|
||||
if ( _imageInfo->size )
|
||||
return Geometry( _imageInfo->size );
|
||||
|
||||
return Geometry();
|
||||
}
|
||||
|
||||
void Magick::Options::strokeAntiAlias( bool flag_ )
|
||||
{
|
||||
flag_ ? _drawInfo->stroke_antialias=MagickTrue : _drawInfo->stroke_antialias=MagickFalse;
|
||||
}
|
||||
bool Magick::Options::strokeAntiAlias( void ) const
|
||||
{
|
||||
return (_drawInfo->stroke_antialias != 0 ? true : false);
|
||||
}
|
||||
|
||||
// Color to use when drawing object outlines
|
||||
void Magick::Options::strokeColor ( const Magick::Color &strokeColor_ )
|
||||
{
|
||||
_drawInfo->stroke = strokeColor_;
|
||||
}
|
||||
Magick::Color Magick::Options::strokeColor ( void ) const
|
||||
{
|
||||
return _drawInfo->stroke;
|
||||
}
|
||||
|
||||
void Magick::Options::strokeDashArray ( const double* strokeDashArray_ )
|
||||
{
|
||||
_drawInfo->dash_pattern=(double *)
|
||||
RelinquishMagickMemory(_drawInfo->dash_pattern);
|
||||
|
||||
if(strokeDashArray_)
|
||||
{
|
||||
// Count elements in dash array
|
||||
size_t x;
|
||||
for (x=0; strokeDashArray_[x]; x++) ;
|
||||
// Allocate elements
|
||||
_drawInfo->dash_pattern =
|
||||
static_cast<double*>(AcquireMagickMemory((x+1)*sizeof(double)));
|
||||
// Copy elements
|
||||
memcpy(_drawInfo->dash_pattern,strokeDashArray_,
|
||||
(x+1)*sizeof(double));
|
||||
}
|
||||
}
|
||||
const double* Magick::Options::strokeDashArray ( void ) const
|
||||
{
|
||||
return _drawInfo->dash_pattern;
|
||||
}
|
||||
|
||||
void Magick::Options::strokeDashOffset ( double strokeDashOffset_ )
|
||||
{
|
||||
_drawInfo->dash_offset = strokeDashOffset_;
|
||||
}
|
||||
double Magick::Options::strokeDashOffset ( void ) const
|
||||
{
|
||||
return _drawInfo->dash_offset;
|
||||
}
|
||||
|
||||
// Specify the shape to be used at the end of open subpaths when they
|
||||
// are stroked. Values of LineCap are ButtCap, RoundCap, and
|
||||
// SquareCap.
|
||||
void Magick::Options::strokeLineCap ( Magick::LineCap lineCap_ )
|
||||
{
|
||||
_drawInfo->linecap = lineCap_;
|
||||
}
|
||||
Magick::LineCap Magick::Options::strokeLineCap ( void ) const
|
||||
{
|
||||
return _drawInfo->linecap;
|
||||
}
|
||||
|
||||
// Specify the shape to be used at the corners of paths (or other
|
||||
// vector shapes) when they are stroked.
|
||||
void Magick::Options::strokeLineJoin ( Magick::LineJoin lineJoin_ )
|
||||
{
|
||||
_drawInfo->linejoin = lineJoin_;
|
||||
}
|
||||
Magick::LineJoin Magick::Options::strokeLineJoin ( void ) const
|
||||
{
|
||||
return _drawInfo->linejoin;
|
||||
}
|
||||
|
||||
// miterLimit for drawing lines, circles, ellipses, etc.
|
||||
void Magick::Options::strokeMiterLimit ( size_t miterLimit_ )
|
||||
{
|
||||
_drawInfo->miterlimit = miterLimit_;
|
||||
}
|
||||
size_t Magick::Options::strokeMiterLimit ( void ) const
|
||||
{
|
||||
return _drawInfo->miterlimit;
|
||||
}
|
||||
|
||||
// Pattern image to use for stroked outlines
|
||||
void Magick::Options::strokePattern ( const MagickCore::Image *strokePattern_ )
|
||||
{
|
||||
if ( _drawInfo->stroke_pattern )
|
||||
{
|
||||
DestroyImageList( _drawInfo->stroke_pattern );
|
||||
_drawInfo->stroke_pattern = 0;
|
||||
}
|
||||
|
||||
if ( strokePattern_ )
|
||||
{
|
||||
ExceptionInfo exceptionInfo;
|
||||
GetExceptionInfo( &exceptionInfo );
|
||||
_drawInfo->stroke_pattern =
|
||||
CloneImage( const_cast<MagickCore::Image*>(strokePattern_),
|
||||
0,
|
||||
0,
|
||||
MagickTrue,
|
||||
&exceptionInfo );
|
||||
throwException( exceptionInfo );
|
||||
(void) DestroyExceptionInfo( &exceptionInfo );
|
||||
}
|
||||
}
|
||||
const MagickCore::Image* Magick::Options::strokePattern ( void ) const
|
||||
{
|
||||
return _drawInfo->stroke_pattern;
|
||||
}
|
||||
|
||||
// Stroke width for drawing lines, circles, ellipses, etc.
|
||||
void Magick::Options::strokeWidth ( double strokeWidth_ )
|
||||
{
|
||||
_drawInfo->stroke_width = strokeWidth_;
|
||||
}
|
||||
double Magick::Options::strokeWidth ( void ) const
|
||||
{
|
||||
return _drawInfo->stroke_width;
|
||||
}
|
||||
|
||||
void Magick::Options::subImage ( size_t subImage_ )
|
||||
{
|
||||
_imageInfo->scene = subImage_;
|
||||
}
|
||||
size_t Magick::Options::subImage ( void ) const
|
||||
{
|
||||
return _imageInfo->scene;
|
||||
}
|
||||
|
||||
void Magick::Options::subRange ( size_t subRange_ )
|
||||
{
|
||||
_imageInfo->number_scenes = subRange_;
|
||||
}
|
||||
size_t Magick::Options::subRange ( void ) const
|
||||
{
|
||||
return _imageInfo->number_scenes;
|
||||
}
|
||||
|
||||
// Annotation text encoding (e.g. "UTF-16")
|
||||
void Magick::Options::textEncoding ( const std::string &encoding_ )
|
||||
{
|
||||
CloneString(&_drawInfo->encoding, encoding_.c_str());
|
||||
}
|
||||
std::string Magick::Options::textEncoding ( void ) const
|
||||
{
|
||||
if ( _drawInfo->encoding && *_drawInfo->encoding )
|
||||
return std::string( _drawInfo->encoding );
|
||||
|
||||
return std::string();
|
||||
}
|
||||
|
||||
void Magick::Options::tileName ( const std::string &tileName_ )
|
||||
{
|
||||
if ( tileName_.length() == 0 )
|
||||
_imageInfo->tile=(char *) RelinquishMagickMemory(_imageInfo->tile);
|
||||
else
|
||||
Magick::CloneString( &_imageInfo->tile, tileName_ );
|
||||
}
|
||||
std::string Magick::Options::tileName ( void ) const
|
||||
{
|
||||
if ( _imageInfo->tile )
|
||||
return std::string( _imageInfo->tile );
|
||||
return std::string();
|
||||
}
|
||||
|
||||
// Image representation type
|
||||
void Magick::Options::type ( const Magick::ImageType type_ )
|
||||
{
|
||||
_imageInfo->type = type_;
|
||||
}
|
||||
Magick::ImageType Magick::Options::type ( void ) const
|
||||
{
|
||||
return _imageInfo->type;
|
||||
}
|
||||
|
||||
// Origin of coordinate system to use when annotating with text or drawing
|
||||
void Magick::Options::transformOrigin ( double tx_, double ty_ )
|
||||
{
|
||||
AffineMatrix current = _drawInfo->affine;
|
||||
AffineMatrix affine;
|
||||
affine.sx=1.0;
|
||||
affine.rx=0.0;
|
||||
affine.ry=0.0;
|
||||
affine.sy=1.0;
|
||||
affine.tx=0.0;
|
||||
affine.ty=0.0;
|
||||
|
||||
affine.tx = tx_;
|
||||
affine.ty = ty_;
|
||||
|
||||
_drawInfo->affine.sx=current.sx*affine.sx+current.ry*affine.rx;
|
||||
_drawInfo->affine.rx=current.rx*affine.sx+current.sy*affine.rx;
|
||||
_drawInfo->affine.ry=current.sx*affine.ry+current.ry*affine.sy;
|
||||
_drawInfo->affine.sy=current.rx*affine.ry+current.sy*affine.sy;
|
||||
_drawInfo->affine.tx=current.sx*affine.tx+current.ry*affine.ty+current.tx;
|
||||
_drawInfo->affine.ty=current.rx*affine.tx+current.sy*affine.ty+current.ty;
|
||||
}
|
||||
|
||||
// Reset transformation parameters to default
|
||||
void Magick::Options::transformReset ( void )
|
||||
{
|
||||
_drawInfo->affine.sx=1.0;
|
||||
_drawInfo->affine.rx=0.0;
|
||||
_drawInfo->affine.ry=0.0;
|
||||
_drawInfo->affine.sy=1.0;
|
||||
_drawInfo->affine.tx=0.0;
|
||||
_drawInfo->affine.ty=0.0;
|
||||
}
|
||||
|
||||
// Rotation to use when annotating with text or drawing
|
||||
void Magick::Options::transformRotation ( double angle_ )
|
||||
{
|
||||
AffineMatrix current = _drawInfo->affine;
|
||||
AffineMatrix affine;
|
||||
affine.sx=1.0;
|
||||
affine.rx=0.0;
|
||||
affine.ry=0.0;
|
||||
affine.sy=1.0;
|
||||
affine.tx=0.0;
|
||||
affine.ty=0.0;
|
||||
|
||||
affine.sx=cos(DegreesToRadians(fmod(angle_,360.0)));
|
||||
affine.rx=(-sin(DegreesToRadians(fmod(angle_,360.0))));
|
||||
affine.ry=sin(DegreesToRadians(fmod(angle_,360.0)));
|
||||
affine.sy=cos(DegreesToRadians(fmod(angle_,360.0)));
|
||||
|
||||
_drawInfo->affine.sx=current.sx*affine.sx+current.ry*affine.rx;
|
||||
_drawInfo->affine.rx=current.rx*affine.sx+current.sy*affine.rx;
|
||||
_drawInfo->affine.ry=current.sx*affine.ry+current.ry*affine.sy;
|
||||
_drawInfo->affine.sy=current.rx*affine.ry+current.sy*affine.sy;
|
||||
_drawInfo->affine.tx=current.sx*affine.tx+current.ry*affine.ty+current.tx;
|
||||
_drawInfo->affine.ty=current.rx*affine.tx+current.sy*affine.ty+current.ty;
|
||||
}
|
||||
|
||||
// Scale to use when annotating with text or drawing
|
||||
void Magick::Options::transformScale ( double sx_, double sy_ )
|
||||
{
|
||||
AffineMatrix current = _drawInfo->affine;
|
||||
AffineMatrix affine;
|
||||
affine.sx=1.0;
|
||||
affine.rx=0.0;
|
||||
affine.ry=0.0;
|
||||
affine.sy=1.0;
|
||||
affine.tx=0.0;
|
||||
affine.ty=0.0;
|
||||
|
||||
affine.sx = sx_;
|
||||
affine.sy = sy_;
|
||||
|
||||
_drawInfo->affine.sx=current.sx*affine.sx+current.ry*affine.rx;
|
||||
_drawInfo->affine.rx=current.rx*affine.sx+current.sy*affine.rx;
|
||||
_drawInfo->affine.ry=current.sx*affine.ry+current.ry*affine.sy;
|
||||
_drawInfo->affine.sy=current.rx*affine.ry+current.sy*affine.sy;
|
||||
_drawInfo->affine.tx=current.sx*affine.tx+current.ry*affine.ty+current.tx;
|
||||
_drawInfo->affine.ty=current.rx*affine.tx+current.sy*affine.ty+current.ty;
|
||||
}
|
||||
|
||||
// Skew to use in X axis when annotating with text or drawing
|
||||
void Magick::Options::transformSkewX ( double skewx_ )
|
||||
{
|
||||
AffineMatrix current = _drawInfo->affine;
|
||||
AffineMatrix affine;
|
||||
affine.sx=1.0;
|
||||
affine.rx=0.0;
|
||||
affine.ry=0.0;
|
||||
affine.sy=1.0;
|
||||
affine.tx=0.0;
|
||||
affine.ty=0.0;
|
||||
|
||||
affine.sx=1.0;
|
||||
affine.ry=tan(DegreesToRadians(fmod(skewx_,360.0)));
|
||||
affine.sy=1.0;
|
||||
|
||||
_drawInfo->affine.sx=current.sx*affine.sx+current.ry*affine.rx;
|
||||
_drawInfo->affine.rx=current.rx*affine.sx+current.sy*affine.rx;
|
||||
_drawInfo->affine.ry=current.sx*affine.ry+current.ry*affine.sy;
|
||||
_drawInfo->affine.sy=current.rx*affine.ry+current.sy*affine.sy;
|
||||
_drawInfo->affine.tx=current.sx*affine.tx+current.ry*affine.ty+current.tx;
|
||||
_drawInfo->affine.ty=current.rx*affine.tx+current.sy*affine.ty+current.ty;
|
||||
}
|
||||
|
||||
// Skew to use in Y axis when annotating with text or drawing
|
||||
void Magick::Options::transformSkewY ( double skewy_ )
|
||||
{
|
||||
AffineMatrix current = _drawInfo->affine;
|
||||
AffineMatrix affine;
|
||||
affine.sx=1.0;
|
||||
affine.rx=0.0;
|
||||
affine.ry=0.0;
|
||||
affine.sy=1.0;
|
||||
affine.tx=0.0;
|
||||
affine.ty=0.0;
|
||||
|
||||
affine.sx=1.0;
|
||||
affine.rx=tan(DegreesToRadians(fmod(skewy_,360.0)));
|
||||
affine.sy=1.0;
|
||||
|
||||
_drawInfo->affine.sx=current.sx*affine.sx+current.ry*affine.rx;
|
||||
_drawInfo->affine.rx=current.rx*affine.sx+current.sy*affine.rx;
|
||||
_drawInfo->affine.ry=current.sx*affine.ry+current.ry*affine.sy;
|
||||
_drawInfo->affine.sy=current.rx*affine.ry+current.sy*affine.sy;
|
||||
_drawInfo->affine.tx=current.sx*affine.tx+current.ry*affine.ty+current.tx;
|
||||
_drawInfo->affine.ty=current.rx*affine.tx+current.sy*affine.ty+current.ty;
|
||||
}
|
||||
|
||||
void Magick::Options::verbose ( bool verboseFlag_ )
|
||||
{
|
||||
_imageInfo->verbose = (MagickBooleanType) verboseFlag_;
|
||||
}
|
||||
bool Magick::Options::verbose ( void ) const
|
||||
{
|
||||
return static_cast<bool>(_imageInfo->verbose);
|
||||
}
|
||||
|
||||
void Magick::Options::virtualPixelMethod ( VirtualPixelMethod virtual_pixel_method_ )
|
||||
{
|
||||
_imageInfo->virtual_pixel_method = virtual_pixel_method_;
|
||||
}
|
||||
Magick::VirtualPixelMethod Magick::Options::virtualPixelMethod ( void ) const
|
||||
{
|
||||
return static_cast<Magick::VirtualPixelMethod>(_imageInfo->virtual_pixel_method);
|
||||
}
|
||||
|
||||
void Magick::Options::view ( const std::string &view_ )
|
||||
{
|
||||
if ( view_.length() == 0 )
|
||||
_imageInfo->view=(char *) RelinquishMagickMemory(_imageInfo->view);
|
||||
else
|
||||
Magick::CloneString( &_imageInfo->view, view_ );
|
||||
}
|
||||
std::string Magick::Options::view ( void ) const
|
||||
{
|
||||
if ( _imageInfo->view )
|
||||
return std::string( _imageInfo->view );
|
||||
|
||||
return std::string();
|
||||
}
|
||||
|
||||
void Magick::Options::x11Display ( const std::string &display_ )
|
||||
{
|
||||
if ( display_.length() == 0 )
|
||||
_imageInfo->server_name=(char *) RelinquishMagickMemory(_imageInfo->server_name);
|
||||
else
|
||||
Magick::CloneString( &_imageInfo->server_name, display_ );
|
||||
}
|
||||
std::string Magick::Options::x11Display ( void ) const
|
||||
{
|
||||
if ( _imageInfo->server_name )
|
||||
return std::string( _imageInfo->server_name );
|
||||
|
||||
return std::string();
|
||||
}
|
||||
|
||||
//
|
||||
// Internal implementation methods. Please do not use.
|
||||
//
|
||||
|
||||
MagickCore::DrawInfo * Magick::Options::drawInfo( void )
|
||||
{
|
||||
return _drawInfo;
|
||||
}
|
||||
|
||||
MagickCore::ImageInfo * Magick::Options::imageInfo( void )
|
||||
{
|
||||
return _imageInfo;
|
||||
}
|
||||
|
||||
MagickCore::QuantizeInfo * Magick::Options::quantizeInfo( void )
|
||||
{
|
||||
return _quantizeInfo;
|
||||
}
|
|
@ -1,125 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003
|
||||
//
|
||||
// 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"
|
||||
|
||||
namespace Magick
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Construct pixel view using specified image.
|
||||
Magick::Pixels::Pixels( Magick::Image &image_ )
|
||||
: _image(image_),
|
||||
_view(AcquireVirtualCacheView(_image.image(),&_exception)),
|
||||
_x(0),
|
||||
_y(0),
|
||||
_columns(0),
|
||||
_rows(0)
|
||||
{
|
||||
GetExceptionInfo( &_exception );
|
||||
|
||||
if (!_view)
|
||||
_image.throwImageException();
|
||||
}
|
||||
|
||||
// Destroy pixel view
|
||||
Magick::Pixels::~Pixels( void )
|
||||
{
|
||||
if ( _view )
|
||||
_view = DestroyCacheView( _view );
|
||||
|
||||
(void) DestroyExceptionInfo( &_exception );
|
||||
}
|
||||
|
||||
// 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.
|
||||
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_;
|
||||
|
||||
PixelPacket* pixels = GetCacheViewAuthenticPixels( _view, x_, y_, columns_, rows_, &_exception);
|
||||
|
||||
if ( !pixels )
|
||||
throwException( _exception );
|
||||
|
||||
return pixels;
|
||||
}
|
||||
|
||||
// Transfer read-only pixels from the image to the pixel view as
|
||||
// defined by the specified region.
|
||||
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_;
|
||||
|
||||
const PixelPacket* pixels =
|
||||
GetCacheViewVirtualPixels(_view, x_, y_, columns_, rows_, &_exception );
|
||||
|
||||
if ( !pixels )
|
||||
throwException( _exception );
|
||||
|
||||
return pixels;
|
||||
}
|
||||
|
||||
// Transfers the image view pixels to the image.
|
||||
void Magick::Pixels::sync ( void )
|
||||
{
|
||||
if( !SyncCacheViewAuthenticPixels( _view, &_exception ) )
|
||||
throwException( _exception );
|
||||
}
|
||||
|
||||
// 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'.
|
||||
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_;
|
||||
|
||||
PixelPacket* pixels = QueueCacheViewAuthenticPixels( _view, x_, y_,
|
||||
columns_, rows_, &_exception );
|
||||
if ( !pixels )
|
||||
throwException( _exception );
|
||||
|
||||
return pixels;
|
||||
}
|
||||
|
||||
// Return pixel colormap index array
|
||||
Magick::IndexPacket* Magick::Pixels::indexes ( void )
|
||||
{
|
||||
IndexPacket* pixel_indexes = GetCacheViewAuthenticIndexQueue( _view );
|
||||
|
||||
if ( !pixel_indexes )
|
||||
_image.throwImageException();
|
||||
|
||||
return pixel_indexes;
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,107 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002
|
||||
//
|
||||
// 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)
|
||||
int sysError;
|
||||
if ( (sysError = ::pthread_mutex_destroy( &_mutex )) == 0 )
|
||||
return;
|
||||
throwExceptionExplicit( OptionError, "mutex destruction failed",
|
||||
strerror(sysError) );
|
||||
#endif
|
||||
#if defined(_MT) && defined(_VISUALC_)
|
||||
if ( ::CloseHandle(_mutex.id) != 0 )
|
||||
return;
|
||||
throwExceptionExplicit( OptionError, "mutex destruction failed" );
|
||||
#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
|
||||
}
|
|
@ -1,53 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 2001
|
||||
//
|
||||
// TypeMetric implementation
|
||||
//
|
||||
|
||||
#define MAGICKCORE_IMPLEMENTATION 1
|
||||
#define MAGICK_PLUSPLUS_IMPLEMENTATION 1
|
||||
|
||||
#include "Magick++/TypeMetric.h"
|
||||
#include <string.h>
|
||||
|
||||
// Default constructor
|
||||
Magick::TypeMetric::TypeMetric ( void )
|
||||
{
|
||||
memset( &_typeMetric, 0, sizeof(_typeMetric));
|
||||
}
|
||||
|
||||
Magick::TypeMetric::~TypeMetric ( void )
|
||||
{
|
||||
// Nothing to do
|
||||
}
|
||||
|
||||
// Ascent, expressed in pixels
|
||||
double Magick::TypeMetric::ascent ( void ) const
|
||||
{
|
||||
return _typeMetric.ascent;
|
||||
}
|
||||
|
||||
// Descent, expressed in pixels
|
||||
double Magick::TypeMetric::descent ( void ) const
|
||||
{
|
||||
return _typeMetric.descent;
|
||||
}
|
||||
|
||||
// Text width, expressed in pixels
|
||||
double Magick::TypeMetric::textWidth ( void ) const
|
||||
{
|
||||
return _typeMetric.width;
|
||||
}
|
||||
|
||||
// Text height, expressed in pixels
|
||||
double Magick::TypeMetric::textHeight ( void ) const
|
||||
{
|
||||
return _typeMetric.height;
|
||||
}
|
||||
|
||||
// Maximum horizontal advance, expressed in pixels
|
||||
double Magick::TypeMetric::maxHorizontalAdvance ( void ) const
|
||||
{
|
||||
return _typeMetric.max_advance;
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
VERS_1.0 {
|
||||
global:
|
||||
*;
|
||||
};
|
|
@ -1,93 +0,0 @@
|
|||
// 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
|
@ -1,75 +0,0 @@
|
|||
// 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;
|
||||
}
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2003
|
||||
//
|
||||
// Test STL coalesceImages function
|
||||
//
|
||||
|
||||
#include <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;
|
||||
}
|
||||
|
|
@ -1,134 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 2001, 2002, 2003
|
||||
//
|
||||
// Test Magick::CoderInfo class and Magick::coderInfoList
|
||||
//
|
||||
|
||||
#include <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;
|
||||
}
|
|
@ -1,154 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003
|
||||
//
|
||||
// Test Magick::Color classes
|
||||
//
|
||||
|
||||
#include <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 },
|
||||
{ "green", 0,0.5019607843137256,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;
|
||||
}
|
|
@ -1,101 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 2003
|
||||
//
|
||||
// Test STL colorHistogram function
|
||||
//
|
||||
|
||||
#undef USE_VECTOR
|
||||
#define USE_MAP
|
||||
|
||||
#include <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;
|
||||
}
|
||||
|
|
@ -1,102 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003
|
||||
//
|
||||
// Tests for throwing exceptions
|
||||
//
|
||||
|
||||
#include <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;
|
||||
}
|
|
@ -1,140 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2002, 2003
|
||||
//
|
||||
// Test STL montageImages function
|
||||
//
|
||||
|
||||
#include <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;
|
||||
}
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2003
|
||||
//
|
||||
// Test STL morphImages function
|
||||
//
|
||||
|
||||
#include <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;
|
||||
}
|
||||
|
|
@ -1,255 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2003
|
||||
//
|
||||
// Test reading/writing BLOBs using Magick++
|
||||
//
|
||||
|
||||
#include <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;
|
||||
}
|
||||
|
||||
|
|
@ -1,112 +0,0 @@
|
|||
// This may look like C code, but it is really -*- C++ -*-
|
||||
//
|
||||
// Copyright Bob Friesenhahn, 1999, 2000, 2003
|
||||
//
|
||||
// Test STL readImages and writeImages functions
|
||||
//
|
||||
|
||||
#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 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++;
|
||||
}
|
||||
}
|
||||
|
||||
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.
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue