# draw.c File Reference

`#include "magick/studio.h"`
`#include "magick/annotate.h"`
`#include "magick/artifact.h"`
`#include "magick/blob.h"`
`#include "magick/cache.h"`
`#include "magick/cache-view.h"`
`#include "magick/color.h"`
`#include "magick/composite.h"`
`#include "magick/composite-private.h"`
`#include "magick/constitute.h"`
`#include "magick/draw.h"`
`#include "magick/draw-private.h"`
`#include "magick/enhance.h"`
`#include "magick/exception.h"`
`#include "magick/exception-private.h"`
`#include "magick/gem.h"`
`#include "magick/geometry.h"`
`#include "magick/image-private.h"`
`#include "magick/list.h"`
`#include "magick/log.h"`
`#include "magick/monitor.h"`
`#include "magick/option.h"`
`#include "magick/paint.h"`
`#include "magick/pixel-private.h"`
`#include "magick/property.h"`
`#include "magick/resample.h"`
`#include "magick/string_.h"`
`#include "magick/token.h"`
`#include "magick/transform.h"`
`#include "magick/utility.h"`

## Data Structures

struct | _EdgeInfo
struct | _ElementInfo
struct | _PolygonInfo
struct | _PathInfo

## Defines

#define | BezierQuantum 200
#define | RenderImageTag "Render/Image"

## Typedefs

typedef struct _EdgeInfo | EdgeInfo
typedef struct _ElementInfo | ElementInfo
typedef struct _PolygonInfo | PolygonInfo
typedef struct _PathInfo | PathInfo

## Enumerations

enum | PathInfoCode { MoveToCode, OpenCode, GhostlineCode, LineToCode, EndCode }

## Functions

static PrimitiveInfo * | TraceStrokePolygon (const DrawInfo *, const PrimitiveInfo *)
static MagickBooleanType | DrawStrokePolygon (Image *, const DrawInfo *, const PrimitiveInfo *)
static unsigned long | TracePath (PrimitiveInfo *, const char *)
static void | TraceArc (PrimitiveInfo *, const PointInfo, const PointInfo, const PointInfo)
static void | TraceArcPath (PrimitiveInfo *, const PointInfo, const PointInfo, const PointInfo, const MagickRealType, const MagickBooleanType, const MagickBooleanType)
static void | TraceBezier (PrimitiveInfo *, const unsigned long)
static void | TraceCircle (PrimitiveInfo *, const PointInfo, const PointInfo)
static void | TraceEllipse (PrimitiveInfo *, const PointInfo, const PointInfo, const PointInfo)
static void | TraceLine (PrimitiveInfo *, const PointInfo, const PointInfo)
static void | TraceRectangle (PrimitiveInfo *, const PointInfo, const PointInfo)
static void | TraceRoundRectangle (PrimitiveInfo *, const PointInfo, const PointInfo, PointInfo)
static void | TraceSquareLinecap (PrimitiveInfo *, const unsigned long, const MagickRealType)
MagickExport DrawInfo * | AcquireDrawInfo (void)
MagickExport DrawInfo * | CloneDrawInfo (const ImageInfo *image_info, const DrawInfo *draw_info)
static int | CompareEdges (const void *x, const void *y)
static void | LogPolygonInfo (const PolygonInfo *polygon_info)
static void | ReversePoints (PointInfo *points, const unsigned long number_points)
static PolygonInfo * | ConvertPathToPolygon (const DrawInfo *magick_unused(draw_info), const PathInfo *path_info)
static void | LogPathInfo (const PathInfo *path_info)
static PathInfo * | ConvertPrimitiveToPath (const DrawInfo *magick_unused(draw_info), const PrimitiveInfo *primitive_info)
MagickExport DrawInfo * | DestroyDrawInfo (DrawInfo *draw_info)
static unsigned long | DestroyEdge (PolygonInfo *polygon_info, const unsigned long edge)
static void | DestroyPolygonInfo (PolygonInfo *polygon_info)
static SegmentInfo | AffineEdge (const Image *image, const AffineMatrix *affine, const double y, const SegmentInfo *edge)
static AffineMatrix | InverseAffineMatrix (const AffineMatrix *affine)
static long | MagickAbsoluteValue (const long x)
static double | MagickMax (const double x, const double y)
static double | MagickMin (const double x, const double y)
MagickExport MagickBooleanType | DrawAffineImage (Image *image, const Image *source, const AffineMatrix *affine)
static void | DrawBoundingRectangles (Image *image, const DrawInfo *draw_info, const PolygonInfo *polygon_info)
MagickExport MagickBooleanType | DrawClipPath (Image *image, const DrawInfo *draw_info, const char *name)
static MagickBooleanType | DrawDashPolygon (const DrawInfo *draw_info, const PrimitiveInfo *primitive_info, Image *image)
static MagickBooleanType | IsPoint (const char *point)
static void | TracePoint (PrimitiveInfo *primitive_info, const PointInfo point)
MagickExport MagickBooleanType | DrawImage (Image *image, const DrawInfo *draw_info)
static MagickRealType | GetStopColorOffset (const SegmentInfo *gradient_vector, const long x, const long y)
MagickExport MagickBooleanType | DrawGradientImage (Image *image, const DrawInfo *draw_info)
MagickExport MagickBooleanType | DrawPatternPath (Image *image, const DrawInfo *draw_info, const char *name, Image **pattern)
static MagickRealType | GetPixelOpacity (PolygonInfo *polygon_info, const MagickRealType mid, const MagickBooleanType fill, const FillRule fill_rule, const long x, const long y, MagickRealType *stroke_opacity)
static MagickBooleanType | DrawPolygonPrimitive (Image *image, const DrawInfo *draw_info, const PrimitiveInfo *primitive_info)
static void | LogPrimitiveInfo (const PrimitiveInfo *primitive_info)
MagickExport MagickBooleanType | DrawPrimitive (Image *image, const DrawInfo *draw_info, const PrimitiveInfo *primitive_info)
static void | DrawRoundLinecap (Image *image, const DrawInfo *draw_info, const PrimitiveInfo *primitive_info)
MagickExport void | GetAffineMatrix (AffineMatrix *affine_matrix)
MagickExport void | GetDrawInfo (const ImageInfo *image_info, DrawInfo *draw_info)
static MagickRealType | Permutate (const long n, const long k)

