rmagick 4.1.0.rc2 → 4.2.1

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 (414) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +63 -0
  3. data/.editorconfig +3 -0
  4. data/.github/ISSUE_TEMPLATE.md +17 -0
  5. data/.github/workflows/ci.yml +108 -0
  6. data/.gitignore +3 -1
  7. data/.rspec +1 -0
  8. data/.rubocop.yml +24 -0
  9. data/.rubocop_todo.yml +151 -297
  10. data/.yardopts +5 -0
  11. data/CHANGELOG.md +96 -0
  12. data/CODE_OF_CONDUCT.md +122 -7
  13. data/CONTRIBUTING.md +14 -10
  14. data/README.md +324 -0
  15. data/Rakefile +16 -22
  16. data/before_install_linux.sh +22 -32
  17. data/before_install_osx.sh +57 -2
  18. data/ext/RMagick/extconf.rb +108 -95
  19. data/ext/RMagick/rmagick.c +77 -104
  20. data/ext/RMagick/rmagick.h +77 -70
  21. data/ext/RMagick/rmdraw.c +289 -446
  22. data/ext/RMagick/rmenum.c +96 -113
  23. data/ext/RMagick/rmfill.c +49 -77
  24. data/ext/RMagick/rmilist.c +144 -244
  25. data/ext/RMagick/rmimage.c +3407 -4166
  26. data/ext/RMagick/rminfo.c +540 -738
  27. data/ext/RMagick/rmkinfo.c +21 -87
  28. data/ext/RMagick/rmmain.c +419 -246
  29. data/ext/RMagick/rmmontage.c +60 -126
  30. data/ext/RMagick/rmpixel.c +401 -345
  31. data/ext/RMagick/rmstruct.c +62 -88
  32. data/ext/RMagick/rmutil.c +151 -228
  33. data/lib/rmagick/version.rb +1 -1
  34. data/lib/rmagick_internal.rb +128 -77
  35. data/lib/rvg/clippath.rb +2 -1
  36. data/lib/rvg/container.rb +10 -5
  37. data/lib/rvg/describable.rb +1 -1
  38. data/lib/rvg/embellishable.rb +5 -4
  39. data/lib/rvg/misc.rb +15 -12
  40. data/lib/rvg/paint.rb +2 -1
  41. data/lib/rvg/pathdata.rb +12 -11
  42. data/lib/rvg/rvg.rb +8 -4
  43. data/lib/rvg/stylable.rb +9 -7
  44. data/lib/rvg/text.rb +11 -6
  45. data/lib/rvg/transformable.rb +3 -2
  46. data/lib/rvg/units.rb +1 -1
  47. data/rmagick.gemspec +8 -6
  48. metadata +46 -421
  49. data/.appveyor.yml +0 -57
  50. data/.circleci/config.yml +0 -56
  51. data/.ruby-version +0 -1
  52. data/.simplecov +0 -27
  53. data/.travis.yml +0 -64
  54. data/Doxyfile +0 -1514
  55. data/README.textile +0 -259
  56. data/benchmarks/memory/README.md +0 -50
  57. data/benchmarks/memory/image_new.rb +0 -8
  58. data/benchmarks/memory/rmagick.gnuplot +0 -16
  59. data/doc/.cvsignore +0 -1
  60. data/doc/comtasks.html +0 -287
  61. data/doc/constants.html +0 -1581
  62. data/doc/css/doc.css +0 -299
  63. data/doc/css/popup.css +0 -34
  64. data/doc/css/ref.css +0 -67
  65. data/doc/draw.html +0 -3272
  66. data/doc/ex/InitialCoords.rb +0 -22
  67. data/doc/ex/NewCoordSys.rb +0 -30
  68. data/doc/ex/OrigCoordSys.rb +0 -16
  69. data/doc/ex/PreserveAspectRatio.rb +0 -204
  70. data/doc/ex/RotateScale.rb +0 -36
  71. data/doc/ex/Skew.rb +0 -38
  72. data/doc/ex/Use01.rb +0 -15
  73. data/doc/ex/Use02.rb +0 -20
  74. data/doc/ex/Use03.rb +0 -16
  75. data/doc/ex/ViewBox.rb +0 -31
  76. data/doc/ex/adaptive_threshold.rb +0 -9
  77. data/doc/ex/add_noise.rb +0 -16
  78. data/doc/ex/affine.rb +0 -48
  79. data/doc/ex/affine_transform.rb +0 -20
  80. data/doc/ex/arc.rb +0 -49
  81. data/doc/ex/arcpath.rb +0 -32
  82. data/doc/ex/arcs01.rb +0 -28
  83. data/doc/ex/arcs02.rb +0 -59
  84. data/doc/ex/average.rb +0 -15
  85. data/doc/ex/axes.rb +0 -64
  86. data/doc/ex/baseline_shift01.rb +0 -17
  87. data/doc/ex/bilevel_channel.rb +0 -8
  88. data/doc/ex/blur_image.rb +0 -12
  89. data/doc/ex/border.rb +0 -10
  90. data/doc/ex/bounding_box.rb +0 -42
  91. data/doc/ex/cbezier1.rb +0 -41
  92. data/doc/ex/cbezier2.rb +0 -41
  93. data/doc/ex/cbezier3.rb +0 -41
  94. data/doc/ex/cbezier4.rb +0 -42
  95. data/doc/ex/cbezier5.rb +0 -42
  96. data/doc/ex/cbezier6.rb +0 -53
  97. data/doc/ex/channel.rb +0 -25
  98. data/doc/ex/charcoal.rb +0 -12
  99. data/doc/ex/chop.rb +0 -29
  100. data/doc/ex/circle.rb +0 -33
  101. data/doc/ex/circle01.rb +0 -16
  102. data/doc/ex/clip_path.rb +0 -60
  103. data/doc/ex/coalesce.rb +0 -57
  104. data/doc/ex/color_fill_to_border.rb +0 -29
  105. data/doc/ex/color_floodfill.rb +0 -28
  106. data/doc/ex/color_histogram.rb +0 -47
  107. data/doc/ex/color_reset.rb +0 -11
  108. data/doc/ex/colorize.rb +0 -16
  109. data/doc/ex/colors.rb +0 -64
  110. data/doc/ex/compose_mask.rb +0 -22
  111. data/doc/ex/composite.rb +0 -133
  112. data/doc/ex/composite_layers.rb +0 -52
  113. data/doc/ex/composite_tiled.rb +0 -21
  114. data/doc/ex/contrast.rb +0 -36
  115. data/doc/ex/crop.rb +0 -31
  116. data/doc/ex/crop_with_gravity.rb +0 -42
  117. data/doc/ex/cubic01.rb +0 -43
  118. data/doc/ex/cubic02.rb +0 -91
  119. data/doc/ex/cycle_colormap.rb +0 -21
  120. data/doc/ex/dissolve.rb +0 -12
  121. data/doc/ex/drawcomp.rb +0 -41
  122. data/doc/ex/drop_shadow.rb +0 -60
  123. data/doc/ex/edge.rb +0 -11
  124. data/doc/ex/ellipse.rb +0 -45
  125. data/doc/ex/ellipse01.rb +0 -21
  126. data/doc/ex/emboss.rb +0 -11
  127. data/doc/ex/enhance.rb +0 -28
  128. data/doc/ex/equalize.rb +0 -11
  129. data/doc/ex/evenodd.rb +0 -42
  130. data/doc/ex/fill_pattern.rb +0 -23
  131. data/doc/ex/flatten_images.rb +0 -36
  132. data/doc/ex/flip.rb +0 -11
  133. data/doc/ex/flop.rb +0 -11
  134. data/doc/ex/font_styles.rb +0 -32
  135. data/doc/ex/fonts.rb +0 -16
  136. data/doc/ex/frame.rb +0 -12
  137. data/doc/ex/gaussian_blur.rb +0 -11
  138. data/doc/ex/get_multiline_type_metrics.rb +0 -41
  139. data/doc/ex/get_pixels.rb +0 -45
  140. data/doc/ex/get_type_metrics.rb +0 -142
  141. data/doc/ex/gradientfill.rb +0 -27
  142. data/doc/ex/grav.rb +0 -45
  143. data/doc/ex/gravity.rb +0 -78
  144. data/doc/ex/group.rb +0 -26
  145. data/doc/ex/hatchfill.rb +0 -27
  146. data/doc/ex/image.rb +0 -44
  147. data/doc/ex/images/Apple.miff +0 -0
  148. data/doc/ex/images/Ballerina.jpg +0 -0
  149. data/doc/ex/images/Ballerina3.jpg +0 -0
  150. data/doc/ex/images/Button_0.gif +0 -0
  151. data/doc/ex/images/Button_1.gif +0 -0
  152. data/doc/ex/images/Button_2.gif +0 -0
  153. data/doc/ex/images/Button_3.gif +0 -0
  154. data/doc/ex/images/Button_4.gif +0 -0
  155. data/doc/ex/images/Button_5.gif +0 -0
  156. data/doc/ex/images/Button_6.gif +0 -0
  157. data/doc/ex/images/Button_7.gif +0 -0
  158. data/doc/ex/images/Button_8.gif +0 -0
  159. data/doc/ex/images/Button_9.gif +0 -0
  160. data/doc/ex/images/Button_A.gif +0 -0
  161. data/doc/ex/images/Button_B.gif +0 -0
  162. data/doc/ex/images/Button_C.gif +0 -0
  163. data/doc/ex/images/Button_D.gif +0 -0
  164. data/doc/ex/images/Button_E.gif +0 -0
  165. data/doc/ex/images/Button_F.gif +0 -0
  166. data/doc/ex/images/Button_G.gif +0 -0
  167. data/doc/ex/images/Button_H.gif +0 -0
  168. data/doc/ex/images/Button_I.gif +0 -0
  169. data/doc/ex/images/Button_J.gif +0 -0
  170. data/doc/ex/images/Button_K.gif +0 -0
  171. data/doc/ex/images/Button_L.gif +0 -0
  172. data/doc/ex/images/Button_M.gif +0 -0
  173. data/doc/ex/images/Button_N.gif +0 -0
  174. data/doc/ex/images/Button_O.gif +0 -0
  175. data/doc/ex/images/Button_P.gif +0 -0
  176. data/doc/ex/images/Button_Q.gif +0 -0
  177. data/doc/ex/images/Button_R.gif +0 -0
  178. data/doc/ex/images/Button_S.gif +0 -0
  179. data/doc/ex/images/Button_T.gif +0 -0
  180. data/doc/ex/images/Button_U.gif +0 -0
  181. data/doc/ex/images/Button_V.gif +0 -0
  182. data/doc/ex/images/Button_W.gif +0 -0
  183. data/doc/ex/images/Button_X.gif +0 -0
  184. data/doc/ex/images/Button_Y.gif +0 -0
  185. data/doc/ex/images/Button_Z.gif +0 -0
  186. data/doc/ex/images/Cheetah.jpg +0 -0
  187. data/doc/ex/images/Coffee.png +0 -0
  188. data/doc/ex/images/Flower_Hat.jpg +0 -0
  189. data/doc/ex/images/Gold_Statue.jpg +0 -0
  190. data/doc/ex/images/Hot_Air_Balloons.jpg +0 -0
  191. data/doc/ex/images/Hot_Air_Balloons_H.jpg +0 -0
  192. data/doc/ex/images/Leaf.miff +0 -0
  193. data/doc/ex/images/No.png +0 -0
  194. data/doc/ex/images/Polynesia.jpg +0 -0
  195. data/doc/ex/images/Red_Rocks.jpg +0 -0
  196. data/doc/ex/images/Rocks_On_Beach.miff +0 -0
  197. data/doc/ex/images/Shorts.jpg +0 -0
  198. data/doc/ex/images/Snake.png +0 -0
  199. data/doc/ex/images/Violin.jpg +0 -0
  200. data/doc/ex/images/Yellow_Rose.miff +0 -0
  201. data/doc/ex/images/big-duck.gif +0 -0
  202. data/doc/ex/images/duck.gif +0 -0
  203. data/doc/ex/images/duck0.gif +0 -0
  204. data/doc/ex/images/duck1.gif +0 -0
  205. data/doc/ex/images/duck10.gif +0 -0
  206. data/doc/ex/images/duck11.gif +0 -0
  207. data/doc/ex/images/duck12.gif +0 -0
  208. data/doc/ex/images/duck13.gif +0 -0
  209. data/doc/ex/images/duck14.gif +0 -0
  210. data/doc/ex/images/duck15.gif +0 -0
  211. data/doc/ex/images/duck2.gif +0 -0
  212. data/doc/ex/images/duck3.gif +0 -0
  213. data/doc/ex/images/duck4.gif +0 -0
  214. data/doc/ex/images/duck5.gif +0 -0
  215. data/doc/ex/images/duck6.gif +0 -0
  216. data/doc/ex/images/duck7.gif +0 -0
  217. data/doc/ex/images/duck8.gif +0 -0
  218. data/doc/ex/images/duck9.gif +0 -0
  219. data/doc/ex/images/graydient230x6.gif +0 -0
  220. data/doc/ex/images/image_with_profile.jpg +0 -0
  221. data/doc/ex/images/logo400x83.gif +0 -0
  222. data/doc/ex/images/model.miff +0 -0
  223. data/doc/ex/images/notimplemented.gif +0 -0
  224. data/doc/ex/images/smile.miff +0 -0
  225. data/doc/ex/images/spin.gif +0 -0
  226. data/doc/ex/implode.rb +0 -34
  227. data/doc/ex/level.rb +0 -11
  228. data/doc/ex/level_colors.rb +0 -11
  229. data/doc/ex/line.rb +0 -41
  230. data/doc/ex/line01.rb +0 -21
  231. data/doc/ex/mask.rb +0 -35
  232. data/doc/ex/matte_fill_to_border.rb +0 -39
  233. data/doc/ex/matte_floodfill.rb +0 -32
  234. data/doc/ex/matte_replace.rb +0 -39
  235. data/doc/ex/median_filter.rb +0 -28
  236. data/doc/ex/modulate.rb +0 -11
  237. data/doc/ex/mono.rb +0 -23
  238. data/doc/ex/morph.rb +0 -25
  239. data/doc/ex/mosaic.rb +0 -37
  240. data/doc/ex/motion_blur.rb +0 -11
  241. data/doc/ex/negate.rb +0 -11
  242. data/doc/ex/negate_channel.rb +0 -9
  243. data/doc/ex/nested_rvg.rb +0 -21
  244. data/doc/ex/nonzero.rb +0 -42
  245. data/doc/ex/normalize.rb +0 -11
  246. data/doc/ex/oil_paint.rb +0 -11
  247. data/doc/ex/opacity.rb +0 -37
  248. data/doc/ex/ordered_dither.rb +0 -11
  249. data/doc/ex/path.rb +0 -63
  250. data/doc/ex/pattern1.rb +0 -25
  251. data/doc/ex/pattern2.rb +0 -26
  252. data/doc/ex/polaroid.rb +0 -26
  253. data/doc/ex/polygon.rb +0 -23
  254. data/doc/ex/polygon01.rb +0 -21
  255. data/doc/ex/polyline.rb +0 -22
  256. data/doc/ex/polyline01.rb +0 -21
  257. data/doc/ex/posterize.rb +0 -8
  258. data/doc/ex/preview.rb +0 -8
  259. data/doc/ex/qbezierpath.rb +0 -52
  260. data/doc/ex/quad01.rb +0 -34
  261. data/doc/ex/quantize-m.rb +0 -25
  262. data/doc/ex/radial_blur.rb +0 -9
  263. data/doc/ex/raise.rb +0 -8
  264. data/doc/ex/random_threshold_channel.rb +0 -13
  265. data/doc/ex/rect01.rb +0 -14
  266. data/doc/ex/rect02.rb +0 -20
  267. data/doc/ex/rectangle.rb +0 -34
  268. data/doc/ex/reduce_noise.rb +0 -28
  269. data/doc/ex/remap.rb +0 -11
  270. data/doc/ex/remap_images.rb +0 -19
  271. data/doc/ex/resize_to_fill.rb +0 -8
  272. data/doc/ex/resize_to_fit.rb +0 -8
  273. data/doc/ex/roll.rb +0 -9
  274. data/doc/ex/rotate.rb +0 -44
  275. data/doc/ex/rotate_f.rb +0 -14
  276. data/doc/ex/roundrect.rb +0 -33
  277. data/doc/ex/rubyname.rb +0 -30
  278. data/doc/ex/rvg_clippath.rb +0 -12
  279. data/doc/ex/rvg_linecap.rb +0 -42
  280. data/doc/ex/rvg_linejoin.rb +0 -40
  281. data/doc/ex/rvg_opacity.rb +0 -18
  282. data/doc/ex/rvg_pattern.rb +0 -26
  283. data/doc/ex/rvg_stroke_dasharray.rb +0 -11
  284. data/doc/ex/segment.rb +0 -11
  285. data/doc/ex/sepiatone.rb +0 -7
  286. data/doc/ex/shade.rb +0 -11
  287. data/doc/ex/shadow.rb +0 -30
  288. data/doc/ex/shave.rb +0 -15
  289. data/doc/ex/shear.rb +0 -10
  290. data/doc/ex/sketch.rb +0 -17
  291. data/doc/ex/skewx.rb +0 -51
  292. data/doc/ex/skewy.rb +0 -47
  293. data/doc/ex/smile.rb +0 -126
  294. data/doc/ex/solarize.rb +0 -11
  295. data/doc/ex/sparse_color.rb +0 -55
  296. data/doc/ex/splice.rb +0 -8
  297. data/doc/ex/spread.rb +0 -11
  298. data/doc/ex/stegano.rb +0 -54
  299. data/doc/ex/stroke_dasharray.rb +0 -42
  300. data/doc/ex/stroke_fill.rb +0 -10
  301. data/doc/ex/stroke_linecap.rb +0 -44
  302. data/doc/ex/stroke_linejoin.rb +0 -48
  303. data/doc/ex/stroke_width.rb +0 -49
  304. data/doc/ex/swirl.rb +0 -17
  305. data/doc/ex/text.rb +0 -37
  306. data/doc/ex/text01.rb +0 -16
  307. data/doc/ex/text_align.rb +0 -36
  308. data/doc/ex/text_antialias.rb +0 -37
  309. data/doc/ex/text_styles.rb +0 -19
  310. data/doc/ex/text_undercolor.rb +0 -28
  311. data/doc/ex/texture_fill_to_border.rb +0 -34
  312. data/doc/ex/texture_floodfill.rb +0 -32
  313. data/doc/ex/texturefill.rb +0 -24
  314. data/doc/ex/threshold.rb +0 -13
  315. data/doc/ex/to_blob.rb +0 -13
  316. data/doc/ex/translate.rb +0 -39
  317. data/doc/ex/transparent.rb +0 -38
  318. data/doc/ex/transpose.rb +0 -9
  319. data/doc/ex/transverse.rb +0 -9
  320. data/doc/ex/tref01.rb +0 -24
  321. data/doc/ex/triangle01.rb +0 -15
  322. data/doc/ex/trim.rb +0 -23
  323. data/doc/ex/tspan01.rb +0 -17
  324. data/doc/ex/tspan02.rb +0 -17
  325. data/doc/ex/tspan03.rb +0 -19
  326. data/doc/ex/unsharp_mask.rb +0 -28
  327. data/doc/ex/viewex.rb +0 -33
  328. data/doc/ex/vignette.rb +0 -12
  329. data/doc/ex/watermark.rb +0 -27
  330. data/doc/ex/wave.rb +0 -9
  331. data/doc/ex/wet_floor.rb +0 -58
  332. data/doc/ex/writing_mode01.rb +0 -26
  333. data/doc/ex/writing_mode02.rb +0 -26
  334. data/doc/ilist.html +0 -2056
  335. data/doc/image1.html +0 -4680
  336. data/doc/image2.html +0 -3665
  337. data/doc/image3.html +0 -4522
  338. data/doc/imageattrs.html +0 -1638
  339. data/doc/imusage.html +0 -514
  340. data/doc/index.html +0 -416
  341. data/doc/info.html +0 -1499
  342. data/doc/magick.html +0 -570
  343. data/doc/optequiv.html +0 -2435
  344. data/doc/rvg.html +0 -975
  345. data/doc/rvgclip.html +0 -248
  346. data/doc/rvggroup.html +0 -305
  347. data/doc/rvgimage.html +0 -289
  348. data/doc/rvgpattern.html +0 -475
  349. data/doc/rvgshape.html +0 -406
  350. data/doc/rvgstyle.html +0 -270
  351. data/doc/rvgtext.html +0 -465
  352. data/doc/rvgtspan.html +0 -238
  353. data/doc/rvgtut.html +0 -530
  354. data/doc/rvguse.html +0 -145
  355. data/doc/rvgxform.html +0 -294
  356. data/doc/scripts/doc.js +0 -22
  357. data/doc/scripts/stripeTables.js +0 -23
  358. data/doc/struct.html +0 -1339
  359. data/doc/usage.html +0 -1621
  360. data/examples/constitute.rb +0 -7
  361. data/examples/crop_with_gravity.rb +0 -43
  362. data/examples/demo.rb +0 -323
  363. data/examples/describe.rb +0 -41
  364. data/examples/find_similar_region.rb +0 -34
  365. data/examples/histogram.rb +0 -312
  366. data/examples/identify.rb +0 -174
  367. data/examples/image_opacity.rb +0 -28
  368. data/examples/import_export.rb +0 -31
  369. data/examples/pattern_fill.rb +0 -37
  370. data/examples/rotating_text.rb +0 -45
  371. data/examples/spinner.rb +0 -49
  372. data/examples/thumbnail.rb +0 -64
  373. data/examples/vignette.rb +0 -78
  374. data/spec/rmagick/ImageList1_spec.rb +0 -24
  375. data/spec/rmagick/draw_spec.rb +0 -155
  376. data/spec/rmagick/image/blue_shift_spec.rb +0 -14
  377. data/spec/rmagick/image/channel_entropy_spec.rb +0 -9
  378. data/spec/rmagick/image/composite_spec.rb +0 -72
  379. data/spec/rmagick/image/constitute_spec.rb +0 -13
  380. data/spec/rmagick/image/dispatch_spec.rb +0 -16
  381. data/spec/rmagick/image/dissolve_spec.rb +0 -54
  382. data/spec/rmagick/image/from_blob_spec.rb +0 -12
  383. data/spec/rmagick/image/ping_spec.rb +0 -12
  384. data/spec/rmagick/image/properties_spec.rb +0 -27
  385. data/spec/rmagick/image/read_spec.rb +0 -28
  386. data/spec/spec_helper.rb +0 -9
  387. data/spec/support/issue_200/app.rb +0 -8
  388. data/test/Draw.rb +0 -351
  389. data/test/Enum.rb +0 -228
  390. data/test/Fill.rb +0 -93
  391. data/test/Image1.rb +0 -606
  392. data/test/Image2.rb +0 -1408
  393. data/test/Image3.rb +0 -1086
  394. data/test/ImageList1.rb +0 -858
  395. data/test/ImageList2.rb +0 -375
  396. data/test/Image_attributes.rb +0 -635
  397. data/test/Import_Export.rb +0 -111
  398. data/test/Info.rb +0 -436
  399. data/test/KernelInfo.rb +0 -59
  400. data/test/Magick.rb +0 -311
  401. data/test/Pixel.rb +0 -259
  402. data/test/PolaroidOptions.rb +0 -23
  403. data/test/Preview.rb +0 -26
  404. data/test/Struct.rb +0 -45
  405. data/test/appearance/Montage.rb +0 -26
  406. data/test/appearance/appearance_assertion.rb +0 -13
  407. data/test/appearance/expected/montage_border_color.jpg +0 -0
  408. data/test/cmyk.icm +0 -0
  409. data/test/lib/internal/Draw.rb +0 -811
  410. data/test/lib/internal/Geometry.rb +0 -98
  411. data/test/lib/internal/Magick.rb +0 -40
  412. data/test/srgb.icm +0 -0
  413. data/test/test_all_basic.rb +0 -49
  414. data/test/tmpnam_test.rb +0 -50
