]> granicus.if.org Git - imagemagick/blobdiff - Magick++/lib/Options.cpp
(no commit message)
[imagemagick] / Magick++ / lib / Options.cpp
index a9cd5258b381ade0a3d83763dd1421961b892ee9..8711a52cfb5f41c6b59100d104a5b884b9f24911 100644 (file)
 #define MAGICKCORE_IMPLEMENTATION  1
 #define MAGICK_PLUSPLUS_IMPLEMENTATION 1
 
-#include "Magick++/Include.h"
 #include <string>
 #include <string.h>
 #include <stdlib.h>
 #include <math.h>
+#include "Magick++/Include.h"
 #include "Magick++/Options.h"
 #include "Magick++/Functions.h"
 #include "Magick++/Exception.h"
 
-#define MagickPI  3.14159265358979323846264338327950288419716939937510
 #define DegreesToRadians(x)  (MagickPI*(x)/180.0)
 
 // Constructor
@@ -208,11 +207,11 @@ Magick::Geometry Magick::Options::density ( void ) const
   return Geometry();
 }
 
-void Magick::Options::depth ( unsigned int depth_ )
+void Magick::Options::depth ( size_t depth_ )
 {
   _imageInfo->depth = depth_;
 }
-unsigned int Magick::Options::depth ( void ) const
+size_t Magick::Options::depth ( void ) const
 {
   return _imageInfo->depth;
 }
@@ -230,11 +229,11 @@ Magick::EndianType Magick::Options::endian ( void ) const
 
 void Magick::Options::file ( FILE *file_ )
 {
-  SetImageInfoFile(_imageInfo, file_ );
+  SetImageInfoFile( _imageInfo, file_ );
 }
 FILE *Magick::Options::file ( void ) const
 {
-  return _imageInfo->file;
+  return GetImageInfoFile( _imageInfo );
 }
 
 void Magick::Options::fileName ( const std::string &fileName_ )
@@ -357,13 +356,12 @@ void Magick::Options::magick ( const std::string &magick_ )
 {
   ExceptionInfo exception;
 
-  FormatMagickString( _imageInfo->filename, MaxTextExtent, "%.1024s:", magick_.c_str() );
+  FormatLocaleString( _imageInfo->filename, MaxTextExtent, "%.1024s:", magick_.c_str() );
   GetExceptionInfo(&exception);
-  SetImageInfo( _imageInfo, MagickTrue, &exception);
+  SetImageInfo( _imageInfo, 1, &exception);
   if ( *_imageInfo->magick == '\0' )
-    throwExceptionExplicit( OptionWarning,
-                           "Unrecognized image format",
-                           magick_.c_str() );
+    throwExceptionExplicit( OptionWarning, "Unrecognized image format",
+           magick_.c_str() );
   (void) DestroyExceptionInfo( &exception );
 }
 std::string Magick::Options::magick ( void ) const
@@ -407,20 +405,20 @@ Magick::Geometry Magick::Options::page ( void ) const
     return Geometry();
 }
 
-void Magick::Options::quality ( unsigned int quality_ )
+void Magick::Options::quality ( size_t quality_ )
 {
   _imageInfo->quality = quality_;
 }
-unsigned int Magick::Options::quality ( void ) const
+size_t Magick::Options::quality ( void ) const
 {
   return _imageInfo->quality;
 }
 
-void Magick::Options::quantizeColors ( unsigned int colors_ )
+void Magick::Options::quantizeColors ( size_t colors_ )
 {
   _quantizeInfo->number_colors = colors_;
 }
-unsigned int Magick::Options::quantizeColors ( void ) const
+size_t Magick::Options::quantizeColors ( void ) const
 {
   return _quantizeInfo->number_colors;
 }
@@ -444,11 +442,11 @@ bool Magick::Options::quantizeDither ( void ) const
   return static_cast<bool>(_imageInfo->dither);
 }
 
-void Magick::Options::quantizeTreeDepth ( unsigned int treeDepth_ )
+void Magick::Options::quantizeTreeDepth ( size_t treeDepth_ )
 {
   _quantizeInfo->tree_depth = treeDepth_;
 }
-unsigned int Magick::Options::quantizeTreeDepth ( void ) const
+size_t Magick::Options::quantizeTreeDepth ( void ) const
 {
   return _quantizeInfo->tree_depth;
 }
@@ -519,7 +517,7 @@ void Magick::Options::strokeDashArray ( const double* strokeDashArray_ )
   if(strokeDashArray_)
     {
       // Count elements in dash array
-      unsigned int x;
+      size_t x;
       for (x=0; strokeDashArray_[x]; x++) ;
       // Allocate elements
       _drawInfo->dash_pattern =
@@ -567,11 +565,11 @@ Magick::LineJoin Magick::Options::strokeLineJoin ( void ) const
 }
 
 // miterLimit for drawing lines, circles, ellipses, etc.
-void Magick::Options::strokeMiterLimit ( unsigned int miterLimit_ )
+void Magick::Options::strokeMiterLimit ( size_t miterLimit_ )
 {
   _drawInfo->miterlimit = miterLimit_;
 }
-unsigned int Magick::Options::strokeMiterLimit ( void ) const
+size_t Magick::Options::strokeMiterLimit ( void ) const
 {
   return _drawInfo->miterlimit;
 }
@@ -614,20 +612,20 @@ double Magick::Options::strokeWidth ( void ) const
   return _drawInfo->stroke_width;
 }
 
-void Magick::Options::subImage ( unsigned int subImage_ )
+void Magick::Options::subImage ( size_t subImage_ )
 {
   _imageInfo->scene = subImage_;
 }
-unsigned int Magick::Options::subImage ( void ) const
+size_t Magick::Options::subImage ( void ) const
 {
   return _imageInfo->scene;
 }
 
-void Magick::Options::subRange ( unsigned int subRange_ )
+void Magick::Options::subRange ( size_t subRange_ )
 {
   _imageInfo->number_scenes = subRange_;
 }
-unsigned int Magick::Options::subRange ( void ) const
+size_t Magick::Options::subRange ( void ) const
 {
   return _imageInfo->number_scenes;
 }
@@ -645,20 +643,6 @@ std::string Magick::Options::textEncoding ( void ) const
   return std::string();
 }
 
-void Magick::Options::tileName ( const std::string &tileName_ )
-{
-  if ( tileName_.length() == 0 )
-    _imageInfo->tile=(char *) RelinquishMagickMemory(_imageInfo->tile);
-  else
-    Magick::CloneString( &_imageInfo->tile, tileName_ );
-}
-std::string Magick::Options::tileName ( void ) const
-{
-  if ( _imageInfo->tile )
-    return std::string( _imageInfo->tile );
-  return std::string();
-}
-
 // Image representation type
 void Magick::Options::type ( const Magick::ImageType type_ )
 {
@@ -808,15 +792,6 @@ bool Magick::Options::verbose ( void ) const
   return static_cast<bool>(_imageInfo->verbose);
 }
 
-void Magick::Options::virtualPixelMethod ( VirtualPixelMethod virtual_pixel_method_ )
-{
-  _imageInfo->virtual_pixel_method = virtual_pixel_method_;
-}
-Magick::VirtualPixelMethod Magick::Options::virtualPixelMethod ( void ) const
-{
-  return static_cast<Magick::VirtualPixelMethod>(_imageInfo->virtual_pixel_method);
-}
-
 void Magick::Options::view ( const std::string &view_ )
 {
   if ( view_.length() == 0 )