This is Magick++, the object-oriented C++ API to the ImageMagick image-processing library. Please report any problems to Bob Friesenhahn <bfriesen@simple.dallas.tx.us>.

Magick++ supports an object model which is inspired by PerlMagick. Magick++ should be a bit faster than PerlMagick since it is written in a compiled language which is not parsed at run-time. This makes it suitable for Web CGI programs. 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 STL. This support allows Magick++ to be used with the Standard Template Library (STL) so that the powerful containers available (e.g. vector and list)  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.

Please be aware that until Magick++ reaches version 1.0, some minor changes may be expected to implemented APIs based on operational experience.
 

Installation

Download the latest Magick++ library sources from http://www.cyberramp.net/~bfriesen/Magick++/.

General

In order to compile Magic++ you must have access to a standard C++ implementation and have ImageMagick installed (ftp://ftp.wizards.dupont.com/pub/ImageMagick/) . The author uses the egcs 1.1.2 version of 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 PCs should also work (project files are provided for Microsoft Visual C++ 6.0). If your compiler does not provide an implementation of the STL, you may be interested in trying a port of the SGI STL implementation to your compiler available from the STL Adaptation Page.

The compiler must support the following recent C++ standard features:

UNIX

To install the package under Unix, installation should be similar to

./configure [ --prefix=/prefix ]
make
make install

The configure script uses the compiler/linker flags it obtains from the installed 'Magick-config' script when performing the build. The library is currently named similar to 'libMagick++.a' and is installed under prefix/lib while the headers are installed under prefix/include.

To influence the options the configure script chooses, you may specify environment variables when running the script. For example, the command
 

CXX=CC CXXFLAGS=-O2 LIBS=-lposix ./configure


specifies additional options to the configure script.  The following table shows the available options.
 
Environment Variables That Effect Configure
Environment 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
LDFLAGS
Library paths (-L/somedir) to look for libraries. Systems that support the notion of a 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

Windows '9X, and Windows NT

To build using Visual C++, extract the contents of Magick++-version.zip (preserving sub-directories) in the ImageMagick distribution directory. This will create the directory Magick++-version containing the sub-directories 'demo', 'doc', 'lib', and 'tests'. Open the workspace file Magick++.dsw and build the project Magick++ in order to build the library. The library is output to the same directory as the ImageMagick libraries.
The available projects are:
Magick++
    the Magick++ library
attributes
    test setting image attributes
manipulate
    test manipulating images
button
    program to create a simple rectangular button with an annotation
demo
    program to demonstrate the image manipulation primitives
shapes
    program to demonstrate use of the drawing primitives
Test and demonstration programs are built in the directory which contains their sources.
 

Documentation

The available user-level classes are shown in the the following table. Follow the links to the class documentation.
 
Magick++ Classes
Magick::Color Color specification.
Magick::Drawable Drawable shape (for input to 'draw').
Magick::Exception C++ exception objects.
Magick::Geometry Geometry specification.
Magick::Image Image frame.  This is the primary object in Magick++.
Magick::Montage Montage options for montageImages().
Magick::STL STL algorithms and function objects for operating on containers of image frames.

Future Plans

At this early stage in development, there is no reason to artificially constrain imagination or ambitions. Therefore, I have laid out a challenging release plan for Magick++. What actually gets accomplished depends on the level of support from users and developers. Volunteers are needed. In particular, work on the CORBA IDL-base API may proceed in parallel with other development. The following is the tentative development and release plan.

1.0 API for operating on individual images and STL containers of images

This version supports all ImageMagick API operations which operate on a single image as well as providing STL container support for operating on multiple images (on any STL compatable container which supports a forward input iterator).
STL is used as the framework in which to store images. Template functions (e.g. montage)  are provided to build the image lists required by ImageMagick and then invoke the list-oriented ImageMagick API. STL is quite powerful yet easy to use. At this stage Magick++ has matched what is currently available/possible using the PerlMagick API due to leveraging the power of STL.
2.0 CORBA IDL based client API with server implementation for executing image processing operations on a remote (or local) computer.
This version provides a standard CORBA IDL-based API. A C++ wrapper API compatable with that developed for release 2.0 is available for use by clients. Client wrappers may also be developed for other languages (e.g. Java). A CORBA server is provided which is implemented in terms of the Magick++ API in order to satisfy client requests (which may run a different operating system than the server) . An implementation repository and object activation is used to instantiate the server upon demand to ensure that server machines are not unnecessarily burdended. The CORBA ORB employed is TAO developed by Doug Schmidt (and friends).
3.0 Integration of IDL-based API with an existing freeware work-queing system in order to load-share image processing tasks across a large number of machines.
This version is the culmination of the effort. By intelligently spreading work over many machines, the performance of ImageMagick is magnified. In order for this to be a success algorithms for efficient transfer of image data must be developed. Algorithms that take into account processor afinity and the CPU vs I/O tradeoff for the task to be performed must be developed. At this point in time, the queuing system to be employed has not been identified.