00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef MAGICKCORE_DRAW_H
00019 #define MAGICKCORE_DRAW_H
00020
00021 #include "MagickCore/geometry.h"
00022 #include "MagickCore/image.h"
00023 #include "MagickCore/pixel.h"
00024 #include "MagickCore/type.h"
00025 #include "MagickCore/color.h"
00026
00027 #if defined(__cplusplus) || defined(c_plusplus)
00028 extern "C" {
00029 #endif
00030
00031 typedef enum
00032 {
00033 UndefinedAlign,
00034 LeftAlign,
00035 CenterAlign,
00036 RightAlign
00037 } AlignType;
00038
00039 typedef enum
00040 {
00041 UndefinedPathUnits,
00042 UserSpace,
00043 UserSpaceOnUse,
00044 ObjectBoundingBox
00045 } ClipPathUnits;
00046
00047 typedef enum
00048 {
00049 UndefinedDecoration,
00050 NoDecoration,
00051 UnderlineDecoration,
00052 OverlineDecoration,
00053 LineThroughDecoration
00054 } DecorationType;
00055
00056 typedef enum
00057 {
00058 UndefinedDirection,
00059 RightToLeftDirection,
00060 LeftToRightDirection
00061 } DirectionType;
00062
00063 typedef enum
00064 {
00065 UndefinedRule,
00066 #undef EvenOddRule
00067 EvenOddRule,
00068 NonZeroRule
00069 } FillRule;
00070
00071 typedef enum
00072 {
00073 UndefinedGradient,
00074 LinearGradient,
00075 RadialGradient
00076 } GradientType;
00077
00078 typedef enum
00079 {
00080 UndefinedCap,
00081 ButtCap,
00082 RoundCap,
00083 SquareCap
00084 } LineCap;
00085
00086 typedef enum
00087 {
00088 UndefinedJoin,
00089 MiterJoin,
00090 RoundJoin,
00091 BevelJoin
00092 } LineJoin;
00093
00094 typedef enum
00095 {
00096 UndefinedMethod,
00097 PointMethod,
00098 ReplaceMethod,
00099 FloodfillMethod,
00100 FillToBorderMethod,
00101 ResetMethod
00102 } PaintMethod;
00103
00104 typedef enum
00105 {
00106 UndefinedPrimitive,
00107 AlphaPrimitive,
00108 ArcPrimitive,
00109 BezierPrimitive,
00110 CirclePrimitive,
00111 ColorPrimitive,
00112 EllipsePrimitive,
00113 ImagePrimitive,
00114 LinePrimitive,
00115 PathPrimitive,
00116 PointPrimitive,
00117 PolygonPrimitive,
00118 PolylinePrimitive,
00119 RectanglePrimitive,
00120 RoundRectanglePrimitive,
00121 TextPrimitive
00122 } PrimitiveType;
00123
00124 typedef enum
00125 {
00126 UndefinedReference,
00127 GradientReference
00128 } ReferenceType;
00129
00130 typedef enum
00131 {
00132 UndefinedSpread,
00133 PadSpread,
00134 ReflectSpread,
00135 RepeatSpread
00136 } SpreadMethod;
00137
00138 typedef struct _StopInfo
00139 {
00140 PixelInfo
00141 color;
00142
00143 double
00144 offset;
00145 } StopInfo;
00146
00147 typedef struct _GradientInfo
00148 {
00149 GradientType
00150 type;
00151
00152 RectangleInfo
00153 bounding_box;
00154
00155 SegmentInfo
00156 gradient_vector;
00157
00158 StopInfo
00159 *stops;
00160
00161 size_t
00162 number_stops;
00163
00164 SpreadMethod
00165 spread;
00166
00167 MagickBooleanType
00168 debug;
00169
00170 PointInfo
00171 center,
00172 radii;
00173
00174 double
00175 radius,
00176 angle;
00177
00178 size_t
00179 signature;
00180 } GradientInfo;
00181
00182 typedef struct _ElementReference
00183 {
00184 char
00185 *id;
00186
00187 ReferenceType
00188 type;
00189
00190 GradientInfo
00191 gradient;
00192
00193 struct _ElementReference
00194 *previous,
00195 *next;
00196
00197 size_t
00198 signature;
00199 } ElementReference;
00200
00201 typedef struct _DrawInfo
00202 {
00203 char
00204 *primitive,
00205 *geometry;
00206
00207 RectangleInfo
00208 viewbox;
00209
00210 AffineMatrix
00211 affine;
00212
00213 PixelInfo
00214 fill,
00215 stroke,
00216 undercolor,
00217 border_color;
00218
00219 Image
00220 *fill_pattern,
00221 *stroke_pattern;
00222
00223 double
00224 stroke_width;
00225
00226 GradientInfo
00227 gradient;
00228
00229 MagickBooleanType
00230 stroke_antialias,
00231 text_antialias;
00232
00233 FillRule
00234 fill_rule;
00235
00236 LineCap
00237 linecap;
00238
00239 LineJoin
00240 linejoin;
00241
00242 size_t
00243 miterlimit;
00244
00245 double
00246 dash_offset;
00247
00248 DecorationType
00249 decorate;
00250
00251 CompositeOperator
00252 compose;
00253
00254 char
00255 *text,
00256 *font,
00257 *metrics,
00258 *family;
00259
00260 size_t
00261 face;
00262
00263 StyleType
00264 style;
00265
00266 StretchType
00267 stretch;
00268
00269 size_t
00270 weight;
00271
00272 char
00273 *encoding;
00274
00275 double
00276 pointsize;
00277
00278 char
00279 *density;
00280
00281 AlignType
00282 align;
00283
00284 GravityType
00285 gravity;
00286
00287 char
00288 *server_name;
00289
00290 double
00291 *dash_pattern;
00292
00293 char
00294 *clip_mask;
00295
00296 SegmentInfo
00297 bounds;
00298
00299 ClipPathUnits
00300 clip_units;
00301
00302 Quantum
00303 alpha;
00304
00305 MagickBooleanType
00306 render;
00307
00308 ElementReference
00309 element_reference;
00310
00311 double
00312 kerning,
00313 interword_spacing,
00314 interline_spacing;
00315
00316 DirectionType
00317 direction;
00318
00319 MagickBooleanType
00320 debug;
00321
00322 size_t
00323 signature;
00324
00325 double
00326 fill_alpha,
00327 stroke_alpha;
00328
00329 MagickBooleanType
00330 clip_path;
00331
00332 Image
00333 *clipping_mask;
00334
00335 ComplianceType
00336 compliance;
00337
00338 Image
00339 *composite_mask;
00340
00341 char
00342 *id;
00343 } DrawInfo;
00344
00345 typedef struct _PrimitiveInfo
00346 {
00347 PointInfo
00348 point;
00349
00350 size_t
00351 coordinates;
00352
00353 PrimitiveType
00354 primitive;
00355
00356 PaintMethod
00357 method;
00358
00359 char
00360 *text;
00361
00362 MagickBooleanType
00363 closed_subpath;
00364 } PrimitiveInfo;
00365
00366 typedef struct _TypeMetric
00367 {
00368 PointInfo
00369 pixels_per_em;
00370
00371 double
00372 ascent,
00373 descent,
00374 width,
00375 height,
00376 max_advance,
00377 underline_position,
00378 underline_thickness;
00379
00380 SegmentInfo
00381 bounds;
00382
00383 PointInfo
00384 origin;
00385 } TypeMetric;
00386
00387 extern MagickExport DrawInfo
00388 *AcquireDrawInfo(void),
00389 *CloneDrawInfo(const ImageInfo *,const DrawInfo *),
00390 *DestroyDrawInfo(DrawInfo *);
00391
00392 extern MagickExport MagickBooleanType
00393 DrawAffineImage(Image *,const Image *,const AffineMatrix *,ExceptionInfo *),
00394 DrawClipPath(Image *,const DrawInfo *,const char *,ExceptionInfo *),
00395 DrawGradientImage(Image *,const DrawInfo *,ExceptionInfo *),
00396 DrawImage(Image *,const DrawInfo *,ExceptionInfo *),
00397 DrawPatternPath(Image *,const DrawInfo *,const char *,Image **,
00398 ExceptionInfo *),
00399 DrawPrimitive(Image *,const DrawInfo *,const PrimitiveInfo *,ExceptionInfo *);
00400
00401 extern MagickExport void
00402 GetAffineMatrix(AffineMatrix *),
00403 GetDrawInfo(const ImageInfo *,DrawInfo *);
00404
00405 #if defined(__cplusplus) || defined(c_plusplus)
00406 }
00407 #endif
00408
00409 #endif