@@ -16,7 +16,6 @@ static Image *clone_imagelist(Image *);
16
16
  static Image *images_from_imagelist(VALUE);
17
17
  static long imagelist_length(VALUE);
18
18
  static long check_imagelist_length(VALUE);
19
- static VALUE imagelist_scene_eq(VALUE, VALUE);
20
19
  static void imagelist_push(VALUE, VALUE);
21
20
  static VALUE ImageList_new(void);
22
21
 
@@ -26,17 +25,15 @@ static VALUE ImageList_new(void);
26
25
 
27
26
  /**
28
27
  * Repeatedly display the images in the images array to an XWindow screen. The
29
- * "delay" argument is the number of 1/100ths of a second (0 to 65535) to delay
28
+ * +delay+ argument is the number of 1/100ths of a second (0 to 65535) to delay
30
29
  * between images.
31
30
  *
32
- * Ruby usage:
33
- * - @verbatim ImageList#animate @endverbatim
34
- * - @verbatim ImageList#animate(delay) @endverbatim
31
+ * @overload animate
35
32
  *
36
- * @param argc number of input arguments
37
- * @param argv array of input arguments
38
- * @param self this object
39
- * @return self
33
+ * @overload animate(delay)
34
+ * @param delay [Numeric] the length of time between each image in an animation
35
+ *
36
+ * @return [Magick::ImageList] self
40
37
  */
