MagickCore 7.1.2-31
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/license/
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{
148 PixelInfo
149 color;
150
151 double
152 offset;
153} StopInfo;
154
155typedef struct _GradientInfo
156{
157 GradientType
158 type;
159
160 RectangleInfo
161 bounding_box;
162
163 SegmentInfo
164 gradient_vector;
165
166 StopInfo
167 *stops;
168
169 size_t
170 number_stops;
171
172 SpreadMethod
173 spread;
174
175 MagickBooleanType
176 debug;
177
178 PointInfo
179 center,
180 radii;
181
182 double
183 radius,
184 angle;
185
186 size_t
187 signature;
188} GradientInfo;
189
190typedef struct _ElementReference
191{
192 char
193 *id;
194
195 ReferenceType
196 type;
197
198 GradientInfo
199 gradient;
200
201 struct _ElementReference
202 *previous,
203 *next;
204
205 size_t
206 signature;
207} ElementReference;
208
209typedef struct _DrawInfo
210{
211 char
212 *primitive,
213 *geometry;
214
215 RectangleInfo
216 viewbox;
217
218 AffineMatrix
219 affine;
220
221 PixelInfo
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
234 GradientInfo
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
304 SegmentInfo
305 bounds;
306
307 ClipPathUnits
308 clip_units;
309
310 Quantum
311 alpha;
312
313 MagickBooleanType
314 render;
315
316 ElementReference
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
355 ImageInfo
356 *image_info;
357
358 size_t
359 *macro_expansion;
360} DrawInfo;
361
362typedef struct _PrimitiveInfo
363{
364 PointInfo
365 point;
366
367 size_t
368 coordinates;
369
370 PrimitiveType
371 primitive;
372
373 PaintMethod
374 method;
375
376 char
377 *text;
378
379 MagickBooleanType
380 closed_subpath;
381} PrimitiveInfo;
382
383typedef struct _TypeMetric
384{
385 PointInfo
386 pixels_per_em;
387
388 double
389 ascent,
390 descent,
391 width,
392 height,
393 max_advance,
394 underline_position,
395 underline_thickness;
396
397 SegmentInfo
398 bounds;
399
400 PointInfo
401 origin;
402} TypeMetric;
403
404extern MagickExport DrawInfo
405 *AcquireDrawInfo(void),
406 *CloneDrawInfo(const ImageInfo *,const DrawInfo *),
407 *DestroyDrawInfo(DrawInfo *);
408
409extern MagickExport MagickBooleanType
410 DrawAffineImage(Image *,const Image *,const AffineMatrix *,ExceptionInfo *),
411 DrawClipPath(Image *,const DrawInfo *,const char *,ExceptionInfo *),
412 DrawGradientImage(Image *,const DrawInfo *,ExceptionInfo *),
413 DrawImage(Image *,const DrawInfo *,ExceptionInfo *),
414 DrawPatternPath(Image *,const DrawInfo *,const char *,Image **,
415 ExceptionInfo *),
416 DrawPrimitive(Image *,const DrawInfo *,const PrimitiveInfo *,ExceptionInfo *);
417
418extern MagickExport void
419 GetAffineMatrix(AffineMatrix *),
420 GetDrawInfo(const ImageInfo *,DrawInfo *);
421
422#if defined(__cplusplus) || defined(c_plusplus)
423}
424#endif
425
426#endif