rmagick 3.2.0 → 4.3.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rmagick might be problematic. Click here for more details.

Files changed (420) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +63 -0
  3. data/.devcontainer/Dockerfile +14 -0
  4. data/.devcontainer/ImageMagick6/devcontainer.json +11 -0
  5. data/.devcontainer/devcontainer.json +11 -0
  6. data/.devcontainer/setup-repo.sh +10 -0
  7. data/.devcontainer/setup-user.sh +45 -0
  8. data/.editorconfig +3 -0
  9. data/.github/ISSUE_TEMPLATE.md +17 -0
  10. data/.github/workflows/ci.yml +79 -0
  11. data/.gitignore +3 -1
  12. data/.rspec +1 -0
  13. data/.rubocop.yml +24 -0
  14. data/.rubocop_todo.yml +151 -297
  15. data/.yardopts +5 -0
  16. data/CHANGELOG.md +233 -0
  17. data/CODE_OF_CONDUCT.md +122 -7
  18. data/CONTRIBUTING.md +14 -10
  19. data/README.md +326 -0
  20. data/Rakefile +16 -22
  21. data/before_install_linux.sh +22 -28
  22. data/before_install_osx.sh +57 -2
  23. data/ext/RMagick/extconf.rb +149 -105
  24. data/ext/RMagick/rmagick.c +77 -104
  25. data/ext/RMagick/rmagick.h +121 -103
  26. data/ext/RMagick/rmdraw.c +364 -436
  27. data/ext/RMagick/rmenum.c +106 -114
  28. data/ext/RMagick/rmfill.c +149 -70
  29. data/ext/RMagick/rmilist.c +225 -367
  30. data/ext/RMagick/rmimage.c +4751 -4405
  31. data/ext/RMagick/rminfo.c +574 -787
  32. data/ext/RMagick/rmkinfo.c +51 -121
  33. data/ext/RMagick/rmmain.c +454 -286
  34. data/ext/RMagick/rmmontage.c +64 -130
  35. data/ext/RMagick/rmpixel.c +488 -437
  36. data/ext/RMagick/rmstruct.c +83 -96
  37. data/ext/RMagick/rmutil.c +302 -214
  38. data/lib/rmagick/version.rb +1 -1
  39. data/lib/rmagick_internal.rb +138 -93
  40. data/lib/rvg/clippath.rb +2 -1
  41. data/lib/rvg/container.rb +10 -5
  42. data/lib/rvg/describable.rb +1 -1
  43. data/lib/rvg/embellishable.rb +5 -4
  44. data/lib/rvg/misc.rb +15 -12
  45. data/lib/rvg/paint.rb +2 -1
  46. data/lib/rvg/pathdata.rb +12 -11
  47. data/lib/rvg/rvg.rb +12 -8
  48. data/lib/rvg/stylable.rb +9 -7
  49. data/lib/rvg/text.rb +11 -6
  50. data/lib/rvg/transformable.rb +3 -2
  51. data/lib/rvg/units.rb +1 -1
  52. data/rmagick.gemspec +10 -11
  53. metadata +52 -423
  54. data/.appveyor.yml +0 -45
  55. data/.circleci/config.yml +0 -56
  56. data/.ruby-version +0 -1
  57. data/.simplecov +0 -27
  58. data/.travis.yml +0 -62
  59. data/Doxyfile +0 -1514
  60. data/README.textile +0 -259
  61. data/benchmarks/memory/README.md +0 -50
  62. data/benchmarks/memory/image_new.rb +0 -8
  63. data/benchmarks/memory/rmagick.gnuplot +0 -16
  64. data/doc/.cvsignore +0 -1
  65. data/doc/comtasks.html +0 -287
  66. data/doc/constants.html +0 -1581
  67. data/doc/css/doc.css +0 -299
  68. data/doc/css/popup.css +0 -34
  69. data/doc/css/ref.css +0 -67
  70. data/doc/draw.html +0 -3272
  71. data/doc/ex/InitialCoords.rb +0 -22
  72. data/doc/ex/NewCoordSys.rb +0 -30
  73. data/doc/ex/OrigCoordSys.rb +0 -16
  74. data/doc/ex/PreserveAspectRatio.rb +0 -204
  75. data/doc/ex/RotateScale.rb +0 -36
  76. data/doc/ex/Skew.rb +0 -38
  77. data/doc/ex/Use01.rb +0 -15
  78. data/doc/ex/Use02.rb +0 -20
  79. data/doc/ex/Use03.rb +0 -16
  80. data/doc/ex/ViewBox.rb +0 -31
  81. data/doc/ex/adaptive_threshold.rb +0 -9
  82. data/doc/ex/add_noise.rb +0 -16
  83. data/doc/ex/affine.rb +0 -48
  84. data/doc/ex/affine_transform.rb +0 -20
  85. data/doc/ex/arc.rb +0 -49
  86. data/doc/ex/arcpath.rb +0 -32
  87. data/doc/ex/arcs01.rb +0 -28
  88. data/doc/ex/arcs02.rb +0 -59
  89. data/doc/ex/average.rb +0 -15
  90. data/doc/ex/axes.rb +0 -64
  91. data/doc/ex/baseline_shift01.rb +0 -17
  92. data/doc/ex/bilevel_channel.rb +0 -8
  93. data/doc/ex/blur_image.rb +0 -12
  94. data/doc/ex/border.rb +0 -10
  95. data/doc/ex/bounding_box.rb +0 -42
  96. data/doc/ex/cbezier1.rb +0 -41
  97. data/doc/ex/cbezier2.rb +0 -41
  98. data/doc/ex/cbezier3.rb +0 -41
  99. data/doc/ex/cbezier4.rb +0 -42
  100. data/doc/ex/cbezier5.rb +0 -42
  101. data/doc/ex/cbezier6.rb +0 -53
  102. data/doc/ex/channel.rb +0 -25
  103. data/doc/ex/charcoal.rb +0 -12
  104. data/doc/ex/chop.rb +0 -29
  105. data/doc/ex/circle.rb +0 -33
  106. data/doc/ex/circle01.rb +0 -16
  107. data/doc/ex/clip_path.rb +0 -60
  108. data/doc/ex/coalesce.rb +0 -57
  109. data/doc/ex/color_fill_to_border.rb +0 -29
  110. data/doc/ex/color_floodfill.rb +0 -28
  111. data/doc/ex/color_histogram.rb +0 -47
  112. data/doc/ex/color_reset.rb +0 -11
  113. data/doc/ex/colorize.rb +0 -16
  114. data/doc/ex/colors.rb +0 -64
  115. data/doc/ex/compose_mask.rb +0 -22
  116. data/doc/ex/composite.rb +0 -133
  117. data/doc/ex/composite_layers.rb +0 -52
  118. data/doc/ex/composite_tiled.rb +0 -21
  119. data/doc/ex/contrast.rb +0 -36
  120. data/doc/ex/crop.rb +0 -31
  121. data/doc/ex/crop_with_gravity.rb +0 -42
  122. data/doc/ex/cubic01.rb +0 -43
  123. data/doc/ex/cubic02.rb +0 -91
  124. data/doc/ex/cycle_colormap.rb +0 -21
  125. data/doc/ex/dissolve.rb +0 -12
  126. data/doc/ex/drawcomp.rb +0 -41
  127. data/doc/ex/drop_shadow.rb +0 -60
  128. data/doc/ex/edge.rb +0 -11
  129. data/doc/ex/ellipse.rb +0 -45
  130. data/doc/ex/ellipse01.rb +0 -21
  131. data/doc/ex/emboss.rb +0 -11
  132. data/doc/ex/enhance.rb +0 -28
  133. data/doc/ex/equalize.rb +0 -11
  134. data/doc/ex/evenodd.rb +0 -42
  135. data/doc/ex/fill_pattern.rb +0 -23
  136. data/doc/ex/flatten_images.rb +0 -36
  137. data/doc/ex/flip.rb +0 -11
  138. data/doc/ex/flop.rb +0 -11
  139. data/doc/ex/font_styles.rb +0 -32
  140. data/doc/ex/fonts.rb +0 -16
  141. data/doc/ex/frame.rb +0 -12
  142. data/doc/ex/gaussian_blur.rb +0 -11
  143. data/doc/ex/get_multiline_type_metrics.rb +0 -41
  144. data/doc/ex/get_pixels.rb +0 -45
  145. data/doc/ex/get_type_metrics.rb +0 -142
  146. data/doc/ex/gradientfill.rb +0 -27
  147. data/doc/ex/grav.rb +0 -45
  148. data/doc/ex/gravity.rb +0 -78
  149. data/doc/ex/group.rb +0 -26
  150. data/doc/ex/hatchfill.rb +0 -27
  151. data/doc/ex/image.rb +0 -44
  152. data/doc/ex/images/Apple.miff +0 -0
  153. data/doc/ex/images/Ballerina.jpg +0 -0
  154. data/doc/ex/images/Ballerina3.jpg +0 -0
  155. data/doc/ex/images/Button_0.gif +0 -0
  156. data/doc/ex/images/Button_1.gif +0 -0
  157. data/doc/ex/images/Button_2.gif +0 -0
  158. data/doc/ex/images/Button_3.gif +0 -0
  159. data/doc/ex/images/Button_4.gif +0 -0
  160. data/doc/ex/images/Button_5.gif +0 -0
  161. data/doc/ex/images/Button_6.gif +0 -0
  162. data/doc/ex/images/Button_7.gif +0 -0
  163. data/doc/ex/images/Button_8.gif +0 -0
  164. data/doc/ex/images/Button_9.gif +0 -0
  165. data/doc/ex/images/Button_A.gif +0 -0
  166. data/doc/ex/images/Button_B.gif +0 -0
  167. data/doc/ex/images/Button_C.gif +0 -0
  168. data/doc/ex/images/Button_D.gif +0 -0
  169. data/doc/ex/images/Button_E.gif +0 -0
  170. data/doc/ex/images/Button_F.gif +0 -0
  171. data/doc/ex/images/Button_G.gif +0 -0
  172. data/doc/ex/images/Button_H.gif +0 -0
  173. data/doc/ex/images/Button_I.gif +0 -0
  174. data/doc/ex/images/Button_J.gif +0 -0
  175. data/doc/ex/images/Button_K.gif +0 -0
  176. data/doc/ex/images/Button_L.gif +0 -0
  177. data/doc/ex/images/Button_M.gif +0 -0
  178. data/doc/ex/images/Button_N.gif +0 -0
  179. data/doc/ex/images/Button_O.gif +0 -0
  180. data/doc/ex/images/Button_P.gif +0 -0
  181. data/doc/ex/images/Button_Q.gif +0 -0
  182. data/doc/ex/images/Button_R.gif +0 -0
  183. data/doc/ex/images/Button_S.gif +0 -0
  184. data/doc/ex/images/Button_T.gif +0 -0
  185. data/doc/ex/images/Button_U.gif +0 -0
  186. data/doc/ex/images/Button_V.gif +0 -0
  187. data/doc/ex/images/Button_W.gif +0 -0
  188. data/doc/ex/images/Button_X.gif +0 -0
  189. data/doc/ex/images/Button_Y.gif +0 -0
  190. data/doc/ex/images/Button_Z.gif +0 -0
  191. data/doc/ex/images/Cheetah.jpg +0 -0
  192. data/doc/ex/images/Coffee.png +0 -0
  193. data/doc/ex/images/Flower_Hat.jpg +0 -0
  194. data/doc/ex/images/Gold_Statue.jpg +0 -0
  195. data/doc/ex/images/Hot_Air_Balloons.jpg +0 -0
  196. data/doc/ex/images/Hot_Air_Balloons_H.jpg +0 -0
  197. data/doc/ex/images/Leaf.miff +0 -0
  198. data/doc/ex/images/No.png +0 -0
  199. data/doc/ex/images/Polynesia.jpg +0 -0
  200. data/doc/ex/images/Red_Rocks.jpg +0 -0
  201. data/doc/ex/images/Rocks_On_Beach.miff +0 -0
  202. data/doc/ex/images/Shorts.jpg +0 -0
  203. data/doc/ex/images/Snake.png +0 -0
  204. data/doc/ex/images/Violin.jpg +0 -0
  205. data/doc/ex/images/Yellow_Rose.miff +0 -0
  206. data/doc/ex/images/big-duck.gif +0 -0
  207. data/doc/ex/images/duck.gif +0 -0
  208. data/doc/ex/images/duck0.gif +0 -0
  209. data/doc/ex/images/duck1.gif +0 -0
  210. data/doc/ex/images/duck10.gif +0 -0
  211. data/doc/ex/images/duck11.gif +0 -0
  212. data/doc/ex/images/duck12.gif +0 -0
  213. data/doc/ex/images/duck13.gif +0 -0
  214. data/doc/ex/images/duck14.gif +0 -0
  215. data/doc/ex/images/duck15.gif +0 -0
  216. data/doc/ex/images/duck2.gif +0 -0
  217. data/doc/ex/images/duck3.gif +0 -0
  218. data/doc/ex/images/duck4.gif +0 -0
  219. data/doc/ex/images/duck5.gif +0 -0
  220. data/doc/ex/images/duck6.gif +0 -0
  221. data/doc/ex/images/duck7.gif +0 -0
  222. data/doc/ex/images/duck8.gif +0 -0
  223. data/doc/ex/images/duck9.gif +0 -0
  224. data/doc/ex/images/graydient230x6.gif +0 -0
  225. data/doc/ex/images/image_with_profile.jpg +0 -0
  226. data/doc/ex/images/logo400x83.gif +0 -0
  227. data/doc/ex/images/model.miff +0 -0
  228. data/doc/ex/images/notimplemented.gif +0 -0
  229. data/doc/ex/images/smile.miff +0 -0
  230. data/doc/ex/images/spin.gif +0 -0
  231. data/doc/ex/implode.rb +0 -34
  232. data/doc/ex/level.rb +0 -11
  233. data/doc/ex/level_colors.rb +0 -11
  234. data/doc/ex/line.rb +0 -41
  235. data/doc/ex/line01.rb +0 -21
  236. data/doc/ex/mask.rb +0 -35
  237. data/doc/ex/matte_fill_to_border.rb +0 -39
  238. data/doc/ex/matte_floodfill.rb +0 -32
  239. data/doc/ex/matte_replace.rb +0 -39
  240. data/doc/ex/median_filter.rb +0 -28
  241. data/doc/ex/modulate.rb +0 -11
  242. data/doc/ex/mono.rb +0 -23
  243. data/doc/ex/morph.rb +0 -25
  244. data/doc/ex/mosaic.rb +0 -37
  245. data/doc/ex/motion_blur.rb +0 -11
  246. data/doc/ex/negate.rb +0 -11
  247. data/doc/ex/negate_channel.rb +0 -9
  248. data/doc/ex/nested_rvg.rb +0 -21
  249. data/doc/ex/nonzero.rb +0 -42
  250. data/doc/ex/normalize.rb +0 -11
  251. data/doc/ex/oil_paint.rb +0 -11
  252. data/doc/ex/opacity.rb +0 -37
  253. data/doc/ex/ordered_dither.rb +0 -11
  254. data/doc/ex/path.rb +0 -63
  255. data/doc/ex/pattern1.rb +0 -25
  256. data/doc/ex/pattern2.rb +0 -26
  257. data/doc/ex/polaroid.rb +0 -26
  258. data/doc/ex/polygon.rb +0 -23
  259. data/doc/ex/polygon01.rb +0 -21
  260. data/doc/ex/polyline.rb +0 -22
  261. data/doc/ex/polyline01.rb +0 -21
  262. data/doc/ex/posterize.rb +0 -8
  263. data/doc/ex/preview.rb +0 -8
  264. data/doc/ex/qbezierpath.rb +0 -52
  265. data/doc/ex/quad01.rb +0 -34
  266. data/doc/ex/quantize-m.rb +0 -25
  267. data/doc/ex/radial_blur.rb +0 -9
  268. data/doc/ex/raise.rb +0 -8
  269. data/doc/ex/random_threshold_channel.rb +0 -13
  270. data/doc/ex/rect01.rb +0 -14
  271. data/doc/ex/rect02.rb +0 -20
  272. data/doc/ex/rectangle.rb +0 -34
  273. data/doc/ex/reduce_noise.rb +0 -28
  274. data/doc/ex/remap.rb +0 -11
  275. data/doc/ex/remap_images.rb +0 -19
  276. data/doc/ex/resize_to_fill.rb +0 -8
  277. data/doc/ex/resize_to_fit.rb +0 -8
  278. data/doc/ex/roll.rb +0 -9
  279. data/doc/ex/rotate.rb +0 -44
  280. data/doc/ex/rotate_f.rb +0 -14
  281. data/doc/ex/roundrect.rb +0 -33
  282. data/doc/ex/rubyname.rb +0 -30
  283. data/doc/ex/rvg_clippath.rb +0 -12
  284. data/doc/ex/rvg_linecap.rb +0 -42
  285. data/doc/ex/rvg_linejoin.rb +0 -40
  286. data/doc/ex/rvg_opacity.rb +0 -18
  287. data/doc/ex/rvg_pattern.rb +0 -26
  288. data/doc/ex/rvg_stroke_dasharray.rb +0 -11
  289. data/doc/ex/segment.rb +0 -11
  290. data/doc/ex/sepiatone.rb +0 -7
  291. data/doc/ex/shade.rb +0 -11
  292. data/doc/ex/shadow.rb +0 -30
  293. data/doc/ex/shave.rb +0 -15
  294. data/doc/ex/shear.rb +0 -10
  295. data/doc/ex/sketch.rb +0 -17
  296. data/doc/ex/skewx.rb +0 -51
  297. data/doc/ex/skewy.rb +0 -47
  298. data/doc/ex/smile.rb +0 -126
  299. data/doc/ex/solarize.rb +0 -11
  300. data/doc/ex/sparse_color.rb +0 -55
  301. data/doc/ex/splice.rb +0 -8
  302. data/doc/ex/spread.rb +0 -11
  303. data/doc/ex/stegano.rb +0 -54
  304. data/doc/ex/stroke_dasharray.rb +0 -42
  305. data/doc/ex/stroke_fill.rb +0 -10
  306. data/doc/ex/stroke_linecap.rb +0 -44
  307. data/doc/ex/stroke_linejoin.rb +0 -48
  308. data/doc/ex/stroke_width.rb +0 -49
  309. data/doc/ex/swirl.rb +0 -17
  310. data/doc/ex/text.rb +0 -37
  311. data/doc/ex/text01.rb +0 -16
  312. data/doc/ex/text_align.rb +0 -36
  313. data/doc/ex/text_antialias.rb +0 -37
  314. data/doc/ex/text_styles.rb +0 -19
  315. data/doc/ex/text_undercolor.rb +0 -28
  316. data/doc/ex/texture_fill_to_border.rb +0 -34
  317. data/doc/ex/texture_floodfill.rb +0 -32
  318. data/doc/ex/texturefill.rb +0 -24
  319. data/doc/ex/threshold.rb +0 -13
  320. data/doc/ex/to_blob.rb +0 -13
  321. data/doc/ex/translate.rb +0 -39
  322. data/doc/ex/transparent.rb +0 -38
  323. data/doc/ex/transpose.rb +0 -9
  324. data/doc/ex/transverse.rb +0 -9
  325. data/doc/ex/tref01.rb +0 -24
  326. data/doc/ex/triangle01.rb +0 -15
  327. data/doc/ex/trim.rb +0 -23
  328. data/doc/ex/tspan01.rb +0 -17
  329. data/doc/ex/tspan02.rb +0 -17
  330. data/doc/ex/tspan03.rb +0 -19
  331. data/doc/ex/unsharp_mask.rb +0 -28
  332. data/doc/ex/viewex.rb +0 -33
  333. data/doc/ex/vignette.rb +0 -12
  334. data/doc/ex/watermark.rb +0 -27
  335. data/doc/ex/wave.rb +0 -9
  336. data/doc/ex/wet_floor.rb +0 -58
  337. data/doc/ex/writing_mode01.rb +0 -26
  338. data/doc/ex/writing_mode02.rb +0 -26
  339. data/doc/ilist.html +0 -2056
  340. data/doc/image1.html +0 -4680
  341. data/doc/image2.html +0 -3665
  342. data/doc/image3.html +0 -4522
  343. data/doc/imageattrs.html +0 -1638
  344. data/doc/imusage.html +0 -514
  345. data/doc/index.html +0 -416
  346. data/doc/info.html +0 -1499
  347. data/doc/magick.html +0 -570
  348. data/doc/optequiv.html +0 -2435
  349. data/doc/rvg.html +0 -975
  350. data/doc/rvgclip.html +0 -248
  351. data/doc/rvggroup.html +0 -305
  352. data/doc/rvgimage.html +0 -289
  353. data/doc/rvgpattern.html +0 -475
  354. data/doc/rvgshape.html +0 -406
  355. data/doc/rvgstyle.html +0 -270
  356. data/doc/rvgtext.html +0 -465
  357. data/doc/rvgtspan.html +0 -238
  358. data/doc/rvgtut.html +0 -530
  359. data/doc/rvguse.html +0 -145
  360. data/doc/rvgxform.html +0 -294
  361. data/doc/scripts/doc.js +0 -22
  362. data/doc/scripts/stripeTables.js +0 -23
  363. data/doc/struct.html +0 -1339
  364. data/doc/usage.html +0 -1621
  365. data/examples/constitute.rb +0 -7
  366. data/examples/crop_with_gravity.rb +0 -42
  367. data/examples/demo.rb +0 -323
  368. data/examples/describe.rb +0 -41
  369. data/examples/find_similar_region.rb +0 -34
  370. data/examples/histogram.rb +0 -312
  371. data/examples/identify.rb +0 -174
  372. data/examples/image_opacity.rb +0 -28
  373. data/examples/import_export.rb +0 -31
  374. data/examples/pattern_fill.rb +0 -37
  375. data/examples/rotating_text.rb +0 -45
  376. data/examples/spinner.rb +0 -49
  377. data/examples/thumbnail.rb +0 -64
  378. data/examples/vignette.rb +0 -78
  379. data/lib/obsolete.rb +0 -66
  380. data/spec/rmagick/ImageList1_spec.rb +0 -24
  381. data/spec/rmagick/draw_spec.rb +0 -155
  382. data/spec/rmagick/image/blue_shift_spec.rb +0 -14
  383. data/spec/rmagick/image/channel_entropy_spec.rb +0 -9
  384. data/spec/rmagick/image/composite_spec.rb +0 -72
  385. data/spec/rmagick/image/constitute_spec.rb +0 -13
  386. data/spec/rmagick/image/dispatch_spec.rb +0 -16
  387. data/spec/rmagick/image/from_blob_spec.rb +0 -12
  388. data/spec/rmagick/image/ping_spec.rb +0 -12
  389. data/spec/rmagick/image/properties_spec.rb +0 -27
  390. data/spec/rmagick/image/read_spec.rb +0 -28
  391. data/spec/spec_helper.rb +0 -10
  392. data/spec/support/issue_200/app.rb +0 -8
  393. data/test/Draw.rb +0 -351
  394. data/test/Enum.rb +0 -228
  395. data/test/Fill.rb +0 -93
  396. data/test/Image1.rb +0 -627
  397. data/test/Image2.rb +0 -1426
  398. data/test/Image3.rb +0 -1091
  399. data/test/ImageList1.rb +0 -858
  400. data/test/ImageList2.rb +0 -406
  401. data/test/Image_attributes.rb +0 -666
  402. data/test/Import_Export.rb +0 -115
  403. data/test/Info.rb +0 -444
  404. data/test/KernelInfo.rb +0 -67
  405. data/test/Magick.rb +0 -311
  406. data/test/Pixel.rb +0 -285
  407. data/test/PolaroidOptions.rb +0 -23
  408. data/test/Preview.rb +0 -26
  409. data/test/Struct.rb +0 -45
  410. data/test/appearance/Montage.rb +0 -26
  411. data/test/appearance/appearance_assertion.rb +0 -13
  412. data/test/appearance/expected/montage_border_color.jpg +0 -0
  413. data/test/cmyk.icm +0 -0
  414. data/test/lib/Obsolete.rb +0 -30
  415. data/test/lib/internal/Draw.rb +0 -823
  416. data/test/lib/internal/Geometry.rb +0 -98
  417. data/test/lib/internal/Magick.rb +0 -40
  418. data/test/srgb.icm +0 -0
  419. data/test/test_all_basic.rb +0 -49
  420. data/test/tmpnam_test.rb +0 -50
