cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1 | /* |
cristy | 7e41fe8 | 2010-12-04 23:12:08 +0000 | [diff] [blame] | 2 | Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 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 | |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame^] | 25 | #include "MagickCore/geometry.h" |
| 26 | #include "MagickCore/image.h" |
| 27 | #include "MagickCore/pixel.h" |
| 28 | #include "MagickCore/type.h" |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 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 | { |
cristy | c9b1295 | 2010-03-28 01:12:28 +0000 | [diff] [blame] | 57 | UndefinedDirection, |
cristy | bdcb4b7 | 2010-04-23 00:15:29 +0000 | [diff] [blame] | 58 | RightToLeftDirection, |
| 59 | LeftToRightDirection |
cristy | c9b1295 | 2010-03-28 01:12:28 +0000 | [diff] [blame] | 60 | } DirectionType; |
| 61 | |
| 62 | typedef enum |
| 63 | { |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 64 | UndefinedRule, |
| 65 | #undef EvenOddRule |
| 66 | EvenOddRule, |
| 67 | NonZeroRule |
| 68 | } FillRule; |
| 69 | |
| 70 | typedef enum |
| 71 | { |
| 72 | UndefinedGradient, |
| 73 | LinearGradient, |
| 74 | RadialGradient |
| 75 | } GradientType; |
| 76 | |
| 77 | typedef enum |
| 78 | { |
| 79 | UndefinedCap, |
| 80 | ButtCap, |
| 81 | RoundCap, |
| 82 | SquareCap |
| 83 | } LineCap; |
| 84 | |
| 85 | typedef enum |
| 86 | { |
| 87 | UndefinedJoin, |
| 88 | MiterJoin, |
| 89 | RoundJoin, |
| 90 | BevelJoin |
| 91 | } LineJoin; |
| 92 | |
| 93 | typedef enum |
| 94 | { |
| 95 | UndefinedMethod, |
| 96 | PointMethod, |
| 97 | ReplaceMethod, |
| 98 | FloodfillMethod, |
| 99 | FillToBorderMethod, |
| 100 | ResetMethod |
| 101 | } PaintMethod; |
| 102 | |
| 103 | typedef enum |
| 104 | { |
| 105 | UndefinedPrimitive, |
| 106 | PointPrimitive, |
| 107 | LinePrimitive, |
| 108 | RectanglePrimitive, |
| 109 | RoundRectanglePrimitive, |
| 110 | ArcPrimitive, |
| 111 | EllipsePrimitive, |
| 112 | CirclePrimitive, |
| 113 | PolylinePrimitive, |
| 114 | PolygonPrimitive, |
| 115 | BezierPrimitive, |
| 116 | ColorPrimitive, |
| 117 | MattePrimitive, |
| 118 | TextPrimitive, |
| 119 | ImagePrimitive, |
| 120 | PathPrimitive |
| 121 | } PrimitiveType; |
| 122 | |
| 123 | typedef enum |
| 124 | { |
| 125 | UndefinedReference, |
| 126 | GradientReference |
| 127 | } ReferenceType; |
| 128 | |
| 129 | typedef enum |
| 130 | { |
| 131 | UndefinedSpread, |
| 132 | PadSpread, |
| 133 | ReflectSpread, |
| 134 | RepeatSpread |
| 135 | } SpreadMethod; |
| 136 | |
| 137 | typedef struct _PointInfo |
| 138 | { |
| 139 | double |
| 140 | x, |
| 141 | y; |
| 142 | } PointInfo; |
| 143 | |
| 144 | typedef struct _StopInfo |
| 145 | { |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame^] | 146 | PixelInfo |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 147 | color; |
| 148 | |
| 149 | MagickRealType |
| 150 | offset; |
| 151 | } StopInfo; |
| 152 | |
| 153 | typedef struct _GradientInfo |
| 154 | { |
| 155 | GradientType |
| 156 | type; |
| 157 | |
| 158 | RectangleInfo |
| 159 | bounding_box; |
| 160 | |
| 161 | SegmentInfo |
| 162 | gradient_vector; |
| 163 | |
| 164 | StopInfo |
| 165 | *stops; |
| 166 | |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 167 | size_t |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 168 | number_stops; |
| 169 | |
| 170 | SpreadMethod |
| 171 | spread; |
| 172 | |
| 173 | MagickBooleanType |
| 174 | debug; |
| 175 | |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 176 | size_t |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 177 | signature; |
| 178 | |
| 179 | PointInfo |
| 180 | center; |
| 181 | |
| 182 | MagickRealType |
| 183 | radius; |
| 184 | } GradientInfo; |
| 185 | |
| 186 | typedef struct _ElementReference |
| 187 | { |
| 188 | char |
| 189 | *id; |
| 190 | |
| 191 | ReferenceType |
| 192 | type; |
| 193 | |
| 194 | GradientInfo |
| 195 | gradient; |
| 196 | |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 197 | size_t |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 198 | signature; |
| 199 | |
| 200 | struct _ElementReference |
| 201 | *previous, |
| 202 | *next; |
| 203 | } ElementReference; |
| 204 | |
| 205 | typedef struct _DrawInfo |
| 206 | { |
| 207 | char |
| 208 | *primitive, |
| 209 | *geometry; |
| 210 | |
| 211 | RectangleInfo |
| 212 | viewbox; |
| 213 | |
| 214 | AffineMatrix |
| 215 | affine; |
| 216 | |
| 217 | GravityType |
| 218 | gravity; |
| 219 | |
| 220 | PixelPacket |
| 221 | fill, |
| 222 | stroke; |
| 223 | |
| 224 | double |
| 225 | stroke_width; |
| 226 | |
| 227 | GradientInfo |
| 228 | gradient; |
| 229 | |
| 230 | Image |
| 231 | *fill_pattern, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 232 | *stroke_pattern; |
| 233 | |
| 234 | MagickBooleanType |
| 235 | stroke_antialias, |
| 236 | text_antialias; |
| 237 | |
| 238 | FillRule |
| 239 | fill_rule; |
| 240 | |
| 241 | LineCap |
| 242 | linecap; |
| 243 | |
| 244 | LineJoin |
| 245 | linejoin; |
| 246 | |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 247 | size_t |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 248 | miterlimit; |
| 249 | |
| 250 | double |
| 251 | dash_offset; |
| 252 | |
| 253 | DecorationType |
| 254 | decorate; |
| 255 | |
| 256 | CompositeOperator |
| 257 | compose; |
| 258 | |
| 259 | char |
| 260 | *text; |
| 261 | |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 262 | size_t |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 263 | face; |
| 264 | |
| 265 | char |
| 266 | *font, |
| 267 | *metrics, |
| 268 | *family; |
| 269 | |
| 270 | StyleType |
| 271 | style; |
| 272 | |
| 273 | StretchType |
| 274 | stretch; |
| 275 | |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 276 | size_t |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 277 | weight; |
| 278 | |
| 279 | char |
| 280 | *encoding; |
| 281 | |
| 282 | double |
| 283 | pointsize; |
| 284 | |
| 285 | char |
| 286 | *density; |
| 287 | |
| 288 | AlignType |
| 289 | align; |
| 290 | |
| 291 | PixelPacket |
| 292 | undercolor, |
| 293 | border_color; |
| 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 |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame^] | 311 | alpha; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 312 | |
| 313 | MagickBooleanType |
| 314 | render; |
| 315 | |
| 316 | ElementReference |
| 317 | element_reference; |
| 318 | |
| 319 | MagickBooleanType |
| 320 | debug; |
| 321 | |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 322 | size_t |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 323 | signature; |
| 324 | |
| 325 | double |
| 326 | kerning, |
cristy | b32b90a | 2009-09-07 21:45:48 +0000 | [diff] [blame] | 327 | interword_spacing, |
cristy | 6ac8b33 | 2010-04-22 02:24:11 +0000 | [diff] [blame] | 328 | interline_spacing; |
| 329 | |
| 330 | DirectionType |
cristy | c9b1295 | 2010-03-28 01:12:28 +0000 | [diff] [blame] | 331 | direction; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 332 | } DrawInfo; |
| 333 | |
| 334 | typedef struct _PrimitiveInfo |
| 335 | { |
| 336 | PointInfo |
| 337 | point; |
| 338 | |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 339 | size_t |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 340 | coordinates; |
| 341 | |
| 342 | PrimitiveType |
| 343 | primitive; |
| 344 | |
| 345 | PaintMethod |
| 346 | method; |
| 347 | |
| 348 | char |
| 349 | *text; |
| 350 | } PrimitiveInfo; |
| 351 | |
| 352 | typedef struct _TypeMetric |
| 353 | { |
| 354 | PointInfo |
| 355 | pixels_per_em; |
| 356 | |
| 357 | double |
| 358 | ascent, |
| 359 | descent, |
| 360 | width, |
| 361 | height, |
| 362 | max_advance, |
| 363 | underline_position, |
| 364 | underline_thickness; |
| 365 | |
| 366 | SegmentInfo |
| 367 | bounds; |
| 368 | |
| 369 | PointInfo |
| 370 | origin; |
| 371 | } TypeMetric; |
| 372 | |
| 373 | extern MagickExport DrawInfo |
| 374 | *AcquireDrawInfo(void), |
| 375 | *CloneDrawInfo(const ImageInfo *,const DrawInfo *), |
| 376 | *DestroyDrawInfo(DrawInfo *); |
| 377 | |
| 378 | extern MagickExport MagickBooleanType |
| 379 | DrawAffineImage(Image *,const Image *,const AffineMatrix *), |
| 380 | DrawClipPath(Image *,const DrawInfo *,const char *), |
| 381 | DrawGradientImage(Image *,const DrawInfo *), |
| 382 | DrawImage(Image *,const DrawInfo *), |
| 383 | DrawPatternPath(Image *,const DrawInfo *,const char *,Image **), |
| 384 | DrawPrimitive(Image *,const DrawInfo *,const PrimitiveInfo *); |
| 385 | |
| 386 | extern MagickExport void |
| 387 | GetAffineMatrix(AffineMatrix *), |
| 388 | GetDrawInfo(const ImageInfo *,DrawInfo *); |
| 389 | |
| 390 | #if defined(__cplusplus) || defined(c_plusplus) |
| 391 | } |
| 392 | #endif |
| 393 | |
| 394 | #endif |