## Define Documentation

#define BezierQuantum 200

#define RenderImageTag "Render/Image"

## Typedef Documentation

typedef struct _EdgeInfo EdgeInfo

typedef struct _ElementInfo ElementInfo

typedef struct _PathInfo PathInfo

typedef struct _PolygonInfo PolygonInfo

## Enumeration Type Documentation

enum PathInfoCode

Enumerator:

  MoveToCode |
  OpenCode |
  GhostlineCode |
  LineToCode |
  EndCode |

## Function Documentation

MagickExport DrawInfo* AcquireDrawInfo | ( | void |  | ) |

static SegmentInfo AffineEdge | ( | const Image * | image,
|  | const AffineMatrix * | affine,
|  | const double | y,
|  | const SegmentInfo * | edge |
| ) |  |  | `[static]`

MagickExport DrawInfo* CloneDrawInfo | ( | const ImageInfo * | image_info,
|  | const DrawInfo * | draw_info |
| ) |  |  |

static int CompareEdges | ( | const void * | x,
|  | const void * | y |
| ) |  |  | `[static]`

static PolygonInfo* ConvertPathToPolygon | ( | const DrawInfo * | magick_unused(draw_info),
|  | const PathInfo * | path_info |
| ) |  |  | `[static]`

static PathInfo* ConvertPrimitiveToPath | ( | const DrawInfo * | magick_unused(draw_info),
|  | const PrimitiveInfo * | primitive_info |
| ) |  |  | `[static]`

MagickExport DrawInfo* DestroyDrawInfo | ( | DrawInfo * | draw_info | ) |

static unsigned long DestroyEdge | ( | PolygonInfo * | polygon_info,
|  | const unsigned long | edge |
| ) |  |  | `[static]`

static void DestroyPolygonInfo | ( | PolygonInfo * | polygon_info | ) | `[static]`

MagickExport MagickBooleanType DrawAffineImage | ( | Image * | image,
|  | const Image * | source,
|  | const AffineMatrix * | affine |
| ) |  |  |

static void DrawBoundingRectangles | ( | Image * | image,
|  | const DrawInfo * | draw_info,
|  | const PolygonInfo * | polygon_info |
| ) |  |  | `[static]`

MagickExport MagickBooleanType DrawClipPath | ( | Image * | image,
|  | const DrawInfo * | draw_info,
|  | const char * | name |
| ) |  |  |

static MagickBooleanType DrawDashPolygon | ( | const DrawInfo * | draw_info,
|  | const PrimitiveInfo * | primitive_info,
|  | Image * | image |
| ) |  |  | `[static]`

MagickExport MagickBooleanType DrawGradientImage | ( | Image * | image,
|  | const DrawInfo * | draw_info |
| ) |  |  |

MagickExport MagickBooleanType DrawImage | ( | Image * | image,
|  | const DrawInfo * | draw_info |
| ) |  |  |

MagickExport MagickBooleanType DrawPatternPath | ( | Image * | image,
|  | const DrawInfo * | draw_info,
|  | const char * | name,
|  | Image ** | pattern |
| ) |  |  |