data/ext/RMagick/rmmain.c CHANGED
@@ -14,6 +14,18 @@
14
14
  #define MAIN // Define external variables
15
15
  #include "rmagick.h"
16
16
 
17
+ #if defined(HAVE_SETMAGICKALIGNEDMEMORYMETHODS) && defined(HAVE_RB_GC_ADJUST_MEMORY_USAGE)
18
+ #if defined(HAVE_POSIX_MEMALIGN) || defined(HAVE__ALIGNED_MSIZE)
19
+ #define USE_RM_ALIGNED_MALLOC 1
20
+
21
+ #if defined(HAVE_MALLOC_H)
22
+ #include <malloc.h>
23
+ #elif defined(HAVE_MALLOC_MALLOC_H)
24
+ #include <malloc/malloc.h>
25
+ #endif
26
+ #endif
27
+ #endif
28
+
17
29
  /*----------------------------------------------------------------------------\
18
30
  | External declarations
19
31
  \----------------------------------------------------------------------------*/
@@ -98,6 +110,78 @@ static void rm_free(void *ptr)
98
110
  }
99
111
 
100
112
 
113
+
114
+ #if USE_RM_ALIGNED_MALLOC
115
+
116
+ static size_t
117
+ rm_aligned_malloc_size(void *ptr)
118
+ {
119
+ #if defined(HAVE_MALLOC_USABLE_SIZE)
120
+ return malloc_usable_size(ptr);
121
+ #elif defined(HAVE_MALLOC_SIZE)
122
+ return malloc_size(ptr);
123
+ #elif defined(HAVE__ALIGNED_MSIZE)
124
+ // Refered to https://github.com/ImageMagick/ImageMagick/blob/master/MagickCore/memory-private.h
125
+ #define MAGICKCORE_SIZEOF_VOID_P 8
126
+ #define CACHE_LINE_SIZE (8 * MAGICKCORE_SIZEOF_VOID_P)
127
+ size_t _aligned_msize(void *memblock, size_t alignment, size_t offset);
128
+ return _aligned_msize(ptr, CACHE_LINE_SIZE, 0);
129
+ #endif
130
+ }
131
+
132
+
133
+ /**
134
+ * Allocate aligned memory.
135
+ *
136
+ * No Ruby usage (internal function)
137
+ *
138
+ * @param size the size of memory to allocate
139
+ * @return pointer to a block of memory
140
+ */
141
+ static void *rm_aligned_malloc(size_t size, size_t alignment)
142
+ {
143
+ void *res;
144
+ size_t allocated_size;
145
+
146
+ #if defined(HAVE_POSIX_MEMALIGN)
147
+ if (posix_memalign(&res, alignment, size) != 0) {
148
+ return NULL;
149
+ }
150
+ #elif defined(HAVE__ALIGNED_MSIZE)
151
+ res = _aligned_malloc(size, alignment);
152
+ #endif
153
+
154
+ allocated_size = rm_aligned_malloc_size(res);
155
+ rb_gc_adjust_memory_usage(allocated_size);
156
+ return res;
157
+ }
158
+
159
+
160
+
161
+
162
+ /**
163
+ * Free aligned memory.
164
+ *
165
+ * No Ruby usage (internal function)
166
+ *
167
+ * @param ptr pointer to the existing block of memory
168
+ */
169
+ static void rm_aligned_free(void *ptr)
170
+ {
171
+ size_t allocated_size = rm_aligned_malloc_size(ptr);
172
+ rb_gc_adjust_memory_usage(-allocated_size);
173
+
174
+ #if defined(HAVE_POSIX_MEMALIGN)
175
+ free(ptr);
176
+ #elif defined(HAVE__ALIGNED_MSIZE)
177
+ _aligned_free(ptr);
178
+ #endif
179
+ }
180
+
181
+ #endif
182
+
183
+
184
+
101
185
  /**
102
186
  * Use managed memory.
103
187
  *
@@ -108,6 +192,9 @@ static inline void managed_memory_enable(VALUE enable)
108
192
  if (enable)
109
193
  {
110
194
  SetMagickMemoryMethods(rm_malloc, rm_realloc, rm_free);
195
+ #if USE_RM_ALIGNED_MALLOC
196
+ SetMagickAlignedMemoryMethods(rm_aligned_malloc, rm_aligned_free);
197
+ #endif
111
198
  }
112
199
  rb_define_const(Module_Magick, "MANAGED_MEMORY", enable);
113
200
  }
@@ -147,8 +234,6 @@ static void set_managed_memory(void)
147
234
  void
148
235
  Init_RMagick2(void)
149
236
  {
150
- VALUE observable;
151
-
152
237
  Module_Magick = rb_define_module("Magick");
153
238
 
154
239
  set_managed_memory();
@@ -157,6 +242,8 @@ Init_RMagick2(void)
157
242
 
158
243
  test_Magick_version();
159
244
 
245
+ rm_main_thread_id = rm_current_thread_id();
246
+
160
247
  /*-----------------------------------------------------------------------*/
