]> granicus.if.org Git - imagemagick/blob - magick/draw.h
(no commit message)
[imagemagick] / magick / draw.h
1 /*
2   Copyright 1999-2009 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.
6   obtain a copy of the License at
7   
8     http://www.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 #if defined(__cplusplus) || defined(c_plusplus)
22 extern "C" {
23 #endif
24
25 #include "magick/geometry.h"
26 #include "magick/image.h"
27 #include "magick/pixel.h"
28 #include "magick/type.h"
29
30 typedef enum
31 {
32   UndefinedAlign,
33   LeftAlign,
34   CenterAlign,
35   RightAlign
36 } AlignType;
37
38 typedef enum
39 {
40   UndefinedPathUnits,
41   UserSpace,
42   UserSpaceOnUse,
43   ObjectBoundingBox
44 } ClipPathUnits;
45
46 typedef enum
47 {
48   UndefinedDecoration,
49   NoDecoration,
50   UnderlineDecoration,
51   OverlineDecoration,
52   LineThroughDecoration
53 } DecorationType;
54
55 typedef enum
56 {
57   UndefinedRule,
58 #undef EvenOddRule
59   EvenOddRule,
60   NonZeroRule
61 } FillRule;
62
63 typedef enum
64 {
65   UndefinedGradient,
66   LinearGradient,
67   RadialGradient
68 } GradientType;
69
70 typedef enum
71 {
72   UndefinedCap,
73   ButtCap,
74   RoundCap,
75   SquareCap
76 } LineCap;
77
78 typedef enum
79 {
80   UndefinedJoin,
81   MiterJoin,
82   RoundJoin,
83   BevelJoin
84 } LineJoin;
85
86 typedef enum
87 {
88   UndefinedMethod,
89   PointMethod,
90   ReplaceMethod,
91   FloodfillMethod,
92   FillToBorderMethod,
93   ResetMethod
94 } PaintMethod;
95
96 typedef enum
97 {
98   UndefinedPrimitive,
99   PointPrimitive,
100   LinePrimitive,
101   RectanglePrimitive,
102   RoundRectanglePrimitive,
103   ArcPrimitive,
104   EllipsePrimitive,
105   CirclePrimitive,
106   PolylinePrimitive,
107   PolygonPrimitive,
108   BezierPrimitive,
109   ColorPrimitive,
110   MattePrimitive,
111   TextPrimitive,
112   ImagePrimitive,
113   PathPrimitive
114 } PrimitiveType;
115
116 typedef enum
117 {
118   UndefinedReference,
119   GradientReference
120 } ReferenceType;
121
122 typedef enum
123 {
124   UndefinedSpread,
125   PadSpread,
126   ReflectSpread,
127   RepeatSpread
128 } SpreadMethod;
129
130 typedef struct _PointInfo
131
132   double
133     x,
134     y;
135 } PointInfo;
136
137 typedef struct _StopInfo
138 {
139   MagickPixelPacket
140     color;
141
142   MagickRealType
143     offset;
144 } StopInfo;
145
146 typedef struct _GradientInfo
147 {
148   GradientType
149     type;
150
151   RectangleInfo
152     bounding_box;
153
154   SegmentInfo
155     gradient_vector;
156
157   StopInfo
158     *stops;
159
160   unsigned long
161     number_stops;
162
163   SpreadMethod
164     spread;
165
166   MagickBooleanType
167     debug;
168
169   unsigned long
170     signature;
171
172   PointInfo
173     center;
174
175   MagickRealType
176     radius;
177 } GradientInfo;
178
179 typedef struct _ElementReference
180 {
181   char
182     *id;
183
184   ReferenceType
185     type;
186
187   GradientInfo
188     gradient;
189
190   unsigned long
191     signature;
192
193   struct _ElementReference
194     *previous,
195     *next;
196 } ElementReference;
197
198 typedef struct _DrawInfo
199 {
200   char
201     *primitive,
202     *geometry;
203
204   RectangleInfo
205     viewbox;
206
207   AffineMatrix
208     affine;
209
210   GravityType
211     gravity;
212
213   PixelPacket
214     fill,
215     stroke;
216
217   double
218     stroke_width;
219
220   GradientInfo
221     gradient;
222
223   Image
224     *fill_pattern,
225     *tile,
226     *stroke_pattern;
227
228   MagickBooleanType
229     stroke_antialias,
230     text_antialias;
231
232   FillRule
233     fill_rule;
234
235   LineCap
236     linecap;
237
238   LineJoin
239     linejoin;
240
241   unsigned long
242     miterlimit;
243
244   double
245     dash_offset;
246
247   DecorationType
248     decorate;
249
250   CompositeOperator
251     compose;
252
253   char
254     *text;
255
256   unsigned long
257     face;
258
259   char
260     *font,
261     *metrics,
262     *family;
263
264   StyleType
265     style;
266
267   StretchType
268     stretch;
269
270   unsigned long
271     weight;
272
273   char
274     *encoding;
275
276   double
277     pointsize;
278
279   char
280     *density;
281
282   AlignType
283     align;
284
285   PixelPacket
286     undercolor,
287     border_color;
288
289   char
290     *server_name;
291
292   double
293     *dash_pattern;
294
295   char
296     *clip_mask;
297
298   SegmentInfo
299     bounds;
300
301   ClipPathUnits
302     clip_units;
303
304   Quantum
305     opacity;
306
307   MagickBooleanType
308     render;
309
310   ElementReference
311     element_reference;
312
313   MagickBooleanType
314     debug;
315
316   unsigned long
317     signature;
318
319   double
320     kerning,
321     interword_spacing,
322     interline_spacing;
323 } DrawInfo;
324
325 typedef struct _PrimitiveInfo
326 {
327   PointInfo
328     point;
329
330   unsigned long
331     coordinates;
332
333   PrimitiveType
334     primitive;
335
336   PaintMethod
337     method;
338
339   char
340     *text;
341 } PrimitiveInfo;
342
343 typedef struct _TypeMetric
344 {
345   PointInfo
346     pixels_per_em;
347
348   double
349     ascent,
350     descent,
351     width,
352     height,
353     max_advance,
354     underline_position,
355     underline_thickness;
356
357   SegmentInfo
358     bounds;
359
360   PointInfo
361     origin;
362 } TypeMetric;
363
364 extern MagickExport DrawInfo
365   *AcquireDrawInfo(void),
366   *CloneDrawInfo(const ImageInfo *,const DrawInfo *),
367   *DestroyDrawInfo(DrawInfo *);
368
369 extern MagickExport MagickBooleanType
370   DrawAffineImage(Image *,const Image *,const AffineMatrix *),
371   DrawClipPath(Image *,const DrawInfo *,const char *),
372   DrawGradientImage(Image *,const DrawInfo *),
373   DrawImage(Image *,const DrawInfo *),
374   DrawPatternPath(Image *,const DrawInfo *,const char *,Image **),
375   DrawPrimitive(Image *,const DrawInfo *,const PrimitiveInfo *);
376
377 extern MagickExport void
378   GetAffineMatrix(AffineMatrix *),
379   GetDrawInfo(const ImageInfo *,DrawInfo *);
380
381 #if defined(__cplusplus) || defined(c_plusplus)
382 }
383 #endif
384
385 #endif