rdp-rmagick 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (388) hide show
  1. data/ChangeLog +769 -0
  2. data/Doxyfile +1514 -0
  3. data/README-Mac-OSX.txt +1 -0
  4. data/README.md +231 -0
  5. data/build_tarball.rake +215 -0
  6. data/doc/comtasks.html +287 -0
  7. data/doc/constants.html +1581 -0
  8. data/doc/css/doc.css +299 -0
  9. data/doc/css/popup.css +34 -0
  10. data/doc/css/ref.css +67 -0
  11. data/doc/draw.html +3269 -0
  12. data/doc/ex/InitialCoords.rb +23 -0
  13. data/doc/ex/NewCoordSys.rb +32 -0
  14. data/doc/ex/OrigCoordSys.rb +18 -0
  15. data/doc/ex/PreserveAspectRatio.rb +205 -0
  16. data/doc/ex/RotateScale.rb +37 -0
  17. data/doc/ex/Skew.rb +38 -0
  18. data/doc/ex/Use01.rb +16 -0
  19. data/doc/ex/Use02.rb +21 -0
  20. data/doc/ex/Use03.rb +16 -0
  21. data/doc/ex/ViewBox.rb +33 -0
  22. data/doc/ex/adaptive_threshold.rb +10 -0
  23. data/doc/ex/add_noise.rb +17 -0
  24. data/doc/ex/affine.rb +48 -0
  25. data/doc/ex/affine_transform.rb +20 -0
  26. data/doc/ex/arc.rb +49 -0
  27. data/doc/ex/arcpath.rb +33 -0
  28. data/doc/ex/arcs01.rb +28 -0
  29. data/doc/ex/arcs02.rb +61 -0
  30. data/doc/ex/average.rb +15 -0
  31. data/doc/ex/axes.rb +64 -0
  32. data/doc/ex/baseline_shift01.rb +18 -0
  33. data/doc/ex/bilevel_channel.rb +9 -0
  34. data/doc/ex/blur_image.rb +12 -0
  35. data/doc/ex/border.rb +10 -0
  36. data/doc/ex/bounding_box.rb +44 -0
  37. data/doc/ex/cbezier1.rb +42 -0
  38. data/doc/ex/cbezier2.rb +42 -0
  39. data/doc/ex/cbezier3.rb +42 -0
  40. data/doc/ex/cbezier4.rb +43 -0
  41. data/doc/ex/cbezier5.rb +43 -0
  42. data/doc/ex/cbezier6.rb +53 -0
  43. data/doc/ex/channel.rb +26 -0
  44. data/doc/ex/charcoal.rb +12 -0
  45. data/doc/ex/chop.rb +29 -0
  46. data/doc/ex/circle.rb +33 -0
  47. data/doc/ex/circle01.rb +17 -0
  48. data/doc/ex/clip_path.rb +60 -0
  49. data/doc/ex/coalesce.rb +60 -0
  50. data/doc/ex/color_fill_to_border.rb +29 -0
  51. data/doc/ex/color_floodfill.rb +28 -0
  52. data/doc/ex/color_histogram.rb +48 -0
  53. data/doc/ex/color_reset.rb +11 -0
  54. data/doc/ex/colorize.rb +16 -0
  55. data/doc/ex/colors.rb +64 -0
  56. data/doc/ex/compose_mask.rb +23 -0
  57. data/doc/ex/composite.rb +135 -0
  58. data/doc/ex/composite_layers.rb +53 -0
  59. data/doc/ex/composite_tiled.rb +23 -0
  60. data/doc/ex/contrast.rb +36 -0
  61. data/doc/ex/crop.rb +31 -0
  62. data/doc/ex/crop_with_gravity.rb +46 -0
  63. data/doc/ex/cubic01.rb +45 -0
  64. data/doc/ex/cubic02.rb +94 -0
  65. data/doc/ex/cycle_colormap.rb +21 -0
  66. data/doc/ex/dissolve.rb +13 -0
  67. data/doc/ex/drawcomp.rb +42 -0
  68. data/doc/ex/drop_shadow.rb +60 -0
  69. data/doc/ex/edge.rb +11 -0
  70. data/doc/ex/ellipse.rb +45 -0
  71. data/doc/ex/ellipse01.rb +22 -0
  72. data/doc/ex/emboss.rb +11 -0
  73. data/doc/ex/enhance.rb +28 -0
  74. data/doc/ex/equalize.rb +11 -0
  75. data/doc/ex/evenodd.rb +43 -0
  76. data/doc/ex/fill_pattern.rb +26 -0
  77. data/doc/ex/flatten_images.rb +36 -0
  78. data/doc/ex/flip.rb +11 -0
  79. data/doc/ex/flop.rb +11 -0
  80. data/doc/ex/font_styles.rb +34 -0
  81. data/doc/ex/fonts.rb +20 -0
  82. data/doc/ex/frame.rb +12 -0
  83. data/doc/ex/gaussian_blur.rb +11 -0
  84. data/doc/ex/get_multiline_type_metrics.rb +42 -0
  85. data/doc/ex/get_pixels.rb +48 -0
  86. data/doc/ex/get_type_metrics.rb +146 -0
  87. data/doc/ex/gradientfill.rb +27 -0
  88. data/doc/ex/grav.rb +46 -0
  89. data/doc/ex/gravity.rb +79 -0
  90. data/doc/ex/group.rb +26 -0
  91. data/doc/ex/hatchfill.rb +27 -0
  92. data/doc/ex/image.rb +46 -0
  93. data/doc/ex/images/Apple.miff +0 -0
  94. data/doc/ex/images/Ballerina.jpg +0 -0
  95. data/doc/ex/images/Ballerina3.jpg +0 -0
  96. data/doc/ex/images/Button_0.gif +0 -0
  97. data/doc/ex/images/Button_1.gif +0 -0
  98. data/doc/ex/images/Button_2.gif +0 -0
  99. data/doc/ex/images/Button_3.gif +0 -0
  100. data/doc/ex/images/Button_4.gif +0 -0
  101. data/doc/ex/images/Button_5.gif +0 -0
  102. data/doc/ex/images/Button_6.gif +0 -0
  103. data/doc/ex/images/Button_7.gif +0 -0
  104. data/doc/ex/images/Button_8.gif +0 -0
  105. data/doc/ex/images/Button_9.gif +0 -0
  106. data/doc/ex/images/Button_A.gif +0 -0
  107. data/doc/ex/images/Button_B.gif +0 -0
  108. data/doc/ex/images/Button_C.gif +0 -0
  109. data/doc/ex/images/Button_D.gif +0 -0
  110. data/doc/ex/images/Button_E.gif +0 -0
  111. data/doc/ex/images/Button_F.gif +0 -0
  112. data/doc/ex/images/Button_G.gif +0 -0
  113. data/doc/ex/images/Button_H.gif +0 -0
  114. data/doc/ex/images/Button_I.gif +0 -0
  115. data/doc/ex/images/Button_J.gif +0 -0
  116. data/doc/ex/images/Button_K.gif +0 -0
  117. data/doc/ex/images/Button_L.gif +0 -0
  118. data/doc/ex/images/Button_M.gif +0 -0
  119. data/doc/ex/images/Button_N.gif +0 -0
  120. data/doc/ex/images/Button_O.gif +0 -0
  121. data/doc/ex/images/Button_P.gif +0 -0
  122. data/doc/ex/images/Button_Q.gif +0 -0
  123. data/doc/ex/images/Button_R.gif +0 -0
  124. data/doc/ex/images/Button_S.gif +0 -0
  125. data/doc/ex/images/Button_T.gif +0 -0
  126. data/doc/ex/images/Button_U.gif +0 -0
  127. data/doc/ex/images/Button_V.gif +0 -0
  128. data/doc/ex/images/Button_W.gif +0 -0
  129. data/doc/ex/images/Button_X.gif +0 -0
  130. data/doc/ex/images/Button_Y.gif +0 -0
  131. data/doc/ex/images/Button_Z.gif +0 -0
  132. data/doc/ex/images/Cheetah.jpg +0 -0
  133. data/doc/ex/images/Coffee.wmf +0 -0
  134. data/doc/ex/images/Flower_Hat.jpg +0 -0
  135. data/doc/ex/images/Gold_Statue.jpg +0 -0
  136. data/doc/ex/images/Hot_Air_Balloons.jpg +0 -0
  137. data/doc/ex/images/Hot_Air_Balloons_H.jpg +0 -0
  138. data/doc/ex/images/Leaf.miff +0 -0
  139. data/doc/ex/images/No.wmf +0 -0
  140. data/doc/ex/images/Polynesia.jpg +0 -0
  141. data/doc/ex/images/Red_Rocks.jpg +0 -0
  142. data/doc/ex/images/Rocks_On_Beach.miff +0 -0
  143. data/doc/ex/images/Shorts.jpg +0 -0
  144. data/doc/ex/images/Snake.wmf +0 -0
  145. data/doc/ex/images/Violin.jpg +0 -0
  146. data/doc/ex/images/Yellow_Rose.miff +0 -0
  147. data/doc/ex/images/big-duck.gif +0 -0
  148. data/doc/ex/images/duck.gif +0 -0
  149. data/doc/ex/images/duck0.gif +0 -0
  150. data/doc/ex/images/duck1.gif +0 -0
  151. data/doc/ex/images/duck10.gif +0 -0
  152. data/doc/ex/images/duck11.gif +0 -0
  153. data/doc/ex/images/duck12.gif +0 -0
  154. data/doc/ex/images/duck13.gif +0 -0
  155. data/doc/ex/images/duck14.gif +0 -0
  156. data/doc/ex/images/duck15.gif +0 -0
  157. data/doc/ex/images/duck2.gif +0 -0
  158. data/doc/ex/images/duck3.gif +0 -0
  159. data/doc/ex/images/duck4.gif +0 -0
  160. data/doc/ex/images/duck5.gif +0 -0
  161. data/doc/ex/images/duck6.gif +0 -0
  162. data/doc/ex/images/duck7.gif +0 -0
  163. data/doc/ex/images/duck8.gif +0 -0
  164. data/doc/ex/images/duck9.gif +0 -0
  165. data/doc/ex/images/graydient230x6.gif +0 -0
  166. data/doc/ex/images/logo400x83.gif +0 -0
  167. data/doc/ex/images/model.miff +0 -0
  168. data/doc/ex/images/notimplemented.gif +0 -0
  169. data/doc/ex/images/smile.miff +0 -0
  170. data/doc/ex/images/spin.gif +0 -0
  171. data/doc/ex/implode.rb +34 -0
  172. data/doc/ex/level.rb +11 -0
  173. data/doc/ex/level_colors.rb +11 -0
  174. data/doc/ex/line.rb +42 -0
  175. data/doc/ex/line01.rb +23 -0
  176. data/doc/ex/mask.rb +36 -0
  177. data/doc/ex/matte_fill_to_border.rb +40 -0
  178. data/doc/ex/matte_floodfill.rb +33 -0
  179. data/doc/ex/matte_replace.rb +40 -0
  180. data/doc/ex/median_filter.rb +28 -0
  181. data/doc/ex/modulate.rb +11 -0
  182. data/doc/ex/mono.rb +23 -0
  183. data/doc/ex/morph.rb +26 -0
  184. data/doc/ex/mosaic.rb +35 -0
  185. data/doc/ex/motion_blur.rb +11 -0
  186. data/doc/ex/negate.rb +11 -0
  187. data/doc/ex/negate_channel.rb +9 -0
  188. data/doc/ex/nested_rvg.rb +21 -0
  189. data/doc/ex/nonzero.rb +43 -0
  190. data/doc/ex/normalize.rb +11 -0
  191. data/doc/ex/oil_paint.rb +11 -0
  192. data/doc/ex/opacity.rb +37 -0
  193. data/doc/ex/ordered_dither.rb +11 -0
  194. data/doc/ex/path.rb +64 -0
  195. data/doc/ex/pattern1.rb +25 -0
  196. data/doc/ex/pattern2.rb +26 -0
  197. data/doc/ex/polaroid.rb +28 -0
  198. data/doc/ex/polygon.rb +24 -0
  199. data/doc/ex/polygon01.rb +23 -0
  200. data/doc/ex/polyline.rb +23 -0
  201. data/doc/ex/polyline01.rb +23 -0
  202. data/doc/ex/posterize.rb +8 -0
  203. data/doc/ex/preview.rb +9 -0
  204. data/doc/ex/qbezierpath.rb +52 -0
  205. data/doc/ex/quad01.rb +36 -0
  206. data/doc/ex/quantize-m.rb +25 -0
  207. data/doc/ex/radial_blur.rb +9 -0
  208. data/doc/ex/raise.rb +8 -0
  209. data/doc/ex/random_threshold_channel.rb +13 -0
  210. data/doc/ex/rect01.rb +15 -0
  211. data/doc/ex/rect02.rb +22 -0
  212. data/doc/ex/rectangle.rb +35 -0
  213. data/doc/ex/reduce_noise.rb +28 -0
  214. data/doc/ex/remap.rb +12 -0
  215. data/doc/ex/remap_images.rb +21 -0
  216. data/doc/ex/resize_to_fill.rb +10 -0
  217. data/doc/ex/resize_to_fit.rb +10 -0
  218. data/doc/ex/roll.rb +9 -0
  219. data/doc/ex/rotate.rb +45 -0
  220. data/doc/ex/rotate_f.rb +14 -0
  221. data/doc/ex/roundrect.rb +34 -0
  222. data/doc/ex/rubyname.rb +30 -0
  223. data/doc/ex/rvg_clippath.rb +14 -0
  224. data/doc/ex/rvg_linecap.rb +43 -0
  225. data/doc/ex/rvg_linejoin.rb +41 -0
  226. data/doc/ex/rvg_opacity.rb +19 -0
  227. data/doc/ex/rvg_pattern.rb +26 -0
  228. data/doc/ex/rvg_stroke_dasharray.rb +12 -0
  229. data/doc/ex/segment.rb +11 -0
  230. data/doc/ex/sepiatone.rb +8 -0
  231. data/doc/ex/shade.rb +11 -0
  232. data/doc/ex/shadow.rb +31 -0
  233. data/doc/ex/shave.rb +15 -0
  234. data/doc/ex/shear.rb +10 -0
  235. data/doc/ex/sketch.rb +18 -0
  236. data/doc/ex/skewx.rb +52 -0
  237. data/doc/ex/skewy.rb +47 -0
  238. data/doc/ex/smile.rb +125 -0
  239. data/doc/ex/solarize.rb +11 -0
  240. data/doc/ex/sparse_color.rb +55 -0
  241. data/doc/ex/splice.rb +9 -0
  242. data/doc/ex/spread.rb +11 -0
  243. data/doc/ex/stegano.rb +55 -0
  244. data/doc/ex/stroke_dasharray.rb +43 -0
  245. data/doc/ex/stroke_fill.rb +11 -0
  246. data/doc/ex/stroke_linecap.rb +44 -0
  247. data/doc/ex/stroke_linejoin.rb +48 -0
  248. data/doc/ex/stroke_width.rb +49 -0
  249. data/doc/ex/swirl.rb +17 -0
  250. data/doc/ex/text.rb +37 -0
  251. data/doc/ex/text01.rb +17 -0
  252. data/doc/ex/text_align.rb +36 -0
  253. data/doc/ex/text_antialias.rb +38 -0
  254. data/doc/ex/text_styles.rb +21 -0
  255. data/doc/ex/text_undercolor.rb +28 -0
  256. data/doc/ex/texture_fill_to_border.rb +34 -0
  257. data/doc/ex/texture_floodfill.rb +32 -0
  258. data/doc/ex/texturefill.rb +25 -0
  259. data/doc/ex/threshold.rb +13 -0
  260. data/doc/ex/to_blob.rb +14 -0
  261. data/doc/ex/translate.rb +39 -0
  262. data/doc/ex/transparent.rb +38 -0
  263. data/doc/ex/transpose.rb +9 -0
  264. data/doc/ex/transverse.rb +9 -0
  265. data/doc/ex/tref01.rb +25 -0
  266. data/doc/ex/triangle01.rb +16 -0
  267. data/doc/ex/trim.rb +24 -0
  268. data/doc/ex/tspan01.rb +18 -0
  269. data/doc/ex/tspan02.rb +19 -0
  270. data/doc/ex/tspan03.rb +21 -0
  271. data/doc/ex/unsharp_mask.rb +28 -0
  272. data/doc/ex/viewex.rb +35 -0
  273. data/doc/ex/vignette.rb +12 -0
  274. data/doc/ex/watermark.rb +28 -0
  275. data/doc/ex/wave.rb +9 -0
  276. data/doc/ex/wet_floor.rb +59 -0
  277. data/doc/ex/writing_mode01.rb +27 -0
  278. data/doc/ex/writing_mode02.rb +26 -0
  279. data/doc/ilist.html +2056 -0
  280. data/doc/image1.html +4680 -0
  281. data/doc/image2.html +3665 -0
  282. data/doc/image3.html +4522 -0
  283. data/doc/imageattrs.html +1638 -0
  284. data/doc/imusage.html +514 -0
  285. data/doc/index.html +416 -0
  286. data/doc/info.html +1499 -0
  287. data/doc/magick.html +565 -0
  288. data/doc/optequiv.html +2435 -0
  289. data/doc/rvg.html +975 -0
  290. data/doc/rvgclip.html +248 -0
  291. data/doc/rvggroup.html +305 -0
  292. data/doc/rvgimage.html +289 -0
  293. data/doc/rvgpattern.html +475 -0
  294. data/doc/rvgshape.html +406 -0
  295. data/doc/rvgstyle.html +270 -0
  296. data/doc/rvgtext.html +465 -0
  297. data/doc/rvgtspan.html +238 -0
  298. data/doc/rvgtut.html +530 -0
  299. data/doc/rvguse.html +145 -0
  300. data/doc/rvgxform.html +294 -0
  301. data/doc/scripts/doc.js +22 -0
  302. data/doc/scripts/stripeTables.js +23 -0
  303. data/doc/struct.html +1339 -0
  304. data/doc/usage.html +1621 -0
  305. data/examples/constitute.rb +7 -0
  306. data/examples/crop_with_gravity.rb +46 -0
  307. data/examples/demo.rb +324 -0
  308. data/examples/describe.rb +44 -0
  309. data/examples/find_similar_region.rb +34 -0
  310. data/examples/histogram.rb +325 -0
  311. data/examples/identify.rb +187 -0
  312. data/examples/image_opacity.rb +29 -0
  313. data/examples/import_export.rb +31 -0
  314. data/examples/pattern_fill.rb +38 -0
  315. data/examples/rotating_text.rb +45 -0
  316. data/examples/spinner.rb +50 -0
  317. data/examples/thumbnail.rb +65 -0
  318. data/examples/vignette.rb +79 -0
  319. data/ext/RMagick/Makefile +180 -0
  320. data/ext/RMagick/RMagick2.so +0 -0
  321. data/ext/RMagick/extconf.h +119 -0
  322. data/ext/RMagick/extconf.rb +406 -0
  323. data/ext/RMagick/mkmf.log +3022 -0
  324. data/ext/RMagick/rmagick.c +394 -0
  325. data/ext/RMagick/rmagick.h +1307 -0
  326. data/ext/RMagick/rmagick.o +0 -0
  327. data/ext/RMagick/rmdraw.c +1991 -0
  328. data/ext/RMagick/rmdraw.o +0 -0
  329. data/ext/RMagick/rmenum.c +1224 -0
  330. data/ext/RMagick/rmenum.o +0 -0
  331. data/ext/RMagick/rmfill.c +717 -0
  332. data/ext/RMagick/rmfill.o +0 -0
  333. data/ext/RMagick/rmilist.c +1217 -0
  334. data/ext/RMagick/rmilist.o +0 -0
  335. data/ext/RMagick/rmimage.c +15099 -0
  336. data/ext/RMagick/rmimage.o +0 -0
  337. data/ext/RMagick/rminfo.c +2567 -0
  338. data/ext/RMagick/rminfo.o +0 -0
  339. data/ext/RMagick/rmmain.c +1705 -0
  340. data/ext/RMagick/rmmain.o +0 -0
  341. data/ext/RMagick/rmmontage.c +511 -0
  342. data/ext/RMagick/rmmontage.o +0 -0
  343. data/ext/RMagick/rmpixel.c +1103 -0
  344. data/ext/RMagick/rmpixel.o +0 -0
  345. data/ext/RMagick/rmstruct.c +1047 -0
  346. data/ext/RMagick/rmstruct.o +0 -0
  347. data/ext/RMagick/rmutil.c +1730 -0
  348. data/ext/RMagick/rmutil.o +0 -0
  349. data/lib/RMagick.rb +1962 -0
  350. data/lib/rvg/clippath.rb +48 -0
  351. data/lib/rvg/container.rb +131 -0
  352. data/lib/rvg/deep_equal.rb +56 -0
  353. data/lib/rvg/describable.rb +53 -0
  354. data/lib/rvg/embellishable.rb +417 -0
  355. data/lib/rvg/misc.rb +740 -0
  356. data/lib/rvg/paint.rb +55 -0
  357. data/lib/rvg/pathdata.rb +131 -0
  358. data/lib/rvg/rvg.rb +283 -0
  359. data/lib/rvg/stretchable.rb +168 -0
  360. data/lib/rvg/stylable.rb +124 -0
  361. data/lib/rvg/text.rb +187 -0
  362. data/lib/rvg/to_c.rb +103 -0
  363. data/lib/rvg/transformable.rb +133 -0
  364. data/lib/rvg/units.rb +66 -0
  365. data/metaconfig +7 -0
  366. data/post-clean.rb +12 -0
  367. data/post-install.rb +50 -0
  368. data/post-setup.rb +254 -0
  369. data/rmagick.gemspec +20 -0
  370. data/setup.rb +1585 -0
  371. data/test/Draw.rb +121 -0
  372. data/test/Image1.rb +762 -0
  373. data/test/Image2.rb +1308 -0
  374. data/test/Image3.rb +1001 -0
  375. data/test/ImageList1.rb +808 -0
  376. data/test/ImageList2.rb +389 -0
  377. data/test/Image_attributes.rb +682 -0
  378. data/test/Import_Export.rb +116 -0
  379. data/test/Info.rb +349 -0
  380. data/test/Magick.rb +364 -0
  381. data/test/Pixel.rb +120 -0
  382. data/test/Preview.rb +62 -0
  383. data/test/all_basic.rb +39 -0
  384. data/test/cmyk.icm +0 -0
  385. data/test/srgb.icm +0 -0
  386. data/test/test.0 +0 -0
  387. data/uninstall.rb +74 -0
  388. metadata +455 -0
