]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sun, 21 Nov 2010 23:49:30 +0000 (23:49 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sun, 21 Nov 2010 23:49:30 +0000 (23:49 +0000)
wand/ChangeLog
wand/drawing-wand.c
wand/drawing-wand.h
wand/magick-property.c
wand/magick-property.h

index dab8f2b60b6fd00119a01b39593b25a5c6f53400..5ea4c6d553d53e8b104456be6535d45314d355de 100644 (file)
@@ -1,3 +1,6 @@
+2010-11-21  6.6.6-0 Cristy  <quetzlzacatenango@image...>
+  * Add DrawGetFontResolution() / DrawSetFontResolution().
+
 2009-10-10  6.5.6-10 Cristy  <quetzlzacatenango@image...>
   * Add MagickSetImageArtifact(), etc.  Wand artifacts are like properties
     except they are not exported.  They are needed for some method such
index 77f8d5d3a5ff46ef66e35061bea5a1f5ba26bc32..5f75a4805f35775da0df1c0a78308d451c5d42fd 100644 (file)
@@ -1580,6 +1580,59 @@ WandExport char *DrawGetFontFamily(const DrawingWand *wand)
 %                                                                             %
 %                                                                             %
 %                                                                             %
+%   D r a w G e t F o n t R e s o l u t i o n                                 %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  DrawGetFontResolution() gets the image X and Y resolution.
+%
+%  The format of the DrawGetFontResolution method is:
+%
+%      DrawBooleanType DrawGetFontResolution(const DrawingWand *wand,
+%        double *x,double *y)
+%
+%  A description of each parameter follows:
+%
+%    o wand: the magick wand.
+%
+%    o x: the x-resolution.
+%
+%    o y: the y-resolution.
+%
+*/
+WandExport MagickBooleanType DrawGetFontResolution(const DrawingWand *wand,
+  double *x,double *y)
+{
+  assert(wand != (DrawingWand *) NULL);
+  assert(wand->signature == WandSignature);
+  if (wand->debug != MagickFalse)
+    (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
+  *x=72.0;
+  *y=72.0;
+  if (CurrentContext->density != (char *) NULL)
+    {
+      GeometryInfo
+        geometry_info;
+
+      MagickStatusType
+        flags;
+
+      flags=ParseGeometry(CurrentContext->density,&geometry_info);
+      *x=geometry_info.rho;
+      *y=geometry_info.sigma;
+      if ((flags & SigmaValue) == MagickFalse)
+        *y=(*x);
+    }
+  return(MagickTrue);
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
 %   D r a w G e t F o n t S i z e                                             %
 %                                                                             %
 %                                                                             %
@@ -4722,6 +4775,49 @@ WandExport void DrawSetFillOpacity(DrawingWand *wand,const double fill_opacity)
 %                                                                             %
 %                                                                             %
 %                                                                             %
+%   D r a w S e t F o n t R e s o l u t i o n                                 %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  DrawSetFontResolution() sets the image resolution.
+%
+%  The format of the DrawSetFontResolution method is:
+%
+%      DrawBooleanType DrawSetFontResolution(DrawingWand *wand,
+%        const double x_resolution,const doubtl y_resolution)
+%
+%  A description of each parameter follows:
+%
+%    o wand: the magick wand.
+%
+%    o x_resolution: the image x resolution.
+%
+%    o y_resolution: the image y resolution.
+%
+*/
+WandExport MagickBooleanType DrawSetFontResolution(DrawingWand *wand,
+  const double x_resolution,const double y_resolution)
+{
+  char
+    density[MaxTextExtent];
+
+  assert(wand != (DrawingWand *) NULL);
+  assert(wand->signature == WandSignature);
+  if (wand->debug != MagickFalse)
+    (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
+  (void) FormatMagickString(density,MaxTextExtent,"%gx%g",x_resolution,
+    y_resolution);
+  (void) CloneString(&CurrentContext->density,density);
+  return(MagickTrue);
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
 %   D r a w S e t O p a c i t y                                               %
 %                                                                             %
 %                                                                             %
index a0258f9509a1f74dd0f884f9728e5eab49c275f8..788b9b53a342b513edf7ba979639bf86e294d1fe 100644 (file)
@@ -85,6 +85,7 @@ extern WandExport MagickBooleanType
   DrawClearException(DrawingWand *),
   DrawComposite(DrawingWand *,const CompositeOperator,const double,const double,
     const double,const double,MagickWand *),
+  DrawGetFontResolution(const DrawingWand *,double *,double *),
   DrawGetStrokeAntialias(const DrawingWand *),
   DrawGetTextAntialias(const DrawingWand *),
   DrawPopPattern(DrawingWand *),
@@ -95,6 +96,7 @@ extern WandExport MagickBooleanType
   DrawSetFillPatternURL(DrawingWand *,const char *),
   DrawSetFont(DrawingWand *,const char *),
   DrawSetFontFamily(DrawingWand *,const char *),
+  DrawSetFontResolution(DrawingWand *,const double,const double),
   DrawSetStrokeDashArray(DrawingWand *,const size_t,const double *),
   DrawSetStrokePatternURL(DrawingWand *,const char *),
   DrawSetVectorGraphics(DrawingWand *,const char *),
index 5068525307c53b18a3a96d225ae47b748123209c..a7f2dc0fae3eda4d497a577c12b9f819146dab82 100644 (file)
@@ -1372,6 +1372,59 @@ WandExport const char *MagickGetReleaseDate(void)
 %                                                                             %
 %                                                                             %
 %                                                                             %
+%   M a g i c k G e t R e s o l u t i o n                                     %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  MagickGetResolution() gets the image X and Y resolution.
+%
+%  The format of the MagickGetResolution method is:
+%
+%      MagickBooleanType MagickGetResolution(const MagickWand *wand,double *x,
+%        double *y)
+%
+%  A description of each parameter follows:
+%
+%    o wand: the magick wand.
+%
+%    o x: the x-resolution.
+%
+%    o y: the y-resolution.
+%
+*/
+WandExport MagickBooleanType MagickGetResolution(const MagickWand *wand,
+  double *x,double *y)
+{
+  assert(wand != (MagickWand *) NULL);
+  assert(wand->signature == WandSignature);
+  if (wand->debug != MagickFalse)
+    (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
+  *x=72.0;
+  *y=72.0;
+  if (wand->image_info->density != (char *) NULL)
+    {
+      GeometryInfo
+        geometry_info;
+
+      MagickStatusType
+        flags;
+
+      flags=ParseGeometry(wand->image_info->density,&geometry_info);
+      *x=geometry_info.rho;
+      *y=geometry_info.sigma;
+      if ((flags & SigmaValue) == MagickFalse)
+        *y=(*x);
+    }
+  return(MagickTrue);
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
 %   M a g i c k G e t R e s o u r c e                                         %
 %                                                                             %
 %                                                                             %
index 0865db80e29b1473c40209058d6ea0327ff9cbbb..6ed3506c14493949ada3c38510a002e698599fa7 100644 (file)
@@ -82,6 +82,7 @@ extern WandExport MagickBooleanType
   MagickDeleteOption(MagickWand *,const char *),
   MagickGetAntialias(const MagickWand *),
   MagickGetPage(const MagickWand *,size_t *,size_t *,ssize_t *,ssize_t *),
+  MagickGetResolution(const MagickWand *,double *,double *),
   MagickGetSize(const MagickWand *,size_t *,size_t *),
   MagickGetSizeOffset(const MagickWand *,ssize_t *),
   MagickProfileImage(MagickWand *,const char *,const void *,const size_t),