#ifndef Magick_STL_header
#define Magick_STL_header
#include "Magick++/Include.h"
#include <algorithm>
#include <functional>
#include <iterator>
#include <map>
#include <utility>
#include "Magick++/CoderInfo.h"
#include "Magick++/Drawable.h"
#include "Magick++/Exception.h"
#include "Magick++/Montage.h"
namespace Magick
{
class MagickPPExport adaptiveBlurImage : public std::unary_function<Image&,void>
{
public:
adaptiveBlurImage( const double radius_ = 1, const double sigma_ = 0.5 );
void operator()( Image &image_ ) const;
private:
double _radius;
double _sigma;
};
class MagickPPExport adaptiveThresholdImage : public std::unary_function<Image&,void>
{
public:
adaptiveThresholdImage( const size_t width_,
const size_t height_,
const ::ssize_t offset_ = 0 );
void operator()( Image &image_ ) const;
private:
size_t _width;
size_t _height;
::ssize_t _offset;
};
class MagickPPExport addNoiseImage : public std::unary_function<Image&,void>
{
public:
addNoiseImage ( NoiseType noiseType_ );
void operator()( Image &image_ ) const;
private:
NoiseType _noiseType;
};
class MagickPPExport affineTransformImage : public std::unary_function<Image&,void>
{
public:
affineTransformImage( const DrawableAffine &affine_ );
void operator()( Image &image_ ) const;
private:
DrawableAffine _affine;
};
class MagickPPExport annotateImage : public std::unary_function<Image&,void>
{
public:
annotateImage ( const std::string &text_,
const Geometry &geometry_ );
annotateImage ( const std::string &text_,
const Geometry &geometry_,
const GravityType gravity_ );
annotateImage ( const std::string &text_,
const Geometry &geometry_,
const GravityType gravity_,
const double degrees_ );
annotateImage ( const std::string &text_,
const GravityType gravity_ );
void operator()( Image &image_ ) const;
private:
annotateImage(const annotateImage&);
annotateImage& operator=(const annotateImage&);
const std::string _text;
const Geometry _geometry;
const GravityType _gravity;
const double _degrees;
};
class MagickPPExport blurImage : public std::unary_function<Image&,void>
{
public:
blurImage( const double radius_ = 1, const double sigma_ = 0.5 );
void operator()( Image &image_ ) const;
private:
double _radius;
double _sigma;
};
class MagickPPExport borderImage : public std::unary_function<Image&,void>
{
public:
borderImage( const Geometry &geometry_ = borderGeometryDefault );
void operator()( Image &image_ ) const;
private:
Geometry _geometry;
};
class MagickPPExport channelImage : public std::unary_function<Image&,void>
{
public:
channelImage( const ChannelType channel_ );
void operator()( Image &image_ ) const;
private:
ChannelType _channel;
};
class MagickPPExport charcoalImage : public std::unary_function<Image&,void>
{
public:
charcoalImage( const double radius_ = 1, const double sigma_ = 0.5 );
void operator()( Image &image_ ) const;
private:
double _radius;
double _sigma;
};
class MagickPPExport chopImage : public std::unary_function<Image&,void>
{
public:
chopImage( const Geometry &geometry_ );
void operator()( Image &image_ ) const;
private:
Geometry _geometry;
};
class MagickPPExport cdlImage : public std::unary_function<Image&,void>
{
public:
cdlImage( const std::string &cdl_ );
void operator()( Image &image_ ) const;
private:
std::string _cdl;
};
class MagickPPExport colorizeImage : public std::unary_function<Image&,void>
{
public:
colorizeImage( const unsigned int opacityRed_,
const unsigned int opacityGreen_,
const unsigned int opacityBlue_,
const Color &penColor_ );
colorizeImage( const unsigned int opacity_,
const Color &penColor_ );
void operator()( Image &image_ ) const;
private:
unsigned int _opacityRed;
unsigned int _opacityGreen;
unsigned int _opacityBlue;
Color _penColor;
};
class MagickPPExport colorMatrixImage : public std::unary_function<Image&,void>
{
public:
colorMatrixImage( const size_t order_,
const double *color_matrix_ );
void operator()( Image &image_ ) const;
private:
size_t _order;
const double *_color_matrix;
};
class MagickPPExport colorSpaceImage : public std::unary_function<Image&,void>
{
public:
colorSpaceImage( ColorspaceType colorSpace_ );
void operator()( Image &image_ ) const;
private:
ColorspaceType _colorSpace;
};
class MagickPPExport commentImage : public std::unary_function<Image&,void>
{
public:
commentImage( const std::string &comment_ );
void operator()( Image &image_ ) const;
private:
std::string _comment;
};
class MagickPPExport compositeImage : public std::unary_function<Image&,void>
{
public:
compositeImage( const Image &compositeImage_,
::ssize_t xOffset_,
::ssize_t yOffset_,
CompositeOperator compose_ = InCompositeOp );
compositeImage( const Image &compositeImage_,
const Geometry &offset_,
CompositeOperator compose_ = InCompositeOp );
void operator()( Image &image_ ) const;
private:
Image _compositeImage;
::ssize_t _xOffset;
::ssize_t _yOffset;
CompositeOperator _compose;
};
class MagickPPExport contrastImage : public std::unary_function<Image&,void>
{
public:
contrastImage( const size_t sharpen_ );
void operator()( Image &image_ ) const;
private:
size_t _sharpen;
};
class MagickPPExport cropImage : public std::unary_function<Image&,void>
{
public:
cropImage( const Geometry &geometry_ );
void operator()( Image &image_ ) const;
private:
Geometry _geometry;
};
class MagickPPExport cycleColormapImage : public std::unary_function<Image&,void>
{
public:
cycleColormapImage( const ::ssize_t amount_ );
void operator()( Image &image_ ) const;
private:
::ssize_t _amount;
};
class MagickPPExport despeckleImage : public std::unary_function<Image&,void>
{
public:
despeckleImage( void );
void operator()( Image &image_ ) const;
private:
};
class MagickPPExport distortImage : public std::unary_function<Image&,void>
{
public:
distortImage( const Magick::DistortImageMethod method_,
const size_t number_arguments_,
const double *arguments_,
const bool bestfit_ );
distortImage( const Magick::DistortImageMethod method_,
const size_t number_arguments_,
const double *arguments_ );
void operator()( Image &image_ ) const;
private:
DistortImageMethod _method;
size_t _number_arguments;
const double *_arguments;
bool _bestfit;
};
class MagickPPExport drawImage : public std::unary_function<Image&,void>
{
public:
drawImage( const Drawable &drawable_ );
drawImage( const DrawableList &drawable_ );
void operator()( Image &image_ ) const;
private:
DrawableList _drawableList;
};
class MagickPPExport edgeImage : public std::unary_function<Image&,void>
{
public:
edgeImage( const double radius_ = 0.0 );
void operator()( Image &image_ ) const;
private:
double _radius;
};
class MagickPPExport embossImage : public std::unary_function<Image&,void>
{
public:
embossImage( void );
embossImage( const double radius_, const double sigma_ );
void operator()( Image &image_ ) const;
private:
double _radius;
double _sigma;
};
class MagickPPExport enhanceImage : public std::unary_function<Image&,void>
{
public:
enhanceImage( void );
void operator()( Image &image_ ) const;
private:
};
class MagickPPExport equalizeImage : public std::unary_function<Image&,void>
{
public:
equalizeImage( void );
void operator()( Image &image_ ) const;
private:
};
class MagickPPExport fillColorImage : public std::unary_function<Image&,void>
{
public:
fillColorImage( const Color &fillColor_ );
void operator()( Image &image_ ) const;
private:
Color _fillColor;
};
class MagickPPExport flipImage : public std::unary_function<Image&,void>
{
public:
flipImage( void );
void operator()( Image &image_ ) const;
private:
};
class MagickPPExport floodFillColorImage : public std::unary_function<Image&,void>
{
public:
floodFillColorImage( const ::ssize_t x_,
const ::ssize_t y_,
const Color &fillColor_ );
floodFillColorImage( const Geometry &point_,
const Color &fillColor_ );
floodFillColorImage( const ::ssize_t x_,
const ::ssize_t y_,
const Color &fillColor_,
const Color &borderColor_ );
floodFillColorImage( const Geometry &point_,
const Color &fillColor_,
const Color &borderColor_ );
void operator()( Image &image_ ) const;
private:
::ssize_t _x;
::ssize_t _y;
Color _fillColor;
Color _borderColor;
};
class MagickPPExport floodFillTextureImage : public std::unary_function<Image&,void>
{
public:
floodFillTextureImage( const ::ssize_t x_,
const ::ssize_t y_,
const Image &texture_ );
floodFillTextureImage( const Geometry &point_,
const Image &texture_ );
floodFillTextureImage( const ::ssize_t x_,
const ::ssize_t y_,
const Image &texture_,
const Color &borderColor_ );
floodFillTextureImage( const Geometry &point_,
const Image &texture_,
const Color &borderColor_ );
void operator()( Image &image_ ) const;
private:
::ssize_t _x;
::ssize_t _y;
Image _texture;
Color _borderColor;
};
class MagickPPExport flopImage : public std::unary_function<Image&,void>
{
public:
flopImage( void );
void operator()( Image &image_ ) const;
private:
};
class MagickPPExport frameImage : public std::unary_function<Image&,void>
{
public:
frameImage( const Geometry &geometry_ = frameGeometryDefault );
frameImage( const size_t width_, const size_t height_,
const ::ssize_t innerBevel_ = 6, const ::ssize_t outerBevel_ = 6 );
void operator()( Image &image_ ) const;
private:
size_t _width;
size_t _height;
::ssize_t _outerBevel;
::ssize_t _innerBevel;
};
class MagickPPExport gammaImage : public std::unary_function<Image&,void>
{
public:
gammaImage( const double gamma_ );
gammaImage ( const double gammaRed_,
const double gammaGreen_,
const double gammaBlue_ );
void operator()( Image &image_ ) const;
private:
double _gammaRed;
double _gammaGreen;
double _gammaBlue;
};
class MagickPPExport gaussianBlurImage : public std::unary_function<Image&,void>
{
public:
gaussianBlurImage( const double width_, const double sigma_ );
void operator()( Image &image_ ) const;
private:
double _width;
double _sigma;
};
class MagickPPExport haldClutImage : public std::unary_function<Image&,void>
{
public:
haldClutImage( const Image &haldClutImage_ );
void operator()( Image &image_ ) const;
private:
Image _haldClutImage;
};
class MagickPPExport implodeImage : public std::unary_function<Image&,void>
{
public:
implodeImage( const double factor_ = 50 );
void operator()( Image &image_ ) const;
private:
double _factor;
};
class MagickPPExport inverseFourierTransformImage : public std::unary_function<Image&,void>
{
public:
inverseFourierTransformImage( const Image &phaseImage_ );
void operator()( Image &image_ ) const;
private:
Image _phaseImage;
};
class MagickPPExport isValidImage : public std::unary_function<Image&,void>
{
public:
isValidImage( const bool isValid_ );
void operator()( Image &image_ ) const;
private:
bool _isValid;
};
class MagickPPExport labelImage : public std::unary_function<Image&,void>
{
public:
labelImage( const std::string &label_ );
void operator()( Image &image_ ) const;
private:
std::string _label;
};
class MagickPPExport levelImage : public std::unary_function<Image&,void>
{
public:
levelImage( const double black_point,
const double white_point,
const double mid_point=1.0 );
void operator()( Image &image_ ) const;
private:
double _black_point;
double _white_point;
double _mid_point;
};
class MagickPPExport levelChannelImage : public std::unary_function<Image&,void>
{
public:
levelChannelImage( const Magick::ChannelType channel,
const double black_point,
const double white_point,
const double mid_point=1.0 );
void operator()( Image &image_ ) const;
private:
Magick::ChannelType _channel;
double _black_point;
double _white_point;
double _mid_point;
};
class MagickPPExport magnifyImage : public std::unary_function<Image&,void>
{
public:
magnifyImage( void );
void operator()( Image &image_ ) const;
private:
};
class MagickPPExport mapImage : public std::unary_function<Image&,void>
{
public:
mapImage( const Image &mapImage_ ,
const bool dither_ = false );
void operator()( Image &image_ ) const;
private:
Image _mapImage;
bool _dither;
};
class MagickPPExport matteFloodfillImage : public std::unary_function<Image&,void>
{
public:
matteFloodfillImage( const Color &target_ ,
const unsigned int matte_,
const ::ssize_t x_, const ::ssize_t y_,
const PaintMethod method_ );
void operator()( Image &image_ ) const;
private:
Color _target;
unsigned int _matte;
::ssize_t _x;
::ssize_t _y;
PaintMethod _method;
};
class MagickPPExport medianFilterImage : public std::unary_function<Image&,void>
{
public:
medianFilterImage( const double radius_ = 0.0 );
void operator()( Image &image_ ) const;
private:
double _radius;
};
class MagickPPExport mergeLayersImage : public
std::unary_function<Image&,void>
{
public:
mergeLayersImage ( ImageLayerMethod layerMethod_ );
void operator()( Image &image_ ) const;
private:
ImageLayerMethod _layerMethod;
};
class MagickPPExport minifyImage : public std::unary_function<Image&,void>
{
public:
minifyImage( void );
void operator()( Image &image_ ) const;
private:
};
class MagickPPExport modulateImage : public std::unary_function<Image&,void>
{
public:
modulateImage( const double brightness_,
const double saturation_,
const double hue_ );
void operator()( Image &image_ ) const;
private:
double _brightness;
double _saturation;
double _hue;
};
class MagickPPExport negateImage : public std::unary_function<Image&,void>
{
public:
negateImage( const bool grayscale_ = false );
void operator()( Image &image_ ) const;
private:
bool _grayscale;
};
class MagickPPExport normalizeImage : public std::unary_function<Image&,void>
{
public:
normalizeImage( void );
void operator()( Image &image_ ) const;
private:
};
class MagickPPExport oilPaintImage : public std::unary_function<Image&,void>
{
public:
oilPaintImage( const double radius_ = 3 );
void operator()( Image &image_ ) const;
private:
double _radius;
};
class MagickPPExport opacityImage : public std::unary_function<Image&,void>
{
public:
opacityImage( const unsigned int opacity_ );
void operator()( Image &image_ ) const;
private:
unsigned int _opacity;
};
class MagickPPExport opaqueImage : public std::unary_function<Image&,void>
{
public:
opaqueImage( const Color &opaqueColor_,
const Color &penColor_ );
void operator()( Image &image_ ) const;
private:
Color _opaqueColor;
Color _penColor;
};
class MagickPPExport quantizeImage : public std::unary_function<Image&,void>
{
public:
quantizeImage( const bool measureError_ = false );
void operator()( Image &image_ ) const;
private:
bool _measureError;
};
class MagickPPExport raiseImage : public std::unary_function<Image&,void>
{
public:
raiseImage( const Geometry &geometry_ = raiseGeometryDefault,
const bool raisedFlag_ = false );
void operator()( Image &image_ ) const;
private:
Geometry _geometry;
bool _raisedFlag;
};
class MagickPPExport ReadOptions
{
public:
ReadOptions(void);
ReadOptions(const ReadOptions& options_);
~ReadOptions();
void density(const Geometry &geomery_);
Geometry density(void) const;
void depth(size_t depth_);
size_t depth(void) const;
void quiet(const bool quiet_);
bool quiet(void) const;
void size(const Geometry &geometry_);
Geometry size(void) const;
MagickCore::ImageInfo *imageInfo(void);
private:
ReadOptions& operator=(const ReadOptions&);
MagickCore::ImageInfo *_imageInfo;
bool _quiet;
};
class MagickPPExport reduceNoiseImage : public std::unary_function<Image&,void>
{
public:
reduceNoiseImage( void );
reduceNoiseImage (const size_t order_ );
void operator()( Image &image_ ) const;
private:
size_t _order;
};
class MagickPPExport resizeImage : public std::unary_function<Image&,void>
{
public:
resizeImage( const Geometry &geometry_ );
void operator()( Image &image_ ) const;
private:
Geometry _geometry;
};
class MagickPPExport rollImage : public std::unary_function<Image&,void>
{
public:
rollImage( const Geometry &roll_ );
rollImage( const ::ssize_t columns_, const ::ssize_t rows_ );
void operator()( Image &image_ ) const;
private:
size_t _columns;
size_t _rows;
};
class MagickPPExport rotateImage : public std::unary_function<Image&,void>
{
public:
rotateImage( const double degrees_ );
void operator()( Image &image_ ) const;
private:
double _degrees;
};
class MagickPPExport sampleImage : public std::unary_function<Image&,void>
{
public:
sampleImage( const Geometry &geometry_ );
void operator()( Image &image_ ) const;
private:
Geometry _geometry;
};
class MagickPPExport scaleImage : public std::unary_function<Image&,void>
{
public:
scaleImage( const Geometry &geometry_ );
void operator()( Image &image_ ) const;
private:
Geometry _geometry;
};
class MagickPPExport segmentImage : public std::unary_function<Image&,void>
{
public:
segmentImage( const double clusterThreshold_ = 1.0,
const double smoothingThreshold_ = 1.5 );
void operator()( Image &image_ ) const;
private:
double _clusterThreshold;
double _smoothingThreshold;
};
class MagickPPExport shadeImage : public std::unary_function<Image&,void>
{
public:
shadeImage( const double azimuth_ = 30,
const double elevation_ = 30,
const bool colorShading_ = false );
void operator()( Image &image_ ) const;
private:
double _azimuth;
double _elevation;
bool _colorShading;
};
class MagickPPExport shadowImage : public std::unary_function<Image&,void>
{
public:
shadowImage( const double percent_opacity_ = 80, const double sigma_ = 0.5,
const ssize_t x_ = 5, const ssize_t y_ = 5 );
void operator()( Image &image_ ) const;
private:
double _percent_opacity;
double _sigma;
ssize_t _x;
ssize_t _y;
};
class MagickPPExport sharpenImage : public std::unary_function<Image&,void>
{
public:
sharpenImage( const double radius_ = 1, const double sigma_ = 0.5 );
void operator()( Image &image_ ) const;
private:
double _radius;
double _sigma;
};
class MagickPPExport shaveImage : public std::unary_function<Image&,void>
{
public:
shaveImage( const Geometry &geometry_ );
void operator()( Image &image_ ) const;
private:
Geometry _geometry;
};
class MagickPPExport shearImage : public std::unary_function<Image&,void>
{
public:
shearImage( const double xShearAngle_,
const double yShearAngle_ );
void operator()( Image &image_ ) const;
private:
double _xShearAngle;
double _yShearAngle;
};
class MagickPPExport solarizeImage : public std::unary_function<Image&,void>
{
public:
solarizeImage( const double factor_ );
void operator()( Image &image_ ) const;
private:
double _factor;
};
class MagickPPExport spliceImage : public std::unary_function<Image&,void>
{
public:
spliceImage( const Geometry &geometry_ );
void operator()( Image &image_ ) const;
private:
Geometry _geometry;
};
class MagickPPExport spreadImage : public std::unary_function<Image&,void>
{
public:
spreadImage( const size_t amount_ = 3 );
void operator()( Image &image_ ) const;
private:
size_t _amount;
};
class MagickPPExport steganoImage : public std::unary_function<Image&,void>
{
public:
steganoImage( const Image &waterMark_ );
void operator()( Image &image_ ) const;
private:
Image _waterMark;
};
class MagickPPExport stereoImage : public std::unary_function<Image&,void>
{
public:
stereoImage( const Image &rightImage_ );
void operator()( Image &image_ ) const;
private:
Image _rightImage;
};
class MagickPPExport strokeColorImage : public std::unary_function<Image&,void>
{
public:
strokeColorImage( const Color &strokeColor_ );
void operator()( Image &image_ ) const;
private:
Color _strokeColor;
};
class MagickPPExport swirlImage : public std::unary_function<Image&,void>
{
public:
swirlImage( const double degrees_ );
void operator()( Image &image_ ) const;
private:
double _degrees;
};
class MagickPPExport textureImage : public std::unary_function<Image&,void>
{
public:
textureImage( const Image &texture_ );
void operator()( Image &image_ ) const;
private:
Image _texture;
};
class MagickPPExport thresholdImage : public std::unary_function<Image&,void>
{
public:
thresholdImage( const double threshold_ );
void operator()( Image &image_ ) const;
private:
double _threshold;
};
class MagickPPExport transformImage : public std::unary_function<Image&,void>
{
public:
transformImage( const Geometry &imageGeometry_ );
transformImage( const Geometry &imageGeometry_,
const Geometry &cropGeometry_ );
void operator()( Image &image_ ) const;
private:
Geometry _imageGeometry;
Geometry _cropGeometry;
};
class MagickPPExport transparentImage : public std::unary_function<Image&,void>
{
public:
transparentImage( const Color& color_ );
void operator()( Image &image_ ) const;
private:
Color _color;
};
class MagickPPExport trimImage : public std::unary_function<Image&,void>
{
public:
trimImage( void );
void operator()( Image &image_ ) const;
private:
};
class MagickPPExport waveImage : public std::unary_function<Image&,void>
{
public:
waveImage( const double amplitude_ = 25.0,
const double wavelength_ = 150.0 );
void operator()( Image &image_ ) const;
private:
double _amplitude;
double _wavelength;
};
class MagickPPExport zoomImage : public std::unary_function<Image&,void>
{
public:
zoomImage( const Geometry &geometry_ );
void operator()( Image &image_ ) const;
private:
Geometry _geometry;
};
class MagickPPExport antiAliasImage : public std::unary_function<Image&,void>
{
public:
antiAliasImage( const bool flag_ );
void operator()( Image &image_ ) const;
private:
bool _flag;
};
class MagickPPExport adjoinImage : public std::unary_function<Image&,void>
{
public:
adjoinImage( const bool flag_ );
void operator()( Image &image_ ) const;
private:
bool _flag;
};
class MagickPPExport animationDelayImage : public std::unary_function<Image&,void>
{
public:
animationDelayImage( const size_t delay_ );
void operator()( Image &image_ ) const;
private:
size_t _delay;
};
class MagickPPExport animationIterationsImage : public std::unary_function<Image&,void>
{
public:
animationIterationsImage( const size_t iterations_ );
void operator()( Image &image_ ) const;
private:
size_t _iterations;
};
class MagickPPExport backgroundColorImage : public std::unary_function<Image&,void>
{
public:
backgroundColorImage( const Color &color_ );
void operator()( Image &image_ ) const;
private:
Color _color;
};
class MagickPPExport backgroundTextureImage : public std::unary_function<Image&,void>
{
public:
backgroundTextureImage( const std::string &backgroundTexture_ );
void operator()( Image &image_ ) const;
private:
std::string _backgroundTexture;
};
class MagickPPExport borderColorImage : public std::unary_function<Image&,void>
{
public:
borderColorImage( const Color &color_ );
void operator()( Image &image_ ) const;
private:
Color _color;
};
class MagickPPExport boxColorImage : public std::unary_function<Image&,void>
{
public:
boxColorImage( const Color &boxColor_ );
void operator()( Image &image_ ) const;
private:
Color _boxColor;
};
class MagickPPExport chromaBluePrimaryImage : public std::unary_function<Image&,void>
{
public:
chromaBluePrimaryImage( const double x_, const double y_ );
void operator()( Image &image_ ) const;
private:
double _x;
double _y;
};
class MagickPPExport chromaGreenPrimaryImage : public std::unary_function<Image&,void>
{
public:
chromaGreenPrimaryImage( const double x_, const double y_ );
void operator()( Image &image_ ) const;
private:
double _x;
double _y;
};
class MagickPPExport chromaRedPrimaryImage : public std::unary_function<Image&,void>
{
public:
chromaRedPrimaryImage( const double x_, const double y_ );
void operator()( Image &image_ ) const;
private:
double _x;
double _y;
};
class MagickPPExport chromaWhitePointImage : public std::unary_function<Image&,void>
{
public:
chromaWhitePointImage( const double x_, const double y_ );
void operator()( Image &image_ ) const;
private:
double _x;
double _y;
};
class MagickPPExport colorFuzzImage : public std::unary_function<Image&,void>
{
public:
colorFuzzImage( const double fuzz_ );
void operator()( Image &image_ ) const;
private:
double _fuzz;
};
class MagickPPExport colorMapImage : public std::unary_function<Image&,void>
{
public:
colorMapImage( const size_t index_, const Color &color_ );
void operator()( Image &image_ ) const;
private:
size_t _index;
Color _color;
};
class MagickPPExport composeImage : public std::unary_function<Image&,void>
{
public:
composeImage( const CompositeOperator compose_ );
void operator()( Image &image_ ) const;
private:
CompositeOperator _compose;
};
class MagickPPExport compressTypeImage : public std::unary_function<Image&,void>
{
public:
compressTypeImage( const CompressionType compressType_ );
void operator()( Image &image_ ) const;
private:
CompressionType _compressType;
};
class MagickPPExport densityImage : public std::unary_function<Image&,void>
{
public:
densityImage( const Geometry &geomery_ );
void operator()( Image &image_ ) const;
private:
Geometry _geomery;
};
class MagickPPExport depthImage : public std::unary_function<Image&,void>
{
public:
depthImage( const size_t depth_ );
void operator()( Image &image_ ) const;
private:
size_t _depth;
};
class MagickPPExport endianImage : public std::unary_function<Image&,void>
{
public:
endianImage( const EndianType endian_ );
void operator()( Image &image_ ) const;
private:
EndianType _endian;
};
class MagickPPExport fileNameImage : public std::unary_function<Image&,void>
{
public:
fileNameImage( const std::string &fileName_ );
void operator()( Image &image_ ) const;
private:
std::string _fileName;
};
class MagickPPExport filterTypeImage : public std::unary_function<Image&,void>
{
public:
filterTypeImage( const FilterTypes filterType_ );
void operator()( Image &image_ ) const;
private:
FilterTypes _filterType;
};
class MagickPPExport fontImage : public std::unary_function<Image&,void>
{
public:
fontImage( const std::string &font_ );
void operator()( Image &image_ ) const;
private:
std::string _font;
};
class MagickPPExport fontPointsizeImage : public std::unary_function<Image&,void>
{
public:
fontPointsizeImage( const size_t pointsize_ );
void operator()( Image &image_ ) const;
private:
size_t _pointsize;
};
class MagickPPExport gifDisposeMethodImage : public std::unary_function<Image&,void>
{
public:
gifDisposeMethodImage( const size_t disposeMethod_ );
void operator()( Image &image_ ) const;
private:
size_t _disposeMethod;
};
class MagickPPExport interlaceTypeImage : public std::unary_function<Image&,void>
{
public:
interlaceTypeImage( const InterlaceType interlace_ );
void operator()( Image &image_ ) const;
private:
InterlaceType _interlace;
};
class MagickPPExport lineWidthImage : public std::unary_function<Image&,void>
{
public:
lineWidthImage( const double lineWidth_ );
void operator()( Image &image_ ) const;
private:
double _lineWidth;
};
class MagickPPExport magickImage : public std::unary_function<Image&,void>
{
public:
magickImage( const std::string &magick_ );
void operator()( Image &image_ ) const;
private:
std::string _magick;
};
class MagickPPExport matteImage : public std::unary_function<Image&,void>
{
public:
matteImage( const bool matteFlag_ );
void operator()( Image &image_ ) const;
private:
bool _matteFlag;
};
class MagickPPExport matteColorImage : public std::unary_function<Image&,void>
{
public:
matteColorImage( const Color &matteColor_ );
void operator()( Image &image_ ) const;
private:
Color _matteColor;
};
class MagickPPExport monochromeImage : public std::unary_function<Image&,void>
{
public:
monochromeImage( const bool monochromeFlag_ );
void operator()( Image &image_ ) const;
private:
bool _monochromeFlag;
};
class MagickPPExport penColorImage : public std::unary_function<Image&,void>
{
public:
penColorImage( const Color &penColor_ );
void operator()( Image &image_ ) const;
private:
Color _penColor;
};
class MagickPPExport penTextureImage : public std::unary_function<Image&,void>
{
public:
penTextureImage( const Image &penTexture_ );
void operator()( Image &image_ ) const;
private:
Image _penTexture;
};
class MagickPPExport pixelColorImage : public std::unary_function<Image&,void>
{
public:
pixelColorImage( const ::ssize_t x_,
const ::ssize_t y_,
const Color &color_);
void operator()( Image &image_ ) const;
private:
::ssize_t _x;
::ssize_t _y;
Color _color;
};
class MagickPPExport pageImage : public std::unary_function<Image&,void>
{
public:
pageImage( const Geometry &pageSize_ );
void operator()( Image &image_ ) const;
private:
Geometry _pageSize;
};
class MagickPPExport qualityImage : public std::unary_function<Image&,void>
{
public:
qualityImage( const size_t quality_ );
void operator()( Image &image_ ) const;
private:
size_t _quality;
};
class MagickPPExport quantizeColorsImage : public std::unary_function<Image&,void>
{
public:
quantizeColorsImage( const size_t colors_ );
void operator()( Image &image_ ) const;
private:
size_t _colors;
};
class MagickPPExport quantizeColorSpaceImage : public std::unary_function<Image&,void>
{
public:
quantizeColorSpaceImage( const ColorspaceType colorSpace_ );
void operator()( Image &image_ ) const;
private:
ColorspaceType _colorSpace;
};
class MagickPPExport quantizeDitherImage : public std::unary_function<Image&,void>
{
public:
quantizeDitherImage( const bool ditherFlag_ );
void operator()( Image &image_ ) const;
private:
bool _ditherFlag;
};
class MagickPPExport quantizeTreeDepthImage : public std::unary_function<Image&,void>
{
public:
quantizeTreeDepthImage( const size_t treeDepth_ );
void operator()( Image &image_ ) const;
private:
size_t _treeDepth;
};
class MagickPPExport renderingIntentImage : public std::unary_function<Image&,void>
{
public:
renderingIntentImage( const RenderingIntent renderingIntent_ );
void operator()( Image &image_ ) const;
private:
RenderingIntent _renderingIntent;
};
class MagickPPExport resolutionUnitsImage : public std::unary_function<Image&,void>
{
public:
resolutionUnitsImage( const ResolutionType resolutionUnits_ );
void operator()( Image &image_ ) const;
private:
ResolutionType _resolutionUnits;
};
class MagickPPExport sceneImage : public std::unary_function<Image&,void>
{
public:
sceneImage( const size_t scene_ );
void operator()( Image &image_ ) const;
private:
size_t _scene;
};
class MagickPPExport sigmoidalContrastImage : public std::unary_function<Image&,void>
{
public:
sigmoidalContrastImage( const size_t sharpen_,
const double contrast,
const double midpoint = QuantumRange / 2.0 );
void operator()( Image &image_ ) const;
private:
size_t _sharpen;
double contrast;
double midpoint;
};
class MagickPPExport sizeImage : public std::unary_function<Image&,void>
{
public:
sizeImage( const Geometry &geometry_ );
void operator()( Image &image_ ) const;
private:
Geometry _geometry;
};
class MagickPPExport stripImage : public std::unary_function<Image&,void>
{
public:
stripImage( void );
void operator()( Image &image_ ) const;
private:
};
class MagickPPExport subImageImage : public std::unary_function<Image&,void>
{
public:
subImageImage( const size_t subImage_ );
void operator()( Image &image_ ) const;
private:
size_t _subImage;
};
class MagickPPExport subRangeImage : public std::unary_function<Image&,void>
{
public:
subRangeImage( const size_t subRange_ );
void operator()( Image &image_ ) const;
private:
size_t _subRange;
};
class MagickPPExport tileNameImage : public std::unary_function<Image&,void>
{
public:
tileNameImage( const std::string &tileName_ );
void operator()( Image &image_ ) const;
private:
std::string _tileName;
};
class MagickPPExport typeImage : public std::unary_function<Image&,void>
{
public:
typeImage( const ImageType type_ );
void operator()( Image &image_ ) const;
private:
Magick::ImageType _type;
};
class MagickPPExport verboseImage : public std::unary_function<Image&,void>
{
public:
verboseImage( const bool verbose_ );
void operator()( Image &image_ ) const;
private:
bool _verbose;
};
class MagickPPExport viewImage : public std::unary_function<Image&,void>
{
public:
viewImage( const std::string &view_ );
void operator()( Image &image_ ) const;
private:
std::string _view;
};
class MagickPPExport x11DisplayImage : public std::unary_function<Image&,void>
{
public:
x11DisplayImage( const std::string &display_ );
void operator()( Image &image_ ) const;
private:
std::string _display;
};
template <class InputIterator>
void linkImages( InputIterator first_,
InputIterator last_ ) {
MagickCore::Image* previous = 0;
::ssize_t scene = 0;
for ( InputIterator iter = first_; iter != last_; ++iter )
{
iter->modifyImage();
MagickCore::Image* current = iter->image();
current->previous = previous;
current->next = 0;
current->scene = scene++;
if ( previous != 0)
previous->next = current;
previous = current;
}
}
template <class InputIterator>
void unlinkImages( InputIterator first_,
InputIterator last_ ) {
for( InputIterator iter = first_; iter != last_; ++iter )
{
MagickCore::Image* image = iter->image();
image->previous = 0;
image->next = 0;
}
}
template <class Container>
void insertImages( Container *sequence_,
MagickCore::Image* images_ ) {
MagickCore::Image *image = images_;
if ( image )
{
do
{
MagickCore::Image* next_image = image->next;
image->next = 0;
if (next_image != 0)
next_image->previous=0;
sequence_->push_back( Magick::Image( image ) );
image=next_image;
} while( image );
return;
}
}
template <class InputIterator>
void animateImages( InputIterator first_,
InputIterator last_ ) {
GetPPException;
linkImages( first_, last_ );
MagickCore::AnimateImages( first_->imageInfo(), first_->image() );
MagickCore::GetImageException( first_->image(), exceptionInfo );
unlinkImages( first_, last_ );
ThrowPPException(first_->quiet());
}
template <class InputIterator>
void appendImages( Image *appendedImage_,
InputIterator first_,
InputIterator last_,
bool stack_ = false) {
GetPPException;
linkImages( first_, last_ );
MagickCore::Image* image = MagickCore::AppendImages( first_->image(),
(MagickBooleanType) stack_,
exceptionInfo );
unlinkImages( first_, last_ );
appendedImage_->replaceImage( image );
ThrowPPException(appendedImage_->quiet());
}
template <class Container>
void artifactNames(Container *names_,const Image* image_)
{
char*
name;
names_->clear();
MagickCore::ResetImageArtifactIterator(image_->constImage());
name=MagickCore::GetNextImageArtifact(image_->constImage());
while (name != (char *) NULL)
{
names_->push_back(std::string(name));
name=MagickCore::GetNextImageArtifact(image_->constImage());
}
}
template <class Container>
void attributeNames(Container *names_,const Image* image_)
{
char*
name;
names_->clear();
MagickCore::ResetImagePropertyIterator(image_->constImage());
name=MagickCore::GetNextImageProperty(image_->constImage());
while (name != (char *) NULL)
{
names_->push_back(std::string(name));
name=MagickCore::GetNextImageProperty(image_->constImage());
}
}
template <class InputIterator>
void averageImages( Image *averagedImage_,
InputIterator first_,
InputIterator last_ ) {
GetPPException;
linkImages( first_, last_ );
MagickCore::Image* image = MagickCore::EvaluateImages( first_->image(),
MagickCore::MeanEvaluateOperator, exceptionInfo );
unlinkImages( first_, last_ );
averagedImage_->replaceImage( image );
ThrowPPException(averagedImage_->quiet());
}
template <class InputIterator, class Container >
void coalesceImages( Container *coalescedImages_,
InputIterator first_,
InputIterator last_ ) {
GetPPException;
linkImages( first_, last_ );
MagickCore::Image* images = MagickCore::CoalesceImages( first_->image(),
exceptionInfo);
unlinkImages( first_, last_ );
coalescedImages_->clear();
insertImages( coalescedImages_, images );
ThrowPPException(first_->quiet());
}
template <class Container >
void coderInfoList( Container *container_,
CoderInfo::MatchType isReadable_ = CoderInfo::AnyMatch,
CoderInfo::MatchType isWritable_ = CoderInfo::AnyMatch,
CoderInfo::MatchType isMultiFrame_ = CoderInfo::AnyMatch
) {
size_t number_formats;
GetPPException;
char **coder_list =
MagickCore::GetMagickList( "*", &number_formats, exceptionInfo );
if( !coder_list )
{
throwException(exceptionInfo);
throwExceptionExplicit(MagickCore::MissingDelegateError,
"Coder array not returned!", 0 );
}
container_->clear();
for ( ::ssize_t i=0; i < (::ssize_t) number_formats; i++)
{
const MagickCore::MagickInfo *magick_info =
MagickCore::GetMagickInfo( coder_list[i], exceptionInfo );
coder_list[i]=(char *)
MagickCore::RelinquishMagickMemory( coder_list[i] );
if ( magick_info->stealth )
continue;
try {
CoderInfo coderInfo( magick_info->name );
if ( isReadable_ != CoderInfo::AnyMatch &&
(( coderInfo.isReadable() && isReadable_ != CoderInfo::TrueMatch ) ||
( !coderInfo.isReadable() && isReadable_ != CoderInfo::FalseMatch )) )
continue;
if ( isWritable_ != CoderInfo::AnyMatch &&
(( coderInfo.isWritable() && isWritable_ != CoderInfo::TrueMatch ) ||
( !coderInfo.isWritable() && isWritable_ != CoderInfo::FalseMatch )) )
continue;
if ( isMultiFrame_ != CoderInfo::AnyMatch &&
(( coderInfo.isMultiFrame() && isMultiFrame_ != CoderInfo::TrueMatch ) ||
( !coderInfo.isMultiFrame() && isMultiFrame_ != CoderInfo::FalseMatch )) )
continue;
container_->push_back( coderInfo );
}
catch ( Magick::ErrorModule )
{
continue;
}
}
coder_list=(char **) MagickCore::RelinquishMagickMemory( coder_list );
ThrowPPException(false);
}
template <class Container >
void colorHistogram( Container *histogram_, const Image image)
{
GetPPException;
size_t colors;
MagickCore::ColorPacket *histogram_array =
MagickCore::GetImageHistogram( image.constImage(), &colors, exceptionInfo );
ThrowPPException(image.quiet());
histogram_->clear();
for ( size_t i=0; i < colors; i++)
{
histogram_->insert( histogram_->end(), std::pair<const Color,size_t>
( Color(histogram_array[i].pixel), (size_t) histogram_array[i].count) );
}
histogram_array=(MagickCore::ColorPacket *)
MagickCore::RelinquishMagickMemory(histogram_array);
}
template <class InputIterator >
void combineImages( Image *combinedImage_,
InputIterator first_,
InputIterator last_,
const ChannelType channel_ ) {
GetPPException;
linkImages( first_, last_ );
MagickCore::Image* image = CombineImages( first_->image(), channel_, exceptionInfo );
unlinkImages( first_, last_ );
combinedImage_->replaceImage( image );
ThrowPPException(combinedImage_->quiet());
}
template <class Container>
void cropToTiles(Container *tiledImages_,const Image image_,
const Geometry &geometry_)
{
GetPPException;
MagickCore::Image* images=CropImageToTiles(image_.constImage(),
static_cast<std::string>(geometry_).c_str(),exceptionInfo);
tiledImages_->clear();
insertImages(tiledImages_,images);
ThrowPPException(image_.quiet());
}
template <class InputIterator, class Container >
void deconstructImages( Container *deconstructedImages_,
InputIterator first_,
InputIterator last_ ) {
GetPPException;
linkImages( first_, last_ );
MagickCore::Image* images = DeconstructImages( first_->image(),
exceptionInfo);
unlinkImages( first_, last_ );
deconstructedImages_->clear();
insertImages( deconstructedImages_, images );
ThrowPPException(first_->quiet());
}
template <class InputIterator>
void displayImages( InputIterator first_,
InputIterator last_ ) {
GetPPException;
linkImages( first_, last_ );
MagickCore::DisplayImages( first_->imageInfo(), first_->image() );
MagickCore::GetImageException( first_->image(), exceptionInfo );
unlinkImages( first_, last_ );
ThrowPPException(first_->quiet());
}
template <class InputIterator >
void evaluateImages( Image *evaluatedImage_,
InputIterator first_,
InputIterator last_,
const MagickEvaluateOperator operator_ ) {
GetPPException;
linkImages( first_, last_ );
MagickCore::Image* image = EvaluateImages( first_->image(), operator_, exceptionInfo );
unlinkImages( first_, last_ );
evaluatedImage_->replaceImage( image );
ThrowPPException(evaluatedImage_->quiet());
}
template <class InputIterator>
void flattenImages( Image *flattendImage_,
InputIterator first_,
InputIterator last_ ) {
GetPPException;
linkImages( first_, last_ );
MagickCore::Image* image = MagickCore::MergeImageLayers( first_->image(),
FlattenLayer,exceptionInfo );
unlinkImages( first_, last_ );
flattendImage_->replaceImage( image );
ThrowPPException(flattendImage_->quiet());
}
template <class Container >
void forwardFourierTransformImage( Container *fourierImages_,
const Image &image_ ) {
GetPPException;
MagickCore::Image* images = ForwardFourierTransformImage(
image_.constImage(), MagickTrue, exceptionInfo);
fourierImages_->clear();
insertImages( fourierImages_, images );
ThrowPPException(image_.quiet());
}
template <class Container >
void forwardFourierTransformImage( Container *fourierImages_,
const Image &image_, const bool magnitude_ ) {
GetPPException;
MagickCore::Image* images = ForwardFourierTransformImage(
image_.constImage(), magnitude_ == true ? MagickTrue : MagickFalse,
exceptionInfo);
fourierImages_->clear();
insertImages( fourierImages_, images );
ThrowPPException(image_.quiet());
}
template <class InputIterator>
void fxImages(Image *fxImage_,InputIterator first_,InputIterator last_,
const std::string expression)
{
MagickCore::Image
*image;
GetPPException;
linkImages(first_,last_);
image=FxImageChannel(first_->constImage(),DefaultChannels,
expression.c_str(),exceptionInfo);
unlinkImages(first_,last_);
fxImage_->replaceImage(image);
ThrowPPException(fxImage_->quiet());
}
template <class InputIterator>
void mapImages( InputIterator first_,
InputIterator last_,
const Image& mapImage_,
bool dither_ = false,
bool measureError_ = false ) {
GetPPException;
MagickCore::QuantizeInfo quantizeInfo;
MagickCore::GetQuantizeInfo( &quantizeInfo );
quantizeInfo.dither = dither_ ? MagickCore::MagickTrue : MagickCore::MagickFalse;
linkImages( first_, last_ );
MagickCore::RemapImages( &quantizeInfo, first_->image(),
(mapImage_.isValid() ? mapImage_.constImage() : (const MagickCore::Image*) NULL));
MagickCore::GetImageException( first_->image(), exceptionInfo );
if ( exceptionInfo->severity != MagickCore::UndefinedException )
{
unlinkImages( first_, last_ );
throwException(exceptionInfo,mapImage_.quiet());
}
MagickCore::Image* image = first_->image();
while( image )
{
if ( measureError_ )
{
MagickCore::GetImageQuantizeError( image );
if ( image->exception.severity > MagickCore::UndefinedException )
{
unlinkImages( first_, last_ );
throwException(exceptionInfo,mapImage_.quiet());
}
}
MagickCore::SyncImage( image );
if ( image->exception.severity > MagickCore::UndefinedException )
{
unlinkImages( first_, last_ );
throwException(exceptionInfo,mapImage_.quiet());
}
image=image->next;
}
unlinkImages( first_, last_ );
(void) MagickCore::DestroyExceptionInfo( exceptionInfo );
}
template <class InputIterator >
void mergeImageLayers( Image *mergedImage_,
InputIterator first_,
InputIterator last_,
const ImageLayerMethod method_ ) {
GetPPException;
linkImages( first_, last_ );
MagickCore::Image* image = MergeImageLayers( first_->image(), method_, exceptionInfo );
unlinkImages( first_, last_ );
mergedImage_->replaceImage( image );
ThrowPPException(mergedImage_->quiet());
}
template <class Container, class InputIterator>
void montageImages(Container *montageImages_,InputIterator first_,
InputIterator last_,const Montage &options_)
{
MagickCore::Image
*images;
MagickCore::MontageInfo
*montageInfo;
montageInfo=static_cast<MagickCore::MontageInfo*>(
MagickCore::AcquireMagickMemory(sizeof(MagickCore::MontageInfo)));
options_.updateMontageInfo(*montageInfo);
if (options_.label().length() != 0)
first_->label(options_.label());
linkImages(first_,last_);
GetPPException;
images=MagickCore::MontageImages(first_->image(),montageInfo,
exceptionInfo);
unlinkImages(first_,last_);
montageImages_->clear();
if (images != (MagickCore::Image *) NULL)
insertImages(montageImages_,images);
MagickCore::DestroyMontageInfo(montageInfo);
ThrowPPException(first_->quiet());
if (montageImages_->size() > 0 && options_.transparentColor().isValid())
for_each(montageImages_->begin(),montageImages_->end(),transparentImage(
options_.transparentColor()));
}
template <class InputIterator, class Container >
void morphImages( Container *morphedImages_,
InputIterator first_,
InputIterator last_,
size_t frames_ ) {
GetPPException;
linkImages( first_, last_ );
MagickCore::Image* images = MagickCore::MorphImages( first_->image(), frames_,
exceptionInfo);
unlinkImages( first_, last_ );
morphedImages_->clear();
insertImages( morphedImages_, images );
ThrowPPException(first_->quiet());
}
template <class InputIterator>
void mosaicImages( Image *mosaicImage_,
InputIterator first_,
InputIterator last_ ) {
GetPPException;
linkImages( first_, last_ );
MagickCore::Image* image = MagickCore::MergeImageLayers( first_->image(),
MosaicLayer,exceptionInfo );
unlinkImages( first_, last_ );
mosaicImage_->replaceImage( image );
ThrowPPException(mosaicImage_->quiet());
}
template <class InputIterator, class Container >
void optimizeImageLayers( Container *optimizedImages_,
InputIterator first_,
InputIterator last_ ) {
GetPPException;
linkImages( first_, last_ );
MagickCore::Image* images = OptimizeImageLayers( first_->image(), exceptionInfo );
unlinkImages( first_, last_ );
optimizedImages_->clear();
insertImages( optimizedImages_, images );
ThrowPPException(first_->quiet());
}
template <class InputIterator, class Container >
void optimizePlusImageLayers( Container *optimizedImages_,
InputIterator first_,
InputIterator last_ ) {
GetPPException;
linkImages( first_, last_ );
MagickCore::Image* images = OptimizePlusImageLayers( first_->image(), exceptionInfo );
unlinkImages( first_, last_ );
optimizedImages_->clear();
insertImages( optimizedImages_, images );
ThrowPPException(first_->quiet());
}
template<class InputIterator>
void optimizeTransparency(InputIterator first_,InputIterator last_)
{
GetPPException;
linkImages(first_,last_);
OptimizeImageTransparency(first_->image(),exceptionInfo);
unlinkImages(first_,last_ );
ThrowPPException(first_->quiet());
}
template <class Container>
void profileNames(Container *names_,const Image* image_)
{
const char
*name;
names_->clear();
MagickCore::ResetImageProfileIterator(image_->constImage());
name=MagickCore::GetNextImageProfile(image_->constImage());
while (name != (const char *) NULL)
{
names_->push_back(std::string(name));
name=MagickCore::GetNextImageProfile(image_->constImage());
}
}
template <class InputIterator>
void quantizeImages( InputIterator first_,
InputIterator last_,
bool measureError_ = false ) {
GetPPException;
linkImages( first_, last_ );
MagickCore::QuantizeImages( first_->quantizeInfo(),
first_->image() );
MagickCore::GetImageException( first_->image(), exceptionInfo );
if ( exceptionInfo->severity > MagickCore::UndefinedException )
{
unlinkImages( first_, last_ );
throwException(exceptionInfo,first_->quiet());
}
MagickCore::Image* image = first_->image();
while( image != 0 )
{
if ( measureError_ )
MagickCore::GetImageQuantizeError( image );
MagickCore::SyncImage( image );
image=image->next;
}
unlinkImages( first_, last_ );
(void) MagickCore::DestroyExceptionInfo( exceptionInfo );
}
template<class Container>
void readImages(Container *sequence_,const std::string &imageSpec_,
ReadOptions &options)
{
MagickCore::Image
*images;
MagickCore::ImageInfo
*imageInfo;
imageInfo=options.imageInfo();
imageSpec_.copy(imageInfo->filename,MaxTextExtent-1);
imageInfo->filename[imageSpec_.length()] = 0;
GetPPException;
images=MagickCore::ReadImage(imageInfo,exceptionInfo);
insertImages(sequence_,images);
ThrowPPException(options.quiet());
}
template<class Container>
void readImages(Container *sequence_,const std::string &imageSpec_)
{
ReadOptions options;
readImages(sequence_,imageSpec_,options);
}
template<class Container>
void readImages(Container *sequence_,const Blob &blob_,ReadOptions &options)
{
MagickCore::Image
*images;
GetPPException;
images=MagickCore::BlobToImage(options.imageInfo(),blob_.data(),
blob_.length(),exceptionInfo);
insertImages(sequence_,images);
ThrowPPException(options.quiet());
}
template<class Container>
void readImages(Container *sequence_,const Blob &blob_)
{
ReadOptions options;
readImages(sequence_,blob_,options);
}
template <class Container >
void separateImages( Container *separatedImages_,
const Image &image_,
const ChannelType channel_ ) {
GetPPException;
MagickCore::Image* images = MagickCore::SeparateImages( image_.constImage(), channel_, exceptionInfo );
separatedImages_->clear();
insertImages( separatedImages_, images );
ThrowPPException(image_.quiet());
}
template<class InputIterator>
void smushImages(Image *smushedImage_,InputIterator first_,
InputIterator last_,const ssize_t offset_,bool stack_=false)
{
MagickCore::Image
*newImage;
GetPPException;
linkImages(first_,last_);
newImage=MagickCore::SmushImages(first_->constImage(),
(MagickBooleanType) stack_,offset_,exceptionInfo);
unlinkImages(first_,last_);
smushedImage_->replaceImage(newImage);
ThrowPPException(smushedImage_->quiet());
}
template <class InputIterator>
void writeImages( InputIterator first_,
InputIterator last_,
const std::string &imageSpec_,
bool adjoin_ = true ) {
first_->adjoin( adjoin_ );
GetPPException;
linkImages( first_, last_ );
::ssize_t errorStat = MagickCore::WriteImages( first_->constImageInfo(),
first_->image(),
imageSpec_.c_str(),
exceptionInfo );
unlinkImages( first_, last_ );
if ( errorStat != false )
{
(void) MagickCore::DestroyExceptionInfo( exceptionInfo );
return;
}
ThrowPPException(first_->quiet());
}
template <class InputIterator>
void writeImages( InputIterator first_,
InputIterator last_,
Blob *blob_,
bool adjoin_ = true) {
first_->adjoin( adjoin_ );
linkImages( first_, last_ );
GetPPException;
size_t length = 2048;
void* data = MagickCore::ImagesToBlob( first_->imageInfo(),
first_->image(),
&length,
exceptionInfo);
blob_->updateNoCopy( data, length, Magick::Blob::MallocAllocator );
unlinkImages( first_, last_ );
ThrowPPException(first_->quiet());
}
}
#endif