# draw.h

Go to the documentation of this file.

    00001 /*
    00002   Copyright 1999-2008 ImageMagick Studio LLC, a non-profit organization
    00003   dedicated to making software imaging solutions freely available.
    00004
    00005   You may not use this file except in compliance with the License.
    00006   obtain a copy of the License at
    00007
    00008     http://www.imagemagick.org/script/license.php
    00009
    00010   Unless required by applicable law or agreed to in writing, software
    00011   distributed under the License is distributed on an "AS IS" BASIS,
    00012   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    00013   See the License for the specific language governing permissions and
    00014   limitations under the License.
    00015
    00016   MagickCore drawing methods.
    00017 */
    00018 #ifndef _MAGICKCORE_DRAW_H
    00019 #define _MAGICKCORE_DRAW_H
    00020
    00021 #if defined(__cplusplus) || defined(c_plusplus)
    00022 extern "C" {
    00023 #endif
    00024
    00025 #include "magick/geometry.h"
    00026 #include "magick/image.h"
    00027 #include "magick/pixel.h"
    00028 #include "magick/type.h"
    00029
    00030 typedef enum
    00031 {
    00032   UndefinedAlign,
    00033   LeftAlign,
    00034   CenterAlign,
    00035   RightAlign
    00036 } AlignType;
    00037
    00038 typedef enum
    00039 {
    00040   UndefinedPathUnits,
    00041   UserSpace,
    00042   UserSpaceOnUse,
    00043   ObjectBoundingBox
    00044 } ClipPathUnits;
    00045
    00046 typedef enum
    00047 {
    00048   UndefinedDecoration,
    00049   NoDecoration,
    00050   UnderlineDecoration,
    00051   OverlineDecoration,
    00052   LineThroughDecoration
    00053 } DecorationType;
    00054
    00055 typedef enum
    00056 {
    00057   UndefinedRule,
    00058 #undef EvenOddRule
    00059   EvenOddRule,
    00060   NonZeroRule
    00061 } FillRule;
    00062
    00063 typedef enum
    00064 {
    00065   UndefinedGradient,
    00066   LinearGradient,
    00067   RadialGradient
    00068 } GradientType;
    00069
    00070 typedef enum
    00071 {
    00072   UndefinedCap,
    00073   ButtCap,
    00074   RoundCap,
    00075   SquareCap
    00076 } LineCap;
    00077
    00078 typedef enum
    00079 {
    00080   UndefinedJoin,
    00081   MiterJoin,
    00082   RoundJoin,
    00083   BevelJoin
    00084 } LineJoin;
    00085
    00086 typedef enum
    00087 {
    00088   UndefinedMethod,
    00089   PointMethod,
    00090   ReplaceMethod,
    00091   FloodfillMethod,
    00092   FillToBorderMethod,
    00093   ResetMethod
    00094 } PaintMethod;
    00095
    00096 typedef enum
    00097 {
    00098   UndefinedPrimitive,
    00099   PointPrimitive,
    00100   LinePrimitive,
    00101   RectanglePrimitive,
    00102   RoundRectanglePrimitive,
    00103   ArcPrimitive,
    00104   EllipsePrimitive,
    00105   CirclePrimitive,
    00106   PolylinePrimitive,
    00107   PolygonPrimitive,
    00108   BezierPrimitive,
    00109   ColorPrimitive,
    00110   MattePrimitive,
    00111   TextPrimitive,
    00112   ImagePrimitive,
    00113   PathPrimitive
    00114 } PrimitiveType;
    00115
    00116 typedef enum
    00117 {
    00118   UndefinedReference,
    00119   GradientReference
    00120 } ReferenceType;
    00121
    00122 typedef enum
    00123 {
    00124   UndefinedSpread,
    00125   PadSpread,
    00126   ReflectSpread,
    00127   RepeatSpread
    00128 } SpreadMethod;
    00129
    00130 typedef struct _StopInfo
    00131 {
    00132   MagickPixelPacket
    00133     color;
    00134
    00135   MagickRealType
    00136     offset;
    00137 } StopInfo;
    00138
    00139 typedef struct _GradientInfo
    00140 {
    00141   GradientType
    00142     type;
    00143
    00144   RectangleInfo
    00145     bounding_box;
    00146
    00147   SegmentInfo
    00148     gradient_vector;
    00149
    00150   StopInfo
    00151     *stops;
    00152
    00153   unsigned long
    00154     number_stops;
    00155
    00156   SpreadMethod
    00157     spread;
    00158
    00159   MagickBooleanType
    00160     debug;
    00161
    00162   unsigned long
    00163     signature;
    00164 } GradientInfo;
    00165
    00166 typedef struct _ElementReference
    00167 {
    00168   char
    00169     *id;
    00170
    00171   ReferenceType
    00172     type;
    00173
    00174   GradientInfo
    00175     gradient;
    00176
    00177   unsigned long
    00178     signature;
    00179
    00180   struct _ElementReference
    00181     *previous,
    00182     *next;
    00183 } ElementReference;
    00184
    00185 typedef struct _DrawInfo
    00186 {
    00187   char
    00188     *primitive,
    00189     *geometry;
    00190
    00191   RectangleInfo
    00192     viewbox;
    00193
    00194   AffineMatrix
    00195     affine;
    00196
    00197   GravityType
    00198     gravity;
    00199
    00200   PixelPacket
    00201     fill,
    00202     stroke;
    00203
    00204   double
    00205     stroke_width;
    00206
    00207   GradientInfo
    00208     gradient;
    00209
    00210   Image
    00211     *fill_pattern,
    00212     *tile,
    00213     *stroke_pattern;
    00214
    00215   MagickBooleanType
    00216     stroke_antialias,
    00217     text_antialias;
    00218
    00219   FillRule
    00220     fill_rule;
    00221
    00222   LineCap
    00223     linecap;
    00224
    00225   LineJoin
    00226     linejoin;
    00227
    00228   unsigned long
    00229     miterlimit;
    00230
    00231   double
    00232     dash_offset;
    00233
    00234   DecorationType
    00235     decorate;
    00236
    00237   CompositeOperator
    00238     compose;
    00239
    00240   char
    00241     *text;
    00242
    00243   unsigned long
    00244     face;
    00245
    00246   char
    00247     *font,
    00248     *metrics,
    00249     *family;
    00250
    00251   StyleType
    00252     style;
    00253
    00254   StretchType
    00255     stretch;
    00256
    00257   unsigned long
    00258     weight;
    00259
    00260   char
    00261     *encoding;
    00262
    00263   double
    00264     pointsize;
    00265
    00266   char
    00267     *density;
    00268
    00269   AlignType
    00270     align;
    00271
    00272   PixelPacket
    00273     undercolor,
    00274     border_color;
    00275
    00276   char
    00277     *server_name;
    00278
    00279   double
    00280     *dash_pattern;
    00281
    00282   char
    00283     *clip_mask;
    00284
    00285   SegmentInfo
    00286     bounds;
    00287
    00288   ClipPathUnits
    00289     clip_units;
    00290
    00291   Quantum
    00292     opacity;
    00293
    00294   MagickBooleanType
    00295     render;
    00296
    00297   ElementReference
    00298     element_reference;
    00299
    00300   MagickBooleanType
    00301     debug;
    00302
    00303   unsigned long
    00304     signature;
    00305 } DrawInfo;
    00306
    00307 typedef struct _PointInfo
    00308 {
    00309   double
    00310     x,
    00311     y;
    00312 } PointInfo;
    00313
    00314 typedef struct _PrimitiveInfo
    00315 {
    00316   PointInfo
    00317     point;
    00318
    00319   unsigned long
    00320     coordinates;
    00321
    00322   PrimitiveType
    00323     primitive;
    00324
    00325   PaintMethod
    00326     method;
    00327
    00328   char
    00329     *text;
    00330 } PrimitiveInfo;
    00331
    00332 typedef struct _TypeMetric
    00333 {
    00334   PointInfo
    00335     pixels_per_em;
    00336
    00337   double
    00338     ascent,
    00339     descent,
    00340     width,
    00341     height,
    00342     max_advance,
    00343     underline_position,
    00344     underline_thickness;
    00345
    00346   SegmentInfo
    00347     bounds;
    00348
    00349   PointInfo
    00350     origin;
    00351 } TypeMetric;
    00352
    00353 extern MagickExport DrawInfo
    00354   *AcquireDrawInfo(void),
    00355   *CloneDrawInfo(const ImageInfo *,const DrawInfo *),
    00356   *DestroyDrawInfo(DrawInfo *);
    00357
    00358 extern MagickExport MagickBooleanType
    00359   DrawAffineImage(Image *,const Image *,const AffineMatrix *),
    00360   DrawClipPath(Image *,const DrawInfo *,const char *),
    00361   DrawGradientImage(Image *,const DrawInfo *),
    00362   DrawImage(Image *,const DrawInfo *),
    00363   DrawPatternPath(Image *,const DrawInfo *,const char *,Image **),
    00364   DrawPrimitive(Image *,const DrawInfo *,const PrimitiveInfo *);
    00365
    00366 extern MagickExport void
    00367   GetAffineMatrix(AffineMatrix *),
    00368   GetDrawInfo(const ImageInfo *,DrawInfo *);
    00369
    00370 #if defined(__cplusplus) || defined(c_plusplus)
    00371 }
    00372 #endif
    00373
    00374 #endif