MagickCore 7.1.1
Convert, Edit, Or Compose Bitmap Images
Loading...
Searching...
No Matches
draw.h
1/*
2 Copyright @ 1999 ImageMagick Studio LLC, a non-profit organization
3 dedicated to making software imaging solutions freely available.
4
5 You may not use this file except in compliance with the License. You may
6 obtain a copy of the License at
7
8 https://imagemagick.org/script/license.php
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15
16 MagickCore drawing methods.
17*/
18#ifndef MAGICKCORE_DRAW_H
19#define MAGICKCORE_DRAW_H
20
21#include "MagickCore/geometry.h"
22#include "MagickCore/image.h"
23#include "MagickCore/pixel.h"
24#include "MagickCore/type.h"
25#include "MagickCore/color.h"
26
27#if defined(__cplusplus) || defined(c_plusplus)
28extern "C" {
29#endif
30
31typedef enum
32{
33 UndefinedAlign,
34 LeftAlign,
35 CenterAlign,
36 RightAlign
37} AlignType;
38
39typedef enum
40{
41 UndefinedPathUnits,
42 UserSpace,
43 UserSpaceOnUse,
44 ObjectBoundingBox
45} ClipPathUnits;
46
47typedef enum
48{
49 UndefinedDecoration,
50 NoDecoration,
51 UnderlineDecoration,
52 OverlineDecoration,
53 LineThroughDecoration
54} DecorationType;
55
56typedef enum
57{
58 UndefinedDirection,
59 RightToLeftDirection,
60 LeftToRightDirection,
61 TopToBottomDirection
62} DirectionType;
63
64typedef enum
65{
66 UndefinedRule,
67#undef EvenOddRule
68 EvenOddRule,
69 NonZeroRule
70} FillRule;
71
72typedef enum
73{
74 UndefinedGradient,
75 LinearGradient,
76 RadialGradient
77} GradientType;
78
79typedef enum
80{
81 UndefinedCap,
82 ButtCap,
83 RoundCap,
84 SquareCap
85} LineCap;
86
87typedef enum
88{
89 UndefinedJoin,
90 MiterJoin,
91 RoundJoin,
92 BevelJoin
93} LineJoin;
94
95typedef enum
96{
97 UndefinedMethod,
98 PointMethod,
99 ReplaceMethod,
100 FloodfillMethod,
101 FillToBorderMethod,
102 ResetMethod
103} PaintMethod;
104
105typedef enum
106{
107 UndefinedPrimitive,
108 AlphaPrimitive,
109 ArcPrimitive,
110 BezierPrimitive,
111 CirclePrimitive,
112 ColorPrimitive,
113 EllipsePrimitive,
114 ImagePrimitive,
115 LinePrimitive,
116 PathPrimitive,
117 PointPrimitive,
118 PolygonPrimitive,
119 PolylinePrimitive,
120 RectanglePrimitive,
121 RoundRectanglePrimitive,
122 TextPrimitive
123} PrimitiveType;
124
125typedef enum
126{
127 UndefinedReference,
128 GradientReference
129} ReferenceType;
130
131typedef enum
132{
133 UndefinedSpread,
134 PadSpread,
135 ReflectSpread,
136 RepeatSpread
137} SpreadMethod;
138
139typedef enum
140{
141 UndefinedWordBreakType,
142 NormalWordBreakType,
143 BreakWordBreakType
144} WordBreakType;
145
146typedef struct _StopInfo
147{
149 color;
150
151 double
152 offset;
153} StopInfo;
154
155typedef struct _GradientInfo
156{
157 GradientType
158 type;
159
161 bounding_box;
162
164 gradient_vector;
165
167 *stops;
168
169 size_t
170 number_stops;
171
172 SpreadMethod
173 spread;
174
175 MagickBooleanType
176 debug;
177
179 center,
180 radii;
181
182 double
183 radius,
184 angle;
185
186 size_t
187 signature;
189
190typedef struct _ElementReference
191{
192 char
193 *id;
194
195 ReferenceType
196 type;
197
199 gradient;
200
201 struct _ElementReference
202 *previous,
203 *next;
204
205 size_t
206 signature;
208
209typedef struct _DrawInfo
210{
211 char
212 *primitive,
213 *geometry;
214
216 viewbox;
217
219 affine;
220
222 fill,
223 stroke,
224 undercolor,
225 border_color;
226
227 Image
228 *fill_pattern,
229 *stroke_pattern;
230
231 double
232 stroke_width;
233
235 gradient;
236
237 MagickBooleanType
238 stroke_antialias,
239 text_antialias;
240
241 FillRule
242 fill_rule;
243
244 LineCap
245 linecap;
246
247 LineJoin
248 linejoin;
249
250 size_t
251 miterlimit;
252
253 double
254 dash_offset;
255
256 DecorationType
257 decorate;
258
259 CompositeOperator
260 compose;
261
262 char
263 *text,
264 *font,
265 *metrics,
266 *family;
267
268 size_t
269 face;
270
271 StyleType
272 style;
273
274 StretchType
275 stretch;
276
277 size_t
278 weight;
279
280 char
281 *encoding;
282
283 double
284 pointsize;
285
286 char
287 *density;
288
289 AlignType
290 align;
291
292 GravityType
293 gravity;
294
295 char
296 *server_name;
297
298 double
299 *dash_pattern;
300
301 char
302 *clip_mask;
303
305 bounds;
306
307 ClipPathUnits
308 clip_units;
309
310 Quantum
311 alpha;
312
313 MagickBooleanType
314 render;
315
317 element_reference;
318
319 double
320 kerning,
321 interword_spacing,
322 interline_spacing;
323
324 DirectionType
325 direction;
326
327 MagickBooleanType
328 debug;
329
330 size_t
331 signature;
332
333 double
334 fill_alpha,
335 stroke_alpha;
336
337 MagickBooleanType
338 clip_path;
339
340 Image
341 *clipping_mask;
342
343 ComplianceType
344 compliance;
345
346 Image
347 *composite_mask;
348
349 char
350 *id;
351
352 WordBreakType
353 word_break;
354
356 *image_info;
357} DrawInfo;
358
359typedef struct _PrimitiveInfo
360{
362 point;
363
364 size_t
365 coordinates;
366
367 PrimitiveType
368 primitive;
369
370 PaintMethod
371 method;
372
373 char
374 *text;
375
376 MagickBooleanType
377 closed_subpath;
379
380typedef struct _TypeMetric
381{
383 pixels_per_em;
384
385 double
386 ascent,
387 descent,
388 width,
389 height,
390 max_advance,
391 underline_position,
392 underline_thickness;
393
395 bounds;
396
398 origin;
399} TypeMetric;
400
401extern MagickExport DrawInfo
402 *AcquireDrawInfo(void),
403 *CloneDrawInfo(const ImageInfo *,const DrawInfo *),
404 *DestroyDrawInfo(DrawInfo *);
405
406extern MagickExport MagickBooleanType
407 DrawAffineImage(Image *,const Image *,const AffineMatrix *,ExceptionInfo *),
408 DrawClipPath(Image *,const DrawInfo *,const char *,ExceptionInfo *),
409 DrawGradientImage(Image *,const DrawInfo *,ExceptionInfo *),
410 DrawImage(Image *,const DrawInfo *,ExceptionInfo *),
411 DrawPatternPath(Image *,const DrawInfo *,const char *,Image **,
412 ExceptionInfo *),
413 DrawPrimitive(Image *,const DrawInfo *,const PrimitiveInfo *,ExceptionInfo *);
414
415extern MagickExport void
416 GetAffineMatrix(AffineMatrix *),
417 GetDrawInfo(const ImageInfo *,DrawInfo *);
418
419#if defined(__cplusplus) || defined(c_plusplus)
420}
421#endif
422
423#endif