13ed852eea50f9d4cd633efb8c2b054b8e33c253cristy// This may look like C code, but it is really -*- C++ -*-
23ed852eea50f9d4cd633efb8c2b054b8e33c253cristy//
33ed852eea50f9d4cd633efb8c2b054b8e33c253cristy// Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003
4b6f009f769ad7a6ca2c83d00e06565e64fc65aaddirk// Copyright Dirk Lemstra 2014-2016
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)))),
3207f84e72b205d18eb8ad35380af95351d9f0a1a3dirk    _drawInfo(static_cast<DrawInfo*>(AcquireMagickMemory(sizeof(DrawInfo)))),
3307f84e72b205d18eb8ad35380af95351d9f0a1a3dirk    _quiet(false)
343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  // Initialize image info with defaults
3683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  GetImageInfo(_imageInfo);
3783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  // Initialize quantization info
3983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  GetQuantizeInfo(_quantizeInfo);
403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  // Initialize drawing info
4283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  GetDrawInfo(_imageInfo,_drawInfo);
433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
4561ab4ad4628896f4b8a4dbc6a369a93c8696efcadirkMagick::Options::Options(const Options& options_)
461888443d44c6a29f8d0836521a9c6a34b3a12006dirk  : _imageInfo(CloneImageInfo(options_._imageInfo)),
473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    _quantizeInfo(CloneQuantizeInfo(options_._quantizeInfo)),
4807f84e72b205d18eb8ad35380af95351d9f0a1a3dirk    _drawInfo(CloneDrawInfo(_imageInfo,options_._drawInfo)),
4907f84e72b205d18eb8ad35380af95351d9f0a1a3dirk    _quiet(options_._quiet)
503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
533ed852eea50f9d4cd633efb8c2b054b8e33c253cristyMagick::Options::~Options()
543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  // Destroy image info
5683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk   _imageInfo=DestroyImageInfo(_imageInfo);
573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  // Destroy quantization info
5983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk   _quantizeInfo=DestroyQuantizeInfo(_quantizeInfo);
603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  // Destroy drawing info
6283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk   _drawInfo=DestroyDrawInfo(_drawInfo);
633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
650575024ee81530a499dd4199aa07d608ec1c87e1dirkvoid Magick::Options::adjoin(const bool flag_)
663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
6783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _imageInfo->adjoin=static_cast<MagickBooleanType>(
6883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    flag_ ? MagickTrue : MagickFalse);
693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
7083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
7183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkbool Magick::Options::adjoin(void) const
723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
7383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(static_cast<bool>(_imageInfo->adjoin));
743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
76b797b2c96f796f4920c9ee807dc5f47e6f160418dirkvoid Magick::Options::alphaColor(const Color &alphaColor_)
77b797b2c96f796f4920c9ee807dc5f47e6f160418dirk{
78b797b2c96f796f4920c9ee807dc5f47e6f160418dirk  _imageInfo->alpha_color=alphaColor_;
79b797b2c96f796f4920c9ee807dc5f47e6f160418dirk}
80b797b2c96f796f4920c9ee807dc5f47e6f160418dirk
81b797b2c96f796f4920c9ee807dc5f47e6f160418dirkMagick::Color Magick::Options::alphaColor(void) const
82b797b2c96f796f4920c9ee807dc5f47e6f160418dirk{
83b797b2c96f796f4920c9ee807dc5f47e6f160418dirk  return(Magick::Color(_imageInfo->alpha_color));
84b797b2c96f796f4920c9ee807dc5f47e6f160418dirk}
85b797b2c96f796f4920c9ee807dc5f47e6f160418dirk
8661ab4ad4628896f4b8a4dbc6a369a93c8696efcadirkvoid Magick::Options::backgroundColor(const Color &color_)
873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
8883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _imageInfo->background_color=color_;
893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
9083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
9183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagick::Color Magick::Options::backgroundColor(void) const
923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
9361ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk  return(Color(_imageInfo->background_color));
943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
9683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::backgroundTexture(const std::string &backgroundTexture_)
973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
9883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (backgroundTexture_.length() == 0)
993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    _imageInfo->texture=(char *) RelinquishMagickMemory(_imageInfo->texture);
1003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  else
10183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    Magick::CloneString(&_imageInfo->texture,backgroundTexture_);
1023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
10383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
10483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkstd::string Magick::Options::backgroundTexture(void) const
1053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
10683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (_imageInfo->texture)
10783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    return(std::string(_imageInfo->texture));
1083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  else
10983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    return(std::string());
1103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
1113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
11283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::borderColor(const Color &color_)
1133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
11483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _imageInfo->border_color=color_;
11583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _drawInfo->border_color=color_;
1163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
11783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
11883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagick::Color Magick::Options::borderColor(void) const
1193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
12061ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk  return(Color(_imageInfo->border_color));
1213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
1223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
12361ab4ad4628896f4b8a4dbc6a369a93c8696efcadirkvoid Magick::Options::boxColor(const Color &boxColor_)
1243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
12583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _drawInfo->undercolor=boxColor_;
1263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
12783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
12883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagick::Color Magick::Options::boxColor(void) const
1293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
13061ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk  return(Color(_drawInfo->undercolor));
1313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
1323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
1330575024ee81530a499dd4199aa07d608ec1c87e1dirkvoid Magick::Options::colorspaceType(const ColorspaceType colorspace_)
1343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
13583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _imageInfo->colorspace=colorspace_;
1363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
13783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
13883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagick::ColorspaceType Magick::Options::colorspaceType(void) const
1393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
14083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(static_cast<Magick::ColorspaceType>(_imageInfo->colorspace));
1413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
1423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
1430575024ee81530a499dd4199aa07d608ec1c87e1dirkvoid Magick::Options::compressType(const CompressionType compressType_)
1443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
14583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _imageInfo->compression=compressType_;
1463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
14783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
14883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagick::CompressionType Magick::Options::compressType(void) const
1493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
15083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(static_cast<Magick::CompressionType>(_imageInfo->compression));
1513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
1523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
1530575024ee81530a499dd4199aa07d608ec1c87e1dirkvoid Magick::Options::colorFuzz(const double fuzz_)
1543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
15583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _imageInfo->fuzz=fuzz_;
1563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
15783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
15883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkdouble Magick::Options::colorFuzz(void) const
1593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
16083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_imageInfo->fuzz);
1613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
1623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
1630575024ee81530a499dd4199aa07d608ec1c87e1dirkvoid Magick::Options::debug(const bool flag_)
1643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
16583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if  (flag_)
16683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    SetLogEventMask("All");
1673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  else
16883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    SetLogEventMask("None");
1693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
17083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
17183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkbool Magick::Options::debug(void) const
1723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
17383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (IsEventLogging())
17483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    return(true);
17583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(false);
1763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
1773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
17861ab4ad4628896f4b8a4dbc6a369a93c8696efcadirkvoid Magick::Options::density(const Point &density_)
1793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
180be1bbacaa9919aa3754e3abae43557be13669657dirk  if (!density_.isValid())
1813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    _imageInfo->density=(char *) RelinquishMagickMemory(_imageInfo->density);
1823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  else
18361ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk   CloneString(&_imageInfo->density,density_);
1843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
18583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
186be1bbacaa9919aa3754e3abae43557be13669657dirkMagick::Point Magick::Options::density(void) const
1873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
18883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (_imageInfo->density)
189be1bbacaa9919aa3754e3abae43557be13669657dirk    return(Point(_imageInfo->density));
1903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
191be1bbacaa9919aa3754e3abae43557be13669657dirk  return(Point());
1923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
1933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
1940575024ee81530a499dd4199aa07d608ec1c87e1dirkvoid Magick::Options::depth(const size_t depth_)
1953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
19683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _imageInfo->depth=depth_;
1973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
19883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
19983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirksize_t Magick::Options::depth(void) const
2003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
20183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_imageInfo->depth);
2023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
2033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
2040575024ee81530a499dd4199aa07d608ec1c87e1dirkvoid Magick::Options::endian(const Magick::EndianType endian_)
2053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
20683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _imageInfo->endian=endian_;
2073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
20883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
20983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagick::EndianType Magick::Options::endian(void) const
2103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
21183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_imageInfo->endian);
2123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
2133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
21483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::file(FILE *file_)
21515781e5110c893ce0eb7924926ae0d1a056f90ebcristy{
21683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  SetImageInfoFile(_imageInfo,file_);
21715781e5110c893ce0eb7924926ae0d1a056f90ebcristy}
21883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
21983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkFILE *Magick::Options::file(void) const
22015781e5110c893ce0eb7924926ae0d1a056f90ebcristy{
22183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(GetImageInfoFile(_imageInfo));
22215781e5110c893ce0eb7924926ae0d1a056f90ebcristy}
22315781e5110c893ce0eb7924926ae0d1a056f90ebcristy
22483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::fileName(const std::string &fileName_)
2253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
226151b66dffc9e3c2e8c4f8cdaca37ff987ca0f497cristy  fileName_.copy(_imageInfo->filename,MagickPathExtent-1);
227151b66dffc9e3c2e8c4f8cdaca37ff987ca0f497cristy  if (fileName_.length() > MagickPathExtent-1)
228151b66dffc9e3c2e8c4f8cdaca37ff987ca0f497cristy    _imageInfo->filename[MagickPathExtent-1]=0;
22983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  else
23083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    _imageInfo->filename[fileName_.length()]=0;
2313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
23283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
23383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkstd::string Magick::Options::fileName(void) const
2343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
23583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(std::string(_imageInfo->filename));
2363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
2373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
23861ab4ad4628896f4b8a4dbc6a369a93c8696efcadirkvoid Magick::Options::fillColor(const Color &fillColor_)
2393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
24083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _drawInfo->fill=fillColor_;
24161ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk  if (fillColor_ == Color())
2423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    fillPattern((const MagickCore::Image*) NULL);
24361ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk  setOption("fill",fillColor_);
2443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
24583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
24683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagick::Color Magick::Options::fillColor(void) const
2473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
24883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_drawInfo->fill);
2493ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
25083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
25183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::fillPattern(const MagickCore::Image *fillPattern_)
2523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
25383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (_drawInfo->fill_pattern)
25483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk      _drawInfo->fill_pattern=DestroyImageList(_drawInfo->fill_pattern);
25583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
25683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (fillPattern_)
2573ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    {
25883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk      GetPPException;
25983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk      _drawInfo->fill_pattern=CloneImage(const_cast<MagickCore::Image*>(
26083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk        fillPattern_),0,0,static_cast<MagickBooleanType>(MagickTrue),
261e31feb8a39ea937a6328da579085cd2ee66ab4c0dirk        exceptionInfo);
26207f84e72b205d18eb8ad35380af95351d9f0a1a3dirk      ThrowPPException(_quiet);
2633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    }
2643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
26583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
26683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkconst MagickCore::Image *Magick::Options::fillPattern(void) const
2673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
26883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_drawInfo->fill_pattern);
2693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
2703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
27161ab4ad4628896f4b8a4dbc6a369a93c8696efcadirkvoid Magick::Options::fillRule(const FillRule &fillRule_)
2723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
27383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _drawInfo->fill_rule=fillRule_;
2743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
27583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
27683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagick::FillRule Magick::Options::fillRule(void) const
2773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
27883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_drawInfo->fill_rule);
2793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
2803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
28183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::font(const std::string &font_)
2823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
28383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (font_.length() == 0)
2843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    {
2853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      _imageInfo->font=(char *) RelinquishMagickMemory(_imageInfo->font);
2863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      _drawInfo->font=(char *) RelinquishMagickMemory(_drawInfo->font);
2873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    }
2883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  else
2893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    {
29083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk      Magick::CloneString(&_imageInfo->font,font_);
29183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk      Magick::CloneString(&_drawInfo->font,font_);
2923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    }
2933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
29483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
29583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkstd::string Magick::Options::font(void) const
2963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
29783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (_imageInfo->font)
29883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    return(std::string(_imageInfo->font));
2993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
30083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(std::string());
3013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
3023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
3036409f34d637a34a1c643632aa849371ec8b3b5a8dirkvoid Magick::Options::fontFamily(const std::string &family_)
3046409f34d637a34a1c643632aa849371ec8b3b5a8dirk{
3056409f34d637a34a1c643632aa849371ec8b3b5a8dirk  if (family_.length() == 0)
3066409f34d637a34a1c643632aa849371ec8b3b5a8dirk    {
3076409f34d637a34a1c643632aa849371ec8b3b5a8dirk      _drawInfo->family=(char *) RelinquishMagickMemory(_drawInfo->font);
30814489718d12a28c56ea1d858114b45730c929409dirk      DestroyString(RemoveImageOption(imageInfo(),"family"));
3096409f34d637a34a1c643632aa849371ec8b3b5a8dirk    }
3106409f34d637a34a1c643632aa849371ec8b3b5a8dirk  else
3116409f34d637a34a1c643632aa849371ec8b3b5a8dirk    {
3126409f34d637a34a1c643632aa849371ec8b3b5a8dirk      Magick::CloneString(&_drawInfo->family,family_);
3136409f34d637a34a1c643632aa849371ec8b3b5a8dirk      (void) SetImageOption(imageInfo(),"family",family_.c_str());
3146409f34d637a34a1c643632aa849371ec8b3b5a8dirk    }
3156409f34d637a34a1c643632aa849371ec8b3b5a8dirk}
3166409f34d637a34a1c643632aa849371ec8b3b5a8dirk
3176409f34d637a34a1c643632aa849371ec8b3b5a8dirkstd::string Magick::Options::fontFamily(void) const
3186409f34d637a34a1c643632aa849371ec8b3b5a8dirk{
3196409f34d637a34a1c643632aa849371ec8b3b5a8dirk  if (_drawInfo->family)
3206409f34d637a34a1c643632aa849371ec8b3b5a8dirk    return(std::string(_drawInfo->family));
3216409f34d637a34a1c643632aa849371ec8b3b5a8dirk
3226409f34d637a34a1c643632aa849371ec8b3b5a8dirk  return(std::string());
3236409f34d637a34a1c643632aa849371ec8b3b5a8dirk}
3246409f34d637a34a1c643632aa849371ec8b3b5a8dirk
3250575024ee81530a499dd4199aa07d608ec1c87e1dirkvoid Magick::Options::fontPointsize(const double pointSize_)
3263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
32783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _imageInfo->pointsize=pointSize_;
32883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _drawInfo->pointsize=pointSize_;
3293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
33083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
33183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkdouble Magick::Options::fontPointsize(void) const
3323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
33383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_imageInfo->pointsize);
3343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
3353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
3360575024ee81530a499dd4199aa07d608ec1c87e1dirkvoid Magick::Options::fontStyle(const StyleType style_)
33761ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk{
33861ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk  _drawInfo->style=style_;
33961ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk  (void) SetImageOption(_imageInfo,"style",CommandOptionToMnemonic(
34061ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk    MagickStyleOptions,(ssize_t) style_));
34161ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk}
34261ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk
34361ab4ad4628896f4b8a4dbc6a369a93c8696efcadirkMagick::StyleType Magick::Options::fontStyle(void) const
34461ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk{
34561ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk  return(_drawInfo->style);
34661ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk}
34761ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk
3480575024ee81530a499dd4199aa07d608ec1c87e1dirkvoid Magick::Options::fontWeight(const size_t weight_)
34961ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk{
35061ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk  _drawInfo->weight=weight_;
35161ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk  setOption("weight",(double) weight_);
35261ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk}
35361ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk
35461ab4ad4628896f4b8a4dbc6a369a93c8696efcadirksize_t Magick::Options::fontWeight(void) const
35561ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk{
35661ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk  return(_drawInfo->weight);
35761ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk}
35861ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk
35983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkstd::string Magick::Options::format(void) const
3603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
36183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  const MagickInfo
36283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    *magick_info=0;
3633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
36483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  GetPPException;
36583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (*_imageInfo->magick != '\0' )
366e31feb8a39ea937a6328da579085cd2ee66ab4c0dirk    magick_info = GetMagickInfo(_imageInfo->magick,exceptionInfo);
36707f84e72b205d18eb8ad35380af95351d9f0a1a3dirk  ThrowPPException(_quiet);
36883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
36983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if ((magick_info != 0) && (*magick_info->description != '\0'))
37083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    return(std::string( magick_info->description));
3713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
37283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(std::string());
3733ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
3743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
3750575024ee81530a499dd4199aa07d608ec1c87e1dirkvoid Magick::Options::interlaceType(const InterlaceType interlace_)
3763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
37783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _imageInfo->interlace=interlace_;
3783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
37983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
38083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagick::InterlaceType Magick::Options::interlaceType(void) const
3813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
38283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(static_cast<Magick::InterlaceType>(_imageInfo->interlace));
3833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
3843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
38583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::magick(const std::string &magick_)
3863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
38749ccbc806b20f4892e6c8588768617afdfcee3cddirk  if (magick_.empty())
38849ccbc806b20f4892e6c8588768617afdfcee3cddirk  {
3891723755555721a4f099b6d4e691de1114cdee5e5dirk    _imageInfo->magick[0] = '\0';
39049ccbc806b20f4892e6c8588768617afdfcee3cddirk    return;
39149ccbc806b20f4892e6c8588768617afdfcee3cddirk  }
39249ccbc806b20f4892e6c8588768617afdfcee3cddirk
393151b66dffc9e3c2e8c4f8cdaca37ff987ca0f497cristy  FormatLocaleString(_imageInfo->filename,MagickPathExtent,"%.1024s:",
39483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    magick_.c_str());
39583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  GetPPException;
396e31feb8a39ea937a6328da579085cd2ee66ab4c0dirk  SetImageInfo(_imageInfo,1,exceptionInfo);
397af4a73fc720b635879b16dd01b78abf468fcbba7cristy  if ( _imageInfo->magick[0] == '\0' )
398af4a73fc720b635879b16dd01b78abf468fcbba7cristy    throwExceptionExplicit(MagickCore::OptionError,"Unrecognized image format",
399af4a73fc720b635879b16dd01b78abf468fcbba7cristy      magick_.c_str());
40007f84e72b205d18eb8ad35380af95351d9f0a1a3dirk  ThrowPPException(_quiet);
4013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
40283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
40383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkstd::string Magick::Options::magick(void) const
4043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
405af4a73fc720b635879b16dd01b78abf468fcbba7cristy  if ( _imageInfo->magick[0] != '\0' )
40683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    return(std::string(_imageInfo->magick));
40783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
40883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(std::string());
4093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
4103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
4110575024ee81530a499dd4199aa07d608ec1c87e1dirkvoid Magick::Options::monochrome(const bool monochromeFlag_)
4123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
41383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _imageInfo->monochrome=(MagickBooleanType) monochromeFlag_;
4143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
41583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
41683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkbool Magick::Options::monochrome(void) const
4173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
41883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(static_cast<bool>(_imageInfo->monochrome));
4193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
4203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
42161ab4ad4628896f4b8a4dbc6a369a93c8696efcadirkvoid Magick::Options::page(const Geometry &pageSize_)
4223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
42383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (!pageSize_.isValid())
4243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    _imageInfo->page=(char *) RelinquishMagickMemory(_imageInfo->page);
4253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  else
42683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    Magick::CloneString(&_imageInfo->page,pageSize_);
4273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
42883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
42983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagick::Geometry Magick::Options::page(void) const
4303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
43183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (_imageInfo->page)
43283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    return(Geometry(_imageInfo->page));
4333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
43483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(Geometry());
4353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
4363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
4370575024ee81530a499dd4199aa07d608ec1c87e1dirkvoid Magick::Options::quality(const size_t quality_)
4383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
43983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _imageInfo->quality=quality_;
4403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
44183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
44283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirksize_t Magick::Options::quality(void) const
4433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
44483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_imageInfo->quality);
4453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
4463ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
4470575024ee81530a499dd4199aa07d608ec1c87e1dirkvoid Magick::Options::quantizeColors(const size_t colors_)
4483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
44983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _quantizeInfo->number_colors=colors_;
4503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
45183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
45283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirksize_t Magick::Options::quantizeColors(void) const
4533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
45483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_quantizeInfo->number_colors);
4553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
4563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
4570575024ee81530a499dd4199aa07d608ec1c87e1dirkvoid Magick::Options::quantizeColorSpace(const ColorspaceType colorSpace_)
4583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
45983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _quantizeInfo->colorspace=colorSpace_;
4603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
46183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
46283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagick::ColorspaceType Magick::Options::quantizeColorSpace(void) const
4633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
46483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(static_cast<Magick::ColorspaceType>(_quantizeInfo->colorspace));
4653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
4663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
4670575024ee81530a499dd4199aa07d608ec1c87e1dirkvoid Magick::Options::quantizeDither(const bool ditherFlag_)
4683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
46983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _imageInfo->dither=(MagickBooleanType) ditherFlag_;
47083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _quantizeInfo->dither_method=ditherFlag_ ? RiemersmaDitherMethod :
471cbda611068350bf4459f2dda1951f8823702e129cristy    NoDitherMethod;
4723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
47383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
47483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkbool Magick::Options::quantizeDither(void) const
4753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
47683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(static_cast<bool>(_imageInfo->dither));
4773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
4783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
4790575024ee81530a499dd4199aa07d608ec1c87e1dirkvoid Magick::Options::quantizeDitherMethod(const DitherMethod ditherMethod_)
4806d64b3658c2fa7218fbc309b9c85e3ec4441310edirk{
4816d64b3658c2fa7218fbc309b9c85e3ec4441310edirk  _quantizeInfo->dither_method=ditherMethod_;
4826d64b3658c2fa7218fbc309b9c85e3ec4441310edirk}
4836d64b3658c2fa7218fbc309b9c85e3ec4441310edirk
4846d64b3658c2fa7218fbc309b9c85e3ec4441310edirkMagickCore::DitherMethod Magick::Options::quantizeDitherMethod(void) const
4856d64b3658c2fa7218fbc309b9c85e3ec4441310edirk{
4866d64b3658c2fa7218fbc309b9c85e3ec4441310edirk  return(_quantizeInfo->dither_method);
4876d64b3658c2fa7218fbc309b9c85e3ec4441310edirk}
4886d64b3658c2fa7218fbc309b9c85e3ec4441310edirk
4890575024ee81530a499dd4199aa07d608ec1c87e1dirkvoid Magick::Options::quantizeTreeDepth(const size_t treeDepth_)
4903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
49183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _quantizeInfo->tree_depth=treeDepth_;
4923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
49383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
49483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirksize_t Magick::Options::quantizeTreeDepth(void) const
4953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
49683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_quantizeInfo->tree_depth);
4973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
4983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
49907f84e72b205d18eb8ad35380af95351d9f0a1a3dirkvoid Magick::Options::quiet(const bool quiet_)
50007f84e72b205d18eb8ad35380af95351d9f0a1a3dirk{
50107f84e72b205d18eb8ad35380af95351d9f0a1a3dirk  _quiet=quiet_;
50207f84e72b205d18eb8ad35380af95351d9f0a1a3dirk}
50307f84e72b205d18eb8ad35380af95351d9f0a1a3dirk
50407f84e72b205d18eb8ad35380af95351d9f0a1a3dirkbool Magick::Options::quiet(void) const
50507f84e72b205d18eb8ad35380af95351d9f0a1a3dirk{
50607f84e72b205d18eb8ad35380af95351d9f0a1a3dirk  return(_quiet);
50707f84e72b205d18eb8ad35380af95351d9f0a1a3dirk}
50807f84e72b205d18eb8ad35380af95351d9f0a1a3dirk
5090575024ee81530a499dd4199aa07d608ec1c87e1dirkvoid Magick::Options::resolutionUnits(const ResolutionType resolutionUnits_)
5103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
51183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _imageInfo->units=resolutionUnits_;
5123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
51383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
51483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagick::ResolutionType Magick::Options::resolutionUnits(void) const
5153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
51661ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk  return(_imageInfo->units);
5173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
5183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
51983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::samplingFactor(const std::string &samplingFactor_)
5203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
52183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (samplingFactor_.length() == 0)
52283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    _imageInfo->sampling_factor=(char *) RelinquishMagickMemory(
52383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk      _imageInfo->sampling_factor);
5243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  else
52583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    Magick::CloneString(&_imageInfo->sampling_factor,samplingFactor_);
5263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
52783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
52883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkstd::string Magick::Options::samplingFactor(void) const
5293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
53083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (_imageInfo->sampling_factor)
53183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    return(std::string(_imageInfo->sampling_factor));
5323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
53383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(std::string());
5343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
5353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
53683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::size(const Geometry &geometry_)
5373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
5383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _imageInfo->size=(char *) RelinquishMagickMemory(_imageInfo->size);
5393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
54083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (geometry_.isValid())
54183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    Magick::CloneString(&_imageInfo->size,geometry_);
5423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
54383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
54483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagick::Geometry Magick::Options::size(void) const
5453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
54683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (_imageInfo->size)
54783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    return(Geometry(_imageInfo->size));
5483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
54983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(Geometry());
5503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
5513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
5520575024ee81530a499dd4199aa07d608ec1c87e1dirkvoid Magick::Options::strokeAntiAlias(const bool flag_)
5533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
55483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  flag_ ? _drawInfo->stroke_antialias=MagickTrue :
55583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    _drawInfo->stroke_antialias=MagickFalse;
5563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
55783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
55883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkbool Magick::Options::strokeAntiAlias(void) const
5593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
56083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_drawInfo->stroke_antialias != 0 ? true : false);
5613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
5623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
56361ab4ad4628896f4b8a4dbc6a369a93c8696efcadirkvoid Magick::Options::strokeColor(const Color &strokeColor_)
5643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
56583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _drawInfo->stroke=strokeColor_;
56661ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk  if (strokeColor_ == Color())
56761ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk    strokePattern((const MagickCore::Image*) NULL);
56861ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk  setOption("stroke",strokeColor_);
5693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
57083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
57183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagick::Color Magick::Options::strokeColor(void) const
5723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
57383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_drawInfo->stroke);
5743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
5753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
57683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::strokeDashArray(const double *strokeDashArray_)
5773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
57883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _drawInfo->dash_pattern=(double *) RelinquishMagickMemory(
57983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    _drawInfo->dash_pattern);
5803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
5813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  if(strokeDashArray_)
5823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    {
58383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk      size_t
58483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk        x;
5853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      // Count elements in dash array
5863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      for (x=0; strokeDashArray_[x]; x++) ;
5873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      // Allocate elements
58883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk      _drawInfo->dash_pattern=static_cast<double*>(AcquireMagickMemory((x+1)*
58983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk        sizeof(double)));
5903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy      // Copy elements
59183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk      memcpy(_drawInfo->dash_pattern,strokeDashArray_,(x+1)*sizeof(double));
59219cc523d0bb19eeb7b8e4f8c19a275ba8f314eeadirk      _drawInfo->dash_pattern[x]=0.0;
5933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    }
5943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
59583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
59683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkconst double *Magick::Options::strokeDashArray(void) const
5973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
59883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_drawInfo->dash_pattern);
5993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
6003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
6010575024ee81530a499dd4199aa07d608ec1c87e1dirkvoid Magick::Options::strokeDashOffset(const double strokeDashOffset_)
6023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
60383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _drawInfo->dash_offset=strokeDashOffset_;
6043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
60583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
60683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkdouble Magick::Options::strokeDashOffset(void) const
6073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
60883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_drawInfo->dash_offset);
6093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
6103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
6110575024ee81530a499dd4199aa07d608ec1c87e1dirkvoid Magick::Options::strokeLineCap(const LineCap lineCap_)
6123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
61383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _drawInfo->linecap=lineCap_;
6143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
61583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
61683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagick::LineCap Magick::Options::strokeLineCap(void) const
6173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
61883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_drawInfo->linecap);
6193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
6203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
6210575024ee81530a499dd4199aa07d608ec1c87e1dirkvoid Magick::Options::strokeLineJoin(const LineJoin lineJoin_)
6223ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
62383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _drawInfo->linejoin=lineJoin_;
6243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
62583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
62683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagick::LineJoin Magick::Options::strokeLineJoin(void) const
6273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
62883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_drawInfo->linejoin);
6293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
6303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
6310575024ee81530a499dd4199aa07d608ec1c87e1dirkvoid Magick::Options::strokeMiterLimit(const size_t miterLimit_)
6323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
63383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _drawInfo->miterlimit=miterLimit_;
6343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
63583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
63683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirksize_t Magick::Options::strokeMiterLimit(void) const
6373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
63883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_drawInfo->miterlimit);
6393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
6403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
64183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::strokePattern(const MagickCore::Image *strokePattern_)
6423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
64383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (_drawInfo->stroke_pattern)
64483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    _drawInfo->stroke_pattern=DestroyImageList(_drawInfo->stroke_pattern);
6453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
64683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (strokePattern_)
6473ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    {
64883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk      GetPPException;
64977328896b876314656427663695bc7b2c9be3f74dirk      _drawInfo->stroke_pattern=CloneImage(const_cast<MagickCore::Image*>(
650e31feb8a39ea937a6328da579085cd2ee66ab4c0dirk        strokePattern_),0,0,MagickTrue,exceptionInfo);
651170ed0c49740abf48dfcd2938532241fb760e910dirk      ThrowPPException(_quiet);
6523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    }
6533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
65483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
65583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkconst MagickCore::Image *Magick::Options::strokePattern(void) const
6563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
65783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_drawInfo->stroke_pattern);
6583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
6593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
6600575024ee81530a499dd4199aa07d608ec1c87e1dirkvoid Magick::Options::strokeWidth(const double strokeWidth_)
6613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
66283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _drawInfo->stroke_width=strokeWidth_;
66361ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk  setOption("strokewidth",strokeWidth_);
6643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
66583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
66683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkdouble Magick::Options::strokeWidth(void) const
6673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
66883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_drawInfo->stroke_width);
6693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
6703ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
6710575024ee81530a499dd4199aa07d608ec1c87e1dirkvoid Magick::Options::subImage(const size_t subImage_)
6723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
67383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _imageInfo->scene=subImage_;
6743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
67583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
67683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirksize_t Magick::Options::subImage(void) const
6773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
67883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_imageInfo->scene);
6793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
6803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
6810575024ee81530a499dd4199aa07d608ec1c87e1dirkvoid Magick::Options::subRange(const size_t subRange_)
6823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
68383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _imageInfo->number_scenes=subRange_;
6843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
68583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
68683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirksize_t Magick::Options::subRange(void) const
6873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
68883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_imageInfo->number_scenes);
6893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
6903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
6910575024ee81530a499dd4199aa07d608ec1c87e1dirkvoid Magick::Options::textAntiAlias(const bool flag_)
692ea20b31c9b8d1a55b400559ae15760243dcb897fdirk{
693ea20b31c9b8d1a55b400559ae15760243dcb897fdirk  _drawInfo->text_antialias=static_cast<MagickBooleanType>(
694ea20b31c9b8d1a55b400559ae15760243dcb897fdirk    flag_ ? MagickTrue : MagickFalse);
695ea20b31c9b8d1a55b400559ae15760243dcb897fdirk}
696ea20b31c9b8d1a55b400559ae15760243dcb897fdirk
697ea20b31c9b8d1a55b400559ae15760243dcb897fdirkbool Magick::Options::textAntiAlias(void) const
698ea20b31c9b8d1a55b400559ae15760243dcb897fdirk{
699ea20b31c9b8d1a55b400559ae15760243dcb897fdirk  return(static_cast<bool>(_drawInfo->text_antialias));
700ea20b31c9b8d1a55b400559ae15760243dcb897fdirk}
701ea20b31c9b8d1a55b400559ae15760243dcb897fdirk
7020575024ee81530a499dd4199aa07d608ec1c87e1dirkvoid Magick::Options::textDirection(const DirectionType direction_)
703d37417692d7a7040aa854e493723e92fac1e3ae6dirk{
704d37417692d7a7040aa854e493723e92fac1e3ae6dirk  _drawInfo->direction=direction_;
70561ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk  (void) SetImageOption(_imageInfo,"direction",CommandOptionToMnemonic(
70661ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk    MagickDirectionOptions,(ssize_t) direction_));
707d37417692d7a7040aa854e493723e92fac1e3ae6dirk}
708d37417692d7a7040aa854e493723e92fac1e3ae6dirk
709d37417692d7a7040aa854e493723e92fac1e3ae6dirkMagick::DirectionType Magick::Options::textDirection() const
710d37417692d7a7040aa854e493723e92fac1e3ae6dirk{
711d37417692d7a7040aa854e493723e92fac1e3ae6dirk  return(_drawInfo->direction);
712d37417692d7a7040aa854e493723e92fac1e3ae6dirk}
713d37417692d7a7040aa854e493723e92fac1e3ae6dirk
71483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::textEncoding(const std::string &encoding_)
7153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
716d37417692d7a7040aa854e493723e92fac1e3ae6dirk  CloneString(&_drawInfo->encoding,encoding_.c_str());
71761ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk  (void) SetImageOption(imageInfo(),"encoding",encoding_.c_str());
7183ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
7193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
72083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkstd::string Magick::Options::textEncoding(void) const
7213ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
72283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (_drawInfo->encoding && *_drawInfo->encoding)
72383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    return(std::string(_drawInfo->encoding));
724d37417692d7a7040aa854e493723e92fac1e3ae6dirk
72583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(std::string());
7263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
7273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
7280575024ee81530a499dd4199aa07d608ec1c87e1dirkvoid Magick::Options::textGravity(const GravityType gravity_)
729d37417692d7a7040aa854e493723e92fac1e3ae6dirk{
730d37417692d7a7040aa854e493723e92fac1e3ae6dirk  _drawInfo->gravity=gravity_;
73161ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk  (void) SetImageOption(_imageInfo,"gravity",CommandOptionToMnemonic(
73261ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk    MagickGravityOptions,(ssize_t) gravity_));
733d37417692d7a7040aa854e493723e92fac1e3ae6dirk}
734d37417692d7a7040aa854e493723e92fac1e3ae6dirk
735d37417692d7a7040aa854e493723e92fac1e3ae6dirkMagick::GravityType Magick::Options::textGravity() const
736d37417692d7a7040aa854e493723e92fac1e3ae6dirk{
737d37417692d7a7040aa854e493723e92fac1e3ae6dirk  return(_drawInfo->gravity);
738d37417692d7a7040aa854e493723e92fac1e3ae6dirk}
739d37417692d7a7040aa854e493723e92fac1e3ae6dirk
7400575024ee81530a499dd4199aa07d608ec1c87e1dirkvoid Magick::Options::textInterlineSpacing(const double spacing_)
741a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk{
742a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk  _drawInfo->interline_spacing=spacing_;
74361ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk  setOption("interline-spacing",spacing_);
744a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk}
745a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk
746a424799a0e5bfd6d1b7941c044e067fbf18d319fdirkdouble Magick::Options::textInterlineSpacing(void) const
747a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk{
748a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk  return(_drawInfo->interline_spacing);
749a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk}
750a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk
7510575024ee81530a499dd4199aa07d608ec1c87e1dirkvoid Magick::Options::textInterwordSpacing(const double spacing_)
752a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk{
753a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk  _drawInfo->interword_spacing=spacing_;
75461ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk  setOption("interword-spacing",spacing_);
755a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk}
756a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk
757a424799a0e5bfd6d1b7941c044e067fbf18d319fdirkdouble Magick::Options::textInterwordSpacing(void) const
758a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk{
759a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk  return(_drawInfo->interword_spacing);
760a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk}
761a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk
7620575024ee81530a499dd4199aa07d608ec1c87e1dirkvoid Magick::Options::textKerning(const double kerning_)
763a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk{
764a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk  _drawInfo->kerning=kerning_;
76561ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk  setOption("kerning",kerning_);
766a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk}
767a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk
768a424799a0e5bfd6d1b7941c044e067fbf18d319fdirkdouble Magick::Options::textKerning(void) const
769a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk{
770a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk  return(_drawInfo->kerning);
771a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk}
772a424799a0e5bfd6d1b7941c044e067fbf18d319fdirk
77361ab4ad4628896f4b8a4dbc6a369a93c8696efcadirkvoid Magick::Options::textUnderColor(const Color &undercolor_)
77461ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk{
77561ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk  _drawInfo->undercolor=undercolor_;
77661ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk  setOption("undercolor",undercolor_);
77761ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk}
77861ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk
77961ab4ad4628896f4b8a4dbc6a369a93c8696efcadirkMagick::Color Magick::Options::textUnderColor(void) const
78061ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk{
78161ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk  return(_drawInfo->undercolor);
78261ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk}
78361ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk
7840575024ee81530a499dd4199aa07d608ec1c87e1dirkvoid Magick::Options::transformOrigin(const double tx_,const double ty_)
7853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
78683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  AffineMatrix
78783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    affine,
78883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    current=_drawInfo->affine;
78983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
7903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.sx=1.0;
7913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.rx=0.0;
7923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.ry=0.0;
7933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.sy=1.0;
7943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.tx=0.0;
7953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.ty=0.0;
7963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
79783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  affine.tx=tx_;
79883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  affine.ty=ty_;
7993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
8003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.sx=current.sx*affine.sx+current.ry*affine.rx;
8013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.rx=current.rx*affine.sx+current.sy*affine.rx;
8023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.ry=current.sx*affine.ry+current.ry*affine.sy;
8033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.sy=current.rx*affine.ry+current.sy*affine.sy;
8043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.tx=current.sx*affine.tx+current.ry*affine.ty+current.tx;
8053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.ty=current.rx*affine.tx+current.sy*affine.ty+current.ty;
8063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
8073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
80883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::transformReset(void)
8093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
8103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.sx=1.0;
8113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.rx=0.0;
8123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.ry=0.0;
8133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.sy=1.0;
8143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.tx=0.0;
8153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.ty=0.0;
8163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
8173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
8180575024ee81530a499dd4199aa07d608ec1c87e1dirkvoid Magick::Options::transformRotation(const double angle_)
8193ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
82083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  AffineMatrix
82183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    affine,
82283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    current=_drawInfo->affine;
82383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
8243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.sx=1.0;
8253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.rx=0.0;
8263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.ry=0.0;
8273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.sy=1.0;
8283ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.tx=0.0;
8293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.ty=0.0;
8303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
8313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.sx=cos(DegreesToRadians(fmod(angle_,360.0)));
8323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.rx=(-sin(DegreesToRadians(fmod(angle_,360.0))));
8333ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.ry=sin(DegreesToRadians(fmod(angle_,360.0)));
8343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.sy=cos(DegreesToRadians(fmod(angle_,360.0)));
8353ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
8363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.sx=current.sx*affine.sx+current.ry*affine.rx;
8373ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.rx=current.rx*affine.sx+current.sy*affine.rx;
8383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.ry=current.sx*affine.ry+current.ry*affine.sy;
8393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.sy=current.rx*affine.ry+current.sy*affine.sy;
8403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.tx=current.sx*affine.tx+current.ry*affine.ty+current.tx;
8413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.ty=current.rx*affine.tx+current.sy*affine.ty+current.ty;
8423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
8433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
8440575024ee81530a499dd4199aa07d608ec1c87e1dirkvoid Magick::Options::transformScale(const double sx_,const double sy_)
8453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
84683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  AffineMatrix
84783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    affine,
84883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    current=_drawInfo->affine;
84983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
8503ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.sx=1.0;
8513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.rx=0.0;
8523ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.ry=0.0;
8533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.sy=1.0;
8543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.tx=0.0;
8553ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.ty=0.0;
8563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
85783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  affine.sx=sx_;
85883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  affine.sy=sy_;
8593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
8603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.sx=current.sx*affine.sx+current.ry*affine.rx;
8613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.rx=current.rx*affine.sx+current.sy*affine.rx;
8623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.ry=current.sx*affine.ry+current.ry*affine.sy;
8633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.sy=current.rx*affine.ry+current.sy*affine.sy;
8643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.tx=current.sx*affine.tx+current.ry*affine.ty+current.tx;
8653ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.ty=current.rx*affine.tx+current.sy*affine.ty+current.ty;
8663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
8673ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
8680575024ee81530a499dd4199aa07d608ec1c87e1dirkvoid Magick::Options::transformSkewX(const double skewx_)
8693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
87083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  AffineMatrix
87183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    affine,
87283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    current=_drawInfo->affine;
87383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
8743ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.sx=1.0;
8753ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.rx=0.0;
8763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.ry=0.0;
8773ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.sy=1.0;
8783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.tx=0.0;
8793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.ty=0.0;
8803ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
8813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.sx=1.0;
8823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.ry=tan(DegreesToRadians(fmod(skewx_,360.0)));
8833ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.sy=1.0;
8843ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
8853ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.sx=current.sx*affine.sx+current.ry*affine.rx;
8863ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.rx=current.rx*affine.sx+current.sy*affine.rx;
8873ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.ry=current.sx*affine.ry+current.ry*affine.sy;
8883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.sy=current.rx*affine.ry+current.sy*affine.sy;
8893ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.tx=current.sx*affine.tx+current.ry*affine.ty+current.tx;
8903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.ty=current.rx*affine.tx+current.sy*affine.ty+current.ty;
8913ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
8923ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
8930575024ee81530a499dd4199aa07d608ec1c87e1dirkvoid Magick::Options::transformSkewY(const double skewy_)
8943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
89583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  AffineMatrix
89683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    affine,
89783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    current=_drawInfo->affine;
89883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
8993ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.sx=1.0;
9003ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.rx=0.0;
9013ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.ry=0.0;
9023ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.sy=1.0;
9033ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.tx=0.0;
9043ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.ty=0.0;
9053ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
9063ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.sx=1.0;
9073ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.rx=tan(DegreesToRadians(fmod(skewy_,360.0)));
9083ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  affine.sy=1.0;
9093ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
9103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.sx=current.sx*affine.sx+current.ry*affine.rx;
9113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.rx=current.rx*affine.sx+current.sy*affine.rx;
9123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.ry=current.sx*affine.ry+current.ry*affine.sy;
9133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.sy=current.rx*affine.ry+current.sy*affine.sy;
9143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.tx=current.sx*affine.tx+current.ry*affine.ty+current.tx;
9153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  _drawInfo->affine.ty=current.rx*affine.tx+current.sy*affine.ty+current.ty;
9163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
9173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
91861ab4ad4628896f4b8a4dbc6a369a93c8696efcadirkvoid Magick::Options::type(const ImageType type_)
91983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk{
92083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _imageInfo->type=type_;
92183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk}
92283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
92383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagick::ImageType Magick::Options::type(void) const
9243ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
92583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_imageInfo->type);
9263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
92783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
9280575024ee81530a499dd4199aa07d608ec1c87e1dirkvoid Magick::Options::verbose(const bool verboseFlag_)
9293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
93083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _imageInfo->verbose=(MagickBooleanType) verboseFlag_;
9313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
9323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
93383c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkbool Magick::Options::verbose(void) const
9343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
93583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(static_cast<bool>(_imageInfo->verbose));
93683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk}
93783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
93883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkvoid Magick::Options::x11Display(const std::string &display_)
9393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
94083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (display_.length() == 0)
94183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    _imageInfo->server_name=(char *) RelinquishMagickMemory(
94283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk      _imageInfo->server_name);
9433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  else
94483c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    Magick::CloneString(&_imageInfo->server_name,display_);
9453ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
94683c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
94783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkstd::string Magick::Options::x11Display(void) const
9483ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
94983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  if (_imageInfo->server_name)
95083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk    return(std::string( _imageInfo->server_name));
9513ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
95283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(std::string());
9533ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
9543ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
95583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagickCore::DrawInfo *Magick::Options::drawInfo(void)
9563ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
95783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_drawInfo);
9583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
9593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
96083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagickCore::ImageInfo *Magick::Options::imageInfo(void)
9613ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
96283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_imageInfo);
9633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
9643ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
96583c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagickCore::QuantizeInfo *Magick::Options::quantizeInfo(void)
9663ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
96783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  return(_quantizeInfo);
9683ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
96983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk
97083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirkMagick::Options::Options(const MagickCore::ImageInfo* imageInfo_,
97183c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  const MagickCore::QuantizeInfo* quantizeInfo_,
97283c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  const MagickCore::DrawInfo* drawInfo_)
97307f84e72b205d18eb8ad35380af95351d9f0a1a3dirk: _imageInfo((MagickCore::ImageInfo* ) NULL),
97407f84e72b205d18eb8ad35380af95351d9f0a1a3dirk  _quantizeInfo((MagickCore::QuantizeInfo* ) NULL),
97507f84e72b205d18eb8ad35380af95351d9f0a1a3dirk  _drawInfo((MagickCore::DrawInfo* ) NULL),
97607f84e72b205d18eb8ad35380af95351d9f0a1a3dirk  _quiet(false)
97783c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk{
97883c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _imageInfo=CloneImageInfo(imageInfo_);
97983c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _quantizeInfo=CloneQuantizeInfo(quantizeInfo_);
98083c9c37e8e76d6e5d0ef32537a7a9cf80bf62e9edirk  _drawInfo=CloneDrawInfo(imageInfo_,drawInfo_);
981830e974c2864362a20c44c4a6e915b523cb56c66cristy}
98261ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk
98361ab4ad4628896f4b8a4dbc6a369a93c8696efcadirkvoid Magick::Options::setOption(const char *name,const Color &value_)
98461ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk{
98561ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk  std::string
98661ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk    option;
98761ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk
98861ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk  option=value_;
98961ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk  (void) SetImageOption(imageInfo(),name,option.c_str());
99061ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk}
99161ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk
99261ab4ad4628896f4b8a4dbc6a369a93c8696efcadirkvoid Magick::Options::setOption(const char *name,const double value_)
99361ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk{
99461ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk  char
99561ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk    option[MagickPathExtent];
99661ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk
99761ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk  (void) FormatLocaleString(option,MagickPathExtent,"%.20g",value_);
99861ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk  (void) SetImageOption(_imageInfo,name,option);
99961ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk}
100061ab4ad4628896f4b8a4dbc6a369a93c8696efcadirk
1001