static MagickBooleanType DrawPolygonPrimitive | ( | Image * | image,
|  | const DrawInfo * | draw_info,
|  | const PrimitiveInfo * | primitive_info |
| ) |  |  | `[static]`

MagickExport MagickBooleanType DrawPrimitive | ( | Image * | image,
|  | const DrawInfo * | draw_info,
|  | const PrimitiveInfo * | primitive_info |
| ) |  |  |

static void DrawRoundLinecap | ( | Image * | image,
|  | const DrawInfo * | draw_info,
|  | const PrimitiveInfo * | primitive_info |
| ) |  |  | `[static]`

static MagickBooleanType DrawStrokePolygon | ( | Image * | image,
|  | const DrawInfo * | draw_info,
|  | const PrimitiveInfo * | primitive_info |
| ) |  |  | `[static]`

MagickExport void GetAffineMatrix | ( | AffineMatrix * | affine_matrix | ) |

MagickExport void GetDrawInfo | ( | const ImageInfo * | image_info,
|  | DrawInfo * | draw_info |
| ) |  |  |

static MagickRealType GetPixelOpacity | ( | PolygonInfo * | polygon_info,
|  | const MagickRealType | mid,
|  | const MagickBooleanType | fill,
|  | const FillRule | fill_rule,
|  | const long | x,
|  | const long | y,
|  | MagickRealType * | stroke_opacity |
| ) |  |  | `[static]`

static MagickRealType GetStopColorOffset | ( | const SegmentInfo * | gradient_vector,
|  | const long | x,
|  | const long | y |
| ) |  |  | `[inline, static]`

static AffineMatrix InverseAffineMatrix | ( | const AffineMatrix * | affine | ) | `[static]`

static MagickBooleanType IsPoint | ( | const char * | point | ) | `[inline, static]`

static void LogPathInfo | ( | const PathInfo * | path_info | ) | `[static]`

static void LogPolygonInfo | ( | const PolygonInfo * | polygon_info | ) | `[static]`

static void LogPrimitiveInfo | ( | const PrimitiveInfo * | primitive_info | ) | `[static]`

static long MagickAbsoluteValue | ( | const long | x | ) | `[inline, static]`

static double MagickMax | ( | const double | x,
|  | const double | y |
| ) |  |  | `[inline, static]`

static double MagickMin | ( | const double | x,
|  | const double | y |
| ) |  |  | `[inline, static]`

static MagickRealType Permutate | ( | const long | n,
|  | const long | k |
| ) |  |  | `[inline, static]`

static void ReversePoints | ( | PointInfo * | points,
|  | const unsigned long | number_points |
| ) |  |  | `[static]`

static void TraceArc | ( | PrimitiveInfo * | primitive_info,
|  | const | PointInfo,
|  | const | PointInfo,
|  | const | PointInfo |
| ) |  |  | `[static]`

static void TraceArcPath | ( | PrimitiveInfo * | primitive_info,
|  | const | PointInfo,
|  | const | PointInfo,
|  | const | PointInfo,
|  | const | MagickRealType,
|  | const | MagickBooleanType,
|  | const | MagickBooleanType |
| ) |  |  |

static void TraceBezier | ( | PrimitiveInfo * | primitive_info,
|  | const unsigned long | number_coordinates |
| ) |  |  |

static void TraceCircle | ( | PrimitiveInfo * | primitive_info,
|  | const | PointInfo,
|  | const | PointInfo |
| ) |  |  |

static void TraceEllipse | ( | PrimitiveInfo * | primitive_info,
|  | const | PointInfo,
|  | const | PointInfo,
|  | const | PointInfo |
| ) |  |  |

static void TraceLine | ( | PrimitiveInfo * | primitive_info,
|  | const | PointInfo,
|  | const | PointInfo |
| ) |  |  |

static unsigned long TracePath | ( | PrimitiveInfo * | primitive_info,
|  | const char * | path |
| ) |  |  | `[static]`

static void TracePoint | ( | PrimitiveInfo * | primitive_info,
|  | const PointInfo | point |
| ) |  |  | `[inline, static]`

static void TraceRectangle | ( | PrimitiveInfo * | primitive_info,
|  | const | PointInfo,
|  | const | PointInfo |
| ) |  |  |

static void TraceRoundRectangle | ( | PrimitiveInfo * | primitive_info,
|  | const | PointInfo,
|  | const | PointInfo,
|  | PointInfo | arc |
| ) |  |  |

static void TraceSquareLinecap | ( | PrimitiveInfo * | primitive_info,
|  | const unsigned long | number_vertices,
|  | const | MagickRealType |
| ) |  |  |

static PrimitiveInfo * TraceStrokePolygon | ( | const DrawInfo * | draw_info,
|  | const PrimitiveInfo * | primitive_info |
| ) |  |  | `[static]`