161
248
  /* Create IDs for frequently used methods, etc. */
162
249
  /*-----------------------------------------------------------------------*/
@@ -167,24 +254,14 @@ Init_RMagick2(void)
167
254
  rm_ID_cur_image = rb_intern("cur_image");
168
255
  rm_ID_dup = rb_intern("dup");
169
256
  rm_ID_fill = rb_intern("fill");
170
- rm_ID_flag = rb_intern("flag");
171
- rm_ID_from_s = rb_intern("from_s");
172
257
  rm_ID_Geometry = rb_intern("Geometry");
173
- rm_ID_GeometryValue = rb_intern("GeometryValue");
174
- rm_ID_has_key_q = rb_intern("has_key?");
175
258
  rm_ID_height = rb_intern("height");
176
259
  rm_ID_initialize_copy = rb_intern("initialize_copy");
177
- rm_ID_length = rb_intern("length");
178
260
  rm_ID_notify_observers = rb_intern("notify_observers");
179
261
  rm_ID_new = rb_intern("new");
180
262
  rm_ID_push = rb_intern("push");
181
- rm_ID_spaceship = rb_intern("<=>");
182
- rm_ID_to_i = rb_intern("to_i");
183
- rm_ID_to_s = rb_intern("to_s");
184
263
  rm_ID_values = rb_intern("values");
185
264
  rm_ID_width = rb_intern("width");
186
- rm_ID_x = rb_intern("x");
187
- rm_ID_y = rb_intern("y");
188
265
 
189
266
  /*-----------------------------------------------------------------------*/
190
267
  /* Module Magick methods */
@@ -210,7 +287,6 @@ Init_RMagick2(void)
210
287
  rb_define_alloc_func(Class_Image, Image_alloc);
211
288
  rb_define_method(Class_Image, "initialize", Image_initialize, -1);
212
289
 
213
- rb_define_singleton_method(Class_Image, "combine", Image_combine, -1);
214
290
  rb_define_singleton_method(Class_Image, "constitute", Image_constitute, 4);
215
291
  rb_define_singleton_method(Class_Image, "_load", Image__load, 1);
216
292
  rb_define_singleton_method(Class_Image, "capture", Image_capture, -1);
@@ -219,72 +295,106 @@ Init_RMagick2(void)
219
295
  rb_define_singleton_method(Class_Image, "read_inline", Image_read_inline, 1);
220
296
  rb_define_singleton_method(Class_Image, "from_blob", Image_from_blob, 1);
221
297
 