41
38
 
42
39
  VALUE
@@ -78,12 +75,12 @@ ImageList_animate(int argc, VALUE *argv, VALUE self)
78
75
  Data_Get_Struct(info_obj, Info, info);
79
76
  #if defined(IMAGEMAGICK_7)
80
77
  exception = AcquireExceptionInfo();
81
- (void) AnimateImages(info, images, exception);
78
+ AnimateImages(info, images, exception);
82
79
  rm_split(images);
83
- CHECK_EXCEPTION()
84
- (void) DestroyExceptionInfo(exception);
80
+ CHECK_EXCEPTION();
81
+ DestroyExceptionInfo(exception);
85
82
  #else
86
- (void) AnimateImages(info, images);
83
+ AnimateImages(info, images);
87
84
  rm_split(images);
88
85
  rm_check_image_exception(images, RetainOnError);
89
86
  #endif
@@ -95,14 +92,10 @@ ImageList_animate(int argc, VALUE *argv, VALUE self)
95
92
 
96
93
 
97
94
  /**
98
- * Append all the images by calling ImageAppend.
99
- *
100
- * Ruby usage:
101
- * - @verbatim ImageList#append(stack) @endverbatim
95
+ * Append all the images
102
96
  *
103
- * @param self this object
104
- * @param stack_arg the stack of images
105
- * @return a Frame object for the result
97
+ * @param stack_arg [Magick::ImageList] the stack of images
98
+ * @return [Magick::Image] a frame object for the result
106
99
  */
