cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame^] | 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 | } DrawInfo; |
| 323 | |
| 324 | typedef struct _PrimitiveInfo |
| 325 | { |
| 326 | PointInfo |
| 327 | point; |
| 328 | |
| 329 | unsigned long |
| 330 | coordinates; |
| 331 | |
| 332 | PrimitiveType |
| 333 | primitive; |
| 334 | |
| 335 | PaintMethod |
| 336 | method; |
| 337 | |
| 338 | char |
| 339 | *text; |
| 340 | } PrimitiveInfo; |
| 341 | |
| 342 | typedef struct _TypeMetric |
| 343 | { |
| 344 | PointInfo |
| 345 | pixels_per_em; |
| 346 | |
| 347 | double |
| 348 | ascent, |
| 349 | descent, |
| 350 | width, |
| 351 | height, |
| 352 | max_advance, |
| 353 | underline_position, |
| 354 | underline_thickness; |
| 355 | |
| 356 | SegmentInfo |
| 357 | bounds; |
| 358 | |
| 359 | PointInfo |
| 360 | origin; |
| 361 | } TypeMetric; |
| 362 | |
| 363 | extern MagickExport DrawInfo |
| 364 | *AcquireDrawInfo(void), |
| 365 | *CloneDrawInfo(const ImageInfo *,const DrawInfo *), |
| 366 | *DestroyDrawInfo(DrawInfo *); |
| 367 | |
| 368 | extern MagickExport MagickBooleanType |
| 369 | DrawAffineImage(Image *,const Image *,const AffineMatrix *), |
| 370 | DrawClipPath(Image *,const DrawInfo *,const char *), |
| 371 | DrawGradientImage(Image *,const DrawInfo *), |
| 372 | DrawImage(Image *,const DrawInfo *), |
| 373 | DrawPatternPath(Image *,const DrawInfo *,const char *,Image **), |
| 374 | DrawPrimitive(Image *,const DrawInfo *,const PrimitiveInfo *); |
| 375 | |
| 376 | extern MagickExport void |
| 377 | GetAffineMatrix(AffineMatrix *), |
| 378 | GetDrawInfo(const ImageInfo *,DrawInfo *); |
| 379 | |
| 380 | #if defined(__cplusplus) || defined(c_plusplus) |
| 381 | } |
| 382 | #endif |
| 383 | |
| 384 | #endif |