222
- DCL_ATTR_WRITER(Image, alpha)
223
- DCL_ATTR_ACCESSOR(Image, background_color)
224
- DCL_ATTR_READER(Image, base_columns)
225
- DCL_ATTR_READER(Image, base_filename)
226
- DCL_ATTR_READER(Image, base_rows)
227
- DCL_ATTR_ACCESSOR(Image, bias)
228
- DCL_ATTR_ACCESSOR(Image, black_point_compensation)
229
- DCL_ATTR_ACCESSOR(Image, blur)
230
- DCL_ATTR_ACCESSOR(Image, border_color)
231
- DCL_ATTR_READER(Image, bounding_box)
232
- DCL_ATTR_ACCESSOR(Image, chromaticity)
233
- DCL_ATTR_ACCESSOR(Image, color_profile)
234
- DCL_ATTR_READER(Image, colors)
235
- DCL_ATTR_ACCESSOR(Image, colorspace)
236
- DCL_ATTR_READER(Image, columns)
237
- DCL_ATTR_ACCESSOR(Image, compose)
238
- DCL_ATTR_ACCESSOR(Image, compression)
239
- DCL_ATTR_ACCESSOR(Image, delay)
240
- DCL_ATTR_ACCESSOR(Image, density)
241
- DCL_ATTR_READER(Image, depth)
242
- DCL_ATTR_READER(Image, directory)
243
- DCL_ATTR_ACCESSOR(Image, dispose)
244
- DCL_ATTR_ACCESSOR(Image, endian)
245
- DCL_ATTR_ACCESSOR(Image, extract_info)
246
- DCL_ATTR_READER(Image, filename)
247
- DCL_ATTR_READER(Image, filesize)
248
- DCL_ATTR_ACCESSOR(Image, filter)
249
- DCL_ATTR_ACCESSOR(Image, format)
250
- DCL_ATTR_ACCESSOR(Image, fuzz)
251
- DCL_ATTR_ACCESSOR(Image, gamma)
252
- DCL_ATTR_ACCESSOR(Image, geometry)
253
- DCL_ATTR_ACCESSOR(Image, gravity)
254
- DCL_ATTR_ACCESSOR(Image, image_type)
255
- DCL_ATTR_ACCESSOR(Image, interlace)
256
- DCL_ATTR_ACCESSOR(Image, iptc_profile)
257
- DCL_ATTR_ACCESSOR(Image, iterations) // do not document! Only used by Image#iterations=
258
- DCL_ATTR_WRITER(Image, mask)
259
- DCL_ATTR_ACCESSOR(Image, matte)
260
- DCL_ATTR_ACCESSOR(Image, matte_color)
261
- DCL_ATTR_READER(Image, mean_error_per_pixel)
262
- DCL_ATTR_READER(Image, mime_type)
263
- DCL_ATTR_WRITER(Image, monitor)
264
- DCL_ATTR_READER(Image, montage)
265
- DCL_ATTR_READER(Image, normalized_mean_error)
266
- DCL_ATTR_READER(Image, normalized_maximum_error)
267
- DCL_ATTR_READER(Image, number_colors)
268
- DCL_ATTR_ACCESSOR(Image, offset)
269
- DCL_ATTR_WRITER(Image, opacity)
270
- DCL_ATTR_ACCESSOR(Image, orientation)
271
- DCL_ATTR_ACCESSOR(Image, page)
272
- DCL_ATTR_ACCESSOR(Image, pixel_interpolation_method)
273
- DCL_ATTR_READER(Image, quality)
274
- DCL_ATTR_READER(Image, quantum_depth)
275
- DCL_ATTR_ACCESSOR(Image, rendering_intent)
276
- DCL_ATTR_READER(Image, rows)
277
- DCL_ATTR_READER(Image, scene)
278
- DCL_ATTR_ACCESSOR(Image, start_loop)
279
- DCL_ATTR_ACCESSOR(Image, class_type)
280
- DCL_ATTR_ACCESSOR(Image, ticks_per_second)
281
- DCL_ATTR_READER(Image, total_colors)
282
- DCL_ATTR_READER(Image, total_ink_density)
283
- DCL_ATTR_ACCESSOR(Image, transparent_color)
284
- DCL_ATTR_ACCESSOR(Image, units)
285
- DCL_ATTR_ACCESSOR(Image, virtual_pixel_method)
286
- DCL_ATTR_ACCESSOR(Image, x_resolution)
287
- DCL_ATTR_ACCESSOR(Image, y_resolution)
298
+ // Define the attributes
299
+ rb_define_method(Class_Image, "background_color", Image_background_color, 0);
300
+ rb_define_method(Class_Image, "background_color=", Image_background_color_eq, 1);
301
+ rb_define_method(Class_Image, "base_columns", Image_base_columns, 0);
302
+ rb_define_method(Class_Image, "base_filename", Image_base_filename, 0);
303
+ rb_define_method(Class_Image, "base_rows", Image_base_rows, 0);
304
+ rb_define_method(Class_Image, "bias", Image_bias, 0);
305
+ rb_define_method(Class_Image, "bias=", Image_bias_eq, 1);
306
+ rb_define_method(Class_Image, "black_point_compensation", Image_black_point_compensation, 0);
307
+ rb_define_method(Class_Image, "black_point_compensation=", Image_black_point_compensation_eq, 1);
308
+ rb_define_method(Class_Image, "border_color", Image_border_color, 0);
309
+ rb_define_method(Class_Image, "border_color=", Image_border_color_eq, 1);
310
+ rb_define_method(Class_Image, "bounding_box", Image_bounding_box, 0);
311
+ rb_define_method(Class_Image, "chromaticity", Image_chromaticity, 0);
312
+ rb_define_method(Class_Image, "chromaticity=", Image_chromaticity_eq, 1);
313
+ rb_define_method(Class_Image, "color_profile", Image_color_profile, 0);
314
+ rb_define_method(Class_Image, "color_profile=", Image_color_profile_eq, 1);
315
+ rb_define_method(Class_Image, "colors", Image_colors, 0);
316
+ rb_define_method(Class_Image, "colorspace", Image_colorspace, 0);
317
+ rb_define_method(Class_Image, "colorspace=", Image_colorspace_eq, 1);
318
+ rb_define_method(Class_Image, "columns", Image_columns, 0);
319
+ rb_define_method(Class_Image, "compose", Image_compose, 0);
320
+ rb_define_method(Class_Image, "compose=", Image_compose_eq, 1);
321
+ rb_define_method(Class_Image, "compression", Image_compression, 0);
322
+ rb_define_method(Class_Image, "compression=", Image_compression_eq, 1);
323
+ rb_define_method(Class_Image, "delay", Image_delay, 0);
324
+ rb_define_method(Class_Image, "delay=", Image_delay_eq, 1);
325
+ rb_define_method(Class_Image, "density", Image_density, 0);
326
+ rb_define_method(Class_Image, "density=", Image_density_eq, 1);
327
+ rb_define_method(Class_Image, "depth", Image_depth, 0);
328
+ rb_define_method(Class_Image, "directory", Image_directory, 0);
329
+ rb_define_method(Class_Image, "dispose", Image_dispose, 0);
330
+ rb_define_method(Class_Image, "dispose=", Image_dispose_eq, 1);
331
+ rb_define_method(Class_Image, "endian", Image_endian, 0);
332
+ rb_define_method(Class_Image, "endian=", Image_endian_eq, 1);
333
+ rb_define_method(Class_Image, "extract_info", Image_extract_info, 0);
334
+ rb_define_method(Class_Image, "extract_info=", Image_extract_info_eq, 1);
335
+ rb_define_method(Class_Image, "filename", Image_filename, 0);
336
+ rb_define_method(Class_Image, "filesize", Image_filesize, 0);
337
+ rb_define_method(Class_Image, "filter", Image_filter, 0);
338
+ rb_define_method(Class_Image, "filter=", Image_filter_eq, 1);
339
+ rb_define_method(Class_Image, "format", Image_format, 0);
340
+ rb_define_method(Class_Image, "format=", Image_format_eq, 1);
341
+ rb_define_method(Class_Image, "fuzz", Image_fuzz, 0);
342
+ rb_define_method(Class_Image, "fuzz=", Image_fuzz_eq, 1);
343
+ rb_define_method(Class_Image, "gamma", Image_gamma, 0);
344
+ rb_define_method(Class_Image, "gamma=", Image_gamma_eq, 1);
345
+ rb_define_method(Class_Image, "geometry", Image_geometry, 0);
346
+ rb_define_method(Class_Image, "geometry=", Image_geometry_eq, 1);
347
+ rb_define_method(Class_Image, "gravity", Image_gravity, 0);
348
+ rb_define_method(Class_Image, "gravity=", Image_gravity_eq, 1);
349
+ rb_define_method(Class_Image, "image_type", Image_image_type, 0);
350
+ rb_define_method(Class_Image, "image_type=", Image_image_type_eq, 1);
351
+ rb_define_method(Class_Image, "interlace", Image_interlace, 0);
352
+ rb_define_method(Class_Image, "interlace=", Image_interlace_eq, 1);
353
+ rb_define_method(Class_Image, "iptc_profile", Image_iptc_profile, 0);
354
+ rb_define_method(Class_Image, "iptc_profile=", Image_iptc_profile_eq, 1);
355
+ rb_define_method(Class_Image, "iterations", Image_iterations, 0); // do not document! Only used by Image#iterations=
356
+ rb_define_method(Class_Image, "iterations=", Image_iterations_eq, 1); // do not document! Only used by Image#iterations=
357
+ rb_define_method(Class_Image, "matte_color", Image_matte_color, 0);
358
+ rb_define_method(Class_Image, "matte_color=", Image_matte_color_eq, 1);
359
+ rb_define_method(Class_Image, "mean_error_per_pixel", Image_mean_error_per_pixel, 0);
360
+ rb_define_method(Class_Image, "mime_type", Image_mime_type, 0);
361
+ rb_define_method(Class_Image, "monitor=", Image_monitor_eq, 1);
362
+ rb_define_method(Class_Image, "montage", Image_montage, 0);
363
+ rb_define_method(Class_Image, "normalized_mean_error", Image_normalized_mean_error, 0);
364
+ rb_define_method(Class_Image, "normalized_maximum_error", Image_normalized_maximum_error, 0);
365
+ rb_define_method(Class_Image, "number_colors", Image_number_colors, 0);
366
+ rb_define_method(Class_Image, "offset", Image_offset, 0);
367
+ rb_define_method(Class_Image, "offset=", Image_offset_eq, 1);
368
+ rb_define_method(Class_Image, "orientation", Image_orientation, 0);
369
+ rb_define_method(Class_Image, "orientation=", Image_orientation_eq, 1);
370
+ rb_define_method(Class_Image, "page", Image_page, 0);
371
+ rb_define_method(Class_Image, "page=", Image_page_eq, 1);
372
+ rb_define_method(Class_Image, "pixel_interpolation_method", Image_pixel_interpolation_method, 0);
373
+ rb_define_method(Class_Image, "pixel_interpolation_method=", Image_pixel_interpolation_method_eq, 1);
374
+ rb_define_method(Class_Image, "quality", Image_quality, 0);
375
+ rb_define_method(Class_Image, "quantum_depth", Image_quantum_depth, 0);
376
+ rb_define_method(Class_Image, "rendering_intent", Image_rendering_intent, 0);
377
+ rb_define_method(Class_Image, "rendering_intent=", Image_rendering_intent_eq, 1);
378
+ rb_define_method(Class_Image, "rows", Image_rows, 0);
379
+ rb_define_method(Class_Image, "scene", Image_scene, 0);
380
+ rb_define_method(Class_Image, "start_loop", Image_start_loop, 0);
381
+ rb_define_method(Class_Image, "start_loop=", Image_start_loop_eq, 1);
382
+ rb_define_method(Class_Image, "class_type", Image_class_type, 0);
383
+ rb_define_method(Class_Image, "class_type=", Image_class_type_eq, 1);
384
+ rb_define_method(Class_Image, "ticks_per_second", Image_ticks_per_second, 0);
385
+ rb_define_method(Class_Image, "ticks_per_second=", Image_ticks_per_second_eq, 1);
386
+ rb_define_method(Class_Image, "total_colors", Image_total_colors, 0);
387
+ rb_define_method(Class_Image, "total_ink_density", Image_total_ink_density, 0);
388
+ rb_define_method(Class_Image, "transparent_color", Image_transparent_color, 0);
389
+ rb_define_method(Class_Image, "transparent_color=", Image_transparent_color_eq, 1);
390
+ rb_define_method(Class_Image, "units", Image_units, 0);
391
+ rb_define_method(Class_Image, "units=", Image_units_eq, 1);
392
+ rb_define_method(Class_Image, "virtual_pixel_method", Image_virtual_pixel_method, 0);
393
+ rb_define_method(Class_Image, "virtual_pixel_method=", Image_virtual_pixel_method_eq, 1);
394
+ rb_define_method(Class_Image, "x_resolution", Image_x_resolution, 0);
395
+ rb_define_method(Class_Image, "x_resolution=", Image_x_resolution_eq, 1);
396
+ rb_define_method(Class_Image, "y_resolution", Image_y_resolution, 0);
397
+ rb_define_method(Class_Image, "y_resolution=", Image_y_resolution_eq, 1);
288
398
 
289
399
  rb_define_method(Class_Image, "adaptive_blur", Image_adaptive_blur, -1);
290
400
  rb_define_method(Class_Image, "adaptive_blur_channel", Image_adaptive_blur_channel, -1);
@@ -412,7 +522,6 @@ Init_RMagick2(void)
412
522
  rb_define_method(Class_Image, "liquid_rescale", Image_liquid_rescale, -1);
413
523
  rb_define_method(Class_Image, "magnify", Image_magnify, 0);
414
524
  rb_define_method(Class_Image, "magnify!", Image_magnify_bang, 0);
415
- rb_define_method(Class_Image, "map", Image_map, -1);
416
525
  rb_define_method(Class_Image, "marshal_dump", Image_marshal_dump, 0);
417
526
  rb_define_method(Class_Image, "marshal_load", Image_marshal_load, 1);
418
527
  rb_define_method(Class_Image, "mask", Image_mask, -1);
@@ -484,7 +593,6 @@ Init_RMagick2(void)
484
593
  rb_define_method(Class_Image, "strip!", Image_strip_bang, 0);
485
594
  rb_define_method(Class_Image, "store_pixels", Image_store_pixels, 5);
486
595
  rb_define_method(Class_Image, "swirl", Image_swirl, 1);
487
- rb_define_method(Class_Image, "sync_profiles", Image_sync_profiles, 0);
488
596
  rb_define_method(Class_Image, "texture_flood_fill", Image_texture_flood_fill, 5);
489
597
  rb_define_method(Class_Image, "threshold", Image_threshold, 1);
490
598
  rb_define_method(Class_Image, "thumbnail", Image_thumbnail, -1);
@@ -529,8 +637,6 @@ Init_RMagick2(void)
529
637
  rb_define_method(Class_ImageList, "deconstruct", ImageList_deconstruct, 0);
530
638
  rb_define_method(Class_ImageList, "display", ImageList_display, 0);
531
639
  rb_define_method(Class_ImageList, "flatten_images", ImageList_flatten_images, 0);
532
- rb_define_method(Class_ImageList, "fx", ImageList_fx, -1);
533
- rb_define_method(Class_ImageList, "map", ImageList_map, -1);
534
640
  rb_define_method(Class_ImageList, "montage", ImageList_montage, 0);
535
641
  rb_define_method(Class_ImageList, "morph", ImageList_morph, 1);
536
642
  rb_define_method(Class_ImageList, "mosaic", ImageList_mosaic, 0);
@@ -546,30 +652,31 @@ Init_RMagick2(void)
546
652
  Class_Draw = rb_define_class_under(Module_Magick, "Draw", rb_cObject);
547
653
  rb_define_alloc_func(Class_Draw, Draw_alloc);
548
654
 
549
- DCL_ATTR_WRITER(Draw, affine)
550
- DCL_ATTR_WRITER(Draw, align)
551
- DCL_ATTR_WRITER(Draw, decorate)
552
- DCL_ATTR_WRITER(Draw, density)
553
- DCL_ATTR_WRITER(Draw, encoding)
554
- DCL_ATTR_WRITER(Draw, fill)
555
- DCL_ATTR_WRITER(Draw, fill_pattern)
556
- DCL_ATTR_WRITER(Draw, font)
557
- DCL_ATTR_WRITER(Draw, font_family)
558
- DCL_ATTR_WRITER(Draw, font_stretch)
559
- DCL_ATTR_WRITER(Draw, font_style)
560
- DCL_ATTR_WRITER(Draw, font_weight)
561
- DCL_ATTR_WRITER(Draw, gravity)
562
- DCL_ATTR_WRITER(Draw, interline_spacing)
563
- DCL_ATTR_WRITER(Draw, interword_spacing)
564
- DCL_ATTR_WRITER(Draw, kerning)
565
- DCL_ATTR_WRITER(Draw, pointsize)
566
- DCL_ATTR_WRITER(Draw, rotation)
567
- DCL_ATTR_WRITER(Draw, stroke)
568
- DCL_ATTR_WRITER(Draw, stroke_pattern)
569
- DCL_ATTR_WRITER(Draw, stroke_width)
570
- DCL_ATTR_WRITER(Draw, text_antialias)
571
- DCL_ATTR_WRITER(Draw, tile)
572
- DCL_ATTR_WRITER(Draw, undercolor)
655
+ // Define the attributes
656
+ rb_define_method(Class_Draw, "affine=", Draw_affine_eq, 1);
657
+ rb_define_method(Class_Draw, "align=", Draw_align_eq, 1);
658
+ rb_define_method(Class_Draw, "decorate=", Draw_decorate_eq, 1);
659
+ rb_define_method(Class_Draw, "density=", Draw_density_eq, 1);
660
+ rb_define_method(Class_Draw, "encoding=", Draw_encoding_eq, 1);
661
+ rb_define_method(Class_Draw, "fill=", Draw_fill_eq, 1);
662
+ rb_define_method(Class_Draw, "fill_pattern=", Draw_fill_pattern_eq, 1);
663
+ rb_define_method(Class_Draw, "font=", Draw_font_eq, 1);
664
+ rb_define_method(Class_Draw, "font_family=", Draw_font_family_eq, 1);
665
+ rb_define_method(Class_Draw, "font_stretch=", Draw_font_stretch_eq, 1);
666
+ rb_define_method(Class_Draw, "font_style=", Draw_font_style_eq, 1);
667
+ rb_define_method(Class_Draw, "font_weight=", Draw_font_weight_eq, 1);
668
+ rb_define_method(Class_Draw, "gravity=", Draw_gravity_eq, 1);
669
+ rb_define_method(Class_Draw, "interline_spacing=", Draw_interline_spacing_eq, 1);
670
+ rb_define_method(Class_Draw, "interword_spacing=", Draw_interword_spacing_eq, 1);
671
+ rb_define_method(Class_Draw, "kerning=", Draw_kerning_eq, 1);
672
+ rb_define_method(Class_Draw, "pointsize=", Draw_pointsize_eq, 1);
673
+ rb_define_method(Class_Draw, "rotation=", Draw_rotation_eq, 1);
674
+ rb_define_method(Class_Draw, "stroke=", Draw_stroke_eq, 1);
675
+ rb_define_method(Class_Draw, "stroke_pattern=", Draw_stroke_pattern_eq, 1);
676
+ rb_define_method(Class_Draw, "stroke_width=", Draw_stroke_width_eq, 1);
677
+ rb_define_method(Class_Draw, "text_antialias=", Draw_text_antialias_eq, 1);
678
+ rb_define_method(Class_Draw, "tile=", Draw_tile_eq, 1);
679
+ rb_define_method(Class_Draw, "undercolor=", Draw_undercolor_eq, 1);
573
680
 