Binary file
@@ -0,0 +1,1224 @@
1
+ /**************************************************************************//**
2
+ * Enumeration methods.
3
+ *
4
+ * Copyright © 2002 - 2009 by Timothy P. Hunter
5
+ *
6
+ * Changes since Nov. 2009 copyright © by Benjamin Thomas and Omer Bar-or
7
+ *
8
+ * @file rmenum.c
9
+ * @version $Id: rmenum.c,v 1.9 2009/12/20 02:33:33 baror Exp $
10
+ * @author Tim Hunter
11
+ ******************************************************************************/
12
+
13
+ #include "rmagick.h"
14
+
15
+
16
+ #define ENUMERATORS_CLASS_VAR "@@enumerators"
17
+
18
+
19
+ static VALUE Enum_type_values(VALUE);
20
+ static VALUE Enum_type_inspect(VALUE);
21
+
22
+
23
+
24
+
25
+
26
+ /**
27
+ * Set up a subclass of Enum.
28
+ *
29
+ * No Ruby usage (internal function)
30
+ *
31
+ * @param tag the name of the subclass
32
+ * @return the subclass
33
+ */
34
+ VALUE
35
+ rm_define_enum_type(const char *tag)
36
+ {
37
+ VALUE class;
38
+
39
+ class = rb_define_class_under(Module_Magick, tag, Class_Enum);\
40
+
41
+ rb_define_singleton_method(class, "values", Enum_type_values, 0);
42
+ rb_define_method(class, "initialize", Enum_type_initialize, 2);
43
+ rb_define_method(class, "inspect", Enum_type_inspect, 0);
44
+ return class;
45
+ }
46
+
47
+
48
+ /**
49
+ * Construct a new Enum subclass instance.
50
+ *
51
+ * No Ruby usage (internal function)
52
+ *
53
+ * @param class the subclass
54
+ * @param sym the symbol
55
+ * @param val the value for the symbol
56
+ * @return a new instance of class
57
+ */
58
+ VALUE
59
+ rm_enum_new(VALUE class, VALUE sym, VALUE val)
60
+ {
61
+ VALUE argv[2];
62
+
63
+ argv[0] = sym;
64
+ argv[1] = val;
65
+ return rb_obj_freeze(rb_class_new_instance(2, argv, class));
66
+ }
67
+
68
+
69
+ /**
70
+ * Enum class alloc function.
71
+ *
72
+ * No Ruby usage (internal function)
73
+ *
74
+ * @param class the Ruby class to use
75
+ * @return a new enumerator
76
+ */
77
+ VALUE
78
+ Enum_alloc(VALUE class)
79
+ {
80
+ MagickEnum *magick_enum;
81
+ volatile VALUE enumr;
82
+
83
+ enumr = Data_Make_Struct(class, MagickEnum, NULL, NULL, magick_enum);
84
+ rb_obj_freeze(enumr);
85
+ return enumr;
86
+ }
87
+
88
+
89
+ /**
90
+ * "Case equal" operator for Enum.
91
+ *
92
+ * Ruby usage:
93
+ * - @verbatim Enum#=== @endverbatim
94
+ *
95
+ * Notes:
96
+ * - Yes, I know "case equal" is a misnomer.
97
+ *
98
+ * @param self this object
99
+ * @param other the other object
100
+ * @return true or false
101
+ */
102
+ VALUE
103
+ Enum_case_eq(VALUE self, VALUE other)
104
+ {
105
+ MagickEnum *this, *that;
106
+
107
+ if (CLASS_OF(self) == CLASS_OF(other))
108
+ {
109
+ Data_Get_Struct(self, MagickEnum, this);
110
+ Data_Get_Struct(other, MagickEnum, that);
111
+ return this->val == that->val ? Qtrue : Qfalse;
112
+ }
113
+
114
+ return Qfalse;
115
+ }
116
+
117
+
118
+ /**
119
+ * Initialize a new Enum instance.
120
+ *
121
+ * Ruby usage:
122
+ * - @verbatim Enum#initialize(sym,val) @endverbatim
123
+ *
124
+ * @param self this object
125
+ * @param sym the symbol
126
+ * @param val the value for the symbol
127
+ * @return self
128
+ */
129
+ VALUE
130
+ Enum_initialize(VALUE self, VALUE sym, VALUE val)
131
+ {
132
+ MagickEnum *magick_enum;
133
+
134
+ Data_Get_Struct(self, MagickEnum, magick_enum);
135
+ magick_enum->id = rb_to_id(sym); /* convert symbol to ID */
136
+ magick_enum->val = NUM2INT(val);
137
+
138
+ return self;
139
+ }
140
+
141
+
142
+ /**
143
+ * Return the value of an enum.
144
+ *
145
+ * Ruby usage:
146
+ * - @verbatim Enum#to_i @endverbatim
147
+ *
148
+ * @param self this object
149
+ * @return this object's value
150
+ */
151
+ VALUE
152
+ Enum_to_i(VALUE self)
153
+ {
154
+ MagickEnum *magick_enum;
155
+
156
+ Data_Get_Struct(self, MagickEnum, magick_enum);
157
+ return INT2NUM(magick_enum->val);
158
+ }
159
+
160
+
161
+ /**
162
+ * Support Comparable module in Enum.
163
+ *
164
+ * Ruby usage:
165
+ * - @verbatim Enum#<=> @endverbatim
166
+ *
167
+ * Notes:
168
+ * - Enums must be instances of the same class to be equal.
169
+ *
170
+ * @param self this object
171
+ * @param other the other object
172
+ * @return -1, 0, 1, or nil
173
+ */
174
+ VALUE
175
+ Enum_spaceship(VALUE self, VALUE other)
176
+ {
177
+ MagickEnum *this, *that;
178
+
179
+ Data_Get_Struct(self, MagickEnum, this);
180
+ Data_Get_Struct(other, MagickEnum, that);
181
+
182
+ if (this->val > that->val)
183
+ {
184
+ return INT2FIX(1);
185
+ }
186
+ else if (this->val < that->val)
187
+ {
188
+ return INT2FIX(-1);
189
+ }
190
+
191
+ // Values are equal, check class.
192
+
193
+ return rb_funcall(CLASS_OF(self), rm_ID_spaceship, 1, CLASS_OF(other));
194
+ }
195
+
196
+
197
+ /**
198
+ * Return the name of an enum.
199
+ *
200
+ * Ruby usage:
201
+ * - @verbatim Enum#to_s @endverbatim
202
+ *
203
+ * @param self this object
204
+ * @return the name
205
+ */
206
+ VALUE
207
+ Enum_to_s(VALUE self)
208
+ {
209
+ MagickEnum *magick_enum;
210
+
211
+ Data_Get_Struct(self, MagickEnum, magick_enum);
212
+ return rb_str_new2(rb_id2name(magick_enum->id));
213
+ }
214
+
215
+
216
+ /**
217
+ * Initialize method for all Enum subclasses.
218
+ *
219
+ * Ruby usage:
220
+ * - @verbatim xxx#initialize(sym,val) @endverbatim
221
+ *
222
+ * @param self this object
223
+ * @param sym the symbol
224
+ * @param val the value of the symbol
225
+ * @return self
226
+ */
227
+ VALUE
228
+ Enum_type_initialize(VALUE self, VALUE sym, VALUE val)
229
+ {
230
+ VALUE super_argv[2];
231
+ volatile VALUE enumerators;
232
+
233
+ super_argv[0] = sym;
234
+ super_argv[1] = val;
235
+ (void) rb_call_super(2, (const VALUE *)super_argv);
236
+
237
+ if (rb_cvar_defined(CLASS_OF(self), rb_intern(ENUMERATORS_CLASS_VAR)) != Qtrue)
238
+ {
239
+ rb_cv_set(CLASS_OF(self), ENUMERATORS_CLASS_VAR, rb_ary_new());
240
+ }
241
+
242
+ enumerators = rb_cv_get(CLASS_OF(self), ENUMERATORS_CLASS_VAR);
243
+ (void) rb_ary_push(enumerators, self);
244
+
245
+ return self;
246
+ }
247
+
248
+
249
+ /**
250
+ * Enum subclass #inspect.
251
+ *
252
+ * Ruby usage:
253
+ * - @verbatim xxx#inspect @endverbatim
254
+ *
255
+ * @param self this object
256
+ * @return string representation of self
257
+ */
258
+ static VALUE
259
+ Enum_type_inspect(VALUE self)
260
+ {
261
+ char str[100];
262
+ MagickEnum *magick_enum;
263
+
264
+ Data_Get_Struct(self, MagickEnum, magick_enum);
265
+ sprintf(str, "%.48s=%d", rb_id2name(magick_enum->id), magick_enum->val);
266
+
267
+ return rb_str_new2(str);
268
+ }
269
+
270
+
271
+ /**
272
+ * Behaves like #each if a block is present, otherwise like #to_a.
273
+ *
274
+ * Ruby usage:
275
+ * - @verbatim xxx.values @endverbatim
276
+ * - @verbatim xxx.values {|v| } @endverbatim
277
+ *
278
+ * Notes:
279
+ * - Defined for each Enum subclass
280
+ *
281
+ * @param class the subclass
282
+ * @return iterator over values if given block, a copy of the values otherwise
283
+ */
284
+ static VALUE
285
+ Enum_type_values(VALUE class)
286
+ {
287
+ volatile VALUE enumerators, copy;
288
+ volatile VALUE rv;
289
+ int x;
290
+
291
+ enumerators = rb_cv_get(class, ENUMERATORS_CLASS_VAR);
292
+
293
+ if (rb_block_given_p())
294
+ {
295
+ for (x = 0; x < RARRAY_LEN(enumerators); x++)
296
+ {
297
+ (void) rb_yield(rb_ary_entry(enumerators, x));
298
+ }
299
+ rv = class;
300
+ }
301
+ else
302
+ {
303
+ copy = rb_ary_new2(RARRAY_LEN(enumerators));
304
+ for (x = 0; x < RARRAY_LEN(enumerators); x++)
305
+ {
306
+ (void) rb_ary_push(copy, rb_ary_entry(enumerators, x));
307
+ }
308
+ rb_obj_freeze(copy);
309
+ rv = copy;
310
+ }
311
+
312
+ return rv;
313
+ }
314
+
315
+
316
+ /**
317
+ * Construct a ClassType enum object for the specified value.
318
+ *
319
+ * No Ruby usage (internal function)
320
+ *
321
+ * @param cls the class type
322
+ * @return a new enumerator
323
+ */
324
+ VALUE
325
+ ClassType_new(ClassType cls)
326
+ {
327
+ const char *name;
328
+
329
+ switch(cls)
330
+ {
331
+ default:
332
+ case UndefinedClass:
333
+ name = "UndefineClass";
334
+ break;
335
+ case DirectClass:
336
+ name = "DirectClass";
337
+ break;
338
+ case PseudoClass:
339
+ name = "PseudoClass";
340
+ break;
341
+ }
342
+
343
+ return rm_enum_new(Class_ClassType, ID2SYM(rb_intern(name)), INT2FIX(cls));
344
+ }
345
+
346
+
347
+ /**
348
+ * Construct a ColorspaceType enum object for the specified value.
349
+ *
350
+ * No Ruby usage (internal function)
351
+ *
352
+ * @param cs the ColorspaceType
353
+ * @return a new ColorspaceType enumerator
354
+ */
355
+ VALUE
356
+ ColorspaceType_new(ColorspaceType cs)
357
+ {
358
+ const char *name;
359
+
360
+ switch(cs)
361
+ {
362
+ default:
363
+ case UndefinedColorspace:
364
+ name = "UndefinedColorspace";
365
+ break;
366
+ case RGBColorspace:
367
+ name = "RGBColorspace";
368
+ break;
369
+ case GRAYColorspace:
370
+ name = "GRAYColorspace";
371
+ break;
372
+ case TransparentColorspace:
373
+ name = "TransparentColorspace";
374
+ break;
375
+ case OHTAColorspace:
376
+ name = "OHTAColorspace";
377
+ break;
378
+ case XYZColorspace:
379
+ name = "XYZColorspace";
380
+ break;
381
+ case YCbCrColorspace:
382
+ name = "YCbCrColorspace";
383
+ break;
384
+ case YCCColorspace:
385
+ name = "YCCColorspace";
386
+ break;
387
+ case YIQColorspace:
388
+ name = "YIQColorspace";
389
+ break;
390
+ case YPbPrColorspace:
391
+ name = "YPbPrColorspace";
392
+ break;
393
+ case YUVColorspace:
394
+ name = "YUVColorspace";
395
+ break;
396
+ case CMYKColorspace:
397
+ name = "CMYKColorspace";
398
+ break;
399
+ case sRGBColorspace:
400
+ name = "sRGBColorspace";
401
+ break;
402
+ case HSLColorspace:
403
+ name = "HSLColorspace";
404
+ break;
405
+ case HWBColorspace:
406
+ name = "HWBColorspace";
407
+ break;
408
+ case HSBColorspace:
409
+ name = "HSBColorspace";
410
+ break;
411
+ case LABColorspace:
412
+ name = "LABColorspace";
413
+ break;
414
+ case Rec601YCbCrColorspace:
415
+ name = "Rec601YCbCrColorspace";
416
+ break;
417
+ case Rec601LumaColorspace:
418
+ name = "Rec601LumaColorspace";
419
+ break;
420
+ case Rec709LumaColorspace:
421
+ name = "Rec709LumaColorspace";
422
+ break;
423
+ case Rec709YCbCrColorspace:
424
+ name = "Rec709YCbCrColorspace";
425
+ break;
426
+ case LogColorspace:
427
+ name = "LogColorspace";
428
+ break;
429
+ case CMYColorspace:
430
+ name = "CMYColorspace";
431
+ break;
432
+ }
433
+
434
+ return rm_enum_new(Class_ColorspaceType, ID2SYM(rb_intern(name)), INT2FIX(cs));
435
+
436
+ }
437
+
438
+
439
+ /**
440
+ * Return the name of a CompositeOperator enum as a string.
441
+ *
442
+ * No Ruby usage (internal function)
443
+ *
444
+ * @param op the CompositeOperator
445
+ * @return the name
446
+ */
447
+ static const char *
448
+ CompositeOperator_name(CompositeOperator op)
449
+ {
450
+ switch (op)
451
+ {
452
+ ENUM_TO_NAME(UndefinedCompositeOp)
453
+ ENUM_TO_NAME(NoCompositeOp)
454
+ ENUM_TO_NAME(AddCompositeOp)
455
+ ENUM_TO_NAME(AtopCompositeOp)
456
+ #if defined(HAVE_ENUM_BLURCOMPOSITEOP)
457
+ ENUM_TO_NAME(BlurCompositeOp)
458
+ #endif
459
+ ENUM_TO_NAME(BumpmapCompositeOp)
460
+ ENUM_TO_NAME(ChangeMaskCompositeOp)
461
+ ENUM_TO_NAME(ClearCompositeOp)
462
+ ENUM_TO_NAME(ColorBurnCompositeOp)
463
+ ENUM_TO_NAME(BlendCompositeOp)
464
+ ENUM_TO_NAME(ColorDodgeCompositeOp)
465
+ ENUM_TO_NAME(ExclusionCompositeOp)
466
+ ENUM_TO_NAME(HardLightCompositeOp)
467
+ ENUM_TO_NAME(SoftLightCompositeOp)
468
+ ENUM_TO_NAME(ColorizeCompositeOp)
469
+ ENUM_TO_NAME(CopyBlueCompositeOp)
470
+ ENUM_TO_NAME(CopyCompositeOp)
471
+ ENUM_TO_NAME(CopyCyanCompositeOp)
472
+ ENUM_TO_NAME(CopyMagentaCompositeOp)
473
+ ENUM_TO_NAME(CopyYellowCompositeOp)
474
+ ENUM_TO_NAME(CopyBlackCompositeOp)
475
+ ENUM_TO_NAME(CopyGreenCompositeOp)
476
+ ENUM_TO_NAME(CopyOpacityCompositeOp)
477
+ ENUM_TO_NAME(CopyRedCompositeOp)
478
+ ENUM_TO_NAME(DarkenCompositeOp)
479
+ #if defined(HAVE_ENUM_DISTORTCOMPOSITEOP)
480
+ ENUM_TO_NAME(DistortCompositeOp)
481
+ #endif
482
+ ENUM_TO_NAME(DivideCompositeOp)
483
+ ENUM_TO_NAME(DstAtopCompositeOp)
484
+ ENUM_TO_NAME(DstCompositeOp)
485
+ ENUM_TO_NAME(DstInCompositeOp)
486
+ ENUM_TO_NAME(DstOutCompositeOp)
487
+ ENUM_TO_NAME(DstOverCompositeOp)
488
+ ENUM_TO_NAME(DifferenceCompositeOp)
489
+ ENUM_TO_NAME(DisplaceCompositeOp)
490
+ ENUM_TO_NAME(DissolveCompositeOp)
491
+ ENUM_TO_NAME(HueCompositeOp)
492
+ ENUM_TO_NAME(InCompositeOp)
493
+ ENUM_TO_NAME(LightenCompositeOp)
494
+ #if defined(HAVE_ENUM_LINEARBURNCOMPOSITEOP)
495
+ ENUM_TO_NAME(LinearBurnCompositeOp)
496
+ #endif
497
+ #if defined(HAVE_ENUM_LINEARDODGECOMPOSITEOP)
498
+ ENUM_TO_NAME(LinearDodgeCompositeOp)
499
+ #endif
500
+ ENUM_TO_NAME(LinearLightCompositeOp)
501
+ ENUM_TO_NAME(LuminizeCompositeOp)
502
+ #if defined(HAVE_ENUM_MATHEMATICSCOMPOSITEOP)
503
+ ENUM_TO_NAME(MathematicsCompositeOp)
504
+ #endif
505
+ ENUM_TO_NAME(MinusCompositeOp)
506
+ ENUM_TO_NAME(ModulateCompositeOp)
507
+ ENUM_TO_NAME(MultiplyCompositeOp)
508
+ ENUM_TO_NAME(OutCompositeOp)
509
+ ENUM_TO_NAME(OverCompositeOp)
510
+ ENUM_TO_NAME(OverlayCompositeOp)
511
+ #if defined(HAVE_ENUM_PEGTOPLIGHTCOMPOSITEOP)
512
+ ENUM_TO_NAME(PegtopLightCompositeOp)
513
+ #endif
514
+ #if defined(HAVE_ENUM_PINLIGHTCOMPOSITEOP)
515
+ ENUM_TO_NAME(PinLightCompositeOp)
516
+ #endif
517
+ ENUM_TO_NAME(PlusCompositeOp)
518
+ ENUM_TO_NAME(ReplaceCompositeOp)
519
+ ENUM_TO_NAME(SaturateCompositeOp)
520
+ ENUM_TO_NAME(ScreenCompositeOp)
521
+ ENUM_TO_NAME(SrcAtopCompositeOp)
522
+ ENUM_TO_NAME(SrcCompositeOp)
523
+ ENUM_TO_NAME(SrcInCompositeOp)
524
+ ENUM_TO_NAME(SrcOutCompositeOp)
525
+ ENUM_TO_NAME(SrcOverCompositeOp)
526
+ ENUM_TO_NAME(SubtractCompositeOp)
527
+ ENUM_TO_NAME(ThresholdCompositeOp)
528
+ #if defined(HAVE_ENUM_VIVIDLIGHTCOMPOSITEOP)
529
+ ENUM_TO_NAME(VividLightCompositeOp)
530
+ #endif
531
+ ENUM_TO_NAME(XorCompositeOp)
532
+ }
533
+
534
+ return "UndefinedCompositeOp";
535
+ }
536
+
537
+
538
+ /**
539
+ * Construct a CompositeOperator enum object for the specified value.
540
+ *
541
+ * No Ruby usage (internal function)
542
+ *
543
+ * @param op the CompositeOperator
544
+ * @return a new CompositeOperator enumerator
545
+ */
546
+ VALUE
547
+ CompositeOperator_new(CompositeOperator op)
548
+ {
549
+ const char *name = CompositeOperator_name(op);
550
+ return rm_enum_new(Class_CompositeOperator, ID2SYM(rb_intern(name)), INT2FIX(op));
551
+ }
552
+
553
+
554
+ /**
555
+ * Return the name of a CompressionType enum as a string.
556
+ *
557
+ * No Ruby usage (internal function)
558
+ *
559
+ * @param ct the CompressionType
560
+ * @return the name
561
+ */
562
+ static const char *
563
+ CompressionType_name(CompressionType ct)
564
+ {
565
+ switch (ct)
566
+ {
567
+ ENUM_TO_NAME(UndefinedCompression)
568
+ ENUM_TO_NAME(NoCompression)
569
+ #if defined(HAVE_ENUM_B44COMPRESSION)
570
+ ENUM_TO_NAME(B44Compression)
571
+ #endif
572
+ #if defined(HAVE_ENUM_B44ACOMPRESSION)
573
+ ENUM_TO_NAME(B44ACompression)
574
+ #endif
575
+ ENUM_TO_NAME(BZipCompression)
576
+ #if defined(HAVE_ENUM_DXT1COMPRESSION)
577
+ ENUM_TO_NAME(DXT1Compression)
578
+ #endif
579
+ #if defined(HAVE_ENUM_DXT3COMPRESSION)
580
+ ENUM_TO_NAME(DXT3Compression)
581
+ #endif
582
+ #if defined(HAVE_ENUM_DXT5COMPRESSION)
583
+ ENUM_TO_NAME(DXT5Compression)
584
+ #endif
585
+ ENUM_TO_NAME(FaxCompression)
586
+ ENUM_TO_NAME(Group4Compression)
587
+ ENUM_TO_NAME(JPEGCompression)
588
+ ENUM_TO_NAME(JPEG2000Compression)
589
+ ENUM_TO_NAME(LosslessJPEGCompression)
590
+ ENUM_TO_NAME(LZWCompression)
591
+ #if defined(HAVE_ENUM_PIZCOMPRESSION)
592
+ ENUM_TO_NAME(PizCompression)
593
+ #endif
594
+ #if defined(HAVE_ENUM_PXR24COMPRESSION)
595
+ ENUM_TO_NAME(Pxr24Compression)
596
+ #endif
597
+ ENUM_TO_NAME(RLECompression)
598
+ ENUM_TO_NAME(ZipCompression)
599
+ #if defined(HAVE_ENUM_ZIPSCOMPRESSION)
600
+ ENUM_TO_NAME(ZipSCompression)
601
+ #endif
602
+ }
603
+
604
+ return "UndefinedCompression";
605
+ }
606
+
607
+
608
+ /**
609
+ * Construct a CompressionType enum object for the specified value.
610
+ *
611
+ * No Ruby usage (internal function)
612
+ *
613
+ * @param ct the CompressionType
614
+ * @return a new CompressionType enumerator
615
+ */
616
+ VALUE
617
+ CompressionType_new(CompressionType ct)
618
+ {
619
+ const char *name = CompressionType_name(ct);
620
+ return rm_enum_new(Class_CompressionType, ID2SYM(rb_intern(name)), INT2FIX(ct));
621
+ }
622
+
623
+
624
+ /**
625
+ * Return the name of a DisposeType enum as a string.
626
+ *
627
+ * No Ruby usage (internal function)
628
+ *
629
+ * @param type the DisposeType
630
+ * @return the name
631
+ */
632
+ static const char *
633
+ DisposeType_name(DisposeType type)
634
+ {
635
+ switch(type)
636
+ {
637
+ ENUM_TO_NAME(UndefinedDispose)
638
+ ENUM_TO_NAME(BackgroundDispose)
639
+ ENUM_TO_NAME(NoneDispose)
640
+ ENUM_TO_NAME(PreviousDispose)
641
+ }
642
+
643
+ return "UndefinedDispose";
644
+ }
645
+
646
+
647
+ /**
648
+ * Construct a DisposeType enum object for the specified value..new.
649
+ *
650
+ * No Ruby usage (internal function)
651
+ *
652
+ * @param type the DisposeType
653
+ * @return a new DisposeType enumerator
654
+ */
655
+ VALUE
656
+ DisposeType_new(DisposeType type)
657
+ {
658
+ const char *name = DisposeType_name(type);
659
+ return rm_enum_new(Class_DisposeType, ID2SYM(rb_intern(name)), INT2FIX(type));
660
+ }
661
+
662
+
663
+ /**
664
+ * Return the name of a FilterTypes enum as a string.
665
+ *
666
+ * No Ruby usage (internal function)
667
+ *
668
+ * @param type the FilterTypes
669
+ * @return the name
670
+ */
671
+ static const char *
672
+ FilterTypes_name(FilterTypes type)
673
+ {
674
+ switch(type)
675
+ {
676
+ ENUM_TO_NAME(UndefinedFilter)
677
+ ENUM_TO_NAME(PointFilter)
678
+ ENUM_TO_NAME(BoxFilter)
679
+ ENUM_TO_NAME(TriangleFilter)
680
+ ENUM_TO_NAME(HermiteFilter)
681
+ ENUM_TO_NAME(HanningFilter)
682
+ ENUM_TO_NAME(HammingFilter)
683
+ ENUM_TO_NAME(BlackmanFilter)
684
+ ENUM_TO_NAME(GaussianFilter)
685
+ ENUM_TO_NAME(QuadraticFilter)
686
+ ENUM_TO_NAME(CubicFilter)
687
+ ENUM_TO_NAME(CatromFilter)
688
+ ENUM_TO_NAME(MitchellFilter)
689
+ ENUM_TO_NAME(LanczosFilter)
690
+ ENUM_TO_NAME(BesselFilter)
691
+ ENUM_TO_NAME(SincFilter)
692
+ #if defined(HAVE_ENUM_KAISERFILTER)
693
+ ENUM_TO_NAME(KaiserFilter)
694
+ #endif
695
+ #if defined(HAVE_ENUM_WELSHFILTER)
696
+ ENUM_TO_NAME(WelshFilter)
697
+ #endif
698
+ #if defined(HAVE_ENUM_PARZENFILTER)
699
+ ENUM_TO_NAME(ParzenFilter)
700
+ #endif
701
+ #if defined(HAVE_ENUM_LAGRANGEFILTER)
702
+ ENUM_TO_NAME(LagrangeFilter)
703
+ #endif
704
+ #if defined(HAVE_ENUM_BOHMANFILTER)
705
+ ENUM_TO_NAME(BohmanFilter)
706
+ #endif
707
+ #if defined(HAVE_ENUM_BARTLETTFILTER)
708
+ ENUM_TO_NAME(BartlettFilter)
709
+ #endif
710
+ #if defined(HAVE_ENUM_SENTINELFILTER)
711
+ // not a real filter name - defeat gcc warning message
712
+ case SentinelFilter:
713
+ break;
714
+ #endif
715
+ }
716
+
717
+ return "UndefinedFilter";
718
+ }
719
+
720
+
721
+ /**
722
+ * Construct an FilterTypes enum object for the specified value.
723
+ *
724
+ * No Ruby usage (internal function)
725
+ *
726
+ * @param type the FilterTypes
727
+ * @return a new FilterTypes enumerator
728
+ */
729
+ VALUE
730
+ FilterTypes_new(FilterTypes type)
731
+ {
732
+ const char *name = FilterTypes_name(type);
733
+ return rm_enum_new(Class_FilterTypes, ID2SYM(rb_intern(name)), INT2FIX(type));
734
+ }
735
+
736
+
737
+ /**
738
+ * Return the name of a EndianType enum as a string.
739
+ *
740
+ * No Ruby usage (internal function)
741
+ *
742
+ * @param type the EndianType
743
+ * @return the name
744
+ */
745
+ static const char *
746
+ EndianType_name(EndianType type)
747
+ {
748
+ switch(type)
749
+ {
750
+ ENUM_TO_NAME(UndefinedEndian)
751
+ ENUM_TO_NAME(LSBEndian)
752
+ ENUM_TO_NAME(MSBEndian)
753
+ }
754
+ return "UndefinedEndian";
755
+ }
756
+
757
+
758
+ /**
759
+ * Construct an EndianType enum object.
760
+ *
761
+ * No Ruby usage (internal function)
762
+ *
763
+ * @param type the EndianType
764
+ * @return a new EndianType enumerator
765
+ */
766
+ VALUE
767
+ EndianType_new(EndianType type)
768
+ {
769
+ const char *name = EndianType_name(type);
770
+ return rm_enum_new(Class_EndianType, ID2SYM(rb_intern(name)), INT2FIX(type));
771
+ }
772
+
773
+
774
+ /**
775
+ * Return the name of a GravityType enum as a string.
776
+ *
777
+ * No Ruby usage (internal function)
778
+ *
779
+ * @param type the GravityType
780
+ * @return the name
781
+ */
782
+ static const char *
783
+ GravityType_name(GravityType type)
784
+ {
785
+ switch(type)
786
+ {
787
+ ENUM_TO_NAME(ForgetGravity)
788
+ ENUM_TO_NAME(NorthWestGravity)
789
+ ENUM_TO_NAME(NorthGravity)
790
+ ENUM_TO_NAME(NorthEastGravity)
791
+ ENUM_TO_NAME(WestGravity)
792
+ ENUM_TO_NAME(CenterGravity)
793
+ ENUM_TO_NAME(EastGravity)
794
+ ENUM_TO_NAME(SouthWestGravity)
795
+ ENUM_TO_NAME(SouthGravity)
796
+ ENUM_TO_NAME(SouthEastGravity)
797
+ ENUM_TO_NAME(StaticGravity)
798
+ }
799
+
800
+ // Defeat "duplicate case value" error.
801
+ return "UndefinedGravity";
802
+ }
803
+
804
+
805
+ /**
806
+ * Construct an GravityType enum object for the specified value.
807
+ *
808
+ * No Ruby usage (internal function)
809
+ *
810
+ * @param type the GravityType
811
+ * @return a new GravityType enumerator
812
+ */
813
+ VALUE
814
+ GravityType_new(GravityType type)
815
+ {
816
+ const char *name = GravityType_name(type);
817
+ return rm_enum_new(Class_GravityType, ID2SYM(rb_intern(name)), INT2FIX(type));
818
+ }
819
+
820
+
821
+ /**
822
+ * Return the name of a ImageType enum as a string.
823
+ *
824
+ * No Ruby usage (internal function)
825
+ *
826
+ * @param type the ImageType
827
+ * @return the name
828
+ */
829
+ static const char *
830
+ ImageType_name(ImageType type)
831
+ {
832
+ switch(type)
833
+ {
834
+ ENUM_TO_NAME(UndefinedType)
835
+ ENUM_TO_NAME(BilevelType)
836
+ ENUM_TO_NAME(GrayscaleType)
837
+ ENUM_TO_NAME(GrayscaleMatteType)
838
+ ENUM_TO_NAME(PaletteType)
839
+ ENUM_TO_NAME(PaletteMatteType)
840
+ ENUM_TO_NAME(TrueColorType)
841
+ ENUM_TO_NAME(TrueColorMatteType)
842
+ ENUM_TO_NAME(ColorSeparationType)
843
+ ENUM_TO_NAME(ColorSeparationMatteType)
844
+ ENUM_TO_NAME(OptimizeType)
845
+ ENUM_TO_NAME(PaletteBilevelMatteType)
846
+ }
847
+
848
+ return "UndefinedType";
849
+ }
850
+
851
+
852
+ /**
853
+ * Construct an ImageType enum object for the specified value.
854
+ *
855
+ * No Ruby usage (internal function)
856
+ *
857
+ * @param type the ImageType
858
+ * @return a new ImageType enumerator
859
+ */
860
+ VALUE
861
+ ImageType_new(ImageType type)
862
+ {
863
+ const char *name = ImageType_name(type);
864
+ return rm_enum_new(Class_ImageType, ID2SYM(rb_intern(name)), INT2FIX(type));
865
+ }
866
+
867
+
868
+ /**
869
+ * Return the name of a InterlaceType enum as a string.
870
+ *
871
+ * No Ruby usage (internal function)
872
+ *
873
+ * @param interlace the InterlaceType
874
+ * @return the name
875
+ */
876
+ static const char *
877
+ InterlaceType_name(InterlaceType interlace)
878
+ {
879
+ switch(interlace)
880
+ {
881
+ ENUM_TO_NAME(UndefinedInterlace)
882
+ ENUM_TO_NAME(GIFInterlace)
883
+ ENUM_TO_NAME(JPEGInterlace)
884
+ ENUM_TO_NAME(PNGInterlace)
885
+ ENUM_TO_NAME(NoInterlace)
886
+ ENUM_TO_NAME(LineInterlace)
887
+ ENUM_TO_NAME(PlaneInterlace)
888
+ ENUM_TO_NAME(PartitionInterlace)
889
+ }
890
+
891
+ return "UndefinedInterlace";
892
+ }
893
+
894
+
895
+ /**
896
+ * Construct an InterlaceType enum object for the specified value.
897
+ *
898
+ * No Ruby usage (internal function)
899
+ *
900
+ * @param interlace the InterlaceType
901
+ * @return a new InterlaceType enumerator
902
+ */
903
+ VALUE
904
+ InterlaceType_new(InterlaceType interlace)
905
+ {
906
+ const char *name = InterlaceType_name(interlace);
907
+ return rm_enum_new(Class_InterlaceType, ID2SYM(rb_intern(name)), INT2FIX(interlace));
908
+ }
909
+
910
+
911
+ /**
912
+ * Return the name of a InterpolatePixelMethod enum as a string.
913
+ *
914
+ * No Ruby usage (internal function)
915
+ *
916
+ * @param interpolate the InterpolatePixelMethod
917
+ * @return the name
918
+ */
919
+ static const char *
920
+ InterpolatePixelMethod_name(InterpolatePixelMethod interpolate)
921
+ {
922
+ switch(interpolate)
923
+ {
924
+ ENUM_TO_NAME(UndefinedInterpolatePixel)
925
+ ENUM_TO_NAME(AverageInterpolatePixel)
926
+ ENUM_TO_NAME(BicubicInterpolatePixel)
927
+ ENUM_TO_NAME(BilinearInterpolatePixel)
928
+ ENUM_TO_NAME(FilterInterpolatePixel)
929
+ ENUM_TO_NAME(IntegerInterpolatePixel)
930
+ ENUM_TO_NAME(MeshInterpolatePixel)
931
+ ENUM_TO_NAME(NearestNeighborInterpolatePixel)
932
+ ENUM_TO_NAME(SplineInterpolatePixel)
933
+ }
934
+
935
+ return "UndefinedInterpolatePixel";
936
+ }
937
+
938
+
939
+ /**
940
+ * Construct an InterpolatePixelMethod enum object for the specified value.
941
+ *
942
+ * No Ruby usage (internal function)
943
+ *
944
+ * @param interpolate the InterpolatePixelMethod
945
+ * @return a new InterpolatePixelMethod enumerator
946
+ */
947
+ VALUE
948
+ InterpolatePixelMethod_new(InterpolatePixelMethod interpolate)
949
+ {
950
+ const char *name = InterpolatePixelMethod_name(interpolate);
951
+ return rm_enum_new(Class_InterpolatePixelMethod, ID2SYM(rb_intern(name)), INT2FIX(interpolate));
952
+ }
953
+
954
+
955
+ /**
956
+ * Return the name of a MagickLayerMethod enum as a string.
957
+ *
958
+ * No Ruby usage (internal function)
959
+ *
960
+ * @param method the MagickLayerMethod
961
+ * @return the name
962
+ */
963
+ static const char *
964
+ LAYERMETHODTYPE_NAME(LAYERMETHODTYPE method)
965
+ {
966
+ switch(method)
967
+ {
968
+ ENUM_TO_NAME(UndefinedLayer)
969
+ ENUM_TO_NAME(CompareAnyLayer)
970
+ ENUM_TO_NAME(CompareClearLayer)
971
+ ENUM_TO_NAME(CompareOverlayLayer)
972
+ ENUM_TO_NAME(OptimizeLayer)
973
+ ENUM_TO_NAME(OptimizePlusLayer)
974
+ ENUM_TO_NAME(CoalesceLayer)
975
+ ENUM_TO_NAME(DisposeLayer)
976
+ ENUM_TO_NAME(OptimizeTransLayer)
977
+ ENUM_TO_NAME(OptimizeImageLayer)
978
+ ENUM_TO_NAME(RemoveDupsLayer)
979
+ ENUM_TO_NAME(RemoveZeroLayer)
980
+ ENUM_TO_NAME(CompositeLayer)
981
+ #if defined(HAVE_ENUM_MERGELAYER)
982
+ ENUM_TO_NAME(MergeLayer)
983
+ #endif
984
+ #if defined(HAVE_ENUM_MOSAICLAYER)
985
+ ENUM_TO_NAME(MosaicLayer)
986
+ #endif
987
+ #if defined(HAVE_ENUM_FLATTENLAYER)
988
+ ENUM_TO_NAME(FlattenLayer)
989
+ #endif
990
+ #if defined(HAVE_ENUM_TRIMBOUNDSLAYER)
991
+ ENUM_TO_NAME(TrimBoundsLayer)
992
+ #endif
993
+ }
994
+
995
+ return "UndefinedLayer";
996
+ }
997
+
998
+
999
+ /**
1000
+ * Construct an MagickLayerMethod enum object for the specified value.
1001
+ *
1002
+ * No Ruby usage (internal function)
1003
+ *
1004
+ * @param method the MagickLayerMethod
1005
+ * @return a new MagickLayerMethod enumerator
1006
+ */
1007
+ VALUE
1008
+ LAYERMETHODTYPE_NEW(LAYERMETHODTYPE method)
1009
+ {
1010
+ const char *name = LAYERMETHODTYPE_NAME(method);
1011
+ return rm_enum_new(CLASS_LAYERMETHODTYPE, ID2SYM(rb_intern(name)), INT2FIX(method));
1012
+ }
1013
+
1014
+
1015
+ /**
1016
+ * Return the name of a OrientationType enum as a string.
1017
+ *
1018
+ * No Ruby usage (internal function)
1019
+ *
1020
+ * @param type the OreintationType
1021
+ * @return the name
1022
+ */
1023
+ static const char *
1024
+ OrientationType_name(OrientationType type)
1025
+ {
1026
+ switch(type)
1027
+ {
1028
+ ENUM_TO_NAME(UndefinedOrientation)
1029
+ ENUM_TO_NAME(TopLeftOrientation)
1030
+ ENUM_TO_NAME(TopRightOrientation)
1031
+ ENUM_TO_NAME(BottomRightOrientation)
1032
+ ENUM_TO_NAME(BottomLeftOrientation)
1033
+ ENUM_TO_NAME(LeftTopOrientation)
1034
+ ENUM_TO_NAME(RightTopOrientation)
1035
+ ENUM_TO_NAME(RightBottomOrientation)
1036
+ ENUM_TO_NAME(LeftBottomOrientation)
1037
+ }
1038
+
1039
+ return "UndefinedOrientation";
1040
+ }
1041
+
1042
+
1043
+ /**
1044
+ * Construct an OrientationType enum object for the specified value.
1045
+ *
1046
+ * No Ruby usage (internal function)
1047
+ *
1048
+ * @param type the OrientationType
1049
+ * @return a new OrientationType enumerator
1050
+ */
1051
+ VALUE
1052
+ OrientationType_new(OrientationType type)
1053
+ {
1054
+ const char *name = OrientationType_name(type);
1055
+ return rm_enum_new(Class_OrientationType, ID2SYM(rb_intern(name)), INT2FIX(type));
1056
+ }
1057
+
1058
+
1059
+ /**
1060
+ * Return the name of a RenderingIntent enum as a string.
1061
+ *
1062
+ * No Ruby usage (internal function)
1063
+ *
1064
+ * @param intent the RenderingIntent
1065
+ * @return the name
1066
+ */
1067
+ static const char *
1068
+ RenderingIntent_name(RenderingIntent intent)
1069
+ {
1070
+ switch(intent)
1071
+ {
1072
+ ENUM_TO_NAME(UndefinedIntent)
1073
+ ENUM_TO_NAME(SaturationIntent)
1074
+ ENUM_TO_NAME(PerceptualIntent)
1075
+ ENUM_TO_NAME(AbsoluteIntent)
1076
+ ENUM_TO_NAME(RelativeIntent)
1077
+ }
1078
+
1079
+ return "UndefinedIntent";
1080
+ }
1081
+
1082
+
1083
+ /**
1084
+ * Construct an RenderingIntent enum object for the specified value.
1085
+ *
1086
+ * No Ruby usage (internal function)
1087
+ *
1088
+ * @param intent the RenderingIntent
1089
+ * @return a new RenderingIntent enumerator
1090
+ */
1091
+ VALUE
1092
+ RenderingIntent_new(RenderingIntent intent)
1093
+ {
1094
+ const char *name = RenderingIntent_name(intent);
1095
+ return rm_enum_new(Class_RenderingIntent, ID2SYM(rb_intern(name)), INT2FIX(intent));
1096
+ }
1097
+
1098
+
1099
+ /**
1100
+ * Return the name of a ResolutionType enum as a string.
1101
+ *
1102
+ * No Ruby usage (internal function)
1103
+ *
1104
+ * @param type the ResolutionType
1105
+ * @return the name
1106
+ */
1107
+ static const char *
1108
+ ResolutionType_name(ResolutionType type)
1109
+ {
1110
+ switch(type)
1111
+ {
1112
+ ENUM_TO_NAME(UndefinedResolution)
1113
+ ENUM_TO_NAME(PixelsPerInchResolution)
1114
+ ENUM_TO_NAME(PixelsPerCentimeterResolution)
1115
+ }
1116
+
1117
+ return "UndefinedResolution";
1118
+ }
1119
+
1120
+
1121
+ /**
1122
+ * Construct an ResolutionType enum object for the specified value.
1123
+ *
1124
+ * No Ruby usage (internal function)
1125
+ *
1126
+ * @param type the ResolutionType
1127
+ * @return a new ResolutionType enumerator
1128
+ */
1129
+ VALUE
1130
+ ResolutionType_new(ResolutionType type)
1131
+ {
1132
+ const char *name = ResolutionType_name(type);
1133
+ return rm_enum_new(Class_ResolutionType, ID2SYM(rb_intern(name)), INT2FIX(type));
1134
+ }
1135
+
1136
+
1137
+ /**
1138
+ * Return the string representation of a StorageType value.
1139
+ *
1140
+ * No Ruby usage (internal function)
1141
+ *
1142
+ * @param type the StorageType
1143
+ * @return the name
1144
+ */
1145
+ const char *
1146
+ StorageType_name(StorageType type)
1147
+ {
1148
+ switch (type)
1149
+ {
1150
+ ENUM_TO_NAME(UndefinedPixel)
1151
+ ENUM_TO_NAME(CharPixel)
1152
+ ENUM_TO_NAME(DoublePixel)
1153
+ ENUM_TO_NAME(FloatPixel)
1154
+ ENUM_TO_NAME(IntegerPixel)
1155
+ ENUM_TO_NAME(LongPixel)
1156
+ ENUM_TO_NAME(QuantumPixel)
1157
+ ENUM_TO_NAME(ShortPixel)
1158
+ }
1159
+
1160
+ return "UndefinedPixel";
1161
+ }
1162
+
1163
+
1164
+ /**
1165
+ * Return the string representation of a VirtualPixelMethod value.
1166
+ *
1167
+ * No Ruby usage (internal function)
1168
+ *
1169
+ * @param method the VirtualPixelMethod
1170
+ * @return the name
1171
+ */
1172
+ static const char *
1173
+ VirtualPixelMethod_name(VirtualPixelMethod method)
1174
+ {
1175
+ switch (method)
1176
+ {
1177
+ ENUM_TO_NAME(UndefinedVirtualPixelMethod)
1178
+ ENUM_TO_NAME(EdgeVirtualPixelMethod)
1179
+ ENUM_TO_NAME(MirrorVirtualPixelMethod)
1180
+ ENUM_TO_NAME(TileVirtualPixelMethod)
1181
+ ENUM_TO_NAME(TransparentVirtualPixelMethod)
1182
+ ENUM_TO_NAME(BackgroundVirtualPixelMethod)
1183
+ ENUM_TO_NAME(DitherVirtualPixelMethod)
1184
+ ENUM_TO_NAME(RandomVirtualPixelMethod)
1185
+ ENUM_TO_NAME(ConstantVirtualPixelMethod)
1186
+ ENUM_TO_NAME(MaskVirtualPixelMethod)
1187
+ ENUM_TO_NAME(BlackVirtualPixelMethod)
1188
+ ENUM_TO_NAME(GrayVirtualPixelMethod)
1189
+ ENUM_TO_NAME(WhiteVirtualPixelMethod)
1190
+ #if defined(HAVE_ENUM_HORIZONTALTILEVIRTUALPIXELMETHOD)
1191
+ ENUM_TO_NAME(HorizontalTileVirtualPixelMethod)
1192
+ #endif
1193
+ #if defined(HAVE_ENUM_VERTICALTILEVIRTUALPIXELMETHOD)
1194
+ ENUM_TO_NAME(VerticalTileVirtualPixelMethod)
1195
+ #endif
1196
+ #if defined(HAVE_ENUM_HORIZONTALTILEEDGEVIRTUALPIXELMETHOD)
1197
+ ENUM_TO_NAME(HorizontalTileEdgeVirtualPixelMethod)
1198
+ #endif
1199
+ #if defined(HAVE_ENUM_VERTICALTILEEDGEVIRTUALPIXELMETHOD)
1200
+ ENUM_TO_NAME(VerticalTileEdgeVirtualPixelMethod)
1201
+ #endif
1202
+ #if defined(HAVE_ENUM_CHECKERTILEVIRTUALPIXELMETHOD)
1203
+ ENUM_TO_NAME(CheckerTileVirtualPixelMethod)
1204
+ #endif
1205
+ }
1206
+
1207
+ return "UndefinedVirtualPixelMethod";
1208
+ }
1209
+
1210
+
1211
+ /**
1212
+ * Construct a VirtualPixelMethod enum for a specified VirtualPixelMethod value.
1213
+ *
1214
+ * No Ruby usage (internal function)
1215
+ *
1216
+ * @param style theVirtualPixelMethod
1217
+ * @return a new VirtualPixelMethod enumerator
1218
+ */
1219
+ VALUE
1220
+ VirtualPixelMethod_new(VirtualPixelMethod style)
1221
+ {
1222
+ const char *name = VirtualPixelMethod_name(style);
1223
+ return rm_enum_new(Class_VirtualPixelMethod, ID2SYM(rb_intern(name)), INT2FIX(style));
1224
+ }