rmagick-windows 2.16.1

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