574
681
  rb_define_method(Class_Draw, "annotate", Draw_annotate, 6);
575
682
  rb_define_method(Class_Draw, "clone", Draw_clone, 0);
@@ -597,27 +704,27 @@ Init_RMagick2(void)
597
704
 
598
705
  rb_define_method(Class_DrawOptions, "initialize", DrawOptions_initialize, 0);
599
706
 
600
- SHARE_ATTR_WRITER(DrawOptions, Draw, affine)
601
- SHARE_ATTR_WRITER(DrawOptions, Draw, align)
602
- SHARE_ATTR_WRITER(DrawOptions, Draw, decorate)
603
- SHARE_ATTR_WRITER(DrawOptions, Draw, density)
604
- SHARE_ATTR_WRITER(DrawOptions, Draw, encoding)
605
- SHARE_ATTR_WRITER(DrawOptions, Draw, fill)
606
- SHARE_ATTR_WRITER(DrawOptions, Draw, fill_pattern)
607
- SHARE_ATTR_WRITER(DrawOptions, Draw, font)
608
- SHARE_ATTR_WRITER(DrawOptions, Draw, font_family)
609
- SHARE_ATTR_WRITER(DrawOptions, Draw, font_stretch)
610
- SHARE_ATTR_WRITER(DrawOptions, Draw, font_style)
611
- SHARE_ATTR_WRITER(DrawOptions, Draw, font_weight)
612
- SHARE_ATTR_WRITER(DrawOptions, Draw, gravity)
613
- SHARE_ATTR_WRITER(DrawOptions, Draw, pointsize)
614
- SHARE_ATTR_WRITER(DrawOptions, Draw, rotation)
615
- SHARE_ATTR_WRITER(DrawOptions, Draw, stroke)
616
- SHARE_ATTR_WRITER(DrawOptions, Draw, stroke_pattern)
617
- SHARE_ATTR_WRITER(DrawOptions, Draw, stroke_width)
618
- SHARE_ATTR_WRITER(DrawOptions, Draw, text_antialias)
619
- SHARE_ATTR_WRITER(DrawOptions, Draw, tile)
620
- SHARE_ATTR_WRITER(DrawOptions, Draw, undercolor)
707
+ rb_define_method(Class_DrawOptions, "affine=", Draw_affine_eq, 1);
708
+ rb_define_method(Class_DrawOptions, "align=", Draw_align_eq, 1);
709
+ rb_define_method(Class_DrawOptions, "decorate=", Draw_decorate_eq, 1);
710
+ rb_define_method(Class_DrawOptions, "density=", Draw_density_eq, 1);
711
+ rb_define_method(Class_DrawOptions, "encoding=", Draw_encoding_eq, 1);
712
+ rb_define_method(Class_DrawOptions, "fill=", Draw_fill_eq, 1);
713
+ rb_define_method(Class_DrawOptions, "fill_pattern=", Draw_fill_pattern_eq, 1);
714
+ rb_define_method(Class_DrawOptions, "font=", Draw_font_eq, 1);
715
+ rb_define_method(Class_DrawOptions, "font_family=", Draw_font_family_eq, 1);
716
+ rb_define_method(Class_DrawOptions, "font_stretch=", Draw_font_stretch_eq, 1);
717
+ rb_define_method(Class_DrawOptions, "font_style=", Draw_font_style_eq, 1);
718
+ rb_define_method(Class_DrawOptions, "font_weight=", Draw_font_weight_eq, 1);
719
+ rb_define_method(Class_DrawOptions, "gravity=", Draw_gravity_eq, 1);
720
+ rb_define_method(Class_DrawOptions, "pointsize=", Draw_pointsize_eq, 1);
721
+ rb_define_method(Class_DrawOptions, "rotation=", Draw_rotation_eq, 1);
722
+ rb_define_method(Class_DrawOptions, "stroke=", Draw_stroke_eq, 1);
723
+ rb_define_method(Class_DrawOptions, "stroke_pattern=", Draw_stroke_pattern_eq, 1);
724
+ rb_define_method(Class_DrawOptions, "stroke_width=", Draw_stroke_width_eq, 1);
725
+ rb_define_method(Class_DrawOptions, "text_antialias=", Draw_text_antialias_eq, 1);
726
+ rb_define_method(Class_DrawOptions, "tile=", Draw_tile_eq, 1);
727
+ rb_define_method(Class_DrawOptions, "undercolor=", Draw_undercolor_eq, 1);
621
728
 
622
729
  /*-----------------------------------------------------------------------*/
623
730
  /* Class Magick::Pixel */
@@ -625,11 +732,6 @@ Init_RMagick2(void)
625
732
 
626
733
  Class_Pixel = rb_define_class_under(Module_Magick, "Pixel", rb_cObject);
627
734
 
628
- // include Observable in Pixel for Image::View class
629
- (void) rb_require("observer");
630
- observable = rb_const_get(rb_cObject, rb_intern("Observable"));
631
- rb_include_module(Class_Pixel, observable);
632
-
633
735
  // include Comparable
634
736
  rb_include_module(Class_Pixel, rb_mComparable);
635
737
 
@@ -637,21 +739,27 @@ Init_RMagick2(void)
637
739
  // and the deprecated "from_HSL".
638
740
  rb_define_alloc_func(Class_Pixel, Pixel_alloc);
639
741
  rb_define_singleton_method(Class_Pixel, "from_color", Pixel_from_color, 1);
640
- rb_define_singleton_method(Class_Pixel, "from_HSL", Pixel_from_HSL, 1);
641
742
  rb_define_singleton_method(Class_Pixel, "from_hsla", Pixel_from_hsla, -1);
642
743
 
643
744
  // Define the RGBA attributes
644
- DCL_ATTR_ACCESSOR(Pixel, red)
645
- DCL_ATTR_ACCESSOR(Pixel, green)
646
- DCL_ATTR_ACCESSOR(Pixel, blue)
647
- DCL_ATTR_ACCESSOR(Pixel, alpha)
648
- DCL_ATTR_ACCESSOR(Pixel, opacity)
745
+ rb_define_method(Class_Pixel, "red", Pixel_red, 0);
746
+ rb_define_method(Class_Pixel, "red=", Pixel_red_eq, 1);
747
+ rb_define_method(Class_Pixel, "green", Pixel_green, 0);
748
+ rb_define_method(Class_Pixel, "green=", Pixel_green_eq, 1);
749
+ rb_define_method(Class_Pixel, "blue", Pixel_blue, 0);
750
+ rb_define_method(Class_Pixel, "blue=", Pixel_blue_eq, 1);
751
+ rb_define_method(Class_Pixel, "alpha", Pixel_alpha, 0);
752
+ rb_define_method(Class_Pixel, "alpha=", Pixel_alpha_eq, 1);
649
753
 
650
754
  // Define the CMYK attributes
651
- DCL_ATTR_ACCESSOR(Pixel, cyan)
652
- DCL_ATTR_ACCESSOR(Pixel, magenta)
653
- DCL_ATTR_ACCESSOR(Pixel, yellow)
654
- DCL_ATTR_ACCESSOR(Pixel, black)
755
+ rb_define_method(Class_Pixel, "cyan", Pixel_cyan, 0);
756
+ rb_define_method(Class_Pixel, "cyan=", Pixel_cyan_eq, 1);
757
+ rb_define_method(Class_Pixel, "magenta", Pixel_magenta, 0);
758
+ rb_define_method(Class_Pixel, "magenta=", Pixel_magenta_eq, 1);
759
+ rb_define_method(Class_Pixel, "yellow", Pixel_yellow, 0);
760
+ rb_define_method(Class_Pixel, "yellow=", Pixel_yellow_eq, 1);
761
+ rb_define_method(Class_Pixel, "black", Pixel_black, 0);
762
+ rb_define_method(Class_Pixel, "black=", Pixel_black_eq, 1);
655
763
 
656
764
 
657
765
  // Define the instance methods
@@ -668,7 +776,6 @@ Init_RMagick2(void)
668
776
  rb_define_method(Class_Pixel, "marshal_dump", Pixel_marshal_dump, 0);
669
777
  rb_define_method(Class_Pixel, "marshal_load", Pixel_marshal_load, 1);
670
778
  rb_define_method(Class_Pixel, "to_color", Pixel_to_color, -1);
671
- rb_define_method(Class_Pixel, "to_HSL", Pixel_to_HSL, 0); // deprecated
672
779
  rb_define_method(Class_Pixel, "to_hsla", Pixel_to_hsla, 0);
673
780
  rb_define_method(Class_Pixel, "to_s", Pixel_to_s, 0);
674
781
 
@@ -684,23 +791,23 @@ Init_RMagick2(void)
684
791
  rb_define_method(Class_Montage, "freeze", rm_no_freeze, 0);
685
792
 
686
793
  // These accessors supply optional arguments for Magick::ImageList::Montage.new
687
- DCL_ATTR_WRITER(Montage, background_color)
688
- DCL_ATTR_WRITER(Montage, border_color)
689
- DCL_ATTR_WRITER(Montage, border_width)
690
- DCL_ATTR_WRITER(Montage, compose)
691
- DCL_ATTR_WRITER(Montage, filename)
692
- DCL_ATTR_WRITER(Montage, fill)
693
- DCL_ATTR_WRITER(Montage, font)
694
- DCL_ATTR_WRITER(Montage, frame)
695
- DCL_ATTR_WRITER(Montage, geometry)
696
- DCL_ATTR_WRITER(Montage, gravity)
697
- DCL_ATTR_WRITER(Montage, matte_color)
698
- DCL_ATTR_WRITER(Montage, pointsize)
699
- DCL_ATTR_WRITER(Montage, shadow)
700
- DCL_ATTR_WRITER(Montage, stroke)
701
- DCL_ATTR_WRITER(Montage, texture)
702
- DCL_ATTR_WRITER(Montage, tile)
703
- DCL_ATTR_WRITER(Montage, title)
794
+ rb_define_method(Class_Montage, "background_color=", Montage_background_color_eq, 1);
795
+ rb_define_method(Class_Montage, "border_color=", Montage_border_color_eq, 1);
796
+ rb_define_method(Class_Montage, "border_width=", Montage_border_width_eq, 1);
797
+ rb_define_method(Class_Montage, "compose=", Montage_compose_eq, 1);
798
+ rb_define_method(Class_Montage, "filename=", Montage_filename_eq, 1);
799
+ rb_define_method(Class_Montage, "fill=", Montage_fill_eq, 1);
800
+ rb_define_method(Class_Montage, "font=", Montage_font_eq, 1);
801
+ rb_define_method(Class_Montage, "frame=", Montage_frame_eq, 1);
802
+ rb_define_method(Class_Montage, "geometry=", Montage_geometry_eq, 1);
803
+ rb_define_method(Class_Montage, "gravity=", Montage_gravity_eq, 1);
804
+ rb_define_method(Class_Montage, "matte_color=", Montage_matte_color_eq, 1);
805
+ rb_define_method(Class_Montage, "pointsize=", Montage_pointsize_eq, 1);
806
+ rb_define_method(Class_Montage, "shadow=", Montage_shadow_eq, 1);
807
+ rb_define_method(Class_Montage, "stroke=", Montage_stroke_eq, 1);
808
+ rb_define_method(Class_Montage, "texture=", Montage_texture_eq, 1);
809
+ rb_define_method(Class_Montage, "tile=", Montage_tile_eq, 1);
810
+ rb_define_method(Class_Montage, "title=", Montage_title_eq, 1);
704
811
 
