From: cristy Date: Sun, 21 Nov 2010 23:49:30 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~8472 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=56375382184b1b1f465e73c3b88a26b84067956b;p=imagemagick --- diff --git a/wand/ChangeLog b/wand/ChangeLog index dab8f2b60..5ea4c6d55 100644 --- a/wand/ChangeLog +++ b/wand/ChangeLog @@ -1,3 +1,6 @@ +2010-11-21 6.6.6-0 Cristy + * Add DrawGetFontResolution() / DrawSetFontResolution(). + 2009-10-10 6.5.6-10 Cristy * Add MagickSetImageArtifact(), etc. Wand artifacts are like properties except they are not exported. They are needed for some method such diff --git a/wand/drawing-wand.c b/wand/drawing-wand.c index 77f8d5d3a..5f75a4805 100644 --- a/wand/drawing-wand.c +++ b/wand/drawing-wand.c @@ -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); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % % 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); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % % D r a w S e t O p a c i t y % % % % % diff --git a/wand/drawing-wand.h b/wand/drawing-wand.h index a0258f950..788b9b53a 100644 --- a/wand/drawing-wand.h +++ b/wand/drawing-wand.h @@ -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 *), diff --git a/wand/magick-property.c b/wand/magick-property.c index 506852530..a7f2dc0fa 100644 --- a/wand/magick-property.c +++ b/wand/magick-property.c @@ -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); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % % M a g i c k G e t R e s o u r c e % % % % % diff --git a/wand/magick-property.h b/wand/magick-property.h index 0865db80e..6ed3506c1 100644 --- a/wand/magick-property.h +++ b/wand/magick-property.h @@ -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),