107
100
  VALUE
108
101
  ImageList_append(VALUE self, VALUE stack_arg)
@@ -122,22 +115,16 @@ ImageList_append(VALUE self, VALUE stack_arg)
122
115
  new_image = AppendImages(images, stack, exception);
123
116
  rm_split(images);
124
117
  rm_check_exception(exception, new_image, DestroyOnError);
125
- (void) DestroyExceptionInfo(exception);
126
-
127
- rm_ensure_result(new_image);
118
+ DestroyExceptionInfo(exception);
128
119
 
129
120
  return rm_image_new(new_image);
130
121
  }
131
122
 
132
123
 
133
124
  /**
134
- * Average all images together by calling AverageImages.
135
- *
136
- * Ruby usage:
137
- * - @verbatim ImageList#average @endverbatim
125
+ * Average all images together
138
126
  *
139
- * @param self this object
140
- * @return a Frame object for the averaged image
127
+ * @return [Magick::Image] a frame object for the averaged image
141
128
  */
142
129
  VALUE
143
130
  ImageList_average(VALUE self)
@@ -153,26 +140,19 @@ ImageList_average(VALUE self)
153
140
 
154
141
  rm_split(images);
155
142
  rm_check_exception(exception, new_image, DestroyOnError);
156
- (void) DestroyExceptionInfo(exception);
157
-
158
- rm_ensure_result(new_image);
143
+ DestroyExceptionInfo(exception);
159
144
 
160
145
  return rm_image_new(new_image);
161
146
  }
162
147
 
163
148
 
164
149
  /**
165
- * Call CoalesceImages.
166
- *
167
- * Ruby usage:
168
- * - @verbatim ImageList#coalesce @endverbatim
150
+ * Composites a set of images while respecting any page offsets and disposal methods.
169
151
  *
170
- * Notes:
171
- * - Respects the delay, matte, and start_loop fields in each image.
152
+ * - Respects the delay, matte, and start_loop fields in each image.
172
153
  *
173
- * @param self this object
174
- * @return a new Image with the coalesced image sequence return stored in the
175
- * images array
154
+ * @return [Magick::ImageList] a new image with the coalesced image sequence return stored in the
155
+ * images array
176
156
  */
177
157
  VALUE
178
158
  ImageList_coalesce(VALUE self)
@@ -187,9 +167,7 @@ ImageList_coalesce(VALUE self)
187
167
  new_images = CoalesceImages(images, exception);
188
168
  rm_split(images);
189
169
  rm_check_exception(exception, new_images, DestroyOnError);
190
- (void) DestroyExceptionInfo(exception);
191
-
192
- rm_ensure_result(new_images);
170
+ DestroyExceptionInfo(exception);
193
171
 
