File indexing completed on 2025-01-30 10:11:41
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #ifndef MAGICKCORE_DRAW_H
0019 #define MAGICKCORE_DRAW_H
0020
0021 #include "MagickCore/geometry.h"
0022 #include "MagickCore/image.h"
0023 #include "MagickCore/pixel.h"
0024 #include "MagickCore/type.h"
0025 #include "MagickCore/color.h"
0026
0027 #if defined(__cplusplus) || defined(c_plusplus)
0028 extern "C" {
0029 #endif
0030
0031 typedef enum
0032 {
0033 UndefinedAlign,
0034 LeftAlign,
0035 CenterAlign,
0036 RightAlign
0037 } AlignType;
0038
0039 typedef enum
0040 {
0041 UndefinedPathUnits,
0042 UserSpace,
0043 UserSpaceOnUse,
0044 ObjectBoundingBox
0045 } ClipPathUnits;
0046
0047 typedef enum
0048 {
0049 UndefinedDecoration,
0050 NoDecoration,
0051 UnderlineDecoration,
0052 OverlineDecoration,
0053 LineThroughDecoration
0054 } DecorationType;
0055
0056 typedef enum
0057 {
0058 UndefinedDirection,
0059 RightToLeftDirection,
0060 LeftToRightDirection
0061 } DirectionType;
0062
0063 typedef enum
0064 {
0065 UndefinedRule,
0066 #undef EvenOddRule
0067 EvenOddRule,
0068 NonZeroRule
0069 } FillRule;
0070
0071 typedef enum
0072 {
0073 UndefinedGradient,
0074 LinearGradient,
0075 RadialGradient
0076 } GradientType;
0077
0078 typedef enum
0079 {
0080 UndefinedCap,
0081 ButtCap,
0082 RoundCap,
0083 SquareCap
0084 } LineCap;
0085
0086 typedef enum
0087 {
0088 UndefinedJoin,
0089 MiterJoin,
0090 RoundJoin,
0091 BevelJoin
0092 } LineJoin;
0093
0094 typedef enum
0095 {
0096 UndefinedMethod,
0097 PointMethod,
0098 ReplaceMethod,
0099 FloodfillMethod,
0100 FillToBorderMethod,
0101 ResetMethod
0102 } PaintMethod;
0103
0104 typedef enum
0105 {
0106 UndefinedPrimitive,
0107 AlphaPrimitive,
0108 ArcPrimitive,
0109 BezierPrimitive,
0110 CirclePrimitive,
0111 ColorPrimitive,
0112 EllipsePrimitive,
0113 ImagePrimitive,
0114 LinePrimitive,
0115 PathPrimitive,
0116 PointPrimitive,
0117 PolygonPrimitive,
0118 PolylinePrimitive,
0119 RectanglePrimitive,
0120 RoundRectanglePrimitive,
0121 TextPrimitive
0122 } PrimitiveType;
0123
0124 typedef enum
0125 {
0126 UndefinedReference,
0127 GradientReference
0128 } ReferenceType;
0129
0130 typedef enum
0131 {
0132 UndefinedSpread,
0133 PadSpread,
0134 ReflectSpread,
0135 RepeatSpread
0136 } SpreadMethod;
0137
0138 typedef enum
0139 {
0140 UndefinedWordBreakType,
0141 NormalWordBreakType,
0142 BreakWordBreakType
0143 } WordBreakType;
0144
0145 typedef struct _StopInfo
0146 {
0147 PixelInfo
0148 color;
0149
0150 double
0151 offset;
0152 } StopInfo;
0153
0154 typedef struct _GradientInfo
0155 {
0156 GradientType
0157 type;
0158
0159 RectangleInfo
0160 bounding_box;
0161
0162 SegmentInfo
0163 gradient_vector;
0164
0165 StopInfo
0166 *stops;
0167
0168 size_t
0169 number_stops;
0170
0171 SpreadMethod
0172 spread;
0173
0174 MagickBooleanType
0175 debug;
0176
0177 PointInfo
0178 center,
0179 radii;
0180
0181 double
0182 radius,
0183 angle;
0184
0185 size_t
0186 signature;
0187 } GradientInfo;
0188
0189 typedef struct _ElementReference
0190 {
0191 char
0192 *id;
0193
0194 ReferenceType
0195 type;
0196
0197 GradientInfo
0198 gradient;
0199
0200 struct _ElementReference
0201 *previous,
0202 *next;
0203
0204 size_t
0205 signature;
0206 } ElementReference;
0207
0208 typedef struct _DrawInfo
0209 {
0210 char
0211 *primitive,
0212 *geometry;
0213
0214 RectangleInfo
0215 viewbox;
0216
0217 AffineMatrix
0218 affine;
0219
0220 PixelInfo
0221 fill,
0222 stroke,
0223 undercolor,
0224 border_color;
0225
0226 Image
0227 *fill_pattern,
0228 *stroke_pattern;
0229
0230 double
0231 stroke_width;
0232
0233 GradientInfo
0234 gradient;
0235
0236 MagickBooleanType
0237 stroke_antialias,
0238 text_antialias;
0239
0240 FillRule
0241 fill_rule;
0242
0243 LineCap
0244 linecap;
0245
0246 LineJoin
0247 linejoin;
0248
0249 size_t
0250 miterlimit;
0251
0252 double
0253 dash_offset;
0254
0255 DecorationType
0256 decorate;
0257
0258 CompositeOperator
0259 compose;
0260
0261 char
0262 *text,
0263 *font,
0264 *metrics,
0265 *family;
0266
0267 size_t
0268 face;
0269
0270 StyleType
0271 style;
0272
0273 StretchType
0274 stretch;
0275
0276 size_t
0277 weight;
0278
0279 char
0280 *encoding;
0281
0282 double
0283 pointsize;
0284
0285 char
0286 *density;
0287
0288 AlignType
0289 align;
0290
0291 GravityType
0292 gravity;
0293
0294 char
0295 *server_name;
0296
0297 double
0298 *dash_pattern;
0299
0300 char
0301 *clip_mask;
0302
0303 SegmentInfo
0304 bounds;
0305
0306 ClipPathUnits
0307 clip_units;
0308
0309 Quantum
0310 alpha;
0311
0312 MagickBooleanType
0313 render;
0314
0315 ElementReference
0316 element_reference;
0317
0318 double
0319 kerning,
0320 interword_spacing,
0321 interline_spacing;
0322
0323 DirectionType
0324 direction;
0325
0326 MagickBooleanType
0327 debug;
0328
0329 size_t
0330 signature;
0331
0332 double
0333 fill_alpha,
0334 stroke_alpha;
0335
0336 MagickBooleanType
0337 clip_path;
0338
0339 Image
0340 *clipping_mask;
0341
0342 ComplianceType
0343 compliance;
0344
0345 Image
0346 *composite_mask;
0347
0348 char
0349 *id;
0350
0351 WordBreakType
0352 word_break;
0353
0354 ImageInfo
0355 *image_info;
0356 } DrawInfo;
0357
0358 typedef struct _PrimitiveInfo
0359 {
0360 PointInfo
0361 point;
0362
0363 size_t
0364 coordinates;
0365
0366 PrimitiveType
0367 primitive;
0368
0369 PaintMethod
0370 method;
0371
0372 char
0373 *text;
0374
0375 MagickBooleanType
0376 closed_subpath;
0377 } PrimitiveInfo;
0378
0379 typedef struct _TypeMetric
0380 {
0381 PointInfo
0382 pixels_per_em;
0383
0384 double
0385 ascent,
0386 descent,
0387 width,
0388 height,
0389 max_advance,
0390 underline_position,
0391 underline_thickness;
0392
0393 SegmentInfo
0394 bounds;
0395
0396 PointInfo
0397 origin;
0398 } TypeMetric;
0399
0400 extern MagickExport DrawInfo
0401 *AcquireDrawInfo(void),
0402 *CloneDrawInfo(const ImageInfo *,const DrawInfo *),
0403 *DestroyDrawInfo(DrawInfo *);
0404
0405 extern MagickExport MagickBooleanType
0406 DrawAffineImage(Image *,const Image *,const AffineMatrix *,ExceptionInfo *),
0407 DrawClipPath(Image *,const DrawInfo *,const char *,ExceptionInfo *),
0408 DrawGradientImage(Image *,const DrawInfo *,ExceptionInfo *),
0409 DrawImage(Image *,const DrawInfo *,ExceptionInfo *),
0410 DrawPatternPath(Image *,const DrawInfo *,const char *,Image **,
0411 ExceptionInfo *),
0412 DrawPrimitive(Image *,const DrawInfo *,const PrimitiveInfo *,ExceptionInfo *);
0413
0414 extern MagickExport void
0415 GetAffineMatrix(AffineMatrix *),
0416 GetDrawInfo(const ImageInfo *,DrawInfo *);
0417
0418 #if defined(__cplusplus) || defined(c_plusplus)
0419 }
0420 #endif
0421
0422 #endif