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 "magick/geometry.h"
00022 #include "magick/image.h"
00023 #include "magick/pixel.h"
00024 #include "magick/type.h"
00025 #include "magick/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 PointPrimitive,
00108 LinePrimitive,
00109 RectanglePrimitive,
00110 RoundRectanglePrimitive,
00111 ArcPrimitive,
00112 EllipsePrimitive,
00113 CirclePrimitive,
00114 PolylinePrimitive,
00115 PolygonPrimitive,
00116 BezierPrimitive,
00117 ColorPrimitive,
00118 MattePrimitive,
00119 TextPrimitive,
00120 ImagePrimitive,
00121 PathPrimitive
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 _PointInfo
00139 {
00140 double
00141 x,
00142 y;
00143 } PointInfo;
00144
00145 typedef struct _StopInfo
00146 {
00147 MagickPixelPacket
00148 color;
00149
00150 MagickRealType
00151 offset;
00152 } StopInfo;
00153
00154 typedef struct _GradientInfo
00155 {
00156 GradientType
00157 type;
00158
00159 RectangleInfo
00160 bounding_box;
00161
00162 SegmentInfo
00163 gradient_vector;
00164
00165 StopInfo
00166 *stops;
00167
00168 size_t
00169 number_stops;
00170
00171 SpreadMethod
00172 spread;
00173
00174 MagickBooleanType
00175 debug;
00176
00177 size_t
00178 signature;
00179
00180 PointInfo
00181 center;
00182
00183 MagickRealType
00184 radius,
00185 angle;
00186
00187 PointInfo
00188 radii;
00189 } GradientInfo;
00190
00191 typedef struct _ElementReference
00192 {
00193 char
00194 *id;
00195
00196 ReferenceType
00197 type;
00198
00199 GradientInfo
00200 gradient;
00201
00202 size_t
00203 signature;
00204
00205 struct _ElementReference
00206 *previous,
00207 *next;
00208 } ElementReference;
00209
00210 typedef struct _DrawInfo
00211 {
00212 char
00213 *primitive,
00214 *geometry;
00215
00216 RectangleInfo
00217 viewbox;
00218
00219 AffineMatrix
00220 affine;
00221
00222 GravityType
00223 gravity;
00224
00225 PixelPacket
00226 fill,
00227 stroke;
00228
00229 double
00230 stroke_width;
00231
00232 GradientInfo
00233 gradient;
00234
00235 Image
00236 *fill_pattern,
00237 *tile,
00238 *stroke_pattern;
00239
00240 MagickBooleanType
00241 stroke_antialias,
00242 text_antialias;
00243
00244 FillRule
00245 fill_rule;
00246
00247 LineCap
00248 linecap;
00249
00250 LineJoin
00251 linejoin;
00252
00253 size_t
00254 miterlimit;
00255
00256 double
00257 dash_offset;
00258
00259 DecorationType
00260 decorate;
00261
00262 CompositeOperator
00263 compose;
00264
00265 char
00266 *text;
00267
00268 size_t
00269 face;
00270
00271 char
00272 *font,
00273 *metrics,
00274 *family;
00275
00276 StyleType
00277 style;
00278
00279 StretchType
00280 stretch;
00281
00282 size_t
00283 weight;
00284
00285 char
00286 *encoding;
00287
00288 double
00289 pointsize;
00290
00291 char
00292 *density;
00293
00294 AlignType
00295 align;
00296
00297 PixelPacket
00298 undercolor,
00299 border_color;
00300
00301 char
00302 *server_name;
00303
00304 double
00305 *dash_pattern;
00306
00307 char
00308 *clip_mask;
00309
00310 SegmentInfo
00311 bounds;
00312
00313 ClipPathUnits
00314 clip_units;
00315
00316 Quantum
00317 opacity;
00318
00319 MagickBooleanType
00320 render;
00321
00322 ElementReference
00323 element_reference;
00324
00325 MagickBooleanType
00326 debug;
00327
00328 size_t
00329 signature;
00330
00331 double
00332 kerning,
00333 interword_spacing,
00334 interline_spacing;
00335
00336 DirectionType
00337 direction;
00338
00339 double
00340 fill_opacity,
00341 stroke_opacity;
00342
00343 MagickBooleanType
00344 clip_path;
00345
00346 Image
00347 *clipping_mask;
00348
00349 ComplianceType
00350 compliance;
00351
00352 Image
00353 *composite_mask;
00354
00355 char
00356 *id;
00357 } DrawInfo;
00358
00359 typedef struct _PrimitiveInfo
00360 {
00361 PointInfo
00362 point;
00363
00364 size_t
00365 coordinates;
00366
00367 PrimitiveType
00368 primitive;
00369
00370 PaintMethod
00371 method;
00372
00373 char
00374 *text;
00375
00376 MagickBooleanType
00377 closed_subpath;
00378 } PrimitiveInfo;
00379
00380 typedef struct _TypeMetric
00381 {
00382 PointInfo
00383 pixels_per_em;
00384
00385 double
00386 ascent,
00387 descent,
00388 width,
00389 height,
00390 max_advance,
00391 underline_position,
00392 underline_thickness;
00393
00394 SegmentInfo
00395 bounds;
00396
00397 PointInfo
00398 origin;
00399 } TypeMetric;
00400
00401 extern MagickExport DrawInfo
00402 *AcquireDrawInfo(void),
00403 *CloneDrawInfo(const ImageInfo *,const DrawInfo *),
00404 *DestroyDrawInfo(DrawInfo *);
00405
00406 extern MagickExport MagickBooleanType
00407 DrawAffineImage(Image *,const Image *,const AffineMatrix *),
00408 DrawClipPath(Image *,const DrawInfo *,const char *),
00409 DrawGradientImage(Image *,const DrawInfo *),
00410 DrawImage(Image *,const DrawInfo *),
00411 DrawPatternPath(Image *,const DrawInfo *,const char *,Image **),
00412 DrawPrimitive(Image *,const DrawInfo *,const PrimitiveInfo *);
00413
00414 extern MagickExport void
00415 GetAffineMatrix(AffineMatrix *),
00416 GetDrawInfo(const ImageInfo *,DrawInfo *);
00417
00418 #if defined(__cplusplus) || defined(c_plusplus)
00419 }
00420 #endif
00421
00422 #endif