194
172
  return rm_imagelist_from_images(new_images);
195
173
  }
@@ -198,24 +176,20 @@ ImageList_coalesce(VALUE self)
198
176
  /**
199
177
  * Combines the images using the specified colorspace.
200
178
  *
201
- * Ruby usage:
202
- * - @verbatim new_image = ImageList#combine @endverbatim
203
- * - @verbatim new_image = ImageList#combine(colorspace) @endverbatim
179
+ * @overload combine
204
180
  *
205
- * Notes:
206
- * - Calls CombineImages.
181
+ * @overload combine(colorspace)
182
+ * @param colorspace [Magick::ColorspaceType] the colorspace
207
183
  *
208
- * @param argc number of input arguments
209
- * @param argv array of input arguments
210
- * @param self this object
211
- * @return a new image
184
+ * @return [Magick::Image] a new image
212
185
  */
213
186
  VALUE ImageList_combine(int argc, VALUE *argv, VALUE self)
214
187
  {
215
188
  #if defined(IMAGEMAGICK_6)
216
189
  ChannelType channel;
190
+ ColorspaceType old_colorspace;
217
191
  #endif
218
- ColorspaceType colorspace, old_colorspace;
192
+ ColorspaceType colorspace;
219
193
  long len;
220
194
  Image *images, *new_image;
221
195
  ExceptionInfo *exception;
@@ -288,29 +262,24 @@ VALUE ImageList_combine(int argc, VALUE *argv, VALUE self)
288
262
  images->colorspace = old_colorspace;
289
263
  #endif
290
264
  rm_check_exception(exception, new_image, DestroyOnError);
291
- (void) DestroyExceptionInfo(exception);
292
-
293
- rm_ensure_result(new_image);
265
+ DestroyExceptionInfo(exception);
294
266
 
295
267
  return rm_image_new(new_image);
296
268
  }
297
269
 
298
270
 
299
271
  /**
300
- * Equivalent to convert's -layers composite option.
272
+ * An image from source images is composited over an image from receiver's list until one list is finished.
301
273
  *
302
- * Ruby usage:
303
- * - @verbatim ImageList#composite_layers(images) @endverbatim
304
- * - @verbatim ImageList#composite_layers(images,operator) @endverbatim
274
+ * @overload composite_layers(images)
275
+ * @param images [Magick::ImageList] the source images
305
276
  *
306
- * Notes:
307
- * - Default operator is OverCompositeOp
277
+ * @overload composite_layers(images, operator)
278
+ * - Default operator is {Magick::OverCompositeOp}
279
+ * @param images [Magick::ImageList] the source images
280
+ * @param operator [Magick::CompositeOperator] the operator
308
281
  *
309
- * @param argc number of input arguments
310
- * @param argv array of input arguments
311
- * @param self this object
312
- * @return a new imagelist
313
- * @see mogrify.c in ImageMagick
282
+ * @return [Magick::ImageList] a new imagelist
314
283
  */
315
284
  VALUE
316
285
  ImageList_composite_layers(int argc, VALUE *argv, VALUE self)
@@ -340,20 +309,20 @@ ImageList_composite_layers(int argc, VALUE *argv, VALUE self)
340
309
 
341
310
  source = images_from_imagelist(source_images);
342
311
 
343
- SetGeometry(new_images,&geometry);
344
- (void) ParseAbsoluteGeometry(new_images->geometry, &geometry);
312
+ SetGeometry(new_images, &geometry);
313
+ ParseAbsoluteGeometry(new_images->geometry, &geometry);
345
314
 
346
315
  geometry.width = source->page.width != 0 ? source->page.width : source->columns;
347
316
  geometry.height = source->page.height != 0 ? source->page.height : source->rows;
348
- GravityAdjustGeometry(new_images->page.width != 0 ? new_images->page.width : new_images->columns
349
- , new_images->page.height != 0 ? new_images->page.height : new_images->rows
350
- , new_images->gravity, &geometry);
317
+ GravityAdjustGeometry(new_images->page.width != 0 ? new_images->page.width : new_images->columns,
318
+ new_images->page.height != 0 ? new_images->page.height : new_images->rows,
319
+ new_images->gravity, &geometry);
351
320
 
352
321
  exception = AcquireExceptionInfo();
353
322
  CompositeLayers(new_images, operator, source, geometry.x, geometry.y, exception);
354
323
  rm_split(source);
355
324
  rm_check_exception(exception, new_images, DestroyOnError);
356
- (void) DestroyExceptionInfo(exception);
325
+ DestroyExceptionInfo(exception);
357
326
 
358
327
  RB_GC_GUARD(source_images);
359
328
 
@@ -365,11 +334,7 @@ ImageList_composite_layers(int argc, VALUE *argv, VALUE self)
365
334
  * Compare each image with the next in a sequence and returns the maximum
366
335
  * bounding region of any pixel differences it discovers.
367
336
  *
368
- * Ruby usage:
369
- * - @verbatim ImageList#deconstruct @endverbatim
370
- *
371
- * @param self this object
372
- * @return a new imagelist
337
+ * @return [Magick::ImageList] a new imagelist
373
338
  */
374
339
  VALUE
375
340
  ImageList_deconstruct(VALUE self)
@@ -386,9 +351,7 @@ ImageList_deconstruct(VALUE self)
386
351
  #endif
387
352
  rm_split(images);
388
353
  rm_check_exception(exception, new_images, DestroyOnError);
389
- (void) DestroyExceptionInfo(exception);
390
-
391
- rm_ensure_result(new_images);
354
+ DestroyExceptionInfo(exception);
392
355
 
393
356
  return rm_imagelist_from_images(new_images);
394
357
  }
@@ -397,11 +360,7 @@ ImageList_deconstruct(VALUE self)
397
360
  /**
398
361
  * Display all the images to an X window screen.
399
362
  *
400
- * Ruby usage:
401
- * - @verbatim ImageList#display @endverbatim
402
- *
403
- * @param self this object
404
- * @return self
363
+ * @return [Magick::ImageList] self
405
364
  */
406
365
  VALUE
407
366
  ImageList_display(VALUE self)
@@ -421,12 +380,12 @@ ImageList_display(VALUE self)
421
380
  images = images_from_imagelist(self);
422
381
  #if defined(IMAGEMAGICK_7)
423
382
  exception = AcquireExceptionInfo();
424
- (void) DisplayImages(info, images, exception);
383
+ DisplayImages(info, images, exception);
425
384
  rm_split(images);
426
385
  CHECK_EXCEPTION();
427
- (void) DestroyExceptionInfo(exception);
386
+ DestroyExceptionInfo(exception);
428
387
  #else
429
- (void) DisplayImages(info, images);
388
+ DisplayImages(info, images);
430
389
  rm_split(images);
431
390
  rm_check_image_exception(images, RetainOnError);
432
391
  #endif
@@ -440,14 +399,7 @@ ImageList_display(VALUE self)
440
399
  /**
441
400
  * Merge all the images into a single image.
442
401
  *
443
- * Ruby usage:
444
- * - @verbatim ImageList#flatten_images @endverbatim
445
- *
446
- * Notes:
447
- * - Can't use "flatten" because that's an Array method
448
- *
449
- * @param self this object
450
- * @return the new image
402
+ * @return [Magick::ImageList] the new image
451
403
  */
452
404
  VALUE
453
405
  ImageList_flatten_images(VALUE self)
@@ -462,26 +414,23 @@ ImageList_flatten_images(VALUE self)
462
414
 