705
812
  /*-----------------------------------------------------------------------*/
706
813
  /* Class Magick::Image::Info */
@@ -718,53 +825,97 @@ Init_RMagick2(void)
718
825
  rb_define_method(Class_Info, "[]", Info_aref, -1);
719
826
  rb_define_method(Class_Info, "undefine", Info_undefine, 2);
720
827
 
721
- DCL_ATTR_ACCESSOR(Info, antialias)
722
- DCL_ATTR_ACCESSOR(Info, attenuate)
723
- DCL_ATTR_ACCESSOR(Info, authenticate)
724
- DCL_ATTR_ACCESSOR(Info, background_color)
725
- DCL_ATTR_ACCESSOR(Info, border_color)
726
- DCL_ATTR_ACCESSOR(Info, caption)
727
- DCL_ATTR_ACCESSOR(Info, colorspace)
728
- DCL_ATTR_ACCESSOR(Info, comment)
729
- DCL_ATTR_ACCESSOR(Info, compression)
730
- DCL_ATTR_ACCESSOR(Info, delay)
731
- DCL_ATTR_ACCESSOR(Info, density)
732
- DCL_ATTR_ACCESSOR(Info, depth)
733
- DCL_ATTR_ACCESSOR(Info, dispose)
734
- DCL_ATTR_ACCESSOR(Info, dither)
735
- DCL_ATTR_ACCESSOR(Info, endian)
736
- DCL_ATTR_ACCESSOR(Info, extract)
737
- DCL_ATTR_ACCESSOR(Info, filename)
738
- DCL_ATTR_ACCESSOR(Info, fill)
739
- DCL_ATTR_ACCESSOR(Info, font)
740
- DCL_ATTR_ACCESSOR(Info, format)
741
- DCL_ATTR_ACCESSOR(Info, fuzz)
742
- DCL_ATTR_ACCESSOR(Info, gravity)
743
- DCL_ATTR_ACCESSOR(Info, group)
744
- DCL_ATTR_ACCESSOR(Info, image_type)
745
- DCL_ATTR_ACCESSOR(Info, interlace)
746
- DCL_ATTR_ACCESSOR(Info, label)
747
- DCL_ATTR_ACCESSOR(Info, matte_color)
748
- DCL_ATTR_WRITER(Info, monitor)
749
- DCL_ATTR_ACCESSOR(Info, monochrome)
750
- DCL_ATTR_ACCESSOR(Info, number_scenes)
751
- DCL_ATTR_ACCESSOR(Info, orientation)
752
- DCL_ATTR_ACCESSOR(Info, origin) // new in 6.3.1
753
- DCL_ATTR_ACCESSOR(Info, page)
754
- DCL_ATTR_ACCESSOR(Info, pointsize)
755
- DCL_ATTR_ACCESSOR(Info, quality)
756
- DCL_ATTR_ACCESSOR(Info, sampling_factor)
757
- DCL_ATTR_ACCESSOR(Info, scene)
758
- DCL_ATTR_ACCESSOR(Info, server_name)
759
- DCL_ATTR_ACCESSOR(Info, size)
760
- DCL_ATTR_ACCESSOR(Info, stroke)
761
- DCL_ATTR_ACCESSOR(Info, stroke_width)
762
- DCL_ATTR_WRITER(Info, texture)
763
- DCL_ATTR_ACCESSOR(Info, tile_offset)
764
- DCL_ATTR_ACCESSOR(Info, transparent_color)
765
- DCL_ATTR_ACCESSOR(Info, undercolor)
766
- DCL_ATTR_ACCESSOR(Info, units)
767
- DCL_ATTR_ACCESSOR(Info, view)
828
+ // Define the attributes
829
+ rb_define_method(Class_Info, "antialias", Info_antialias, 0);
830
+ rb_define_method(Class_Info, "antialias=", Info_antialias_eq, 1);
831
+ rb_define_method(Class_Info, "attenuate", Info_attenuate, 0);
832
+ rb_define_method(Class_Info, "attenuate=", Info_attenuate_eq, 1);
833
+ rb_define_method(Class_Info, "authenticate", Info_authenticate, 0);
834
+ rb_define_method(Class_Info, "authenticate=", Info_authenticate_eq, 1);
835
+ rb_define_method(Class_Info, "background_color", Info_background_color, 0);
836
+ rb_define_method(Class_Info, "background_color=", Info_background_color_eq, 1);
837
+ rb_define_method(Class_Info, "border_color", Info_border_color, 0);
838
+ rb_define_method(Class_Info, "border_color=", Info_border_color_eq, 1);
839
+ rb_define_method(Class_Info, "caption", Info_caption, 0);
840
+ rb_define_method(Class_Info, "caption=", Info_caption_eq, 1);
841
+ rb_define_method(Class_Info, "colorspace", Info_colorspace, 0);
842
+ rb_define_method(Class_Info, "colorspace=", Info_colorspace_eq, 1);
843
+ rb_define_method(Class_Info, "comment", Info_comment, 0);
844
+ rb_define_method(Class_Info, "comment=", Info_comment_eq, 1);
845
+ rb_define_method(Class_Info, "compression", Info_compression, 0);
846
+ rb_define_method(Class_Info, "compression=", Info_compression_eq, 1);
847
+ rb_define_method(Class_Info, "delay", Info_delay, 0);
848
+ rb_define_method(Class_Info, "delay=", Info_delay_eq, 1);
849
+ rb_define_method(Class_Info, "density", Info_density, 0);
850
+ rb_define_method(Class_Info, "density=", Info_density_eq, 1);
851
+ rb_define_method(Class_Info, "depth", Info_depth, 0);
852
+ rb_define_method(Class_Info, "depth=", Info_depth_eq, 1);
853
+ rb_define_method(Class_Info, "dispose", Info_dispose, 0);
854
+ rb_define_method(Class_Info, "dispose=", Info_dispose_eq, 1);
855
+ rb_define_method(Class_Info, "dither", Info_dither, 0);
856
+ rb_define_method(Class_Info, "dither=", Info_dither_eq, 1);
857
+ rb_define_method(Class_Info, "endian", Info_endian, 0);
858
+ rb_define_method(Class_Info, "endian=", Info_endian_eq, 1);
859
+ rb_define_method(Class_Info, "extract", Info_extract, 0);
860
+ rb_define_method(Class_Info, "extract=", Info_extract_eq, 1);
861
+ rb_define_method(Class_Info, "filename", Info_filename, 0);
862
+ rb_define_method(Class_Info, "filename=", Info_filename_eq, 1);
863
+ rb_define_method(Class_Info, "fill", Info_fill, 0);
864
+ rb_define_method(Class_Info, "fill=", Info_fill_eq, 1);
865
+ rb_define_method(Class_Info, "font", Info_font, 0);
866
+ rb_define_method(Class_Info, "font=", Info_font_eq, 1);
867
+ rb_define_method(Class_Info, "format", Info_format, 0);
868
+ rb_define_method(Class_Info, "format=", Info_format_eq, 1);
869
+ rb_define_method(Class_Info, "fuzz", Info_fuzz, 0);
870
+ rb_define_method(Class_Info, "fuzz=", Info_fuzz_eq, 1);
871
+ rb_define_method(Class_Info, "gravity", Info_gravity, 0);
872
+ rb_define_method(Class_Info, "gravity=", Info_gravity_eq, 1);
873
+ rb_define_method(Class_Info, "image_type", Info_image_type, 0);
874
+ rb_define_method(Class_Info, "image_type=", Info_image_type_eq, 1);
875
+ rb_define_method(Class_Info, "interlace", Info_interlace, 0);
876
+ rb_define_method(Class_Info, "interlace=", Info_interlace_eq, 1);
877
+ rb_define_method(Class_Info, "label", Info_label, 0);
878
+ rb_define_method(Class_Info, "label=", Info_label_eq, 1);
879
+ rb_define_method(Class_Info, "matte_color", Info_matte_color, 0);
880
+ rb_define_method(Class_Info, "matte_color=", Info_matte_color_eq, 1);
881
+ rb_define_method(Class_Info, "monitor=", Info_monitor_eq, 1);
882
+ rb_define_method(Class_Info, "monochrome", Info_monochrome, 0);
883
+ rb_define_method(Class_Info, "monochrome=", Info_monochrome_eq, 1);
884
+ rb_define_method(Class_Info, "number_scenes", Info_number_scenes, 0);
885
+ rb_define_method(Class_Info, "number_scenes=", Info_number_scenes_eq, 1);
886
+ rb_define_method(Class_Info, "orientation", Info_orientation, 0);
887
+ rb_define_method(Class_Info, "orientation=", Info_orientation_eq, 1);
888
+ rb_define_method(Class_Info, "origin", Info_origin, 0); // new in 6.3.1
889
+ rb_define_method(Class_Info, "origin=", Info_origin_eq, 1); // new in 6.3.1
890
+ rb_define_method(Class_Info, "page", Info_page, 0);
891
+ rb_define_method(Class_Info, "page=", Info_page_eq, 1);
892
+ rb_define_method(Class_Info, "pointsize", Info_pointsize, 0);
893
+ rb_define_method(Class_Info, "pointsize=", Info_pointsize_eq, 1);
894
+ rb_define_method(Class_Info, "quality", Info_quality, 0);
895
+ rb_define_method(Class_Info, "quality=", Info_quality_eq, 1);
896
+ rb_define_method(Class_Info, "sampling_factor", Info_sampling_factor, 0);
897
+ rb_define_method(Class_Info, "sampling_factor=", Info_sampling_factor_eq, 1);
898
+ rb_define_method(Class_Info, "scene", Info_scene, 0);
899
+ rb_define_method(Class_Info, "scene=", Info_scene_eq, 1);
900
+ rb_define_method(Class_Info, "server_name", Info_server_name, 0);
901
+ rb_define_method(Class_Info, "server_name=", Info_server_name_eq, 1);
902
+ rb_define_method(Class_Info, "size", Info_size, 0);
903
+ rb_define_method(Class_Info, "size=", Info_size_eq, 1);
904
+ rb_define_method(Class_Info, "stroke", Info_stroke, 0);
905
+ rb_define_method(Class_Info, "stroke=", Info_stroke_eq, 1);
906
+ rb_define_method(Class_Info, "stroke_width", Info_stroke_width, 0);
907
+ rb_define_method(Class_Info, "stroke_width=", Info_stroke_width_eq, 1);
908
+ rb_define_method(Class_Info, "texture=", Info_texture_eq, 1);
909
+ rb_define_method(Class_Info, "tile_offset", Info_tile_offset, 0);
910
+ rb_define_method(Class_Info, "tile_offset=", Info_tile_offset_eq, 1);
911
+ rb_define_method(Class_Info, "transparent_color", Info_transparent_color, 0);
912
+ rb_define_method(Class_Info, "transparent_color=", Info_transparent_color_eq, 1);
913
+ rb_define_method(Class_Info, "undercolor", Info_undercolor, 0);
914
+ rb_define_method(Class_Info, "undercolor=", Info_undercolor_eq, 1);
915
+ rb_define_method(Class_Info, "units", Info_units, 0);
916
+ rb_define_method(Class_Info, "units=", Info_units_eq, 1);
917
+ rb_define_method(Class_Info, "view", Info_view, 0);
918
+ rb_define_method(Class_Info, "view=", Info_view_eq, 1);
768
919
 
769
920
  /*-----------------------------------------------------------------------*/
770
921
  /* Class Magick::KernelInfo */
@@ -775,9 +926,7 @@ Init_RMagick2(void)
775
926
  rb_define_alloc_func(Class_KernelInfo, KernelInfo_alloc);
776
927
 
777
928
  rb_define_method(Class_KernelInfo, "initialize", KernelInfo_initialize, 1);
778
- rb_define_method(Class_KernelInfo, "zero_nans", KernelInfo_zero_nans, 0);
779
929
  rb_define_method(Class_KernelInfo, "unity_add", KernelInfo_unity_add, 1);
