drawing-wand.c File Reference

#include "wand/studio.h"
#include "wand/MagickWand.h"
#include "wand/magick-wand-private.h"
#include "wand/wand.h"

Go to the source code of this file.

Data Structures

struct  _DrawingWand
struct  _DrawVTable

Defines

#define DRAW_BINARY_IMPLEMENTATION   0
#define CurrentContext   (wand->graphic_context[wand->index])
#define DrawingWandId   "DrawingWand"
#define ThrowDrawException(severity, tag, reason)

Enumerations

enum  PathOperation {
  PathDefaultOperation, PathCloseOperation, PathCurveToOperation, PathCurveToQuadraticBezierOperation,
  PathCurveToQuadraticBezierSmoothOperation, PathCurveToSmoothOperation, PathEllipticArcOperation, PathLineToHorizontalOperation,
  PathLineToOperation, PathLineToVerticalOperation, PathMoveToOperation
}
enum  PathMode { DefaultPathMode, AbsolutePathMode, RelativePathMode }

Functions

static int MvgPrintf (DrawingWand *, wand_attribute((format(const char *,...)
static int MvgAutoWrapPrintf (DrawingWand *wand, const char *format,...)
static void MvgAppendColor (DrawingWand *wand, const PixelPacket *color)
static void MvgAppendPointsCommand (DrawingWand *wand, const char *command, const unsigned long number_coordinates, const PointInfo *coordinates)
static void AdjustAffine (DrawingWand *wand, const AffineMatrix *affine)
WandExport void ClearDrawingWand (DrawingWand *wand)
WandExport DrawingWandCloneDrawingWand (const DrawingWand *wand)
WandExport DrawingWandDestroyDrawingWand (DrawingWand *wand)
WandExport void DrawAffine (DrawingWand *wand, const AffineMatrix *affine)
WandExport DrawingWandDrawAllocateWand (const DrawInfo *draw_info, Image *image)
WandExport void DrawAnnotation (DrawingWand *wand, const double x, const double y, const unsigned char *text)
WandExport void DrawArc (DrawingWand *wand, const double sx, const double sy, const double ex, const double ey, const double sd, const double ed)
WandExport void DrawBezier (DrawingWand *wand, const unsigned long number_coordinates, const PointInfo *coordinates)
WandExport void DrawCircle (DrawingWand *wand, const double ox, const double oy, const double px, const double py)
WandExport MagickBooleanType DrawClearException (DrawingWand *wand)
WandExport MagickBooleanType DrawComposite (DrawingWand *wand, const CompositeOperator compose, const double x, const double y, const double width, const double height, MagickWand *magick_wand)
WandExport void DrawColor (DrawingWand *wand, const double x, const double y, const PaintMethod paint_method)
WandExport void DrawComment (DrawingWand *wand, const char *comment)
WandExport void DrawEllipse (DrawingWand *wand, const double ox, const double oy, const double rx, const double ry, const double start, const double end)
WandExport char * DrawGetClipPath (const DrawingWand *wand)
WandExport FillRule DrawGetClipRule (const DrawingWand *wand)
WandExport ClipPathUnits DrawGetClipUnits (const DrawingWand *wand)
WandExport char * DrawGetException (const DrawingWand *wand, ExceptionType *severity)
WandExport ExceptionType DrawGetExceptionType (const DrawingWand *wand)
WandExport void DrawGetFillColor (const DrawingWand *wand, PixelWand *fill_color)
WandExport double DrawGetFillOpacity (const DrawingWand *wand)
WandExport FillRule DrawGetFillRule (const DrawingWand *wand)
WandExport char * DrawGetFont (const DrawingWand *wand)
WandExport char * DrawGetFontFamily (const DrawingWand *wand)
WandExport double DrawGetFontSize (const DrawingWand *wand)
WandExport StretchType DrawGetFontStretch (const DrawingWand *wand)
WandExport StyleType DrawGetFontStyle (const DrawingWand *wand)
WandExport unsigned long DrawGetFontWeight (const DrawingWand *wand)
WandExport GravityType DrawGetGravity (const DrawingWand *wand)
WandExport MagickBooleanType DrawGetStrokeAntialias (const DrawingWand *wand)
WandExport void DrawGetStrokeColor (const DrawingWand *wand, PixelWand *stroke_color)
WandExport double * DrawGetStrokeDashArray (const DrawingWand *wand, unsigned long *number_elements)
WandExport double DrawGetStrokeDashOffset (const DrawingWand *wand)
WandExport LineCap DrawGetStrokeLineCap (const DrawingWand *wand)
WandExport LineJoin DrawGetStrokeLineJoin (const DrawingWand *wand)
WandExport unsigned long DrawGetStrokeMiterLimit (const DrawingWand *wand)
WandExport double DrawGetStrokeOpacity (const DrawingWand *wand)
WandExport double DrawGetStrokeWidth (const DrawingWand *wand)
WandExport AlignType DrawGetTextAlignment (const DrawingWand *wand)
WandExport MagickBooleanType DrawGetTextAntialias (const DrawingWand *wand)
WandExport DecorationType DrawGetTextDecoration (const DrawingWand *wand)
WandExport char * DrawGetTextEncoding (const DrawingWand *wand)
static void SetMagickPixelPacket (const Image *image, const PixelPacket *color, const IndexPacket *index, MagickPixelPacket *pixel)
WandExport char * DrawGetVectorGraphics (DrawingWand *wand)
WandExport void DrawGetTextUnderColor (const DrawingWand *wand, PixelWand *under_color)
WandExport void DrawLine (DrawingWand *wand, const double sx, const double sy, const double ex, const double ey)
WandExport void DrawMatte (DrawingWand *wand, const double x, const double y, const PaintMethod paint_method)
WandExport void DrawPathClose (DrawingWand *wand)
static void DrawPathCurveTo (DrawingWand *wand, const PathMode mode, const double x1, const double y1, const double x2, const double y2, const double x, const double y)
WandExport void DrawPathCurveToAbsolute (DrawingWand *wand, const double x1, const double y1, const double x2, const double y2, const double x, const double y)
WandExport void DrawPathCurveToRelative (DrawingWand *wand, const double x1, const double y1, const double x2, const double y2, const double x, const double y)
static void DrawPathCurveToQuadraticBezier (DrawingWand *wand, const PathMode mode, const double x1, double y1, const double x, const double y)
WandExport void DrawPathCurveToQuadraticBezierAbsolute (DrawingWand *wand, const double x1, const double y1, const double x, const double y)
WandExport void DrawPathCurveToQuadraticBezierRelative (DrawingWand *wand, const double x1, const double y1, const double x, const double y)
static void DrawPathCurveToQuadraticBezierSmooth (DrawingWand *wand, const PathMode mode, const double x, const double y)
WandExport void DrawPathCurveToQuadraticBezierSmoothAbsolute (DrawingWand *wand, const double x, const double y)
WandExport void DrawPathCurveToQuadraticBezierSmoothRelative (DrawingWand *wand, const double x, const double y)
static void DrawPathCurveToSmooth (DrawingWand *wand, const PathMode mode, const double x2, const double y2, const double x, const double y)
WandExport void DrawPathCurveToSmoothAbsolute (DrawingWand *wand, const double x2, const double y2, const double x, const double y)
WandExport void DrawPathCurveToSmoothRelative (DrawingWand *wand, const double x2, const double y2, const double x, const double y)
static void DrawPathEllipticArc (DrawingWand *wand, const PathMode mode, const double rx, const double ry, const double x_axis_rotation, const MagickBooleanType large_arc_flag, const MagickBooleanType sweep_flag, const double x, const double y)
WandExport void DrawPathEllipticArcAbsolute (DrawingWand *wand, const double rx, const double ry, const double x_axis_rotation, const MagickBooleanType large_arc_flag, const MagickBooleanType sweep_flag, const double x, const double y)
WandExport void DrawPathEllipticArcRelative (DrawingWand *wand, const double rx, const double ry, const double x_axis_rotation, const MagickBooleanType large_arc_flag, const MagickBooleanType sweep_flag, const double x, const double y)
WandExport void DrawPathFinish (DrawingWand *wand)
static void DrawPathLineTo (DrawingWand *wand, const PathMode mode, const double x, const double y)
WandExport void DrawPathLineToAbsolute (DrawingWand *wand, const double x, const double y)
WandExport void DrawPathLineToRelative (DrawingWand *wand, const double x, const double y)
static void DrawPathLineToHorizontal (DrawingWand *wand, const PathMode mode, const double x)
WandExport void DrawPathLineToHorizontalAbsolute (DrawingWand *wand, const double x)
WandExport void DrawPathLineToHorizontalRelative (DrawingWand *wand, const double x)
static void DrawPathLineToVertical (DrawingWand *wand, const PathMode mode, const double y)
WandExport void DrawPathLineToVerticalAbsolute (DrawingWand *wand, const double y)
WandExport void DrawPathLineToVerticalRelative (DrawingWand *wand, const double y)
static void DrawPathMoveTo (DrawingWand *wand, const PathMode mode, const double x, const double y)
WandExport void DrawPathMoveToAbsolute (DrawingWand *wand, const double x, const double y)
WandExport void DrawPathMoveToRelative (DrawingWand *wand, const double x, const double y)
WandExport void DrawPathStart (DrawingWand *wand)
WandExport void DrawPoint (DrawingWand *wand, const double x, const double y)
WandExport void DrawPolygon (DrawingWand *wand, const unsigned long number_coordinates, const PointInfo *coordinates)
WandExport void DrawPolyline (DrawingWand *wand, const unsigned long number_coordinates, const PointInfo *coordinates)
WandExport void DrawPopClipPath (DrawingWand *wand)
WandExport void DrawPopDefs (DrawingWand *wand)
WandExport MagickBooleanType DrawPopPattern (DrawingWand *wand)
WandExport void DrawPushClipPath (DrawingWand *wand, const char *clip_mask_id)
WandExport void DrawPushDefs (DrawingWand *wand)
WandExport MagickBooleanType DrawPushPattern (DrawingWand *wand, const char *pattern_id, const double x, const double y, const double width, const double height)
WandExport void DrawRectangle (DrawingWand *wand, const double x1, const double y1, const double x2, const double y2)
WandExport MagickBooleanType DrawRender (DrawingWand *wand)
WandExport void DrawResetVectorGraphics (DrawingWand *wand)
WandExport void DrawRotate (DrawingWand *wand, const double degrees)
WandExport void DrawRoundRectangle (DrawingWand *wand, double x1, double y1, double x2, double y2, double rx, double ry)
WandExport void DrawScale (DrawingWand *wand, const double x, const double y)
WandExport MagickBooleanType DrawSetClipPath (DrawingWand *wand, const char *clip_mask)
WandExport void DrawSetClipRule (DrawingWand *wand, const FillRule fill_rule)
WandExport void DrawSetClipUnits (DrawingWand *wand, const ClipPathUnits clip_units)
static MagickBooleanType IsColorEqual (const PixelPacket *p, const PixelPacket *q)
WandExport void DrawSetFillColor (DrawingWand *wand, const PixelWand *fill_wand)
WandExport void DrawSetFillOpacity (DrawingWand *wand, const double fill_opacity)
WandExport MagickBooleanType DrawSetFillPatternURL (DrawingWand *wand, const char *fill_url)
WandExport void DrawSetFillRule (DrawingWand *wand, const FillRule fill_rule)
WandExport MagickBooleanType DrawSetFont (DrawingWand *wand, const char *font_name)
WandExport MagickBooleanType DrawSetFontFamily (DrawingWand *wand, const char *font_family)
WandExport void DrawSetFontSize (DrawingWand *wand, const double pointsize)
WandExport void DrawSetFontStretch (DrawingWand *wand, const StretchType font_stretch)
WandExport void DrawSetFontStyle (DrawingWand *wand, const StyleType style)
WandExport void DrawSetFontWeight (DrawingWand *wand, const unsigned long font_weight)
WandExport void DrawSetGravity (DrawingWand *wand, const GravityType gravity)
WandExport void DrawSetStrokeColor (DrawingWand *wand, const PixelWand *stroke_wand)
WandExport MagickBooleanType DrawSetStrokePatternURL (DrawingWand *wand, const char *stroke_url)
WandExport void DrawSetStrokeAntialias (DrawingWand *wand, const MagickBooleanType stroke_antialias)
WandExport MagickBooleanType DrawSetStrokeDashArray (DrawingWand *wand, const unsigned long number_elements, const double *dash_array)
WandExport void DrawSetStrokeDashOffset (DrawingWand *wand, const double dash_offset)
WandExport void DrawSetStrokeLineCap (DrawingWand *wand, const LineCap linecap)
WandExport void DrawSetStrokeLineJoin (DrawingWand *wand, const LineJoin linejoin)
WandExport void DrawSetStrokeMiterLimit (DrawingWand *wand, const unsigned long miterlimit)
WandExport void DrawSetStrokeOpacity (DrawingWand *wand, const double stroke_opacity)
WandExport void DrawSetStrokeWidth (DrawingWand *wand, const double stroke_width)
WandExport void DrawSetTextAlignment (DrawingWand *wand, const AlignType alignment)
WandExport void DrawSetTextAntialias (DrawingWand *wand, const MagickBooleanType text_antialias)
WandExport void DrawSetTextDecoration (DrawingWand *wand, const DecorationType decoration)
WandExport void DrawSetTextEncoding (DrawingWand *wand, const char *encoding)
WandExport void DrawSetTextUnderColor (DrawingWand *wand, const PixelWand *under_wand)
static MagickBooleanType IsPoint (const char *point)
WandExport MagickBooleanType DrawSetVectorGraphics (DrawingWand *wand, const char *xml)
WandExport void DrawSkewX (DrawingWand *wand, const double degrees)
WandExport void DrawSkewY (DrawingWand *wand, const double degrees)
WandExport void DrawTranslate (DrawingWand *wand, const double x, const double y)
WandExport void DrawSetViewbox (DrawingWand *wand, unsigned long x1, unsigned long y1, unsigned long x2, unsigned long y2)
WandExport MagickBooleanType IsDrawingWand (const DrawingWand *wand)
WandExport DrawingWandNewDrawingWand (void)
WandExport DrawInfo * PeekDrawingWand (const DrawingWand *wand)
WandExport MagickBooleanType PopDrawingWand (DrawingWand *wand)
WandExport MagickBooleanType PushDrawingWand (DrawingWand *wand)


Define Documentation

#define CurrentContext   (wand->graphic_context[wand->index])

Definition at line 59 of file drawing-wand.c.

Referenced by AdjustAffine(), ClearDrawingWand(), DestroyDrawingWand(), DrawAllocateWand(), DrawGetClipPath(), DrawGetClipRule(), DrawGetClipUnits(), DrawGetFillColor(), DrawGetFillOpacity(), DrawGetFillRule(), DrawGetFont(), DrawGetFontFamily(), DrawGetFontSize(), DrawGetFontStretch(), DrawGetFontStyle(), DrawGetFontWeight(), DrawGetGravity(), DrawGetStrokeAntialias(), DrawGetStrokeColor(), DrawGetStrokeDashArray(), DrawGetStrokeDashOffset(), DrawGetStrokeLineCap(), DrawGetStrokeLineJoin(), DrawGetStrokeMiterLimit(), DrawGetStrokeOpacity(), DrawGetStrokeWidth(), DrawGetTextAlignment(), DrawGetTextAntialias(), DrawGetTextDecoration(), DrawGetTextEncoding(), DrawGetTextUnderColor(), DrawGetVectorGraphics(), DrawRender(), DrawSetClipPath(), DrawSetClipRule(), DrawSetClipUnits(), DrawSetFillColor(), DrawSetFillOpacity(), DrawSetFillPatternURL(), DrawSetFillRule(), DrawSetFont(), DrawSetFontFamily(), DrawSetFontSize(), DrawSetFontStretch(), DrawSetFontStyle(), DrawSetFontWeight(), DrawSetGravity(), DrawSetStrokeAntialias(), DrawSetStrokeColor(), DrawSetStrokeDashArray(), DrawSetStrokeDashOffset(), DrawSetStrokeLineCap(), DrawSetStrokeLineJoin(), DrawSetStrokeMiterLimit(), DrawSetStrokeOpacity(), DrawSetStrokePatternURL(), DrawSetStrokeWidth(), DrawSetTextAlignment(), DrawSetTextAntialias(), DrawSetTextDecoration(), DrawSetTextEncoding(), DrawSetTextUnderColor(), DrawSetVectorGraphics(), NewDrawingWand(), PeekDrawingWand(), PopDrawingWand(), and PushDrawingWand().

#define DRAW_BINARY_IMPLEMENTATION   0

Definition at line 57 of file drawing-wand.c.

#define DrawingWandId   "DrawingWand"

Definition at line 60 of file drawing-wand.c.

Referenced by IsDrawingWand(), and NewDrawingWand().

#define ThrowDrawException ( severity,
tag,
reason   ) 

Value:

(void) ThrowMagickException( \
  wand->exception,GetMagickModule(),severity,tag,"`%s'",reason);

Definition at line 61 of file drawing-wand.c.

Referenced by ClearDrawingWand(), DrawComposite(), DrawPopPattern(), DrawPushPattern(), DrawRender(), DrawSetClipPath(), DrawSetFillPatternURL(), DrawSetStrokeDashArray(), DrawSetStrokePatternURL(), MvgAutoWrapPrintf(), MvgPrintf(), PopDrawingWand(), and PushDrawingWand().


Enumeration Type Documentation

enum PathMode

Enumerator:
DefaultPathMode 
AbsolutePathMode 
RelativePathMode 

Definition at line 82 of file drawing-wand.c.

Enumerator:
PathDefaultOperation 
PathCloseOperation 
PathCurveToOperation 
PathCurveToQuadraticBezierOperation 
PathCurveToQuadraticBezierSmoothOperation 
PathCurveToSmoothOperation 
PathEllipticArcOperation 
PathLineToHorizontalOperation 
PathLineToOperation 
PathLineToVerticalOperation 
PathMoveToOperation 

Definition at line 67 of file drawing-wand.c.


Function Documentation

static void AdjustAffine ( DrawingWand wand,
const AffineMatrix *  affine 
) [static]

WandExport void ClearDrawingWand ( DrawingWand wand  ) 

WandExport DrawingWand* CloneDrawingWand ( const DrawingWand wand  ) 

WandExport DrawingWand* DestroyDrawingWand ( DrawingWand wand  ) 

WandExport void DrawAffine ( DrawingWand wand,
const AffineMatrix *  affine 
)

WandExport DrawingWand* DrawAllocateWand ( const DrawInfo *  draw_info,
Image *  image 
)

Definition at line 708 of file drawing-wand.c.

References CurrentContext, _DrawingWand::destroy, _DrawingWand::image, and NewDrawingWand().

Referenced by ScribbleImage().

WandExport void DrawAnnotation ( DrawingWand wand,
const double  x,
const double  y,
const unsigned char *  text 
)

Definition at line 757 of file drawing-wand.c.

References _DrawingWand::debug, MvgPrintf(), _DrawingWand::name, _DrawingWand::signature, and WandSignature.

Referenced by main().

WandExport void DrawArc ( DrawingWand wand,
const double  sx,
const double  sy,
const double  ex,
const double  ey,
const double  sd,
const double  ed 
)

WandExport void DrawBezier ( DrawingWand wand,
const unsigned long  number_coordinates,
const PointInfo *  coordinates 
)

WandExport void DrawCircle ( DrawingWand wand,
const double  ox,
const double  oy,
const double  px,
const double  py 
)

WandExport MagickBooleanType DrawClearException ( DrawingWand wand  ) 

WandExport void DrawColor ( DrawingWand wand,
const double  x,
const double  y,
const PaintMethod  paint_method 
)

WandExport void DrawComment ( DrawingWand wand,
const char *  comment 
)

Definition at line 1126 of file drawing-wand.c.

References MvgPrintf().

WandExport MagickBooleanType DrawComposite ( DrawingWand wand,
const CompositeOperator  compose,
const double  x,
const double  y,
const double  width,
const double  height,
MagickWand magick_wand 
)

WandExport void DrawEllipse ( DrawingWand wand,
const double  ox,
const double  oy,
const double  rx,
const double  ry,
const double  start,
const double  end 
)

WandExport char* DrawGetClipPath ( const DrawingWand wand  ) 

WandExport FillRule DrawGetClipRule ( const DrawingWand wand  ) 

WandExport ClipPathUnits DrawGetClipUnits ( const DrawingWand wand  ) 

WandExport char* DrawGetException ( const DrawingWand wand,
ExceptionType *  severity 
)

WandExport ExceptionType DrawGetExceptionType ( const DrawingWand wand  ) 

WandExport void DrawGetFillColor ( const DrawingWand wand,
PixelWand fill_color 
)

WandExport double DrawGetFillOpacity ( const DrawingWand wand  ) 

WandExport FillRule DrawGetFillRule ( const DrawingWand wand  ) 

WandExport char* DrawGetFont ( const DrawingWand wand  ) 

WandExport char* DrawGetFontFamily ( const DrawingWand wand  ) 

WandExport double DrawGetFontSize ( const DrawingWand wand  ) 

WandExport StretchType DrawGetFontStretch ( const DrawingWand wand  ) 

WandExport StyleType DrawGetFontStyle ( const DrawingWand wand  ) 

WandExport unsigned long DrawGetFontWeight ( const DrawingWand wand  ) 

WandExport GravityType DrawGetGravity ( const DrawingWand wand  ) 

WandExport MagickBooleanType DrawGetStrokeAntialias ( const DrawingWand wand  ) 

WandExport void DrawGetStrokeColor ( const DrawingWand wand,
PixelWand stroke_color 
)

WandExport double* DrawGetStrokeDashArray ( const DrawingWand wand,
unsigned long *  number_elements 
)

WandExport double DrawGetStrokeDashOffset ( const DrawingWand wand  ) 

WandExport LineCap DrawGetStrokeLineCap ( const DrawingWand wand  ) 

WandExport LineJoin DrawGetStrokeLineJoin ( const DrawingWand wand  ) 

Definition at line 1913 of file drawing-wand.c.

References CurrentContext, _DrawingWand::debug,