463
415
  rm_split(images);
464
416
  rm_check_exception(exception, new_image, DestroyOnError);
465
- (void) DestroyExceptionInfo(exception);
466
-
467
- rm_ensure_result(new_image);
417
+ DestroyExceptionInfo(exception);
468
418
 
469
419
  return rm_image_new(new_image);
470
420
  }
471
421
 
472
422
 
473
423
  /**
474
- * Call MontageImages.
475
- *
476
- * Ruby usage:
477
- * - @verbatim ImageList#montage <{parm block}> @endverbatim
424
+ * Tile one or more thumbnails across an image canvas.
478
425
  *
479
- * Notes:
480
- * - Creates Montage object, yields to block if present in Montage object's
481
- * scope.
426
+ * @overload montage
482
427
  *
483
- * @param self this object
484
- * @return a new image list
428
+ * @overload montage
429
+ * Creates {Magick::ImageList::Montage} object, yields to block
430
+ * if present in {Magick::ImageList::Montage} object's scope.
431
+ * @yield []
432
+ *
433
+ * @return [Magick::ImageList] a new image list
485
434
  */
486
435
  VALUE
487
436
  ImageList_montage(VALUE self)
@@ -497,7 +446,15 @@ ImageList_montage(VALUE self)
497
446
  {
498
447
  // Run the block in the instance's context, allowing the app to modify the
499
448
  // object's attributes.
500
- (void) rb_obj_instance_eval(0, NULL, montage_obj);
449
+ if (rb_proc_arity(rb_block_proc()) == 0)
450
+ {
451
+ rb_warn("passing a block without an image argument is deprecated");
452
+ rb_obj_instance_eval(0, NULL, montage_obj);
453
+ }
454
+ else
455
+ {
456
+ rb_yield(montage_obj);
457
+ }
501
458
  }
502
459
 
503
460
  Data_Get_Struct(montage_obj, Montage, montage);
@@ -522,9 +479,7 @@ ImageList_montage(VALUE self)
522
479
  new_images = MontageImages(images, montage->info, exception);
523
480
  rm_split(images);
524
481
  rm_check_exception(exception, new_images, DestroyOnError);
525
- (void) DestroyExceptionInfo(exception);
526
-
527
- rm_ensure_result(new_images);
482
+ DestroyExceptionInfo(exception);
528
483
 
529
484
  RB_GC_GUARD(montage_obj);
530
485
 
@@ -534,17 +489,11 @@ ImageList_montage(VALUE self)
534
489
 
535
490
  /**
536
491
  * Requires a minimum of two images. The first image is transformed into the
537
- * second by a number of intervening images as specified by "number_images".
538
- *
539
- * Ruby usage:
540
- * - @verbatim ImageList#morph(number_images) @endverbatim
541
- *
542
- * Notes:
543
- * - Sets \@scenes to 0
492
+ * second by a number of intervening images as specified by "nimages".
544
493
  *
545
- * @param self this object
546
- * @param nimages the number of images
547
- * @return a new image list with the images array set to the morph sequence.
494
+ * @note Sets +@scenes+ to 0
495
+ * @param nimages [Numeric] the number of images
496
+ * @return [Magick::ImageList] a new image list with the images array set to the morph sequence.
548
497
  */
549
498
  VALUE
550
499
  ImageList_morph(VALUE self, VALUE nimages)
@@ -566,9 +515,7 @@ ImageList_morph(VALUE self, VALUE nimages)
566
515
  new_images = MorphImages(images, (unsigned long)number_images, exception);
567
516
  rm_split(images);
568
517
  rm_check_exception(exception, new_images, DestroyOnError);
569
- (void) DestroyExceptionInfo(exception);
570
-
571
- rm_ensure_result(new_images);
518
+ DestroyExceptionInfo(exception);
572
519
 
573
520
  return rm_imagelist_from_images(new_images);
574
521
  }
@@ -577,11 +524,7 @@ ImageList_morph(VALUE self, VALUE nimages)
577
524
  /**
578
525
  * Merge all the images into a single image.
579
526
  *
580
- * Ruby usage:
581
- * - @verbatim ImageList#mosaic @endverbatim
582
- *
583
- * @param self this object
584
- * @return the new image
527
+ * @return [Magick::Image] the new image
585
528
  */
586
529
  VALUE
587
530
  ImageList_mosaic(VALUE self)
@@ -596,23 +539,18 @@ ImageList_mosaic(VALUE self)
596
539
 
597
540
  rm_split(images);
598
541
  rm_check_exception(exception, new_image, DestroyOnError);
599
- (void) DestroyExceptionInfo(exception);
600
-
601
- rm_ensure_result(new_image);
542
+ DestroyExceptionInfo(exception);
602
543
 
603
544
  return rm_image_new(new_image);
604
545
  }
605
546
 
606
547
 
607
548
  /**
608
- * Equivalent to -layers option in ImageMagick 6.2.6.
549
+ * Optimizes or compares the images in the list.
550
+ * Equivalent to the -layers option in ImageMagick's mogrify command.
609
551
  *
610
- * Ruby usage:
611
- * - @verbatim ImageList#optimize_layers(method) @endverbatim
612
- *
613
- * @param self this object
614
- * @param method the method to use
615
- * @return a new imagelist
552
+ * @param method [Magick::LayerMethod] the method to use
553
+ * @return [Magick::ImageList] a new imagelist
616
554
  */
617
555
  VALUE
618
556
  ImageList_optimize_layers(VALUE self, VALUE method)
@@ -650,7 +588,7 @@ ImageList_optimize_layers(VALUE self, VALUE method)
650
588
  break;
651
589
  case CompositeLayer:
652
590
  rm_split(images);
653
- (void) DestroyExceptionInfo(exception);
591
+ DestroyExceptionInfo(exception);
654
592
  rb_raise(rb_eNotImpError, "Magick::CompositeLayer is not supported. Use the composite_layers method instead.");
655
593
  break;
656
594
  // In 6.3.4-ish, OptimizeImageLayer replaced OptimizeLayer
@@ -671,9 +609,9 @@ ImageList_optimize_layers(VALUE self, VALUE method)
671
609
  // mogrify supports -dither here. We don't.
672
610
  GetQuantizeInfo(&quantize_info);
673
611
  #if defined(IMAGEMAGICK_7)
674
- (void) RemapImages(&quantize_info, new_images, NULL, exception);
612
+ RemapImages(&quantize_info, new_images, NULL, exception);
675
613
  #else
676
- (void) RemapImages(&quantize_info, new_images, NULL);
614
+ RemapImages(&quantize_info, new_images, NULL);
677
615
  #endif
678
616
  break;
679
617
  case OptimizePlusLayer:
@@ -702,16 +640,14 @@ ImageList_optimize_layers(VALUE self, VALUE method)
702
640
  break;
703
641
  default:
704
642
  rm_split(images);
705
- (void) DestroyExceptionInfo(exception);
643
+ DestroyExceptionInfo(exception);
706
644
  rb_raise(rb_eArgError, "undefined layer method");
707
645
  break;
708
646
  }
709
647
 
710
648
  rm_split(images);
711
649
  rm_check_exception(exception, new_images, DestroyOnError);
712
- (void) DestroyExceptionInfo(exception);
713
-
714
- rm_ensure_result(new_images);
650
+ DestroyExceptionInfo(exception);
715
651
 
716
652
  return rm_imagelist_from_images(new_images);
717
653
  }
@@ -750,22 +686,20 @@ VALUE
750
686
  rm_imagelist_from_images(Image *images)
