root / ImageMagick / trunk / magick / draw.h

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