780
- rb_define_method(Class_KernelInfo, "show", KernelInfo_show, 0);
781
930
  rb_define_method(Class_KernelInfo, "scale", KernelInfo_scale, 2);
782
931
  rb_define_method(Class_KernelInfo, "scale_geometry", KernelInfo_scale_geometry, 1);
783
932
  rb_define_method(Class_KernelInfo, "clone", KernelInfo_clone, 0);
@@ -796,27 +945,29 @@ Init_RMagick2(void)
796
945
 
797
946
  rb_define_method(Class_PolaroidOptions, "initialize", PolaroidOptions_initialize, 0);
798
947
 
799
- DCL_ATTR_WRITER(PolaroidOptions, shadow_color)
800
- DCL_ATTR_WRITER(PolaroidOptions, border_color)
948
+ // Define the attributes
949
+ rb_define_method(Class_PolaroidOptions, "shadow_color=", PolaroidOptions_shadow_color_eq, 1);
950
+ rb_define_method(Class_PolaroidOptions, "border_color=", PolaroidOptions_border_color_eq, 1);
951
+
801
952
  // The other attribute writer methods are implemented by Draw's functions
802
- SHARE_ATTR_WRITER(PolaroidOptions, Draw, align)
803
- SHARE_ATTR_WRITER(PolaroidOptions, Draw, decorate)
804
- SHARE_ATTR_WRITER(PolaroidOptions, Draw, density)
805
- SHARE_ATTR_WRITER(PolaroidOptions, Draw, encoding)
806
- SHARE_ATTR_WRITER(PolaroidOptions, Draw, fill)
807
- SHARE_ATTR_WRITER(PolaroidOptions, Draw, fill_pattern)
808
- SHARE_ATTR_WRITER(PolaroidOptions, Draw, font)
809
- SHARE_ATTR_WRITER(PolaroidOptions, Draw, font_family)
810
- SHARE_ATTR_WRITER(PolaroidOptions, Draw, font_stretch)
811
- SHARE_ATTR_WRITER(PolaroidOptions, Draw, font_style)
812
- SHARE_ATTR_WRITER(PolaroidOptions, Draw, font_weight)
813
- SHARE_ATTR_WRITER(PolaroidOptions, Draw, gravity)
814
- SHARE_ATTR_WRITER(PolaroidOptions, Draw, pointsize)
815
- SHARE_ATTR_WRITER(PolaroidOptions, Draw, stroke)
816
- SHARE_ATTR_WRITER(PolaroidOptions, Draw, stroke_pattern)
817
- SHARE_ATTR_WRITER(PolaroidOptions, Draw, stroke_width)
818
- SHARE_ATTR_WRITER(PolaroidOptions, Draw, text_antialias)
819
- SHARE_ATTR_WRITER(PolaroidOptions, Draw, undercolor)
953
+ rb_define_method(Class_PolaroidOptions, "align=", Draw_align_eq, 1);
954
+ rb_define_method(Class_PolaroidOptions, "decorate=", Draw_decorate_eq, 1);
955
+ rb_define_method(Class_PolaroidOptions, "density=", Draw_density_eq, 1);
956
+ rb_define_method(Class_PolaroidOptions, "encoding=", Draw_encoding_eq, 1);
957
+ rb_define_method(Class_PolaroidOptions, "fill=", Draw_fill_eq, 1);
958
+ rb_define_method(Class_PolaroidOptions, "fill_pattern=", Draw_fill_pattern_eq, 1);
959
+ rb_define_method(Class_PolaroidOptions, "font=", Draw_font_eq, 1);
960
+ rb_define_method(Class_PolaroidOptions, "font_family=", Draw_font_family_eq, 1);
961
+ rb_define_method(Class_PolaroidOptions, "font_stretch=", Draw_font_stretch_eq, 1);
962
+ rb_define_method(Class_PolaroidOptions, "font_style=", Draw_font_style_eq, 1);
963
+ rb_define_method(Class_PolaroidOptions, "font_weight=", Draw_font_weight_eq, 1);
964
+ rb_define_method(Class_PolaroidOptions, "gravity=", Draw_gravity_eq, 1);
965
+ rb_define_method(Class_PolaroidOptions, "pointsize=", Draw_pointsize_eq, 1);
966
+ rb_define_method(Class_PolaroidOptions, "stroke=", Draw_stroke_eq, 1);
967
+ rb_define_method(Class_PolaroidOptions, "stroke_pattern=", Draw_stroke_pattern_eq, 1);
968
+ rb_define_method(Class_PolaroidOptions, "stroke_width=", Draw_stroke_width_eq, 1);
969
+ rb_define_method(Class_PolaroidOptions, "text_antialias=", Draw_text_antialias_eq, 1);
970
+ rb_define_method(Class_PolaroidOptions, "undercolor=", Draw_undercolor_eq, 1);
820
971
 
821
972
 
822
973
  /*-----------------------------------------------------------------------*/
@@ -861,9 +1012,7 @@ Init_RMagick2(void)
861
1012
  DEF_CONST(QuantumRange);
862
1013
  DEF_CONST(MAGICKCORE_QUANTUM_DEPTH);
863
1014
  DEF_CONSTV(OpaqueAlpha, QuantumRange);
864
- DEF_CONST(OpaqueOpacity);
865
1015
  DEF_CONSTV(TransparentAlpha, 0);
866
- DEF_CONST(TransparentOpacity);
867
1016
 
868
1017
  version_constants();
869
1018
  features_constant();
@@ -898,7 +1047,6 @@ Init_RMagick2(void)
898
1047
  ENUMERATOR(UndefinedAlphaChannel)
899
1048
  ENUMERATOR(ActivateAlphaChannel)
900
1049
  ENUMERATOR(DeactivateAlphaChannel)
901
- ENUMERATOR(ResetAlphaChannel) /* deprecated */
902
1050
  ENUMERATOR(SetAlphaChannel)
903
1051
  ENUMERATOR(RemoveAlphaChannel)
904
1052
  ENUMERATOR(CopyAlphaChannel)
@@ -907,7 +1055,6 @@ Init_RMagick2(void)
907
1055
  ENUMERATOR(ShapeAlphaChannel)
908
1056
  ENUMERATOR(TransparentAlphaChannel)
909
1057
  ENUMERATOR(BackgroundAlphaChannel)
910
- ENUMERATOR(FlattenAlphaChannel)
911
1058
  #if defined(IMAGEMAGICK_GREATER_THAN_EQUAL_6_8_9)
912
1059
  ENUMERATOR(AssociateAlphaChannel)
913
1060
  ENUMERATOR(DisassociateAlphaChannel)
@@ -932,7 +1079,6 @@ Init_RMagick2(void)
932
1079
  ENUMERATOR(YellowChannel)
933
1080
  ENUMERATOR(OpacityChannel)
934
1081
  ENUMERATOR(BlackChannel)
935
- ENUMERATOR(MatteChannel)
936
1082
  ENUMERATOR(IndexChannel)
937
1083
  ENUMERATOR(GrayChannel)
938
1084
  ENUMERATOR(AllChannels)
@@ -969,9 +1115,7 @@ Init_RMagick2(void)
969
1115
  ENUMERATOR(HWBColorspace)
970
1116
  ENUMERATOR(HSBColorspace)
971
1117
  ENUMERATOR(LabColorspace)
972
- ENUMERATOR(Rec601LumaColorspace)
973
1118
  ENUMERATOR(Rec601YCbCrColorspace)
974
- ENUMERATOR(Rec709LumaColorspace)
975
1119
  ENUMERATOR(Rec709YCbCrColorspace)
976
1120
  ENUMERATOR(LogColorspace)
977
1121
  ENUMERATOR(CMYColorspace)
@@ -988,6 +1132,16 @@ Init_RMagick2(void)
988
1132
  ENUMERATOR(HCLpColorspace)
989
1133
  ENUMERATOR(YDbDrColorspace)
990
1134
  ENUMERATORV(XyYColorspace, xyYColorspace)
1135
+ #endif
1136
+ #if defined(IMAGEMAGICK_7)
1137
+ #if defined(IMAGEMAGICK_GREATER_THAN_EQUAL_7_0_8)
1138
+ ENUMERATOR(LinearGRAYColorspace)
1139
+ #endif
1140
+ #if defined(IMAGEMAGICK_GREATER_THAN_EQUAL_7_0_10)
1141
+ ENUMERATOR(JzazbzColorspace)
1142
+ #endif
1143
+ #elif defined(IMAGEMAGICK_GREATER_THAN_EQUAL_6_9_10)
1144
+ ENUMERATOR(LinearGRAYColorspace)
991
1145
  #endif
992
1146
  END_ENUM
993
1147
 
@@ -1019,7 +1173,6 @@ Init_RMagick2(void)
1019
1173
  ENUMERATOR(CopyCyanCompositeOp)
1020
1174
  ENUMERATOR(CopyGreenCompositeOp)
1021
1175
  ENUMERATOR(CopyMagentaCompositeOp)
1022
- ENUMERATORV(CopyAlphaCompositeOp, CopyOpacityCompositeOp)
1023
1176
  ENUMERATOR(CopyRedCompositeOp)
1024
1177
  ENUMERATOR(CopyYellowCompositeOp)
1025
1178
  ENUMERATOR(DarkenCompositeOp)
@@ -1037,9 +1190,6 @@ Init_RMagick2(void)
1037
1190
  ENUMERATOR(DissolveCompositeOp)
1038
1191
  ENUMERATOR(ExclusionCompositeOp)
1039
1192
  ENUMERATOR(HardLightCompositeOp)
1040
- #if defined(IMAGEMAGICK_GREATER_THAN_EQUAL_6_8_9)
1041
- ENUMERATOR(HardMixCompositeOp)
1042
- #endif
1043
1193
  ENUMERATOR(HueCompositeOp)
1044
1194
  ENUMERATOR(InCompositeOp)
1045
1195
  ENUMERATOR(LightenCompositeOp)
@@ -1075,6 +1225,14 @@ Init_RMagick2(void)
1075
1225
  ENUMERATOR(UndefinedCompositeOp)
1076
1226
  ENUMERATOR(VividLightCompositeOp)
1077
1227
  ENUMERATOR(XorCompositeOp)
1228
+ #if defined(IMAGEMAGICK_GREATER_THAN_EQUAL_6_8_9)
1229
+ ENUMERATOR(HardMixCompositeOp)
1230
+ #endif
1231
+ #if defined(IMAGEMAGICK_7)
1232
+ ENUMERATOR(CopyAlphaCompositeOp)
1233
+ #else
1234
+ ENUMERATORV(CopyAlphaCompositeOp, CopyOpacityCompositeOp)
1235
+ #endif
1078
1236
  END_ENUM
1079
1237
 
1080
1238
  // CompressionType constants
@@ -1207,7 +1365,6 @@ Init_RMagick2(void)
1207
1365
  ENUMERATOR(SouthWestGravity)
1208
1366
  ENUMERATOR(SouthGravity)
1209
1367
  ENUMERATOR(SouthEastGravity)
1210
- ENUMERATOR(StaticGravity)
1211
1368
  END_ENUM
1212
1369
 
1213
1370
  // ImageType constants
@@ -1215,15 +1372,23 @@ Init_RMagick2(void)
1215
1372
  ENUMERATOR(UndefinedType)
1216
1373
  ENUMERATOR(BilevelType)
1217
1374
  ENUMERATOR(GrayscaleType)
1218
- ENUMERATORV(GrayscaleAlphaType, GrayscaleMatteType)
1219
1375
  ENUMERATOR(PaletteType)
1220
- ENUMERATORV(PaletteAlphaType, PaletteMatteType)
1221
1376
  ENUMERATOR(TrueColorType)
1222
- ENUMERATORV(TrueColorAlphaType, TrueColorMatteType)
1223
1377
  ENUMERATOR(ColorSeparationType)
1224
- ENUMERATORV(ColorSeparationAlphaType, ColorSeparationMatteType)
1225
1378
  ENUMERATOR(OptimizeType)
1379
+ #if defined(IMAGEMAGICK_7)
1380
+ ENUMERATOR(GrayscaleAlphaType)
1381
+ ENUMERATOR(PaletteAlphaType)
1382
+ ENUMERATOR(TrueColorAlphaType)
1383
+ ENUMERATOR(ColorSeparationAlphaType)
1384
+ ENUMERATOR(PaletteBilevelAlphaType)
1385
+ #else
1386
+ ENUMERATORV(GrayscaleAlphaType, GrayscaleMatteType)
1387
+ ENUMERATORV(PaletteAlphaType, PaletteMatteType)
1388
+ ENUMERATORV(TrueColorAlphaType, TrueColorMatteType)
1389
+ ENUMERATORV(ColorSeparationAlphaType, ColorSeparationMatteType)
1226
1390
  ENUMERATORV(PaletteBilevelAlphaType, PaletteBilevelMatteType)
