draw.inc 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. {
  2. Copyright 1999-2005 ImageMagick Studio LLC, a non-profit organization
  3. dedicated to making software imaging solutions freely available.
  4. You may not use this file except in compliance with the License.
  5. obtain a copy of the License at
  6. http://www.imagemagick.org/script/license.php
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. ImageMagick drawing methods.
  13. }
  14. //#include "magick/type.h"
  15. type
  16. AlignType = (
  17. UndefinedAlign,
  18. LeftAlign,
  19. CenterAlign,
  20. RightAlign
  21. );
  22. type
  23. ClipPathUnits = (
  24. UndefinedPathUnits,
  25. UserSpace,
  26. UserSpaceOnUse,
  27. ObjectBoundingBox
  28. );
  29. type
  30. DecorationType = (
  31. UndefinedDecoration,
  32. NoDecoration,
  33. UnderlineDecoration,
  34. OverlineDecoration,
  35. LineThroughDecoration
  36. );
  37. type
  38. FillRule = (
  39. UndefinedRule,
  40. //#undef EvenOddRule
  41. EvenOddRule,
  42. NonZeroRule
  43. );
  44. type
  45. GradientType = (
  46. UndefinedGradient,
  47. LinearGradient,
  48. RadialGradient
  49. );
  50. type
  51. LineCap = (
  52. UndefinedCap,
  53. ButtCap,
  54. RoundCap,
  55. SquareCap
  56. );
  57. type
  58. LineJoin = (
  59. UndefinedJoin,
  60. MiterJoin,
  61. RoundJoin,
  62. BevelJoin
  63. );
  64. type
  65. PaintMethod = (
  66. UndefinedMethod,
  67. PointMethod,
  68. ReplaceMethod,
  69. FloodfillMethod,
  70. FillToBorderMethod,
  71. ResetMethod
  72. );
  73. type
  74. PrimitiveType = (
  75. UndefinedPrimitive,
  76. PointPrimitive,
  77. LinePrimitive,
  78. RectanglePrimitive,
  79. RoundRectanglePrimitive,
  80. ArcPrimitive,
  81. EllipsePrimitive,
  82. CirclePrimitive,
  83. PolylinePrimitive,
  84. PolygonPrimitive,
  85. BezierPrimitive,
  86. ColorPrimitive,
  87. MattePrimitive,
  88. TextPrimitive,
  89. ImagePrimitive,
  90. PathPrimitive
  91. );
  92. type
  93. ReferenceType = (
  94. UndefinedReference,
  95. GradientReference
  96. );
  97. type
  98. SpreadMethod = (
  99. UndefinedSpread,
  100. PadSpread,
  101. ReflectSpead,
  102. RepeatSpread
  103. );
  104. type
  105. GradientInfo = record
  106. type_: GradientType;
  107. color: PixelPacket;
  108. stop: SegmentInfo;
  109. length: Cardinal;
  110. spread: SpreadMethod;
  111. debug: MagickBooleanType;
  112. signature: Cardinal;
  113. previous, next: Pointer;
  114. { struct _GradientInfo
  115. *previous,
  116. *next;}
  117. end;
  118. type
  119. ElementReference = record
  120. id: PChar;
  121. type_: ReferenceType;
  122. gradient: GradientInfo;
  123. signature: Cardinal;
  124. previous, next: Pointer;
  125. { struct _ElementReference
  126. *previous,
  127. *next;}
  128. end;
  129. type
  130. DrawInfo = record
  131. primitive,
  132. geometry: PChar;
  133. viewbox: RectangleInfo;
  134. affine: AffineMatrix;
  135. gravity: GravityType;
  136. fill,
  137. stroke: PixelPacket;
  138. stroke_width: double;
  139. gradient: GradientInfo;
  140. fill_pattern,
  141. tile,
  142. stroke_pattern: PImage;
  143. stroke_antialias,
  144. text_antialias: MagickBooleanType;
  145. fill_rule: FillRule;
  146. linecap_: LineCap;
  147. linejoin_: LineJoin;
  148. miterlimit: Cardinal;
  149. dash_offset: double;
  150. decorate: DecorationType;
  151. compose: CompositeOperator;
  152. text: PChar;
  153. face: Cardinal;
  154. font,
  155. metrics,
  156. family: PChar;
  157. style: StyleType;
  158. stretch: StretchType;
  159. weight: Cardinal;
  160. encoding: PChar;
  161. pointsize: double;
  162. density: PChar;
  163. align: AlignType;
  164. undercolor,
  165. border_color: PixelPacket;
  166. server_name: PChar;
  167. dash_pattern: Pdouble;
  168. clip_path: PChar;
  169. bounds: SegmentInfo;
  170. clip_units: ClipPathUnits;
  171. opacity: Quantum;
  172. render: MagickBooleanType;
  173. element_reference: ElementReference;
  174. debug: MagickBooleanType;
  175. signature: Cardinal;
  176. end;
  177. PDrawInfo = ^DrawInfo;
  178. PPDrawInfo = ^PDrawInfo;
  179. type
  180. PointInfo = record
  181. x, y: double;
  182. end;
  183. PPointInfo = ^PointInfo;
  184. type
  185. PrimitiveInfo = record
  186. point: PointInfo;
  187. coordinates: Cardinal;
  188. primitive: PrimitiveType;
  189. method: PaintMethod;
  190. text: PChar;
  191. end;
  192. type
  193. TypeMetric = record
  194. pixels_per_em: PointInfo;
  195. ascent,
  196. descent,
  197. width,
  198. height,
  199. max_advance,
  200. underline_position,
  201. underline_thickness: double;
  202. bounds: SegmentInfo;
  203. end;
  204. {extern MagickExport DrawInfo
  205. *CloneDrawInfo(const ImageInfo *,const DrawInfo *),
  206. *DestroyDrawInfo(DrawInfo *);
  207. extern MagickExport MagickBooleanType
  208. DrawAffineImage(Image *,const Image *,const AffineMatrix *),
  209. DrawClipPath(Image *,const DrawInfo *,const char *),
  210. DrawImage(Image *,const DrawInfo *),
  211. DrawPatternPath(Image *,const DrawInfo *,const char *,Image **),
  212. DrawPrimitive(Image *,const DrawInfo *,const PrimitiveInfo *);
  213. extern MagickExport void
  214. GetAffineMatrix(AffineMatrix *),
  215. GetDrawInfo(const ImageInfo *,DrawInfo *);}