751
687
  {
752
688
  VALUE new_imagelist;
753
- Image *image;
754
689
 
755
- if (!images)
756
- {
757
- rb_bug("rm_imagelist_from_images called with NULL argument");
758
- }
690
+ rm_ensure_result(images);
759
691
 
760
692
  new_imagelist = ImageList_new();
761
693
 
762
694
  while (images)
763
695
  {
696
+ Image *image;
697
+
764
698
  image = RemoveFirstImageFromList(&images);
765
699
  imagelist_push(new_imagelist, rm_image_new(image));
766
700
  }
767
701
 
768
- (void) rb_iv_set(new_imagelist, "@scene", INT2FIX(0));
702
+ rb_iv_set(new_imagelist, "@scene", INT2FIX(0));
769
703
 
770
704
  RB_GC_GUARD(new_imagelist);
771
705
 
@@ -803,6 +737,9 @@ images_from_imagelist(VALUE imagelist)
803
737
  if (head == image || GetPreviousImageInList(image) != NULL)
804
738
  {
805
739
  image = rm_clone_image(image);
740
+
741
+ // Wrap raw ImageMagick object by Ruby object to destroy using Ruby's GC.
742
+ rm_image_new(image);
806
743
  }
807
744
  AppendImageToList(&head, image);
808
745
  }
@@ -814,24 +751,6 @@ images_from_imagelist(VALUE imagelist)
814
751
  }
815
752
 
816
753
 
817
- /**
818
- * \@scene attribute writer.
819
- *
820
- * No Ruby usage (internal function)
821
- *
822
- * @param imagelist the imagelist
823
- * @param scene the scene
824
- * @return the scene
825
- */
826
- static VALUE
827
- imagelist_scene_eq(VALUE imagelist, VALUE scene)
828
- {
829
- rb_check_frozen(imagelist);
830
- (void) rb_iv_set(imagelist, "@scene", scene);
831
- return scene;
832
- }
833
-
834
-
835
754
  /**
836
755
  * return the # of images in an imagelist.
837
756
  *
@@ -890,7 +809,7 @@ static void
890
809
  imagelist_push(VALUE imagelist, VALUE image)
891
810
  {
892
811
  rb_check_frozen(imagelist);
893
- (void) rb_funcall(imagelist, rm_ID_push, 1, image);
812
+ rb_funcall(imagelist, rm_ID_push, 1, image);
894
813
  }
895
814
 
896
815
 
@@ -905,7 +824,7 @@ imagelist_push(VALUE imagelist, VALUE image)
905
824
  static Image *
906
825
  clone_imagelist(Image *images)
907
826
  {
908
- Image *new_imagelist = NULL, *image, *clone;
827
+ Image *new_imagelist = NULL, *image;
909
828
  ExceptionInfo *exception;
910
829
 
911
830
  exception = AcquireExceptionInfo();
@@ -913,40 +832,31 @@ clone_imagelist(Image *images)
913
832
  image = GetFirstImageInList(images);
914
833
  while (image)
915
834
  {
835
+ Image *clone;
836
+
916
837
  clone = CloneImage(image, 0, 0, MagickTrue, exception);
917
838
  rm_check_exception(exception, new_imagelist, DestroyOnError);
918
839
  AppendImageToList(&new_imagelist, clone);
919
840
  image = GetNextImageInList(image);
920
841
  }
921
842
 
922
- (void) DestroyExceptionInfo(exception);
843
+ DestroyExceptionInfo(exception);
923
844
  return new_imagelist;
924
845
  }
925
846
 
926
847
 
927
848
  /**
928
- * Call QuantizeImages.
929
- *
930
- * Ruby usage:
931
- * - @verbatim ImageList#quantize @endverbatim
932
- * - @verbatim ImageList#quantize(number_colors) @endverbatim
933
- * - @verbatim ImageList#quantize(number_colors, colorspace) @endverbatim
934
- * - @verbatim ImageList#quantize(number_colors, colorspace, dither) @endverbatim
935
- * - @verbatim ImageList#quantize(number_colors, colorspace, dither, tree_depth) @endverbatim
936
- * - @verbatim ImageList#quantize(number_colors, colorspace, dither, tree_depth, measure_error) @endverbatim
937
- *
938
- * Notes:
939
- * - Default number_colors is 256
940
- * - Default coorspace is Magick::RGBColorsapce
941
- * - Default dither is true
942
- * - Default tree_depth is 0
943
- * - Default measure_error is false
944
- * - Sets \@scene to the same value as self.scene
945
- *
946
- * @param argc number of input arguments
947
- * @param argv array of input arguments
948
- * @param self this object
949
- * @return a new ImageList with quantized images
849
+ * Analyzes the colors within a set of reference images and chooses a fixed number of colors to represent the set.
850
+ * The goal of the algorithm is to minimize the difference between the input and output images while minimizing the processing time.
851
+ *
852
+ * @overload quantize(number_colors = 256, colorspace = Magick::RGBColorsapce, dither = true, tree_depth = 0, measure_error = false)
853
+ * @param number_colors [Numeric] the maximum number of colors to use in the output images.
854
+ * @param colorspace [Magick::ColorspaceType] the colorspace to quantize in.
855
+ * @param dither [Magick::DitherMethod, Boolean] a DitherMethod value or true if you want apply dither.
856
+ * @param tree_depth [Numeric] specify the tree depth to use while quantizing.
857
+ * @param measure_error [Boolean] calculate quantization errors when quantizing the image.
858
+ * @return [Magick::ImageList] a new ImageList with quantized images
859
+ * @note Sets +@scene+ to the same value as +self.scene+
950
860
  */
951
861
  VALUE
952
862
  ImageList_quantize(int argc, VALUE *argv, VALUE self)
@@ -971,6 +881,10 @@ ImageList_quantize(int argc, VALUE *argv, VALUE self)
971
881
  {
972
882
  VALUE_TO_ENUM(argv[2], quantize_info.dither_method, DitherMethod);
973
883
  }
884
+ else
885
+ {
886
+ quantize_info.dither_method = RTEST(argv[2]) ? UndefinedDitherMethod : NoDitherMethod;
887
+ }
974
888
  #else
975
889
  if (rb_obj_is_kind_of(argv[2], Class_DitherMethod))