1391
+ #endif
1227
1392
  END_ENUM
1228
1393
 
1229
1394
  // InterlaceType constants
@@ -1267,18 +1432,24 @@ Init_RMagick2(void)
1267
1432
  END_ENUM
1268
1433
 
1269
1434
  DEF_ENUM(MetricType)
1270
- ENUMERATORV(UndefinedErrorMetric, UndefinedMetric)
1271
1435
  ENUMERATOR(AbsoluteErrorMetric)
1272
1436
  ENUMERATOR(MeanAbsoluteErrorMetric)
1273
- ENUMERATORV(MeanErrorPerPixelErrorMetric, MeanErrorPerPixelMetric)
1274
1437
  ENUMERATOR(MeanSquaredErrorMetric)
1275
1438
  ENUMERATOR(PeakAbsoluteErrorMetric)
1276
- ENUMERATORV(PeakSignalToNoiseRatioErrorMetric, PeakSignalToNoiseRatioMetric)
1277
1439
  ENUMERATOR(RootMeanSquaredErrorMetric)
1278
1440
  ENUMERATOR(NormalizedCrossCorrelationErrorMetric)
1279
1441
  ENUMERATOR(FuzzErrorMetric)
1280
1442
  #if defined(IMAGEMAGICK_GREATER_THAN_EQUAL_6_8_9)
1281
1443
  ENUMERATOR(PerceptualHashErrorMetric)
1444
+ #endif
1445
+ #if defined(IMAGEMAGICK_7)
1446
+ ENUMERATOR(UndefinedErrorMetric)
1447
+ ENUMERATOR(MeanErrorPerPixelErrorMetric)
1448
+ ENUMERATOR(PeakSignalToNoiseRatioErrorMetric)
1449
+ #else
1450
+ ENUMERATORV(UndefinedErrorMetric, UndefinedMetric)
1451
+ ENUMERATORV(MeanErrorPerPixelErrorMetric, MeanErrorPerPixelMetric)
1452
+ ENUMERATORV(PeakSignalToNoiseRatioErrorMetric, PeakSignalToNoiseRatioMetric)
1282
1453
  #endif
1283
1454
  END_ENUM
1284
1455
 
@@ -1319,12 +1490,14 @@ Init_RMagick2(void)
1319
1490
  DEF_ENUM(PixelInterpolateMethod)
1320
1491
  ENUMERATOR(UndefinedInterpolatePixel)
1321
1492
  ENUMERATOR(AverageInterpolatePixel)
1322
- ENUMERATOR(BicubicInterpolatePixel)
1323
1493
  ENUMERATOR(BilinearInterpolatePixel)
1324
- ENUMERATOR(FilterInterpolatePixel)
1325
1494
  ENUMERATOR(IntegerInterpolatePixel)
1326
1495
  ENUMERATOR(MeshInterpolatePixel)
1327
- ENUMERATOR(NearestNeighborInterpolatePixel)
1496
+ #if defined(IMAGEMAGICK_7)
1497
+ ENUMERATOR(NearestInterpolatePixel)
1498
+ #else
1499
+ ENUMERATORV(NearestInterpolatePixel, NearestNeighborInterpolatePixel)
1500
+ #endif
1328
1501
  ENUMERATOR(SplineInterpolatePixel)
1329
1502
  ENUMERATOR(Average9InterpolatePixel)
1330
1503
  ENUMERATOR(Average16InterpolatePixel)
@@ -1392,6 +1565,7 @@ Init_RMagick2(void)
1392
1565
  ENUMERATOR(PoissonNoiseQuantumOperator)
1393
1566
  ENUMERATOR(UniformNoiseQuantumOperator)
1394
1567
  ENUMERATOR(CosineQuantumOperator)
1568
+ ENUMERATOR(SetQuantumOperator)
1395
1569
  ENUMERATOR(SineQuantumOperator)
1396
1570
  ENUMERATOR(AddModulusQuantumOperator)
1397
1571
  ENUMERATOR(MeanQuantumOperator)
@@ -1444,7 +1618,6 @@ Init_RMagick2(void)
1444
1618
  ENUMERATOR(CharPixel)
1445
1619
  ENUMERATOR(DoublePixel)
1446
1620
  ENUMERATOR(FloatPixel)
1447
- ENUMERATOR(IntegerPixel)
1448
1621
  ENUMERATOR(LongPixel)
1449
1622
  ENUMERATOR(QuantumPixel)
1450
1623
  ENUMERATOR(ShortPixel)
@@ -1482,7 +1655,6 @@ Init_RMagick2(void)
1482
1655
  ENUMERATOR(BackgroundVirtualPixelMethod)
1483
1656
  ENUMERATOR(DitherVirtualPixelMethod)
1484
1657
  ENUMERATOR(RandomVirtualPixelMethod)
1485
- ENUMERATOR(ConstantVirtualPixelMethod)
1486
1658
  ENUMERATOR(MaskVirtualPixelMethod)
1487
1659
  ENUMERATOR(BlackVirtualPixelMethod)
1488
1660
  ENUMERATOR(GrayVirtualPixelMethod)
@@ -1612,56 +1784,52 @@ Init_RMagick2(void)
1612
1784
  // namespace. The only way to use these classes is via the Magick:: namespace.
1613
1785
 
1614
1786
  // Magick::AffineMatrix
1615
- Class_AffineMatrix = rb_struct_define(NULL, "sx", "rx", "ry", "sy", "tx", "ty", NULL);
1616
- rb_define_const(Module_Magick, "AffineMatrix", Class_AffineMatrix);
1787
+ Class_AffineMatrix = rb_struct_define_under(Module_Magick, "AffineMatrix",
1788
+ "sx", "rx", "ry", "sy", "tx", "ty", NULL);
1617
1789
 
1618
1790
  // Magick::Primary
1619
- Class_Primary = rb_struct_define(NULL, "x", "y", "z", NULL);
1791
+ Class_Primary = rb_struct_define_under(Module_Magick, "Primary",
1792
+ "x", "y", "z", NULL);
1620
1793
  rb_define_method(Class_Primary, "to_s", PrimaryInfo_to_s, 0);
1621
- rb_define_const(Module_Magick, "Primary", Class_Primary);
1622
1794
 
1623
1795
  // Magick::Chromaticity
1624
- Class_Chromaticity = rb_struct_define(NULL
1625
- , "red_primary"
1626
- , "green_primary"
1627
- , "blue_primary"
1628
- , "white_point"
1629
- , NULL);
1796
+ Class_Chromaticity = rb_struct_define_under(Module_Magick, "Chromaticity",
1797
+ "red_primary", "green_primary",
1798
+ "blue_primary", "white_point", NULL);
1630
1799
  rb_define_method(Class_Chromaticity, "to_s", ChromaticityInfo_to_s, 0);
1631
- rb_define_const(Module_Magick, "Chromaticity", Class_Chromaticity);
1632
1800
 
1633
1801
  // Magick::Color
1634
- Class_Color = rb_struct_define(NULL, "name", "compliance", "color", NULL);
1802
+ Class_Color = rb_struct_define_under(Module_Magick, "Color",
1803
+ "name", "compliance", "color", NULL);
1635
1804
  rb_define_method(Class_Color, "to_s", Color_to_s, 0);
1636
- rb_define_const(Module_Magick, "Color", Class_Color);
1637
1805
 
1638
1806
  // Magick::Point
1639
- Class_Point = rb_struct_define(NULL, "x", "y", NULL);
1640
- rb_define_const(Module_Magick, "Point", Class_Point);
1807
+ Class_Point = rb_struct_define_under(Module_Magick, "Point",
1808
+ "x", "y", NULL);
1641
1809
 
1642
1810
  // Magick::Rectangle
1643
- Class_Rectangle = rb_struct_define(NULL, "width", "height", "x", "y", NULL);
1811
+ Class_Rectangle = rb_struct_define_under(Module_Magick, "Rectangle",
1812
+ "width", "height", "x", "y", NULL);
1644
1813
  rb_define_method(Class_Rectangle, "to_s", RectangleInfo_to_s, 0);
1645
- rb_define_const(Module_Magick, "Rectangle", Class_Rectangle);
1646
1814
 
1647
1815
  // Magick::Segment
1648
- Class_Segment = rb_struct_define(NULL, "x1", "y1", "x2", "y2", NULL);
1816
+ Class_Segment = rb_struct_define_under(Module_Magick, "Segment",
1817
+ "x1", "y1", "x2", "y2", NULL);
1649
1818
  rb_define_method(Class_Segment, "to_s", SegmentInfo_to_s, 0);
1650
- rb_define_const(Module_Magick, "Segment", Class_Segment);
1651
1819
 
1652
1820
  // Magick::Font
1653
- Class_Font = rb_struct_define(NULL, "name", "description",
1654
- "family", "style", "stretch", "weight",
1655
- "encoding", "foundry", "format", NULL);
1821
+ Class_Font = rb_struct_define_under(Module_Magick, "Font",
1822
+ "name", "description",
1823
+ "family", "style", "stretch", "weight",
1824
+ "encoding", "foundry", "format", NULL);
1656
1825
  rb_define_method(Class_Font, "to_s", Font_to_s, 0);
1657
- rb_define_const(Module_Magick, "Font", Class_Font);
1658
1826
 
1659
1827
  // Magick::TypeMetric
1660
- Class_TypeMetric = rb_struct_define(NULL, "pixels_per_em", "ascent", "descent",
1661
- "width", "height", "max_advance", "bounds",
1662
- "underline_position", "underline_thickness", NULL);
1828
+ Class_TypeMetric = rb_struct_define_under(Module_Magick, "TypeMetric",
1829
+ "pixels_per_em", "ascent", "descent",
1830
+ "width", "height", "max_advance", "bounds",
1831
+ "underline_position", "underline_thickness", NULL);
1663
1832
  rb_define_method(Class_TypeMetric, "to_s", TypeMetric_to_s, 0);
1664
- rb_define_const(Module_Magick, "TypeMetric", Class_TypeMetric);
1665
1833
 
1666
1834
 
1667
1835
  /*-----------------------------------------------------------------------*/
@@ -1671,8 +1839,6 @@ Init_RMagick2(void)
1671
1839
  SetFatalErrorHandler(rm_fatal_error_handler);
1672
1840
  SetErrorHandler(rm_error_handler);
1673
1841
  SetWarningHandler(rm_warning_handler);
1674
-
1675
- RB_GC_GUARD(observable);
1676
1842
  }
1677
1843
 
1678
1844
 
@@ -1693,7 +1859,6 @@ test_Magick_version(void)
1693
1859
  {
1694
1860
  size_t version_number;
1695
1861
  const char *version_str;
1696
- int x, n;
1697
1862
  ID bypass = rb_intern("RMAGICK_BYPASS_VERSION_TEST");
1698
1863
 
1699
1864
  if (RTEST(rb_const_defined(rb_cObject, bypass)) && RTEST(rb_const_get(rb_cObject, bypass)))
@@ -1704,6 +1869,8 @@ test_Magick_version(void)
1704
1869
  version_str = GetMagickVersion(&version_number);
1705
1870
  if (version_number != MagickLibVersion)
1706
1871
  {
1872
+ int n, x;
1873
+
1707
1874
  // Extract the string "ImageMagick X.Y.Z"
1708
1875
  n = 0;
1709
1876
  for (x = 0; version_str[x] != '\0'; x++)
@@ -1715,7 +1882,8 @@ test_Magick_version(void)
1715
1882
  }
1716
1883
 
1717
1884
  rb_raise(rb_eRuntimeError,
1718
- "This installation of RMagick was configured with %s %s but %.*s is in use.\n" ,
1885
+ "This installation of RMagick was configured with %s %s but %.*s is in use.\n"
1886
+ "Please re-install RMagick to correct the issue.\n",
1719
1887
  MagickPackageName, MagickLibVersionText, x, version_str);
1720
1888
  }
1721
1889
 
@@ -1747,7 +1915,7 @@ version_constants(void)
1747
1915
  rb_obj_freeze(str);
1748
1916
  rb_define_const(Module_Magick, "Version", str);
1749
1917
 
1750
- sprintf(long_version,
1918
+ snprintf(long_version, sizeof(long_version),
1751
1919
  "This is %s ($Date: 2009/12/20 02:33:33 $) Copyright (C) 2009 by Timothy P. Hunter\n"
1752
1920
  "Built with %s\n"
1753
1921
  "Built for %s\n"