Options.cpp revision 49ccbc806b20f4892e6c8588768617afdfcee3cd
13ed852eea50f9d4cd633efb8c2b054b8e33c253cristy// This may look like C code, but it is really -*- C++ -*-
23ed852eea50f9d4cd633efb8c2b054b8e33c253cristy//
33ed852eea50f9d4cd633efb8c2b054b8e33c253cristy// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003
4b435339c088523d4321e119c73d104c3a1f5d27bdirk// Copyright Dirk Lemstra 2014
53ed852eea50f9d4cd633efb8c2b054b8e33c253cristy//
63ed852eea50f9d4cd633efb8c2b054b8e33c253cristy// Implementation of Options
73ed852eea50f9d4cd633efb8c2b054b8e33c253cristy//
83ed852eea50f9d4cd633efb8c2b054b8e33c253cristy// A wrapper around DrawInfo, ImageInfo, and QuantizeInfo
93ed852eea50f9d4cd633efb8c2b054b8e33c253cristy//
103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#define MAGICKCORE_IMPLEMENTATION  1
123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#define MAGICK_PLUSPLUS_IMPLEMENTATION 1
133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
14d4774283661e770ee52d54a7199b7c4d38208c35cristy#include "Magick++/Include.h"
153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#include <string>
163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#include <string.h>
173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#include <stdlib.h>
183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#include <math.h>
19d4774283661e770ee52d54a7199b7c4d38208c35cristy
203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#include "Magick++/Options.h"
213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#include "Magick++/Functions.h"
223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#include "Magick++/Exception.h"
233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
24830e974c2864362a20c44c4a6e915b523cb56c66cristy#define MagickPI  3.14159265358979323846264338327950288419716939937510
253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#define DegreesToRadians(x)  (MagickPI*(x)/180.0)
2683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
2783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagick::Options::Options(void)
2883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  : _imageInfo(static_cast<ImageInfo*>(AcquireMagickMemory(
2983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk      sizeof(ImageInfo)))),
3083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    _quantizeInfo(static_cast<QuantizeInfo*>(AcquireMagickMemory(
3183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk      sizeof(QuantizeInfo)))),
3283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    _drawInfo(static_cast<DrawInfo*>(AcquireMagickMemory(sizeof(DrawInfo))))
333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  // Initialize image info with defaults
3583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  GetImageInfo(_imageInfo);
3683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  // Initialize quantization info
3883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  GetQuantizeInfo(_quantizeInfo);
393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  // Initialize drawing info
4183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  GetDrawInfo(_imageInfo,_drawInfo);
423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
4483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagick::Options::Options(const Magick::Options& options_)
4583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  : _imageInfo(CloneImageInfo(options_._imageInfo )),
463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    _quantizeInfo(CloneQuantizeInfo(options_._quantizeInfo)),
4783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    _drawInfo(CloneDrawInfo(_imageInfo,options_._drawInfo))
483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
513ed852eea50f9d4cd633efb8c2b054b8e33c253cristyMagick::Options::~Options()
523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  // Destroy image info
5483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk   _imageInfo=DestroyImageInfo(_imageInfo);
553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  // Destroy quantization info
5783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk   _quantizeInfo=DestroyQuantizeInfo(_quantizeInfo);
583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  // Destroy drawing info
6083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk   _drawInfo=DestroyDrawInfo(_drawInfo);
613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
6383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::antiAlias(bool flag_)
643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
6583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _drawInfo->text_antialias=static_cast<MagickBooleanType>(
6683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    flag_ ? MagickTrue : MagickFalse);
673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
6883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
6983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkbool Magick::Options::antiAlias(void) const
703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
7183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(static_cast<bool>(_drawInfo->text_antialias));
723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
7483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::adjoin(bool flag_)
753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
7683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _imageInfo->adjoin=static_cast<MagickBooleanType>(
7783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    flag_ ? MagickTrue : MagickFalse);
783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
7983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
8083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkbool Magick::Options::adjoin(void) const
813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
8283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(static_cast<bool>(_imageInfo->adjoin));
833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
8583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::backgroundColor(const Magick::Color &color_)
863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
8783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _imageInfo->background_color=color_;
883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
8983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
9083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagick::Color Magick::Options::backgroundColor(void) const
913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
9283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(Magick::Color(_imageInfo->background_color));
933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
9583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::backgroundTexture(const std::string &backgroundTexture_)
963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
9783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (backgroundTexture_.length() == 0)
983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    _imageInfo->texture=(char *) RelinquishMagickMemory(_imageInfo->texture);
993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  else
10083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    Magick::CloneString(&_imageInfo->texture,backgroundTexture_);
1013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
10283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
10383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkstd::string Magick::Options::backgroundTexture(void) const
1043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
10583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (_imageInfo->texture)
10683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    return(std::string(_imageInfo->texture));
1073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  else
10883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    return(std::string());
1093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
1103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
11183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::borderColor(const Color &color_)
1123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
11383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _imageInfo->border_color=color_;
11483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _drawInfo->border_color=color_;
1153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
11683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
11783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagick::Color Magick::Options::borderColor(void) const
1183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
11983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(Magick::Color(_imageInfo->border_color));
1203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
1213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
12283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::boxColor(const Magick::Color &boxColor_)
1233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
12483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _drawInfo->undercolor=boxColor_;
1253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
12683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
12783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagick::Color Magick::Options::boxColor(void) const
1283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
12983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(Magick::Color(_drawInfo->undercolor));
1303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
1313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
13283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::colorspaceType(Magick::ColorspaceType colorspace_)
1333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
13483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _imageInfo->colorspace=colorspace_;
1353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
13683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
13783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagick::ColorspaceType Magick::Options::colorspaceType(void) const
1383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
13983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(static_cast<Magick::ColorspaceType>(_imageInfo->colorspace));
1403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
1413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
14283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::compressType(CompressionType compressType_)
1433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
14483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _imageInfo->compression=compressType_;
1453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
14683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
14783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagick::CompressionType Magick::Options::compressType(void) const
1483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
14983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(static_cast<Magick::CompressionType>(_imageInfo->compression));
1503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
1513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
15283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::colorFuzz(double fuzz_)
1533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
15483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _imageInfo->fuzz=fuzz_;
1553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
15683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
15783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkdouble Magick::Options::colorFuzz(void) const
1583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
15983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_imageInfo->fuzz);
1603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
1613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
16283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::debug(bool flag_)
1633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
16483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if  (flag_)
16583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    SetLogEventMask("All");
1663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  else
16783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    SetLogEventMask("None");
1683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
16983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
17083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkbool Magick::Options::debug(void) const
1713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
17283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (IsEventLogging())
17383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    return(true);
17483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(false);
1753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
1763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
177be1bbacaa9919aa3754e3abae43557be13669657dirkvoid Magick::Options::density(const Magick::Point &density_)
1783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
179be1bbacaa9919aa3754e3abae43557be13669657dirk  if (!density_.isValid())
1803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    _imageInfo->density=(char *) RelinquishMagickMemory(_imageInfo->density);
1813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  else
18283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    Magick::CloneString(&_imageInfo->density,density_);
1833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
18483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
185be1bbacaa9919aa3754e3abae43557be13669657dirkMagick::Point Magick::Options::density(void) const
1863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
18783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (_imageInfo->density)
188be1bbacaa9919aa3754e3abae43557be13669657dirk    return(Point(_imageInfo->density));
1893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
190be1bbacaa9919aa3754e3abae43557be13669657dirk  return(Point());
1913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
1923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
19383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::depth(size_t depth_)
1943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
19583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _imageInfo->depth=depth_;
1963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
19783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
19883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirksize_t Magick::Options::depth(void) const
1993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
20083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_imageInfo->depth);
2013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
2023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
20383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::endian(Magick::EndianType endian_)
2043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
20583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _imageInfo->endian=endian_;
2063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
20783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
20883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagick::EndianType Magick::Options::endian(void) const
2093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
21083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_imageInfo->endian);
2113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
2123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
21383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::file(FILE *file_)
21415781e5110c893ce0eb7924926ae0d1a056f90ebcristy{
21583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  SetImageInfoFile(_imageInfo,file_);
21615781e5110c893ce0eb7924926ae0d1a056f90ebcristy}
21783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
21883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkFILE *Magick::Options::file(void) const
21915781e5110c893ce0eb7924926ae0d1a056f90ebcristy{
22083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(GetImageInfoFile(_imageInfo));
22115781e5110c893ce0eb7924926ae0d1a056f90ebcristy}
22215781e5110c893ce0eb7924926ae0d1a056f90ebcristy
22383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::fileName(const std::string &fileName_)
2243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
22583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  fileName_.copy(_imageInfo->filename,MaxTextExtent-1);
22683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (fileName_.length() > MaxTextExtent-1)
22783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    _imageInfo->filename[MaxTextExtent-1]=0;
22883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  else
22983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    _imageInfo->filename[fileName_.length()]=0;
2303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
23183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
23283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkstd::string Magick::Options::fileName(void) const
2333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
23483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(std::string(_imageInfo->filename));
2353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
2363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
23783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::fillColor(const Magick::Color &fillColor_)
2383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
23983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _drawInfo->fill=fillColor_;
2403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if (fillColor_ == Magick::Color())
2413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    fillPattern((const MagickCore::Image*) NULL);
2423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
24383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
24483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagick::Color Magick::Options::fillColor(void) const
2453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
24683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_drawInfo->fill);
2473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
24883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
24983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::fillPattern(const MagickCore::Image *fillPattern_)
2503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
25183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (_drawInfo->fill_pattern)
25283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk      _drawInfo->fill_pattern=DestroyImageList(_drawInfo->fill_pattern);
25383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
25483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (fillPattern_)
2553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    {
25683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk      GetPPException;
25783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk      _drawInfo->fill_pattern=CloneImage(const_cast<MagickCore::Image*>(
25883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk        fillPattern_),0,0,static_cast<MagickBooleanType>(MagickTrue),
259e31feb8a39ea937a6328da579085cd2ee66ab4c0dirk        exceptionInfo);
26077328896b876314656427663695bc7b2c9be3f74dirk      ThrowPPException(true);
2613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    }
2623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
26383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
26483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkconst MagickCore::Image *Magick::Options::fillPattern(void) const
2653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
26683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_drawInfo->fill_pattern);
2673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
2683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
26983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::fillRule(const Magick::FillRule &fillRule_)
2703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
27183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _drawInfo->fill_rule=fillRule_;
2723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
27383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
27483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagick::FillRule Magick::Options::fillRule(void) const
2753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
27683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_drawInfo->fill_rule);
2773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
2783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
27983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::font(const std::string &font_)
2803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
28183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (font_.length() == 0)
2823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    {
2833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      _imageInfo->font=(char *) RelinquishMagickMemory(_imageInfo->font);
2843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      _drawInfo->font=(char *) RelinquishMagickMemory(_drawInfo->font);
2853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    }
2863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  else
2873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    {
28883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk      Magick::CloneString(&_imageInfo->font,font_);
28983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk      Magick::CloneString(&_drawInfo->font,font_);
2903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    }
2913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
29283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
29383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkstd::string Magick::Options::font(void) const
2943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
29583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (_imageInfo->font)
29683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    return(std::string(_imageInfo->font));
2973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
29883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(std::string());
2993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
3003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
30183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::fontPointsize(double pointSize_)
3023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
30383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _imageInfo->pointsize=pointSize_;
30483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _drawInfo->pointsize=pointSize_;
3053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
30683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
30783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkdouble Magick::Options::fontPointsize(void) const
3083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
30983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_imageInfo->pointsize);
3103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
3113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
31283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkstd::string Magick::Options::format(void) const
3133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
31483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  const MagickInfo
31583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    *magick_info=0;
3163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
31783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  GetPPException;
31883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (*_imageInfo->magick != '\0' )
319e31feb8a39ea937a6328da579085cd2ee66ab4c0dirk    magick_info = GetMagickInfo(_imageInfo->magick,exceptionInfo);
32077328896b876314656427663695bc7b2c9be3f74dirk  ThrowPPException(true);
32183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
32283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if ((magick_info != 0) && (*magick_info->description != '\0'))
32383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    return(std::string( magick_info->description));
3243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
32583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(std::string());
3263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
3273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
32883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::interlaceType(Magick::InterlaceType interlace_)
3293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
33083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _imageInfo->interlace=interlace_;
3313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
33283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
33383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagick::InterlaceType Magick::Options::interlaceType(void) const
3343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
33583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(static_cast<Magick::InterlaceType>(_imageInfo->interlace));
3363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
3373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
33883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::magick(const std::string &magick_)
3393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
34049ccbc806b20f4892e6c8588768617afdfcee3cddirk  if (magick_.empty())
34149ccbc806b20f4892e6c8588768617afdfcee3cddirk  {
34249ccbc806b20f4892e6c8588768617afdfcee3cddirk    _imageInfo->filename[0] = '\0';
34349ccbc806b20f4892e6c8588768617afdfcee3cddirk    return;
34449ccbc806b20f4892e6c8588768617afdfcee3cddirk  }
34549ccbc806b20f4892e6c8588768617afdfcee3cddirk
34683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  FormatLocaleString(_imageInfo->filename,MaxTextExtent,"%.1024s:",
34783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    magick_.c_str());
34883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  GetPPException;
349e31feb8a39ea937a6328da579085cd2ee66ab4c0dirk  SetImageInfo(_imageInfo,1,exceptionInfo);
35083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (*_imageInfo->magick == '\0')
35177328896b876314656427663695bc7b2c9be3f74dirk    throwExceptionExplicit(MagickCore::OptionError,
35277328896b876314656427663695bc7b2c9be3f74dirk      "Unrecognized image format",magick_.c_str());
35377328896b876314656427663695bc7b2c9be3f74dirk  ThrowPPException(true);
3543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
35583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
35683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkstd::string Magick::Options::magick(void) const
3573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
3588418c7e51974060a1c724e25d700d72fb437174bcristy  if (*_imageInfo->magick)
35983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    return(std::string(_imageInfo->magick));
36083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
36183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(std::string());
3623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
3633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
36483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::matteColor(const Magick::Color &matteColor_)
3653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
36683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _imageInfo->matte_color=matteColor_;
3673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
36883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
36983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagick::Color Magick::Options::matteColor(void) const
3703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
37183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(Magick::Color(_imageInfo->matte_color));
3723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
3733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
37483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::monochrome(bool monochromeFlag_)
3753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
37683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _imageInfo->monochrome=(MagickBooleanType) monochromeFlag_;
3773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
37883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
37983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkbool Magick::Options::monochrome(void) const
3803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
38183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(static_cast<bool>(_imageInfo->monochrome));
3823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
3833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
38483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::page(const Magick::Geometry &pageSize_)
3853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
38683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (!pageSize_.isValid())
3873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    _imageInfo->page=(char *) RelinquishMagickMemory(_imageInfo->page);
3883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  else
38983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    Magick::CloneString(&_imageInfo->page,pageSize_);
3903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
39183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
39283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagick::Geometry Magick::Options::page(void) const
3933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
39483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (_imageInfo->page)
39583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    return(Geometry(_imageInfo->page));
3963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
39783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(Geometry());
3983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
3993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
40083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::quality(size_t quality_)
4013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
40283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _imageInfo->quality=quality_;
4033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
40483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
40583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirksize_t Magick::Options::quality(void) const
4063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
40783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_imageInfo->quality);
4083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
4093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
41083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::quantizeColors(size_t colors_)
4113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
41283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _quantizeInfo->number_colors=colors_;
4133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
41483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
41583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirksize_t Magick::Options::quantizeColors(void) const
4163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
41783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_quantizeInfo->number_colors);
4183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
4193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
42083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::quantizeColorSpace(Magick::ColorspaceType colorSpace_)
4213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
42283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _quantizeInfo->colorspace=colorSpace_;
4233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
42483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
42583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagick::ColorspaceType Magick::Options::quantizeColorSpace(void) const
4263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
42783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(static_cast<Magick::ColorspaceType>(_quantizeInfo->colorspace));
4283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
4293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
43083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::quantizeDither(bool ditherFlag_)
4313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
43283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _imageInfo->dither=(MagickBooleanType) ditherFlag_;
43383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _quantizeInfo->dither_method=ditherFlag_ ? RiemersmaDitherMethod :
434cbda611068350bf4459f2dda1951f8823702e129cristy    NoDitherMethod;
4353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
43683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
43783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkbool Magick::Options::quantizeDither(void) const
4383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
43983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(static_cast<bool>(_imageInfo->dither));
4403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
4413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
4426d64b3658c2fa7218fbc309b9c85e3ec4441310edirkvoid Magick::Options::quantizeDitherMethod(DitherMethod ditherMethod_)
4436d64b3658c2fa7218fbc309b9c85e3ec4441310edirk{
4446d64b3658c2fa7218fbc309b9c85e3ec4441310edirk  _quantizeInfo->dither_method=ditherMethod_;
4456d64b3658c2fa7218fbc309b9c85e3ec4441310edirk}
4466d64b3658c2fa7218fbc309b9c85e3ec4441310edirk
4476d64b3658c2fa7218fbc309b9c85e3ec4441310edirkMagickCore::DitherMethod Magick::Options::quantizeDitherMethod(void) const
4486d64b3658c2fa7218fbc309b9c85e3ec4441310edirk{
4496d64b3658c2fa7218fbc309b9c85e3ec4441310edirk  return(_quantizeInfo->dither_method);
4506d64b3658c2fa7218fbc309b9c85e3ec4441310edirk}
4516d64b3658c2fa7218fbc309b9c85e3ec4441310edirk
45283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::quantizeTreeDepth(size_t treeDepth_)
4533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
45483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _quantizeInfo->tree_depth=treeDepth_;
4553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
45683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
45783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirksize_t Magick::Options::quantizeTreeDepth(void) const
4583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
45983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_quantizeInfo->tree_depth);
4603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
4613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
46283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::resolutionUnits(Magick::ResolutionType resolutionUnits_)
4633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
46483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _imageInfo->units=resolutionUnits_;
4653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
46683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
46783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagick::ResolutionType Magick::Options::resolutionUnits(void) const
4683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
46983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(static_cast<Magick::ResolutionType>(_imageInfo->units));
4703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
4713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
47283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::samplingFactor(const std::string &samplingFactor_)
4733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
47483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (samplingFactor_.length() == 0)
47583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    _imageInfo->sampling_factor=(char *) RelinquishMagickMemory(
47683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk      _imageInfo->sampling_factor);
4773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  else
47883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    Magick::CloneString(&_imageInfo->sampling_factor,samplingFactor_);
4793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
48083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
48183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkstd::string Magick::Options::samplingFactor(void) const
4823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
48383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (_imageInfo->sampling_factor)
48483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    return(std::string(_imageInfo->sampling_factor));
4853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
48683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(std::string());
4873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
4883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
48983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::size(const Geometry &geometry_)
4903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
4913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _imageInfo->size=(char *) RelinquishMagickMemory(_imageInfo->size);
4923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
49383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (geometry_.isValid())
49483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    Magick::CloneString(&_imageInfo->size,geometry_);
4953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
49683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
49783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagick::Geometry Magick::Options::size(void) const
4983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
49983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (_imageInfo->size)
50083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    return(Geometry(_imageInfo->size));
5013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
50283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(Geometry());
5033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
5043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
50583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::strokeAntiAlias(bool flag_)
5063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
50783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  flag_ ? _drawInfo->stroke_antialias=MagickTrue :
50883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    _drawInfo->stroke_antialias=MagickFalse;
5093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
51083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
51183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkbool Magick::Options::strokeAntiAlias(void) const
5123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
51383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_drawInfo->stroke_antialias != 0 ? true : false);
5143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
5153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
51683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::strokeColor(const Magick::Color &strokeColor_)
5173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
51883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _drawInfo->stroke=strokeColor_;
5193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
52083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
52183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagick::Color Magick::Options::strokeColor(void) const
5223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
52383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_drawInfo->stroke);
5243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
5253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
52683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::strokeDashArray(const double *strokeDashArray_)
5273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
52883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _drawInfo->dash_pattern=(double *) RelinquishMagickMemory(
52983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    _drawInfo->dash_pattern);
5303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
5313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if(strokeDashArray_)
5323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    {
53383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk      size_t
53483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk        x;
5353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      // Count elements in dash array
5363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      for (x=0; strokeDashArray_[x]; x++) ;
5373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      // Allocate elements
53883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk      _drawInfo->dash_pattern=static_cast<double*>(AcquireMagickMemory((x+1)*
53983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk        sizeof(double)));
5403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      // Copy elements
54183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk      memcpy(_drawInfo->dash_pattern,strokeDashArray_,(x+1)*sizeof(double));
5423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    }
5433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
54483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
54583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkconst double *Magick::Options::strokeDashArray(void) const
5463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
54783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_drawInfo->dash_pattern);
5483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
5493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
55083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::strokeDashOffset(double strokeDashOffset_)
5513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
55283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _drawInfo->dash_offset=strokeDashOffset_;
5533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
55483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
55583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkdouble Magick::Options::strokeDashOffset(void) const
5563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
55783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_drawInfo->dash_offset);
5583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
5593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
56083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::strokeLineCap(Magick::LineCap lineCap_)
5613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
56283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _drawInfo->linecap=lineCap_;
5633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
56483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
56583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagick::LineCap Magick::Options::strokeLineCap(void) const
5663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
56783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_drawInfo->linecap);
5683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
5693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
57083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::strokeLineJoin(Magick::LineJoin lineJoin_)
5713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
57283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _drawInfo->linejoin=lineJoin_;
5733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
57483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
57583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagick::LineJoin Magick::Options::strokeLineJoin(void) const
5763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
57783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_drawInfo->linejoin);
5783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
5793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
58083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::strokeMiterLimit(size_t miterLimit_)
5813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
58283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _drawInfo->miterlimit=miterLimit_;
5833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
58483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
58583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirksize_t Magick::Options::strokeMiterLimit(void) const
5863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
58783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_drawInfo->miterlimit);
5883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
5893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
59083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::strokePattern(const MagickCore::Image *strokePattern_)
5913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
59283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (_drawInfo->stroke_pattern)
59383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    _drawInfo->stroke_pattern=DestroyImageList(_drawInfo->stroke_pattern);
5943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
59583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (strokePattern_)
5963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    {
59783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk      GetPPException;
59877328896b876314656427663695bc7b2c9be3f74dirk      _drawInfo->stroke_pattern=CloneImage(const_cast<MagickCore::Image*>(
599e31feb8a39ea937a6328da579085cd2ee66ab4c0dirk        strokePattern_),0,0,MagickTrue,exceptionInfo);
60077328896b876314656427663695bc7b2c9be3f74dirk      ThrowPPException(true);
6013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    }
6023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
60383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
60483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkconst MagickCore::Image *Magick::Options::strokePattern(void) const
6053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
60683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_drawInfo->stroke_pattern);
6073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
6083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
60983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::strokeWidth(double strokeWidth_)
6103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
61183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _drawInfo->stroke_width=strokeWidth_;
6123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
61383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
61483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkdouble Magick::Options::strokeWidth(void) const
6153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
61683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_drawInfo->stroke_width);
6173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
6183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
61983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::subImage(size_t subImage_)
6203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
62183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _imageInfo->scene=subImage_;
6223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
62383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
62483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirksize_t Magick::Options::subImage(void) const
6253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
62683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_imageInfo->scene);
6273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
6283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
62983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::subRange(size_t subRange_)
6303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
63183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _imageInfo->number_scenes=subRange_;
6323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
63383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
63483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirksize_t Magick::Options::subRange(void) const
6353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
63683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_imageInfo->number_scenes);
6373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
6383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
639d37417692d7a7040aa854e493723e92fac1e3ae6dirkvoid Magick::Options::textDirection(DirectionType direction_)
640d37417692d7a7040aa854e493723e92fac1e3ae6dirk{
641d37417692d7a7040aa854e493723e92fac1e3ae6dirk  _drawInfo->direction=direction_;
642d37417692d7a7040aa854e493723e92fac1e3ae6dirk}
643d37417692d7a7040aa854e493723e92fac1e3ae6dirk
644d37417692d7a7040aa854e493723e92fac1e3ae6dirkMagick::DirectionType Magick::Options::textDirection() const
645d37417692d7a7040aa854e493723e92fac1e3ae6dirk{
646d37417692d7a7040aa854e493723e92fac1e3ae6dirk  return(_drawInfo->direction);
647d37417692d7a7040aa854e493723e92fac1e3ae6dirk}
648d37417692d7a7040aa854e493723e92fac1e3ae6dirk
64983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::textEncoding(const std::string &encoding_)
6503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
651d37417692d7a7040aa854e493723e92fac1e3ae6dirk  CloneString(&_drawInfo->encoding,encoding_.c_str());
6523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
6533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
65483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkstd::string Magick::Options::textEncoding(void) const
6553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
65683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (_drawInfo->encoding && *_drawInfo->encoding)
65783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    return(std::string(_drawInfo->encoding));
658d37417692d7a7040aa854e493723e92fac1e3ae6dirk
65983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(std::string());
6603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
6613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
662d37417692d7a7040aa854e493723e92fac1e3ae6dirkvoid Magick::Options::textGravity(GravityType gravity_)
663d37417692d7a7040aa854e493723e92fac1e3ae6dirk{
664d37417692d7a7040aa854e493723e92fac1e3ae6dirk  _drawInfo->gravity=gravity_;
665d37417692d7a7040aa854e493723e92fac1e3ae6dirk}
666d37417692d7a7040aa854e493723e92fac1e3ae6dirk
667d37417692d7a7040aa854e493723e92fac1e3ae6dirkMagick::GravityType Magick::Options::textGravity() const
668d37417692d7a7040aa854e493723e92fac1e3ae6dirk{
669d37417692d7a7040aa854e493723e92fac1e3ae6dirk  return(_drawInfo->gravity);
670d37417692d7a7040aa854e493723e92fac1e3ae6dirk}
671d37417692d7a7040aa854e493723e92fac1e3ae6dirk
672a424799a0e5bfd6d1b7941c044e067fbf18d319fdirkvoid Magick::Options::textInterlineSpacing(double spacing_)
673a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk{
674a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk  _drawInfo->interline_spacing=spacing_;
675a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk}
676a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk
677a424799a0e5bfd6d1b7941c044e067fbf18d319fdirkdouble Magick::Options::textInterlineSpacing(void) const
678a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk{
679a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk  return(_drawInfo->interline_spacing);
680a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk}
681a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk
682a424799a0e5bfd6d1b7941c044e067fbf18d319fdirkvoid Magick::Options::textInterwordSpacing(double spacing_)
683a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk{
684a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk  _drawInfo->interword_spacing=spacing_;
685a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk}
686a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk
687a424799a0e5bfd6d1b7941c044e067fbf18d319fdirkdouble Magick::Options::textInterwordSpacing(void) const
688a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk{
689a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk  return(_drawInfo->interword_spacing);
690a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk}
691a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk
692a424799a0e5bfd6d1b7941c044e067fbf18d319fdirkvoid Magick::Options::textKerning(double kerning_)
693a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk{
694a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk  _drawInfo->kerning=kerning_;
695a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk}
696a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk
697a424799a0e5bfd6d1b7941c044e067fbf18d319fdirkdouble Magick::Options::textKerning(void) const
698a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk{
699a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk  return(_drawInfo->kerning);
700a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk}
701a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk
70283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::transformOrigin(double tx_,double ty_)
7033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
70483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  AffineMatrix
70583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    affine,
70683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    current=_drawInfo->affine;
70783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
7083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.sx=1.0;
7093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.rx=0.0;
7103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.ry=0.0;
7113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.sy=1.0;
7123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.tx=0.0;
7133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.ty=0.0;
7143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
71583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  affine.tx=tx_;
71683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  affine.ty=ty_;
7173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
7183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.sx=current.sx*affine.sx+current.ry*affine.rx;
7193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.rx=current.rx*affine.sx+current.sy*affine.rx;
7203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.ry=current.sx*affine.ry+current.ry*affine.sy;
7213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.sy=current.rx*affine.ry+current.sy*affine.sy;
7223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.tx=current.sx*affine.tx+current.ry*affine.ty+current.tx;
7233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.ty=current.rx*affine.tx+current.sy*affine.ty+current.ty;
7243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
7253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
72683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::transformReset(void)
7273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
7283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.sx=1.0;
7293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.rx=0.0;
7303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.ry=0.0;
7313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.sy=1.0;
7323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.tx=0.0;
7333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.ty=0.0;
7343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
7353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
73683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::transformRotation(double angle_)
7373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
73883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  AffineMatrix
73983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    affine,
74083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    current=_drawInfo->affine;
74183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
7423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.sx=1.0;
7433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.rx=0.0;
7443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.ry=0.0;
7453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.sy=1.0;
7463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.tx=0.0;
7473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.ty=0.0;
7483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
7493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.sx=cos(DegreesToRadians(fmod(angle_,360.0)));
7503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.rx=(-sin(DegreesToRadians(fmod(angle_,360.0))));
7513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.ry=sin(DegreesToRadians(fmod(angle_,360.0)));
7523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.sy=cos(DegreesToRadians(fmod(angle_,360.0)));
7533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
7543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.sx=current.sx*affine.sx+current.ry*affine.rx;
7553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.rx=current.rx*affine.sx+current.sy*affine.rx;
7563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.ry=current.sx*affine.ry+current.ry*affine.sy;
7573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.sy=current.rx*affine.ry+current.sy*affine.sy;
7583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.tx=current.sx*affine.tx+current.ry*affine.ty+current.tx;
7593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.ty=current.rx*affine.tx+current.sy*affine.ty+current.ty;
7603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
7613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
76283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::transformScale(double sx_,double sy_)
7633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
76483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  AffineMatrix
76583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    affine,
76683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    current=_drawInfo->affine;
76783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
7683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.sx=1.0;
7693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.rx=0.0;
7703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.ry=0.0;
7713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.sy=1.0;
7723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.tx=0.0;
7733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.ty=0.0;
7743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
77583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  affine.sx=sx_;
77683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  affine.sy=sy_;
7773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
7783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.sx=current.sx*affine.sx+current.ry*affine.rx;
7793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.rx=current.rx*affine.sx+current.sy*affine.rx;
7803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.ry=current.sx*affine.ry+current.ry*affine.sy;
7813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.sy=current.rx*affine.ry+current.sy*affine.sy;
7823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.tx=current.sx*affine.tx+current.ry*affine.ty+current.tx;
7833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.ty=current.rx*affine.tx+current.sy*affine.ty+current.ty;
7843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
7853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
78683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::transformSkewX(double skewx_)
7873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
78883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  AffineMatrix
78983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    affine,
79083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    current=_drawInfo->affine;
79183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
7923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.sx=1.0;
7933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.rx=0.0;
7943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.ry=0.0;
7953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.sy=1.0;
7963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.tx=0.0;
7973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.ty=0.0;
7983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
7993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.sx=1.0;
8003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.ry=tan(DegreesToRadians(fmod(skewx_,360.0)));
8013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.sy=1.0;
8023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
8033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.sx=current.sx*affine.sx+current.ry*affine.rx;
8043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.rx=current.rx*affine.sx+current.sy*affine.rx;
8053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.ry=current.sx*affine.ry+current.ry*affine.sy;
8063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.sy=current.rx*affine.ry+current.sy*affine.sy;
8073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.tx=current.sx*affine.tx+current.ry*affine.ty+current.tx;
8083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.ty=current.rx*affine.tx+current.sy*affine.ty+current.ty;
8093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
8103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
81183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::transformSkewY(double skewy_)
8123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
81383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  AffineMatrix
81483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    affine,
81583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    current=_drawInfo->affine;
81683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
8173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.sx=1.0;
8183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.rx=0.0;
8193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.ry=0.0;
8203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.sy=1.0;
8213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.tx=0.0;
8223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.ty=0.0;
8233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
8243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.sx=1.0;
8253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.rx=tan(DegreesToRadians(fmod(skewy_,360.0)));
8263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.sy=1.0;
8273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
8283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.sx=current.sx*affine.sx+current.ry*affine.rx;
8293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.rx=current.rx*affine.sx+current.sy*affine.rx;
8303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.ry=current.sx*affine.ry+current.ry*affine.sy;
8313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.sy=current.rx*affine.ry+current.sy*affine.sy;
8323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.tx=current.sx*affine.tx+current.ry*affine.ty+current.tx;
8333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.ty=current.rx*affine.tx+current.sy*affine.ty+current.ty;
8343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
8353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
83683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::type(const Magick::ImageType type_)
83783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk{
83883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _imageInfo->type=type_;
83983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk}
84083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
84183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagick::ImageType Magick::Options::type(void) const
8423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
84383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_imageInfo->type);
8443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
84583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
84683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::verbose(bool verboseFlag_)
8473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
84883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _imageInfo->verbose=(MagickBooleanType) verboseFlag_;
8493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
8503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
85183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkbool Magick::Options::verbose(void) const
8523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
85383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(static_cast<bool>(_imageInfo->verbose));
85483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk}
85583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
85683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::view(const std::string &view_)
85783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk{
85883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (view_.length() == 0)
8593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    _imageInfo->view=(char *) RelinquishMagickMemory(_imageInfo->view);
8603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  else
86183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    Magick::CloneString(&_imageInfo->view, view_);
8623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
86383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
86483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkstd::string Magick::Options::view(void) const
8653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
86683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (_imageInfo->view)
86783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    return(std::string(_imageInfo->view));
8683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
86983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(std::string());
8703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
8713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
87283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::x11Display(const std::string &display_)
8733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
87483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (display_.length() == 0)
87583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    _imageInfo->server_name=(char *) RelinquishMagickMemory(
87683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk      _imageInfo->server_name);
8773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  else
87883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    Magick::CloneString(&_imageInfo->server_name,display_);
8793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
88083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
88183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkstd::string Magick::Options::x11Display(void) const
8823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
88383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (_imageInfo->server_name)
88483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    return(std::string( _imageInfo->server_name));
8853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
88683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(std::string());
8873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
8883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
88983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagickCore::DrawInfo *Magick::Options::drawInfo(void)
8903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
89183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_drawInfo);
8923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
8933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
89483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagickCore::ImageInfo *Magick::Options::imageInfo(void)
8953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
89683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_imageInfo);
8973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
8983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
89983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagickCore::QuantizeInfo *Magick::Options::quantizeInfo(void)
9003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
90183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_quantizeInfo);
9023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
90383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
90483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagick::Options::Options(const MagickCore::ImageInfo* imageInfo_,
90583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  const MagickCore::QuantizeInfo* quantizeInfo_,
90683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  const MagickCore::DrawInfo* drawInfo_)
90783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk: _imageInfo(0),
90883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _quantizeInfo(0),
90983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _drawInfo(0)
91083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk{
91183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _imageInfo=CloneImageInfo(imageInfo_);
91283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _quantizeInfo=CloneQuantizeInfo(quantizeInfo_);
91383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _drawInfo=CloneDrawInfo(imageInfo_,drawInfo_);
914830e974c2864362a20c44c4a6e915b523cb56c66cristy}
915