976
890
  {
@@ -1004,12 +918,12 @@ ImageList_quantize(int argc, VALUE *argv, VALUE self)
1004
918
  rm_ensure_result(new_images);
1005
919
 
1006
920
  #if defined(IMAGEMAGICK_7)
1007
- (void) QuantizeImages(&quantize_info, new_images, exception);
921
+ QuantizeImages(&quantize_info, new_images, exception);
1008
922
  #else
1009
- (void) QuantizeImages(&quantize_info, new_images);
923
+ QuantizeImages(&quantize_info, new_images);
1010
924
  #endif
1011
925
  rm_check_exception(exception, new_images, DestroyOnError);
1012
- (void) DestroyExceptionInfo(exception);
926
+ DestroyExceptionInfo(exception);
1013
927
 
1014
928
  // Create new ImageList object, convert mapped image sequence to images,
1015
929
  // append to images array.
@@ -1021,7 +935,7 @@ ImageList_quantize(int argc, VALUE *argv, VALUE self)
1021
935
 
1022
936
  // Set @scene in new ImageList object to same value as in self.
1023
937
  scene = rb_iv_get(self, "@scene");
1024
- (void) rb_iv_set(new_imagelist, "@scene", scene);
938
+ rb_iv_set(new_imagelist, "@scene", scene);
1025
939
 
1026
940
  RB_GC_GUARD(new_imagelist);
1027
941
  RB_GC_GUARD(scene);
@@ -1031,22 +945,14 @@ ImageList_quantize(int argc, VALUE *argv, VALUE self)
1031
945
 
1032
946
 
1033
947
  /**
1034
- * Call RemapImages.
1035
- *
1036
- * Ruby usage:
1037
- * - @verbatim ImageList#remap @endverbatim
1038
- * - @verbatim ImageList#remap(remap_image) @endverbatim
1039
- * - @verbatim ImageList#remap(remap_image, dither_method) @endverbatim
1040
- *
1041
- * Notes:
1042
- * - Default remap_image is nil
1043
- * - Default dither_method is RiemersmaDitherMethod
1044
- * - Modifies images in-place.
1045
- *
1046
- * @param argc number of input arguments
1047
- * @param argv array of input arguments
1048
- * @param self this object
1049
- * @see Image_remap
948
+ * Reduce the colors used in the image list to the set of colors in +remap_image+.
949
+ *
950
+ * @overload remap(remap_image = nil, dither_method = Magick::RiemersmaDitherMethod)
951
+ * @param remap_image [Magick::Image, Magick::ImageList] Either an imagelist or an image. If an
952
+ * imagelist, uses the current image.
953
+ * @param dither_method [Magick::DitherMethod] a DitherMethod value.
954
+ * @return [Magick::ImageList] self
955
+ * @note Modifies images in-place.
1050
956
  */
1051
957
  VALUE
1052
958
  ImageList_remap(int argc, VALUE *argv, VALUE self)
@@ -1082,11 +988,12 @@ ImageList_remap(int argc, VALUE *argv, VALUE self)
1082
988
 
1083
989
  #if defined(IMAGEMAGICK_7)
1084
990
  exception = AcquireExceptionInfo();
1085
- (void) RemapImages(&quantize_info, images, remap_image, exception);
991
+ RemapImages(&quantize_info, images, remap_image, exception);
1086
992
  rm_split(images);
1087
- CHECK_EXCEPTION()
1088
- (void) DestroyExceptionInfo(exception);
993
+ CHECK_EXCEPTION();
994
+ DestroyExceptionInfo(exception);
1089
995
  #else
996
+ RemapImages(&quantize_info, images, remap_image);
1090
997
  rm_split(images);
1091
998
  rm_check_image_exception(images, RetainOnError);
1092
999
  #endif
@@ -1098,15 +1005,13 @@ ImageList_remap(int argc, VALUE *argv, VALUE self)
1098
1005
  /**
1099
1006
  * Return the imagelist as a blob (a String).
1100
1007
  *
1101
- * Ruby usage:
1102
- * - @verbatim ImageList#to_blob @endverbatim
1008
+ * @overload to_blob
1103
1009
  *
1104
- * Notes:
1105
- * - Runs an info parm block if present - the user can specify the image
1106
- * format and depth
1010
+ * @overload to_blob
1011
+ * Runs an info parm block if present - the user can specify the image format and depth
1012
+ * @yield []
1107
1013
  *
1108
- * @param self this object
1109
- * @return the blob
1014
+ * @return [String] the blob
1110
1015
  */
1111
1016
  VALUE
1112
1017
  ImageList_to_blob(VALUE self)
@@ -1126,7 +1031,7 @@ ImageList_to_blob(VALUE self)
1126
1031
  images = images_from_imagelist(self);
1127
1032
 
1128
1033
  exception = AcquireExceptionInfo();
1129
- (void) SetImageInfo(info, MagickTrue, exception);
1034
+ SetImageInfo(info, MagickTrue, exception);
1130
1035
  rm_check_exception(exception, images, RetainOnError);
1131
1036
 
1132
1037
  if (*info->magick != '\0')
@@ -1134,7 +1039,7 @@ ImageList_to_blob(VALUE self)
1134
1039
  Image *img;
1135
1040
  for (img = images; img; img = GetNextImageInList(img))
1136
1041
  {
1137
- strncpy(img->magick, info->magick, sizeof(info->magick)-1);
1042
+ strlcpy(img->magick, info->magick, sizeof(img->magick));
1138
1043
  }
1139
1044
  }
1140
1045
 
@@ -1155,8 +1060,8 @@ ImageList_to_blob(VALUE self)
1155
1060
  length = 0;
1156
1061
  }
1157
1062
  rm_split(images);
1158
- CHECK_EXCEPTION()
1159
- (void) DestroyExceptionInfo(exception);
1063
+ CHECK_EXCEPTION();
1064
+ DestroyExceptionInfo(exception);
1160
1065
 
1161
1066
 
1162
1067
  if (length == 0 || !blob)
@@ -1180,12 +1085,7 @@ ImageList_to_blob(VALUE self)
1180
1085
  * the images will be written as a single multi-image file. Otherwise each image
1181
1086
  * will be written to a separate file.
1182
1087
  *
1183
- * Ruby usage:
1184
- * - @verbatim ImageList#write(file) @endverbatim
1185
- *
1186
- * @param self this object
1187
- * @param file the file
1188
- * @return self
1088
+ * @param file [File, String] the file
1189
1089
  */
1190
1090
  VALUE
1191
1091
  ImageList_write(VALUE self, VALUE file)
@@ -1228,18 +1128,18 @@ ImageList_write(VALUE self, VALUE file)
1228
1128
  for (scene = 0, img = images; img; img = GetNextImageInList(img))
1229
1129
  {
1230
1130
  img->scene = scene++;
1231
- strcpy(img->filename, info->filename);
1131
+ strlcpy(img->filename, info->filename, sizeof(img->filename));
1232
1132
  }
1233
1133
 
1234
1134
  // Find out if the format supports multi-images files.
1235
1135
  exception = AcquireExceptionInfo();
1236
- (void) SetImageInfo(info, MagickTrue, exception);
1136
+ SetImageInfo(info, MagickTrue, exception);
1237
1137
  rm_check_exception(exception, images, RetainOnError);
1238
1138
 
1239
1139
  m = GetMagickInfo(info->magick, exception);
1240
1140
  rm_check_exception(exception, images, RetainOnError);
1241
1141
  #if defined(IMAGEMAGICK_6)
1242
- (void) DestroyExceptionInfo(exception);
1142
+ DestroyExceptionInfo(exception);
1243
1143
  #endif
1244
1144
 
1245
1145
  // Tell WriteImage if we want a multi-images file.
@@ -1252,10 +1152,10 @@ ImageList_write(VALUE self, VALUE file)
1252
1152
  {
1253
1153
  rm_sync_image_options(img, info);
1254
1154
  #if defined(IMAGEMAGICK_7)
1255
- (void) WriteImage(info, img, exception);
1155
+ WriteImage(info, img, exception);
1256
1156
  rm_check_exception(exception, img, RetainOnError);
1257
1157
  #else
1258
- (void) WriteImage(info, img);
1158
+ WriteImage(info, img);
1259
1159
  // images will be split before raising an exception
1260
1160
  rm_check_image_exception(images, RetainOnError);
1261
1161
  #endif
@@ -1266,7 +1166,7 @@ ImageList_write(VALUE self, VALUE file)
1266
1166
  }
1267
1167
 
1268
1168
  #if defined(IMAGEMAGICK_7)
1269
- (void) DestroyExceptionInfo(exception);
1169
+ DestroyExceptionInfo(exception);
1270
1170
  #endif
1271
1171
 
1272
1172
  rm_split(images);