rmagick 2.16.0 → 5.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (441) hide show
  1. checksums.yaml +5 -5
  2. data/.devcontainer/Dockerfile +14 -0
  3. data/.devcontainer/ImageMagick6/devcontainer.json +11 -0
  4. data/.devcontainer/devcontainer.json +11 -0
  5. data/.devcontainer/setup-repo.sh +10 -0
  6. data/.devcontainer/setup-user.sh +45 -0
  7. data/.editorconfig +3 -0
  8. data/.github/ISSUE_TEMPLATE.md +17 -0
  9. data/.github/workflows/ci.yml +157 -0
  10. data/.gitignore +9 -1
  11. data/.rspec +1 -0
  12. data/.rubocop.yml +37 -340
  13. data/.rubocop_todo.yml +456 -0
  14. data/.yardopts +5 -0
  15. data/CHANGELOG.md +536 -0
  16. data/CODE_OF_CONDUCT.md +122 -7
  17. data/CONTRIBUTING.md +37 -6
  18. data/Gemfile +18 -4
  19. data/README.md +319 -0
  20. data/Rakefile +83 -98
  21. data/before_install_linux.sh +65 -28
  22. data/before_install_osx.sh +58 -2
  23. data/ext/RMagick/extconf.rb +310 -393
  24. data/ext/RMagick/{rmagick.c → rmagick.cpp} +119 -127
  25. data/ext/RMagick/rmagick.h +290 -363
  26. data/ext/RMagick/rmagick_gvl.h +224 -0
  27. data/ext/RMagick/rmdraw.cpp +1696 -0
  28. data/ext/RMagick/rmenum.cpp +796 -0
  29. data/ext/RMagick/{rmfill.c → rmfill.cpp} +287 -197
  30. data/ext/RMagick/rmilist.cpp +1275 -0
  31. data/ext/RMagick/rmimage.cpp +16459 -0
  32. data/ext/RMagick/{rminfo.c → rminfo.cpp} +738 -910
  33. data/ext/RMagick/rmkinfo.cpp +210 -0
  34. data/ext/RMagick/rmmain.cpp +1923 -0
  35. data/ext/RMagick/rmmontage.cpp +474 -0
  36. data/ext/RMagick/rmpixel.cpp +1322 -0
  37. data/ext/RMagick/{rmstruct.c → rmstruct.cpp} +104 -284
  38. data/ext/RMagick/{rmutil.c → rmutil.cpp} +500 -433
  39. data/lib/rmagick/version.rb +5 -4
  40. data/lib/rmagick.rb +2 -0
  41. data/lib/rmagick_internal.rb +397 -459
  42. data/lib/rvg/clippath.rb +3 -4
  43. data/lib/rvg/container.rb +30 -22
  44. data/lib/rvg/deep_equal.rb +11 -11
  45. data/lib/rvg/describable.rb +2 -2
  46. data/lib/rvg/embellishable.rb +67 -68
  47. data/lib/rvg/misc.rb +139 -142
  48. data/lib/rvg/paint.rb +2 -1
  49. data/lib/rvg/pathdata.rb +7 -8
  50. data/lib/rvg/rvg.rb +49 -46
  51. data/lib/rvg/stretchable.rb +22 -28
  52. data/lib/rvg/stylable.rb +12 -10
  53. data/lib/rvg/text.rb +169 -165
  54. data/lib/rvg/transformable.rb +17 -16
  55. data/lib/rvg/units.rb +5 -5
  56. data/rmagick.gemspec +7 -41
  57. data/sig/rmagick/_draw_common_methods.rbs +64 -0
  58. data/sig/rmagick/_image_common_methods.rbs +389 -0
  59. data/sig/rmagick/draw.rbs +38 -0
  60. data/sig/rmagick/draw_attribute.rbs +28 -0
  61. data/sig/rmagick/enum.rbs +814 -0
  62. data/sig/rmagick/error.rbs +11 -0
  63. data/sig/rmagick/fill.rbs +21 -0
  64. data/sig/rmagick/geometry.rbs +14 -0
  65. data/sig/rmagick/image.rbs +194 -0
  66. data/sig/rmagick/image_list.rbs +181 -0
  67. data/sig/rmagick/iptc.rbs +101 -0
  68. data/sig/rmagick/kernel_info.rbs +12 -0
  69. data/sig/rmagick/optional_method_arguments.rbs +10 -0
  70. data/sig/rmagick/pixel.rbs +46 -0
  71. data/sig/rmagick/struct.rbs +90 -0
  72. data/sig/rmagick.rbs +43 -0
  73. data/sig/rvg/clippath.rbs +34 -0
  74. data/sig/rvg/container.rbs +78 -0
  75. data/sig/rvg/deep_equal.rbs +48 -0
  76. data/sig/rvg/describable.rbs +30 -0
  77. data/sig/rvg/embellishable.rbs +226 -0
  78. data/sig/rvg/misc.rbs +145 -0
  79. data/sig/rvg/paint.rbs +55 -0
  80. data/sig/rvg/pathdata.rbs +77 -0
  81. data/sig/rvg/rvg.rbs +125 -0
  82. data/sig/rvg/stretchable.rbs +56 -0
  83. data/sig/rvg/stylable.rbs +66 -0
  84. data/sig/rvg/text.rbs +118 -0
  85. data/sig/rvg/transformable.rbs +59 -0
  86. data/sig/rvg/units.rbs +33 -0
  87. metadata +68 -428
  88. data/.hound.yml +0 -2
  89. data/.simplecov +0 -27
  90. data/.travis.yml +0 -74
  91. data/Doxyfile +0 -1514
  92. data/README.textile +0 -251
  93. data/deprecated/RMagick.rb +0 -6
  94. data/doc/.cvsignore +0 -1
  95. data/doc/comtasks.html +0 -287
  96. data/doc/constants.html +0 -1581
  97. data/doc/css/doc.css +0 -299
  98. data/doc/css/popup.css +0 -34
  99. data/doc/css/ref.css +0 -67
  100. data/doc/draw.html +0 -3272
  101. data/doc/ex/InitialCoords.rb +0 -22
  102. data/doc/ex/NewCoordSys.rb +0 -30
  103. data/doc/ex/OrigCoordSys.rb +0 -16
  104. data/doc/ex/PreserveAspectRatio.rb +0 -204
  105. data/doc/ex/RotateScale.rb +0 -36
  106. data/doc/ex/Skew.rb +0 -38
  107. data/doc/ex/Use01.rb +0 -15
  108. data/doc/ex/Use02.rb +0 -20
  109. data/doc/ex/Use03.rb +0 -16
  110. data/doc/ex/ViewBox.rb +0 -31
  111. data/doc/ex/adaptive_threshold.rb +0 -9
  112. data/doc/ex/add_noise.rb +0 -16
  113. data/doc/ex/affine.rb +0 -48
  114. data/doc/ex/affine_transform.rb +0 -20
  115. data/doc/ex/arc.rb +0 -49
  116. data/doc/ex/arcpath.rb +0 -32
  117. data/doc/ex/arcs01.rb +0 -28
  118. data/doc/ex/arcs02.rb +0 -59
  119. data/doc/ex/average.rb +0 -15
  120. data/doc/ex/axes.rb +0 -64
  121. data/doc/ex/baseline_shift01.rb +0 -17
  122. data/doc/ex/bilevel_channel.rb +0 -8
  123. data/doc/ex/blur_image.rb +0 -12
  124. data/doc/ex/border.rb +0 -10
  125. data/doc/ex/bounding_box.rb +0 -42
  126. data/doc/ex/cbezier1.rb +0 -41
  127. data/doc/ex/cbezier2.rb +0 -41
  128. data/doc/ex/cbezier3.rb +0 -41
  129. data/doc/ex/cbezier4.rb +0 -42
  130. data/doc/ex/cbezier5.rb +0 -42
  131. data/doc/ex/cbezier6.rb +0 -53
  132. data/doc/ex/channel.rb +0 -25
  133. data/doc/ex/charcoal.rb +0 -12
  134. data/doc/ex/chop.rb +0 -29
  135. data/doc/ex/circle.rb +0 -33
  136. data/doc/ex/circle01.rb +0 -16
  137. data/doc/ex/clip_path.rb +0 -60
  138. data/doc/ex/coalesce.rb +0 -57
  139. data/doc/ex/color_fill_to_border.rb +0 -29
  140. data/doc/ex/color_floodfill.rb +0 -28
  141. data/doc/ex/color_histogram.rb +0 -47
  142. data/doc/ex/color_reset.rb +0 -11
  143. data/doc/ex/colorize.rb +0 -16
  144. data/doc/ex/colors.rb +0 -64
  145. data/doc/ex/compose_mask.rb +0 -22
  146. data/doc/ex/composite.rb +0 -133
  147. data/doc/ex/composite_layers.rb +0 -53
  148. data/doc/ex/composite_tiled.rb +0 -21
  149. data/doc/ex/contrast.rb +0 -36
  150. data/doc/ex/crop.rb +0 -31
  151. data/doc/ex/crop_with_gravity.rb +0 -42
  152. data/doc/ex/cubic01.rb +0 -43
  153. data/doc/ex/cubic02.rb +0 -91
  154. data/doc/ex/cycle_colormap.rb +0 -21
  155. data/doc/ex/dissolve.rb +0 -12
  156. data/doc/ex/drawcomp.rb +0 -42
  157. data/doc/ex/drop_shadow.rb +0 -60
  158. data/doc/ex/edge.rb +0 -11
  159. data/doc/ex/ellipse.rb +0 -45
  160. data/doc/ex/ellipse01.rb +0 -21
  161. data/doc/ex/emboss.rb +0 -11
  162. data/doc/ex/enhance.rb +0 -28
  163. data/doc/ex/equalize.rb +0 -11
  164. data/doc/ex/evenodd.rb +0 -42
  165. data/doc/ex/fill_pattern.rb +0 -23
  166. data/doc/ex/flatten_images.rb +0 -36
  167. data/doc/ex/flip.rb +0 -11
  168. data/doc/ex/flop.rb +0 -11
  169. data/doc/ex/font_styles.rb +0 -32
  170. data/doc/ex/fonts.rb +0 -20
  171. data/doc/ex/frame.rb +0 -12
  172. data/doc/ex/gaussian_blur.rb +0 -11
  173. data/doc/ex/get_multiline_type_metrics.rb +0 -41
  174. data/doc/ex/get_pixels.rb +0 -47
  175. data/doc/ex/get_type_metrics.rb +0 -141
  176. data/doc/ex/gradientfill.rb +0 -27
  177. data/doc/ex/grav.rb +0 -45
  178. data/doc/ex/gravity.rb +0 -80
  179. data/doc/ex/group.rb +0 -26
  180. data/doc/ex/hatchfill.rb +0 -27
  181. data/doc/ex/image.rb +0 -44
  182. data/doc/ex/images/Apple.miff +0 -0
  183. data/doc/ex/images/Ballerina.jpg +0 -0
  184. data/doc/ex/images/Ballerina3.jpg +0 -0
  185. data/doc/ex/images/Button_0.gif +0 -0
  186. data/doc/ex/images/Button_1.gif +0 -0
  187. data/doc/ex/images/Button_2.gif +0 -0
  188. data/doc/ex/images/Button_3.gif +0 -0
  189. data/doc/ex/images/Button_4.gif +0 -0
  190. data/doc/ex/images/Button_5.gif +0 -0
  191. data/doc/ex/images/Button_6.gif +0 -0
  192. data/doc/ex/images/Button_7.gif +0 -0
  193. data/doc/ex/images/Button_8.gif +0 -0
  194. data/doc/ex/images/Button_9.gif +0 -0
  195. data/doc/ex/images/Button_A.gif +0 -0
  196. data/doc/ex/images/Button_B.gif +0 -0
  197. data/doc/ex/images/Button_C.gif +0 -0
  198. data/doc/ex/images/Button_D.gif +0 -0
  199. data/doc/ex/images/Button_E.gif +0 -0
  200. data/doc/ex/images/Button_F.gif +0 -0
  201. data/doc/ex/images/Button_G.gif +0 -0
  202. data/doc/ex/images/Button_H.gif +0 -0
  203. data/doc/ex/images/Button_I.gif +0 -0
  204. data/doc/ex/images/Button_J.gif +0 -0
  205. data/doc/ex/images/Button_K.gif +0 -0
  206. data/doc/ex/images/Button_L.gif +0 -0
  207. data/doc/ex/images/Button_M.gif +0 -0
  208. data/doc/ex/images/Button_N.gif +0 -0
  209. data/doc/ex/images/Button_O.gif +0 -0
  210. data/doc/ex/images/Button_P.gif +0 -0
  211. data/doc/ex/images/Button_Q.gif +0 -0
  212. data/doc/ex/images/Button_R.gif +0 -0
  213. data/doc/ex/images/Button_S.gif +0 -0
  214. data/doc/ex/images/Button_T.gif +0 -0
  215. data/doc/ex/images/Button_U.gif +0 -0
  216. data/doc/ex/images/Button_V.gif +0 -0
  217. data/doc/ex/images/Button_W.gif +0 -0
  218. data/doc/ex/images/Button_X.gif +0 -0
  219. data/doc/ex/images/Button_Y.gif +0 -0
  220. data/doc/ex/images/Button_Z.gif +0 -0
  221. data/doc/ex/images/Cheetah.jpg +0 -0
  222. data/doc/ex/images/Coffee.wmf +0 -0
  223. data/doc/ex/images/Flower_Hat.jpg +0 -0
  224. data/doc/ex/images/Gold_Statue.jpg +0 -0
  225. data/doc/ex/images/Hot_Air_Balloons.jpg +0 -0
  226. data/doc/ex/images/Hot_Air_Balloons_H.jpg +0 -0
  227. data/doc/ex/images/Leaf.miff +0 -0
  228. data/doc/ex/images/No.wmf +0 -0
  229. data/doc/ex/images/Polynesia.jpg +0 -0
  230. data/doc/ex/images/Red_Rocks.jpg +0 -0
  231. data/doc/ex/images/Rocks_On_Beach.miff +0 -0
  232. data/doc/ex/images/Shorts.jpg +0 -0
  233. data/doc/ex/images/Snake.wmf +0 -0
  234. data/doc/ex/images/Violin.jpg +0 -0
  235. data/doc/ex/images/Yellow_Rose.miff +0 -0
  236. data/doc/ex/images/big-duck.gif +0 -0
  237. data/doc/ex/images/duck.gif +0 -0
  238. data/doc/ex/images/duck0.gif +0 -0
  239. data/doc/ex/images/duck1.gif +0 -0
  240. data/doc/ex/images/duck10.gif +0 -0
  241. data/doc/ex/images/duck11.gif +0 -0
  242. data/doc/ex/images/duck12.gif +0 -0
  243. data/doc/ex/images/duck13.gif +0 -0
  244. data/doc/ex/images/duck14.gif +0 -0
  245. data/doc/ex/images/duck15.gif +0 -0
  246. data/doc/ex/images/duck2.gif +0 -0
  247. data/doc/ex/images/duck3.gif +0 -0
  248. data/doc/ex/images/duck4.gif +0 -0
  249. data/doc/ex/images/duck5.gif +0 -0
  250. data/doc/ex/images/duck6.gif +0 -0
  251. data/doc/ex/images/duck7.gif +0 -0
  252. data/doc/ex/images/duck8.gif +0 -0
  253. data/doc/ex/images/duck9.gif +0 -0
  254. data/doc/ex/images/graydient230x6.gif +0 -0
  255. data/doc/ex/images/image_with_profile.jpg +0 -0
  256. data/doc/ex/images/logo400x83.gif +0 -0
  257. data/doc/ex/images/model.miff +0 -0
  258. data/doc/ex/images/notimplemented.gif +0 -0
  259. data/doc/ex/images/smile.miff +0 -0
  260. data/doc/ex/images/spin.gif +0 -0
  261. data/doc/ex/implode.rb +0 -34
  262. data/doc/ex/level.rb +0 -11
  263. data/doc/ex/level_colors.rb +0 -11
  264. data/doc/ex/line.rb +0 -41
  265. data/doc/ex/line01.rb +0 -21
  266. data/doc/ex/mask.rb +0 -35
  267. data/doc/ex/matte_fill_to_border.rb +0 -39
  268. data/doc/ex/matte_floodfill.rb +0 -32
  269. data/doc/ex/matte_replace.rb +0 -39
  270. data/doc/ex/median_filter.rb +0 -28
  271. data/doc/ex/modulate.rb +0 -11
  272. data/doc/ex/mono.rb +0 -23
  273. data/doc/ex/morph.rb +0 -25
  274. data/doc/ex/mosaic.rb +0 -35
  275. data/doc/ex/motion_blur.rb +0 -11
  276. data/doc/ex/negate.rb +0 -11
  277. data/doc/ex/negate_channel.rb +0 -9
  278. data/doc/ex/nested_rvg.rb +0 -21
  279. data/doc/ex/nonzero.rb +0 -42
  280. data/doc/ex/normalize.rb +0 -11
  281. data/doc/ex/oil_paint.rb +0 -11
  282. data/doc/ex/opacity.rb +0 -37
  283. data/doc/ex/ordered_dither.rb +0 -11
  284. data/doc/ex/path.rb +0 -63
  285. data/doc/ex/pattern1.rb +0 -25
  286. data/doc/ex/pattern2.rb +0 -26
  287. data/doc/ex/polaroid.rb +0 -27
  288. data/doc/ex/polygon.rb +0 -23
  289. data/doc/ex/polygon01.rb +0 -21
  290. data/doc/ex/polyline.rb +0 -22
  291. data/doc/ex/polyline01.rb +0 -21
  292. data/doc/ex/posterize.rb +0 -8
  293. data/doc/ex/preview.rb +0 -8
  294. data/doc/ex/qbezierpath.rb +0 -52
  295. data/doc/ex/quad01.rb +0 -34
  296. data/doc/ex/quantize-m.rb +0 -25
  297. data/doc/ex/radial_blur.rb +0 -9
  298. data/doc/ex/raise.rb +0 -8
  299. data/doc/ex/random_threshold_channel.rb +0 -13
  300. data/doc/ex/rect01.rb +0 -14
  301. data/doc/ex/rect02.rb +0 -20
  302. data/doc/ex/rectangle.rb +0 -34
  303. data/doc/ex/reduce_noise.rb +0 -28
  304. data/doc/ex/remap.rb +0 -11
  305. data/doc/ex/remap_images.rb +0 -19
  306. data/doc/ex/resize_to_fill.rb +0 -8
  307. data/doc/ex/resize_to_fit.rb +0 -8
  308. data/doc/ex/roll.rb +0 -9
  309. data/doc/ex/rotate.rb +0 -44
  310. data/doc/ex/rotate_f.rb +0 -14
  311. data/doc/ex/roundrect.rb +0 -33
  312. data/doc/ex/rubyname.rb +0 -30
  313. data/doc/ex/rvg_clippath.rb +0 -12
  314. data/doc/ex/rvg_linecap.rb +0 -42
  315. data/doc/ex/rvg_linejoin.rb +0 -40
  316. data/doc/ex/rvg_opacity.rb +0 -18
  317. data/doc/ex/rvg_pattern.rb +0 -26
  318. data/doc/ex/rvg_stroke_dasharray.rb +0 -11
  319. data/doc/ex/segment.rb +0 -11
  320. data/doc/ex/sepiatone.rb +0 -7
  321. data/doc/ex/shade.rb +0 -11
  322. data/doc/ex/shadow.rb +0 -30
  323. data/doc/ex/shave.rb +0 -15
  324. data/doc/ex/shear.rb +0 -10
  325. data/doc/ex/sketch.rb +0 -17
  326. data/doc/ex/skewx.rb +0 -51
  327. data/doc/ex/skewy.rb +0 -47
  328. data/doc/ex/smile.rb +0 -125
  329. data/doc/ex/solarize.rb +0 -11
  330. data/doc/ex/sparse_color.rb +0 -54
  331. data/doc/ex/splice.rb +0 -8
  332. data/doc/ex/spread.rb +0 -11
  333. data/doc/ex/stegano.rb +0 -55
  334. data/doc/ex/stroke_dasharray.rb +0 -42
  335. data/doc/ex/stroke_fill.rb +0 -10
  336. data/doc/ex/stroke_linecap.rb +0 -44
  337. data/doc/ex/stroke_linejoin.rb +0 -48
  338. data/doc/ex/stroke_width.rb +0 -49
  339. data/doc/ex/swirl.rb +0 -17
  340. data/doc/ex/text.rb +0 -37
  341. data/doc/ex/text01.rb +0 -16
  342. data/doc/ex/text_align.rb +0 -36
  343. data/doc/ex/text_antialias.rb +0 -37
  344. data/doc/ex/text_styles.rb +0 -19
  345. data/doc/ex/text_undercolor.rb +0 -28
  346. data/doc/ex/texture_fill_to_border.rb +0 -34
  347. data/doc/ex/texture_floodfill.rb +0 -32
  348. data/doc/ex/texturefill.rb +0 -24
  349. data/doc/ex/threshold.rb +0 -13
  350. data/doc/ex/to_blob.rb +0 -13
  351. data/doc/ex/translate.rb +0 -39
  352. data/doc/ex/transparent.rb +0 -38
  353. data/doc/ex/transpose.rb +0 -9
  354. data/doc/ex/transverse.rb +0 -9
  355. data/doc/ex/tref01.rb +0 -24
  356. data/doc/ex/triangle01.rb +0 -15
  357. data/doc/ex/trim.rb +0 -23
  358. data/doc/ex/tspan01.rb +0 -17
  359. data/doc/ex/tspan02.rb +0 -17
  360. data/doc/ex/tspan03.rb +0 -19
  361. data/doc/ex/unsharp_mask.rb +0 -28
  362. data/doc/ex/viewex.rb +0 -33
  363. data/doc/ex/vignette.rb +0 -12
  364. data/doc/ex/watermark.rb +0 -27
  365. data/doc/ex/wave.rb +0 -9
  366. data/doc/ex/wet_floor.rb +0 -58
  367. data/doc/ex/writing_mode01.rb +0 -26
  368. data/doc/ex/writing_mode02.rb +0 -26
  369. data/doc/ilist.html +0 -2056
  370. data/doc/image1.html +0 -4680
  371. data/doc/image2.html +0 -3665
  372. data/doc/image3.html +0 -4522
  373. data/doc/imageattrs.html +0 -1638
  374. data/doc/imusage.html +0 -514
  375. data/doc/index.html +0 -416
  376. data/doc/info.html +0 -1499
  377. data/doc/magick.html +0 -565
  378. data/doc/optequiv.html +0 -2435
  379. data/doc/rvg.html +0 -975
  380. data/doc/rvgclip.html +0 -248
  381. data/doc/rvggroup.html +0 -305
  382. data/doc/rvgimage.html +0 -289
  383. data/doc/rvgpattern.html +0 -475
  384. data/doc/rvgshape.html +0 -406
  385. data/doc/rvgstyle.html +0 -270
  386. data/doc/rvgtext.html +0 -465
  387. data/doc/rvgtspan.html +0 -238
  388. data/doc/rvgtut.html +0 -530
  389. data/doc/rvguse.html +0 -145
  390. data/doc/rvgxform.html +0 -294
  391. data/doc/scripts/doc.js +0 -22
  392. data/doc/scripts/stripeTables.js +0 -23
  393. data/doc/struct.html +0 -1339
  394. data/doc/usage.html +0 -1621
  395. data/examples/constitute.rb +0 -7
  396. data/examples/crop_with_gravity.rb +0 -42
  397. data/examples/demo.rb +0 -324
  398. data/examples/describe.rb +0 -43
  399. data/examples/find_similar_region.rb +0 -34
  400. data/examples/histogram.rb +0 -321
  401. data/examples/identify.rb +0 -185
  402. data/examples/image_opacity.rb +0 -29
  403. data/examples/import_export.rb +0 -31
  404. data/examples/pattern_fill.rb +0 -38
  405. data/examples/rotating_text.rb +0 -44
  406. data/examples/spinner.rb +0 -49
  407. data/examples/thumbnail.rb +0 -64
  408. data/examples/vignette.rb +0 -78
  409. data/ext/RMagick/rmdraw.c +0 -2022
  410. data/ext/RMagick/rmenum.c +0 -1235
  411. data/ext/RMagick/rmilist.c +0 -1270
  412. data/ext/RMagick/rmimage.c +0 -15427
  413. data/ext/RMagick/rmmain.c +0 -1741
  414. data/ext/RMagick/rmmontage.c +0 -519
  415. data/ext/RMagick/rmpixel.c +0 -1114
  416. data/spec/rmagick/ImageList1_spec.rb +0 -24
  417. data/spec/rmagick/draw_spec.rb +0 -156
  418. data/spec/rmagick/image/blue_shift_spec.rb +0 -16
  419. data/spec/rmagick/image/composite_spec.rb +0 -140
  420. data/spec/rmagick/image/constitute_spec.rb +0 -15
  421. data/spec/rmagick/image/dispatch_spec.rb +0 -18
  422. data/spec/rmagick/image/from_blob_spec.rb +0 -14
  423. data/spec/rmagick/image/ping_spec.rb +0 -14
  424. data/spec/rmagick/image/properties_spec.rb +0 -29
  425. data/spec/spec_helper.rb +0 -4
  426. data/test/Image1.rb +0 -565
  427. data/test/Image2.rb +0 -1304
  428. data/test/Image3.rb +0 -1030
  429. data/test/ImageList1.rb +0 -806
  430. data/test/ImageList2.rb +0 -385
  431. data/test/Image_attributes.rb +0 -697
  432. data/test/Import_Export.rb +0 -121
  433. data/test/Info.rb +0 -345
  434. data/test/Magick.rb +0 -321
  435. data/test/Pixel.rb +0 -116
  436. data/test/Preview.rb +0 -57
  437. data/test/cmyk.icm +0 -0
  438. data/test/srgb.icm +0 -0
  439. data/test/test_all_basic.rb +0 -38
  440. data/test/tmpnam_test.rb +0 -50
  441. data/wercker.yml +0 -10
data/doc/struct.html DELETED
@@ -1,1339 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
-
4
- <html xmlns="http://www.w3.org/1999/xhtml">
5
- <head>
6
- <meta name="generator" content=
7
- "HTML Tidy for Linux/x86 (vers 6 November 2007), see www.w3.org" />
8
-
9
- <title>RMagick 0.0.0: Miscellaneous classes</title>
10
- <meta http-equiv="Content-Type" content=
11
- "text/html; charset=us-ascii" />
12
- <meta name="GENERATOR" content="Quanta Plus" />
13
- <meta name="Copyright" content=
14
- "Copyright (C) 2006 by Timothy P. Hunter" />
15
- <link rel="stylesheet" type="text/css" href="css/doc.css" />
16
- <link rel="stylesheet" type="text/css" href="css/ref.css" />
17
- <script type="text/javascript" src="scripts/doc.js">
18
- </script>
19
- <style type="text/css">
20
- /*<![CDATA[*/
21
-
22
- /* Styles local to this page. */
23
-
24
-
25
- /*]]>*/
26
- </style>
27
- </head>
28
-
29
- <body>
30
- <h6 id="header">RMagick 0.0.0 User's Guide and Reference</h6>
31
-
32
- <div class="nav">
33
- &laquo;&nbsp;<a href="draw.html">Prev</a> | <a href=
34
- "index.html">Contents</a> | <a href=
35
- "info.html">Next</a>&nbsp;&raquo;
36
- </div>
37
-
38
- <h1>Miscellaneous classes</h1>
39
-
40
- <div id="toc">
41
- <h2>Table of Contents</h2>
42
-
43
- <h3><a href="#view">The Image::View class</a></h3>
44
-
45
- <ul>
46
- <li><a href="#view">Image::View</a></li>
47
- </ul>
48
-
49
- <h3><a href="#Geometry">The Geometry class</a></h3>
50
-
51
- <ul>
52
- <li><a href="#Geometry">Geometry</a></li>
53
- </ul>
54
-
55
- <h3><a href="#Pixel">The Pixel class</a></h3>
56
-
57
- <ul>
58
- <li><a href="#Pixel">Pixel</a></li>
59
- </ul>
60
-
61
- <h3><a href="#struct">Struct classes</a></h3>
62
-
63
- <ul>
64
- <li><a href="#AffineMatrix">AffineMatrix</a></li>
65
-
66
- <li><a href="#Chromaticity">Chromaticity</a></li>
67
-
68
- <li><a href="#Pixel">Pixel</a></li>
69
-
70
- <li><a href="#Point">Point</a></li>
71
-
72
- <li><a href="#Primary">Primary</a></li>
73
-
74
- <li><a href="#Rectangle">Rectangle</a></li>
75
-
76
- <li><a href="#Segment">Segment</a></li>
77
- </ul>
78
-
79
- <h3><a href="#fill">Fill classes</a></h3>
80
-
81
- <ul>
82
- <li><a href="#GradientFill">GradientFill</a></li>
83
-
84
- <li><a href="#HatchFill">HatchFill</a></li>
85
-
86
- <li><a href="#TextureFill">TextureFill</a></li>
87
- </ul>
88
-
89
- <h3><a href="#exception">Exception classes</a></h3>
90
-
91
- <ul>
92
- <li><a href="#MagickError">ImageMagickError</a></li>
93
-
94
- <li><a href=
95
- "#FatalImageMagickError">FatalImageMagickError</a></li>
96
-
97
- <li><a href=
98
- "#DestroyedImageError">DestroyedImageError</a></li>
99
- </ul>
100
- </div>
101
-
102
- <div class="subhd">
103
- <h2 id="view">The Image::View class</h2>
104
-
105
- <div class="intro">
106
- <h3>Introduction</h3>
107
-
108
- <p>A view is a rectangle in an image. Within the view pixels
109
- can be addressed by specifying their <code>[i][j]</code>
110
- coordinates. The <span class="arg">i</span>, <span class=
111
- "arg">j</span> index values can identify a single pixel or
112
- multiple pixels. Pixels can be accessed or modified
113
- individually or collectively. Pixel <em>channels</em> (that
114
- is, the red, green, blue, and opacity components) can be
115
- accessed or modified individually or collectively. The
116
- <a href="#view_sync">sync</a> method stores modified pixels
117
- back into the image.</p>
118
- </div>
119
-
120
- <h3>class Image::View <span class="superclass">&lt;
121
- Object</span></h3>
122
-
123
- <div class="sig">
124
- <h4>new</h4>
125
-
126
- <p>Image::View.new(<span class="arg">img</span>, <span class=
127
- "arg">x</span>, <span class="arg">y</span>, <span class=
128
- "arg">width</span>, <span class="arg">height</span>) -&gt;
129
- <em>view</em></p>
130
- </div>
131
-
132
- <div class="desc">
133
- <h5>Description</h5>
134
-
135
- <p>The easiest way to use an <code>Image::View</code> object
136
- is to create it with the <a href=
137
- "image3.html#view">Image#view</a> method, which provides a
138
- block-scoped view and automatic syncing. You probably won't
139
- want to create a view by calling <code>new</code>.</p>
140
-
141
- <h5>Arguments</h5>
142
-
143
- <dl>
144
- <dt>img</dt>
145
-
146
- <dd>The image from which the view is taken.</dd>
147
-
148
- <dt>x, y</dt>
149
-
150
- <dd>The x- and y-offsets of the view relative to the
151
- top-left corner of the image. Within the view, pixel
152
- addresses are relative to the top-left corner of the
153
- view.</dd>
154
-
155
- <dt>width, height</dt>
156
-
157
- <dd>The number of columns and the number of rows in the
158
- view.</dd>
159
- </dl>
160
-
161
- <p>It is an error to specify a view that exceeds the
162
- boundaries of the image.</p>
163
- </div>
164
-
165
- <div class="sig">
166
- <h4>[][]</h4>
167
-
168
- <p><span class="arg">view</span>[<span class=
169
- "arg">i</span>][<span class="arg">j</span>] -&gt;
170
- <em>pixel</em> or <em>array</em></p>
171
- </div>
172
-
173
- <div class="desc">
174
- <h5>Description</h5>
175
-
176
- <p>Return one or more pixels in the view. If i and j are each
177
- a single integer value, returns a single pixel. For any other
178
- indexes, returns an array of one or more pixels. If any index
179
- exceeds the boundaries of the view, raises
180
- <code>IndexError</code>.</p>
181
-
182
- <h5>Arguments</h5>
183
-
184
- <p>The <span class="arg">i</span> index identifies a set of
185
- rows in the view. The <span class="arg">j</span> index
186
- identifies a set of columns in the view. The pixels that are
187
- returned are the intersection of these two sets. The indexes
188
- can be:</p>
189
-
190
- <dl>
191
- <dt>omitted</dt>
192
-
193
- <dd>If <span class="arg">i</span> is omitted, all the rows
194
- are used. If <code>j</code> is omitted, all the columns are
195
- used.</dd>
196
-
197
- <dt>an integer</dt>
198
-
199
- <dd>or an object that can be converted to an integer. A
200
- single integer identifies a single row or column. Identify
201
- a single pixel by specifying integers for both indexes. If
202
- the index is negative, counts from the bottom row or right
203
- column of the view.</dd>
204
-
205
- <dt>start, length</dt>
206
-
207
- <dd>Identifies the set of <code>length</code> rows or
208
- columns starting with <code>start</code>. If
209
- <code>start</code> is negative, starts at the bottom row or
210
- right column of the view.</dd>
211
-
212
- <dt>an object that responds to <code>each</code></dt>
213
-
214
- <dd>The index may be any object that responds to
215
- <code>each</code> by returning a sequence of objects that
216
- can be converted to integers. An array with integer values
217
- or a range of integers are two examples.</dd>
218
- </dl>
219
-
220
- <h5>Examples</h5>
221
- <pre>
222
- # Get the 2nd pixel in the 4th row of the view.
223
- pixel = view[3][1] # returns a pixel
224
- # Returns an array with only one value
225
- pixels = view[[3]][[1]]
226
- # Get all the pixels in the 4th row
227
- pixels = view[3][]
228
- # Use arrays to specify a non-contiguous set of rows and columns
229
- pixels = view[[1,3,5]][[2,4,6]]
230
- # Use ranges to specify a contiguous set of rows and columns
231
- pixels = view[1..5][2..6]
232
- </pre>
233
- </div>
234
-
235
- <div class="sig">
236
- <h4>[][].red<br />
237
- [][].green<br />
238
- [][].blue<br />
239
- [][].opacity</h4>
240
-
241
- <p>[<span class="arg">i</span>][<span class=
242
- "arg">j</span>].red -&gt; <em>integer</em> or
243
- <em>array</em><br />
244
- [<span class="arg">i</span>][<span class=
245
- "arg">j</span>].green -&gt; <em>integer</em> or
246
- <em>array</em><br />
247
- [<span class="arg">i</span>][<span class="arg">j</span>].blue
248
- -&gt; <em>integer</em> or <em>array</em><br />
249
- [<span class="arg">i</span>][<span class=
250
- "arg">j</span>].opacity -&gt; <em>integer</em> or
251
- <em>array</em></p>
252
- </div>
253
-
254
- <div class="desc">
255
- <h5>Description</h5>
256
-
257
- <p>If the indexes identify a single pixel, these methods
258
- return the value of the red, green, blue, or opacity channel
259
- of that pixel. If the indexes identify more than one pixel,
260
- these methods return an array of values. See
261
- <code>[][]</code> for a description of possible index
262
- arguments.</p>
263
-
264
- <h5>Examples</h5>
265
- <pre>
266
- # Get the value of the green channel of
267
- # the top-left pixel in the view.
268
- view[0][0] = Pixel(0,128,255)
269
- g = view[0][0].green # returns 128
270
-
271
- # Get the maximum value of the red channel
272
- # for all the pixels in the top row of the view.
273
- m = view[0][].red.max
274
- </pre>
275
- </div>
276
-
277
- <div class="sig">
278
- <h4>[][]=</h4>
279
-
280
- <p><span class="arg">view</span>[<span class=
281
- "arg">i</span>][<span class="arg">j</span>] =
282
- <em>rvalue</em></p>
283
- </div>
284
-
285
- <div class="desc">
286
- <h5>Description</h5>
287
-
288
- <p>Replaces each pixel identified by the indexes with a
289
- duplicate of <span class="arg">rvalue</span>. The rvalue is
290
- either a <a href="#Pixel">Pixel</a> object or a <a href=
291
- "imusage.html#color_name">color name</a>. If
292
- <code>rvalue</code> is a color name, calls
293
- <code>Pixel.from_color</code> to create a pixel.</p>
294
-
295
- <h5>Arguments</h5>
296
-
297
- <p>The indexes are the same as <code>[][]</code>, above.</p>
298
-
299
- <dl>
300
- <dt>rvalue</dt>
301
-
302
- <dd>Either a pixel or a color name.</dd>
303
- </dl>
304
- </div>
305
-
306
- <div class="sig">
307
- <h4>[][].red=<br />
308
- [][].green=<br />
309
- [][].blue=<br />
310
- [][].opacity=</h4>
311
-
312
- <p>[<span class="arg">i</span>][<span class=
313
- "arg">j</span>].red = <em>integer</em><br />
314
- [<span class="arg">i</span>][<span class=
315
- "arg">j</span>].green = <em>integer</em><br />
316
- [<span class="arg">i</span>][<span class="arg">j</span>].blue
317
- = <em>integer</em><br />
318
- [<span class="arg">i</span>][<span class=
319
- "arg">j</span>].opacity = <em>integer</em></p>
320
- </div>
321
-
322
- <div class="desc">
323
- <h5>Description</h5>
324
-
325
- <p>Assigns <em>integer</em> to the red, green, blue, or
326
- opacity channel of the pixel or pixels identified by the
327
- indexes.</p>
328
-
329
- <h5>Examples</h5>
330
- <pre>
331
- # Set the red channel of all the pixels in the 2nd
332
- # row of the view to QuantumRange
333
- view[1][].red = QuantumRange
334
- # Set the green channel of the pixel at [20][30] to
335
- # half that of its left-hand neighbor.
336
- view[20][30].green = view[20][29].green * 0.5
337
- </pre>
338
- </div>
339
-
340
- <div id="view_sync" class="sig">
341
- <h4>sync</h4>
342
-
343
- <p><span class="arg">view</span>.sync(<span class=
344
- "arg">force</span>=<code>false</code>) -&gt;
345
- <code>true</code> or <code>false</code></p>
346
- </div>
347
-
348
- <div class="desc">
349
- <h5>Description</h5>
350
-
351
- <p>If any of the pixels in the view have been modified, this
352
- method stores them in the image. If no pixels have been
353
- modified, this method has no effect.</p>
354
-
355
- <h5>Arguments</h5>
356
-
357
- <dl>
358
- <dt>force</dt>
359
-
360
- <dd>If <code>true</code>, forces the view pixels to be
361
- stored in the image even if none have been modified.</dd>
362
- </dl>
363
-
364
- <h5>Returns</h5>Returns <code>true</code> if the pixels were
365
- stored in the image either because the <code>dirty</code>
366
- flag was <code>true</code> or <code>force</code> was
367
- <code>true</code>, <code>false</code> otherwise.
368
- </div>
369
-
370
- <div class="sig">
371
- <h4>dirty<br />
372
- dirty=</h4>
373
-
374
- <p>view.dirty -&gt; <code>true</code> or
375
- <code>false</code><br />
376
- view.dirty = <code>true</code> or <code>false</code></p>
377
- </div>
378
-
379
- <div class="desc">
380
- <h5>Description</h5>
381
-
382
- <p>Any modification to a pixel in the view causes the
383
- <code>dirty</code> attribute to be set to <code>true</code>.
384
- You can (although normally you don't need to) set
385
- <code>dirty=true</code> to force <code>sync</code> to store
386
- the pixels in the image, or set <code>dirty=false</code> to
387
- keep <code>sync</code> from storing the pixels.</p>
388
- </div>
389
-
390
- <div class="sig">
391
- <h4>x<br />
392
- y<br />
393
- width<br />
394
- height</h4>
395
-
396
- <p>x -&gt; integer<br />
397
- y -&gt; integer<br />
398
- width -&gt; integer<br />
399
- height -&gt; integer</p>
400
- </div>
401
-
402
- <div class="desc">
403
- <h5>Description</h5>
404
-
405
- <p>The <span class="arg">x</span>, <span class=
406
- "arg">y</span>, <span class="arg">width</span>, and
407
- <span class="arg">height</span> arguments specified when the
408
- view was created.</p>
409
- </div>
410
- </div>
411
-
412
- <div class="subhd" id="Geometry">
413
- <h2>The Geometry class</h2>
414
-
415
- <div class="intro">
416
- <h3>Introduction</h3>
417
-
418
- <p>The Geometry class contains the same information as an
419
- ImageMagick <a href="imusage.html#geometry">geometry
420
- string</a>. Geometry objects are interchangeable with
421
- geometry strings.</p>
422
- </div>
423
-
424
- <h3>class Geometry <span class="superclass">&lt;
425
- Object</span></h3>
426
-
427
- <div class="sig">
428
- <h4>new</h4>
429
-
430
- <p>Geometry.new(<span class="arg">width</span>=nil,
431
- <span class="arg">height</span>=nil, <span class=
432
- "arg">x</span>=nil, <span class="arg">y</span>=nil,
433
- <span class="arg">flag</span>=nil) -&gt;
434
- <em>geometry</em></p>
435
- </div>
436
-
437
- <div class="desc">
438
- <h5>Description</h5>
439
-
440
- <p>Constructs a new <code>Geometry</code> object.</p>
441
-
442
- <h5>Attributes</h5>
443
-
444
- <p>A geometry string has the general form
445
- "WxH+x+y[!@%&lt;&gt;]. In a <code>Geometry</code> object,</p>
446
-
447
- <dl>
448
- <dt>width</dt>
449
-
450
- <dd>specifies the W value</dd>
451
-
452
- <dt>height</dt>
453
-
454
- <dd>specifies the H value</dd>
455
-
456
- <dt>x, y</dt>
457
-
458
- <dd>specify the x and y values, respectively</dd>
459
-
460
- <dt>flag</dt>
461
-
462
- <dd>one of the constants shown in this table:</dd>
463
- </dl>
464
-
465
- <table summary="geometry flag constants" class=
466
- "simple_table">
467
- <caption>
468
- <strong>Geometry flag constants</strong>
469
- </caption>
470
-
471
- <tr>
472
- <td align="center"><strong>Constant<br />
473
- name</strong></td>
474
-
475
- <td align="center"><strong>Geometry<br />
476
- string flag</strong></td>
477
-
478
- <td align="center"><strong>Explanation</strong></td>
479
- </tr>
480
-
481
- <tr>
482
- <td valign="top">PercentGeometry</td>
483
-
484
- <td valign="top" align="center">%</td>
485
-
486
- <td>Normally the attributes are treated as pixels. Use
487
- this flag when the <code>width</code> and
488
- <code>height</code> attributes represent
489
- <em>percentages</em>. For example, 125x75 means 125% of
490
- the height and 75% of the width. The <code>x</code> and
491
- <code>y</code> attributes are not affected by this
492
- flag.</td>
493
- </tr>
494
-
495
- <tr>
496
- <td valign="top">AspectGeometry</td>
497
-
498
- <td valign="top" align="center">!</td>
499
-
500
- <td>Use this flag when you want to force the new image to
501
- have exactly the size specified by the the
502
- <code>width</code> and <code>height</code>
503
- attributes.</td>
504
- </tr>
505
-
506
- <tr>
507
- <td valign="top">LessGeometry</td>
508
-
509
- <td valign="top" align="center">&lt;</td>
510
-
511
- <td>Use this flag when you want to change the size of the
512
- image only if both its width and height are smaller the
513
- values specified by those attributes. The image size is
514
- changed proportionally.</td>
515
- </tr>
516
-
517
- <tr>
518
- <td valign="top">GreaterGeometry</td>
519
-
520
- <td valign="top" align="center">&gt;</td>
521
-
522
- <td>Use this flag when you want to change the size of the
523
- image if either its width and height exceed the values
524
- specified by those attributes. The image size is changed
525
- proportionally.</td>
526
- </tr>
527
-
528
- <tr>
529
- <td valign="top">AreaGeometry</td>
530
-
531
- <td valign="top" align="center">@</td>
532
-
533
- <td>This flag is useful only with a single
534
- <code>width</code> attribute. When present, it means the
535
- <code>width</code> attribute represents the total area of
536
- the image in pixels.</td>
537
- </tr>
538
-
539
- <tr>
540
- <td valign="top">MinimumGeometry</td>
541
-
542
- <td valign="top" align="center">^</td>
543
-
544
- <td class="imquote">Use ^ to set a minimum image size
545
- limit. The geometry 640x480^, for example, means the
546
- image width will not be less than 640 and the image
547
- height will not be less than 480 pixels after the resize.
548
- One of those dimensions will match the requested size,
549
- but the image will likely overflow the space requested to
550
- preserve its aspect ratio.</td>
551
- </tr>
552
- </table>
553
-
554
- <p>If any attribute is omitted the default is nil or 0.</p>
555
-
556
- <h5>Example</h5>
557
- <pre>
558
- g = Magick::Geometry.new(100,200,nil,nil,Magick::AspectGeometry)
559
- </pre>
560
- </div>
561
- </div>
562
-
563
- <div class="sig">
564
- <h4>from_s</h4>
565
-
566
- <p>Geometry.<span class="arg">from_s</span>(<span class=
567
- "arg">string</span>) -&gt; <em>geometry</em></p>
568
- </div>
569
-
570
- <div class="desc">
571
- <h5>Description</h5>
572
-
573
- <p>Constructs a new <code>Geometry</code> object from a
574
- <a href="imusage.html#geometry">geometry string</a>.</p>
575
- </div>
576
-
577
- <div class="sig">
578
- <h4>to_s</h4>
579
-
580
- <p><span class="arg">geom.</span>to_s() -&gt;
581
- <em>string</em></p>
582
- </div>
583
-
584
- <div class="desc">
585
- <h5>Description</h5>
586
-
587
- <p>Returns the string equivalent of the <code>Geometry</code>
588
- object..</p>
589
- </div>
590
-
591
- <div class="subhd" id="Pixel">
592
- <h2>The Pixel class</h2>
593
-
594
- <div class="intro">
595
- <h3>Introduction</h3>
596
-
597
- <p>A pixel describes the smallest individually addressable
598
- part of an image. In the RGB <a href=
599
- "constants.html#ColorspaceType">colorspace</a>, a pixel's
600
- color is described by its intensity in the red, green, and
601
- blue channels. Its opacity is described by its intensity in
602
- the opacity (also called alpha, or matte) channel. In the
603
- CMYK colorspace a pixel's color is described by its intensity
604
- in the cyan, magenta, yellow and black (K) channels.
605
- Intensity is a value between 0 and <a href=
606
- "constants.html#QuantumRange">QuantumRange</a>.</p>
607
-
608
- <p>Usually, RMagick methods operate on entire images or on
609
- groups of pixels that have been selected by their position or
610
- color. Some methods, such as <a href=
611
- "image2.html#pixel_color">pixel_color</a> and <a href=
612
- "image3.html#view">view</a>, operate on individual pixels or
613
- even on the RGBA (or CMYK) components thereof.</p>
614
- </div>
615
-
616
- <h3>class Pixel <span class="superclass">&lt;
617
- Object</span><br />
618
- <span class="mixin">mixes in Comparable, Observable</span></h3>
619
-
620
- <div class="sig">
621
- <h4>new</h4>
622
-
623
- <p>Pixel.new(<span class="arg">red</span>, <span class=
624
- "arg">green</span>, <span class="arg">blue</span>,
625
- <span class="arg">opacity</span>) -&gt; <em>pixel</em></p>
626
- </div>
627
-
628
- <div class="desc">
629
- <h5>Description</h5>
630
-
631
- <p>Constructs a pixel object from the specified red, green,
632
- blue, and opacity intensities. The intensity is a number
633
- between 0 and <a href=
634
- "constants.html#Miscellaneous_constants">QuantumRange</a>.</p>
635
-
636
- <h5>Attributes</h5>
637
-
638
- <dl>
639
- <dt>red, green, blue</dt>
640
-
641
- <dd>The red, green, and blue intensities of the pixel,
642
- respectively. If the colorspace is <a href=
643
- "constants.html#ColorspaceType">CMYKColorspace</a>, these
644
- attributes are interpreted as the cyan, magenta, and yellow
645
- intensities.</dd>
646
-
647
- <dt>opacity</dt>
648
-
649
- <dd>The opacity level. Higher intensities are more
650
- transparent. If the colorspace is CMYKColorspace, this
651
- attribute is interpreted as the black intensity.</dd>
652
-
653
- <dt>cyan, magenta, yellow, black</dt>
654
-
655
- <dd>These attributes are aliases for <code>red</code>,
656
- <code>green</code>, <code>blue</code>, and
657
- <code>opacity</code>, respectively.</dd>
658
- </dl>
659
- </div>
660
-
661
- <div class="sig">
662
- <h4>from_color</h4>
663
-
664
- <p>Pixel.from_color(<span class="arg">color_name</span>)
665
- -&gt; <em>pixel</em></p>
666
- </div>
667
-
668
- <div class="desc">
669
- <h5>Description</h5>
670
-
671
- <p>Constructs a new Pixel object from the <a href=
672
- "imusage.html#color_names">color name</a>. Raises
673
- ArgumentError if the name is unknown.</p>
674
- </div>
675
-
676
- <div class="sig">
677
- <h4 id="from_hsla">from_hsla</h4>
678
-
679
- <p>Pixel.from_hsla(<span class="arg">hue</span>, <span class=
680
- "arg">saturation</span>, <span class="arg">lightness</span>,
681
- <span class="arg">alpha</span>=1.0) -&gt; <em>pixel</em></p>
682
- </div>
683
-
684
- <div class="desc">
685
- <h5>Description</h5>
686
-
687
- <p>Constructs a pixel object from the specified
688
- arguments.</p>
689
-
690
- <h5>Arguments</h5>
691
-
692
- <dl>
693
- <dt>hue</dt>
694
-
695
- <dd>Either a String percentage (e.g., "25%") or a value in
696
- the range [0.0, 360.0).</dd>
697
-
698
- <dt>saturation</dt>
699
-
700
- <dd>Either a String percentage (e.g., "25%") or a value in
701
- the range [0.0, 255.0].</dd>
702
-
703
- <dt>lightness</dt>
704
-
705
- <dd>Either a String percentage (e.g., "25%") or a value in
706
- the range [0.0, 255.0].</dd>
707
-
708
- <dt>alpha</dt>
709
-
710
- <dd>Either a String percentage (e.g., "25%") or a value in
711
- the range [0.0, 1.0], where 1.0 is fully opaque and 0.0 is
712
- fully transparent. This argument may be omitted. The default
713
- is 1.0.</dd>
714
- </dl>
715
-
716
- <h5>See also</h5>
717
-
718
- <p><a href="#to_hsla">to_hsla</a></p>
719
- </div>
720
-
721
- <div class="sig">
722
- <h4 id="spaceship">&lt;=&gt;</h4>
723
-
724
- <p><span class="arg">pixel1</span> &lt;=&gt; <span class=
725
- "arg">pixel2</span> -&gt; -1, 0, <em>or</em> 1</p>
726
- </div>
727
-
728
- <div class="desc">
729
- <h5>Description</h5>
730
-
731
- <p>Returns -1, 0, or 1 depending on if <span class=
732
- "arg">pixel1</span> is "less than," equal, or "greater than"
733
- the <span class="arg">pixel2</span>.</p>
734
-
735
- <p>Since there is no way to rank order pixels, and thus
736
- determine if one pixel is "greater than" or "less than"
737
- another, this method uses an arbitrary algorithm that ensures
738
- these two conditions:</p>
739
-
740
- <ol>
741
- <li>pixels with equal RGBA (or CMYK) values compare equal,
742
- and</li>
743
-
744
- <li>comparing the same two unequal pixels always returns
745
- the same result.</li>
746
- </ol>
747
-
748
- <h5>Returns</h5>
749
-
750
- <p>-1, 0, or 1</p>
751
-
752
- <h5>See also</h5>
753
-
754
- <p><a href="#fcmp">fcmp</a></p>
755
- </div>
756
-
757
- <div class="sig">
758
- <h4 id="fcmp">fcmp</h4>
759
-
760
- <p><span class="arg">pixel</span>.fcmp(<span class=
761
- "arg">pixel</span>, <span class="arg">fuzz</span>=0.0,
762
- <span class="arg">colorspace</span>=RGBColorspace) -&gt;
763
- <code>true</code> <em>or</em> <code>false</code></p>
764
- </div>
765
-
766
- <div class="desc">
767
- <h5>Description</h5>
768
-
769
- <p>Returns true if the argument is the same color as
770
- <span class="arg">pixel</span>.</p>
771
-
772
- <h5>Arguments</h5>
773
-
774
- <dl>
775
- <dt>pixel</dt>
776
-
777
- <dd>The pixel to which the receiver is compared.</dd>
778
-
779
- <dt>fuzz</dt>
780
-
781
- <dd>The amount of fuzz to allow before the colors are
782
- considered to be different.</dd>
783
-
784
- <dt>colorspace</dt>
785
-
786
- <dd>If the pixels are in the CMYK colorspace, specify
787
- <a href=
788
- "constants.html#ColorspaceType">Magick::CMYKColorspace</a>.</dd>
789
- </dl>
790
-
791
- <h5>Returns</h5>
792
-
793
- <p><code>true</code> or <code>false</code></p>
794
-
795
- <h5>See also</h5>
796
-
797
- <p><a href="#spaceship">&lt;=&gt;</a></p>
798
- </div>
799
-
800
- <div class="sig">
801
- <h4>intensity</h4>
802
-
803
- <p><span class="arg">pixel</span>.intensity() -&gt;
804
- integer</p>
805
- </div>
806
-
807
- <div class="desc">
808
- <h5>Description</h5>
809
-
810
- <p>Returns the intensity of the pixel. The intensity is
811
- computed as 0.299*R+0.587*G+0.114*B.</p>
812
- </div>
813
-
814
- <div class="sig">
815
- <h4>to_color</h4>
816
-
817
- <p><span class="arg">pixel</span>.to_color(<span class=
818
- "arg">compliance</span>=AllCompliance, <span class=
819
- "arg">matte</span>=<code>false</code>, <span class=
820
- "arg">depth</span>=<code>QuantumDepth</code>, <span class=
821
- "arg">hex</span>=<code>false</code>) -&gt;
822
- <em>string</em></p>
823
- </div>
824
-
825
- <div class="desc">
826
- <h5>Description</h5>
827
-
828
- <p>Returns the <a href="imusage.html#color_names">color
829
- name</a> corresponding the the pixel values. If there is no
830
- such named color in the specified color standard, returns a
831
- string in the form "rgb(r,g,b,a)".</p>
832
-
833
- <h5>Arguments</h5>
834
-
835
- <dl>
836
- <dt>compliance</dt>
837
-
838
- <dd>A <a href=
839
- "constants.html#ComplianceType">ComplianceType</a>
840
- constant. The default value of AllCompliance causes
841
- <code>to_color</code> to search for a color name in any of
842
- the 3 defined color standards.</dd>
843
-
844
- <dt>matte</dt>
845
-
846
- <dd>If false, the pixel's opacity attribute is
847
- ignored.</dd>
848
-
849
- <dt>depth</dt>
850
-
851
- <dd>An image depth. The default is the quantum depth used
852
- when ImageMagick was compiled. The values 16 and 32 can be
853
- used only when ImageMagick was compiled with the
854
- appropriate QuantumDepth.</dd>
855
-
856
- <dt>hex</dt>
857
-
858
- <dd>If true, represent the color name in hex (#rrggbbaa or
859
- #rrrrggggbbbbaaaa) format. In this case <span class=
860
- "arg">compliance</span> is meaningless.</dd>
861
- </dl>
862
-
863
- <h5>See also</h5>
864
-
865
- <p>Compare this method to <a href=
866
- "image3.html#to_color">Image#to_color</a>, in which the
867
- <span class="arg">matte</span> and <span class=
868
- "arg">depth</span> values are taken from an image.</p>
869
- </div>
870
-
871
- <div class="sig">
872
- <h4 id="to_hsla">to_hsla</h4>
873
-
874
- <p><span class="arg">pixel</span>.to_HSL -&gt;
875
- <em>array</em></p>
876
- </div>
877
-
878
- <div class="desc">
879
- <h5>Description</h5>
880
-
881
- <p>Converts the RGB representation of the pixel to hue,
882
- saturation, lightness, and alpha values.</p>
883
-
884
- <h5>Returns</h5>
885
-
886
- <p>An array of the form <code>[hue, saturation, lightness,
887
- alpha]</code>. Each value is in the range specified for it,
888
- as described in <a href="#from_hsla">from_hsla</a>,
889
- above.</p>
890
- </div>
891
- </div>
892
-
893
- <div class="subhd">
894
- <h2 id="struct">Struct classes</h2>
895
-
896
- <div class="intro">
897
- <h3>Introduction</h3>
898
-
899
- <p>These classes are created by the Struct class and are used
900
- to create objects used as attribute and argument values in
901
- other RMagick classes. Like all the classes created by
902
- Struct, these classes define both getter and setter methods
903
- for their attributes. That is, for an attribute <em>x</em>
904
- both the <code>x</code> and <code>x=</code> methods are
905
- defined.</p>
906
-
907
- <p>The <code>Pixel</code> and <code>Geometry</code> classes
908
- define additional constructors and conversion methods.</p>
909
- </div>
910
-
911
- <h3 id="AffineMatrix">class AffineMatrix <span class=
912
- "superclass">&lt; Struct</span></h3>
913
-
914
- <div class="sig">
915
- <h4>new</h4>
916
-
917
- <p>AffineMatrix.new(<span class="arg">sx</span>, <span class=
918
- "arg">rx</span>, <span class="arg">ry</span>, <span class=
919
- "arg">sy</span>, <span class="arg">tx</span>, <span class=
920
- "arg">ty</span>) -&gt; <em>matrix</em></p>
921
- </div>
922
-
923
- <div class="desc">
924
- <h5>Description</h5>
925
-
926
- <p>An AffineMatrix object describes a coordinate
927
- transformation. This object is used as an argument to the
928
- <a href=
929
- "image1.html#affine_transform">Image#affine_transform</a>,
930
- <a href=
931
- "image1.html#composite_affine">Image#composite_affine</a>,
932
- and <a href="draw.html#affine_eq">Draw#affine</a>
933
- methods.</p>
934
-
935
- <h5>Attributes</h5>
936
-
937
- <dl>
938
- <dt>sx, sy</dt>
939
-
940
- <dd>The amount of scaling on the x- and y- axes.</dd>
941
-
942
- <dt>rx, ry</dt>
943
-
944
- <dd>The amount of rotation on the x- and y-axes, in
945
- radians.</dd>
946
-
947
- <dt>tx, ty</dt>
948
-
949
- <dd>The amount of translation on the x- and y-axes, in
950
- pixels.</dd>
951
- </dl>
952
- </div>
953
-
954
- <h3 id="Chromaticity">class Chromaticity <span class=
955
- "superclass">&lt; Struct</span></h3>
956
-
957
- <div class="sig">
958
- <h4>new</h4>
959
-
960
- <p>Chromaticity.new(<span class="arg">red_primary</span>,
961
- <span class="arg">green_primary</span>, <span class=
962
- "arg">blue_primary</span>, <span class=
963
- "arg">white_point</span>) -&gt; <em>chromaticity</em></p>
964
- </div>
965
-
966
- <div class="desc">
967
- <h5>Description</h5>
968
-
969
- <p>A Chromaticity object represents chromaticity values for
970
- the <a href=
971
- "imageattrs.html#chromaticity">Image#chromaticity</a>
972
- attribute.</p>
973
-
974
- <h5>Attributes</h5>
975
-
976
- <p>The attribute values are <a href="#Primary">Primary</a>
977
- objects.</p>
978
-
979
- <dl>
980
- <dt>red_primary</dt>
981
-
982
- <dd>Red primary point (e.g. red_primary.x=0.64,
983
- red_primary.y=0.33)</dd>
984
-
985
- <dt>green_primary</dt>
986
-
987
- <dd>Green primary point (e.g. green_primary.x=0.3,
988
- green_primary.y=0.6)</dd>
989
-
990
- <dt>blue_primary</dt>
991
-
992
- <dd>Blue primary point (e.g. blue_primary.x=0.15,
993
- blue_primary.y=0.06)</dd>
994
-
995
- <dt>white_point</dt>
996
-
997
- <dd>White point (e.g. white_point.x=0.3127,
998
- white_point.y=0.329)</dd>
999
- </dl>
1000
- </div>
1001
-
1002
- <h3 id="Point">class Point <span class="superclass">&lt;
1003
- Struct</span></h3>
1004
-
1005
- <div class="sig">
1006
- <h4>new</h4>
1007
-
1008
- <p>Point.new(<span class="arg">x</span>, <span class=
1009
- "arg">y</span>) -&gt; <em>point</em></p>
1010
- </div>
1011
-
1012
- <div class="desc">
1013
- <h5>Description</h5>
1014
-
1015
- <p>The value of the <code>pixels_per_em</code> attribute in
1016
- the TypeMetric struct returned by <a href=
1017
- "draw.html#get_type_metrics">Draw#get_type_metrics</a> is a
1018
- <code>Point</code> object..</p>
1019
-
1020
- <h5>Attributes</h5>
1021
-
1022
- <dl>
1023
- <dt>x</dt>
1024
-
1025
- <dd>Character width</dd>
1026
-
1027
- <dt>y</dt>
1028
-
1029
- <dd>Character height</dd>
1030
- </dl>
1031
- </div>
1032
-
1033
- <h3 id="Primary">class Primary <span class="superclass">&lt;
1034
- Struct</span></h3>
1035
-
1036
- <div class="sig">
1037
- <h4>new</h4>
1038
-
1039
- <p>Primary.new(<span class="arg">x</span>, <span class=
1040
- "arg">y</span>, <span class="arg">z</span>) -&gt;
1041
- <em>primary</em></p>
1042
- </div>
1043
-
1044
- <div class="desc">
1045
- <h5>Description</h5>
1046
-
1047
- <p>See <a href="#Chromaticity">class Chromaticity</a>.</p>
1048
-
1049
- <h5>Attributes</h5>
1050
-
1051
- <dl>
1052
- <dt>x</dt>
1053
-
1054
- <dd>X ordinate</dd>
1055
-
1056
- <dt>y</dt>
1057
-
1058
- <dd>Y ordinate</dd>
1059
-
1060
- <dt>z</dt>
1061
-
1062
- <dd>Z ordinate. This attribute is always ignored.</dd>
1063
- </dl>
1064
- </div>
1065
-
1066
- <h3 id="Rectangle">class Rectangle <span class=
1067
- "superclass">&lt; Struct</span></h3>
1068
-
1069
- <div class="sig">
1070
- <h4>new</h4>
1071
-
1072
- <p>Rectangle.new(<span class="arg">width</span>, <span class=
1073
- "arg">height</span>, <span class="arg">x</span>, <span class=
1074
- "arg">y</span>) -&gt; <em>rectangle</em></p>
1075
- </div>
1076
-
1077
- <div class="desc">
1078
- <h5>Description</h5>
1079
-
1080
- <p>The value of the <a href=
1081
- "imageattrs.html#tile_info">Image#tile_info</a> and <a href=
1082
- "imageattrs.html#bounding_box">Image#bounding_box</a>
1083
- attributes.</p>
1084
-
1085
- <h5>Attributes</h5>
1086
-
1087
- <dl>
1088
- <dt>width</dt>
1089
-
1090
- <dd>Rectangle width</dd>
1091
-
1092
- <dt>height</dt>
1093
-
1094
- <dd>Rectangle height</dd>
1095
-
1096
- <dt>x</dt>
1097
-
1098
- <dd>Offset from the left edge of the image</dd>
1099
-
1100
- <dt>y</dt>
1101
-
1102
- <dd>Offset from the top edge of the image</dd>
1103
- </dl>
1104
- </div>
1105
-
1106
- <h3 id="Segment">class Segment <span class="superclass">&lt;
1107
- Struct</span></h3>
1108
-
1109
- <div class="sig">
1110
- <h4>new</h4>
1111
-
1112
- <p>Segment.new(<span class="arg">x1</span>, <span class=
1113
- "arg">y1</span>, <span class="arg">x2</span>, <span class=
1114
- "arg">y2</span>) -&gt; <em>segment</em></p>
1115
- </div>
1116
-
1117
- <div class="desc">
1118
- <h5>Description</h5>
1119
-
1120
- <p>The value of the <code>bounds</code> attribute in the
1121
- <a href="draw.html#get_type_metrics">TypeMetric</a>
1122
- class.</p>
1123
-
1124
- <h5>Attributes</h5>
1125
-
1126
- <p><em>x1</em>, <em>y1</em>, <em>x2</em>, <em>y2</em></p>
1127
- </div>
1128
- </div>
1129
-
1130
- <div class="subhd">
1131
- <h2 id="fill">Fill classes</h2>
1132
- </div>
1133
-
1134
- <div class="intro">
1135
- <h3>Introduction</h3>
1136
-
1137
- <p>The <a href="image1.html#new">Image#new</a> and <a href=
1138
- "ilist.html#new_image">ImageList#new_image</a> methods accept a
1139
- <code>Fill</code> object as an optional third argument. A
1140
- <code>Fill</code> object is an instance of a <em>Fill
1141
- class</em>. Fill classes are designed to support custom
1142
- background fills. Each <code>Fill</code> class defines only two
1143
- methods, <code>initialize</code> and <code>fill</code>. The
1144
- <code>initialize</code> method is called from the application
1145
- to create an instance of the fill class. It accepts any
1146
- arguments and does whatever is necessary to create the fill.
1147
- The <code>fill</code> method is called from the initialize
1148
- method of the new image object, after the image is completely
1149
- initialized. The <code>fill</code> method gets the image as its
1150
- only argument and sends whatever methods are necessary to the
1151
- image to fill the image's background.</p>
1152
-
1153
- <p>RMagick supplies three Fill classes,
1154
- <code><strong>HatchFill</strong></code>,
1155
- <code><strong>GradientFill</strong></code>, and
1156
- <code><strong>TextureFill</strong></code>. These classes are
1157
- explained below. The <code>HatchFill</code> class is intended
1158
- as an example of how to write a <code>Fill</code> class and is
1159
- written in pure Ruby. You can read it in RMagick.rb.</p>
1160
- </div>
1161
-
1162
- <h3 id="GradientFill">class GradientFill <span class=
1163
- "superclass">&lt; Object</span></h3>
1164
-
1165
- <div class="sig">
1166
- <h4>new</h4>
1167
-
1168
- <p>GradientFill.new(<span class="arg">x1</span>, <span class=
1169
- "arg">y1</span>, <span class="arg">x2</span>, <span class=
1170
- "arg">y2</span>, <span class="arg">start_color</span>,
1171
- <span class="arg">end_color</span>) -&gt;
1172
- <em>gradient_fill</em></p>
1173
- </div>
1174
-
1175
- <div class="desc">
1176
- <h5>Description</h5>
1177
-
1178
- <p>Creates a gradient fill. The <span class="arg">x1</span>,
1179
- <span class="arg">y1</span>, and <span class="arg">x2</span>,
1180
- <span class="arg">y2</span> arguments describe either a line or
1181
- a point. If <span class="arg">x1</span> != <span class=
1182
- "arg">x2</span> or <span class="arg">y1</span> != <span class=
1183
- "arg">y2</span>, then the arguments describe the starting line
1184
- for the gradient. The gradient will start with <span class=
1185
- "arg">start_color</span> at the starting line and gradually
1186
- transform to <span class="arg">end_color</span> as the distance
1187
- increases from the starting line.</p>
1188
-
1189
- <p>If <span class="arg">x1</span> == <span class=
1190
- "arg">x2</span> and <span class="arg">y1</span> == <span class=
1191
- "arg">y2</span>, the gradient radiates from the specified
1192
- point, gradually transforming from <span class=
1193
- "arg">start_color</span> to <span class=
1194
- "arg">end_color</span>.</p>
1195
-
1196
- <p>The line or point does not have to lie within the image
1197
- bounds.</p>
1198
-
1199
- <h5>Arguments</h5>
1200
-
1201
- <dl>
1202
- <dt>x1, y1</dt>
1203
-
1204
- <dd>One of the starting line end-points.</dd>
1205
-
1206
- <dt>x2, y2</dt>
1207
-
1208
- <dd>The other end-point on the starting line.</dd>
1209
-
1210
- <dt>start_color</dt>
1211
-
1212
- <dd>The color at the starting line.</dd>
1213
-
1214
- <dt>end_color</dt>
1215
-
1216
- <dd>The color to which the gradient transforms.</dd>
1217
- </dl>
1218
-
1219
- <h5>Example</h5>
1220
-
1221
- <p><a href="javascript:popup('gradientfill.rb.html')"><img src=
1222
- "ex/gradientfill.gif" alt="GradientFill example" title=
1223
- "Click to see the example script" /></a></p>
1224
- </div>
1225
-
1226
- <h3 id="HatchFill">class HatchFill <span class="superclass">&lt;
1227
- Object</span></h3>
1228
-
1229
- <div class="sig">
1230
- <h4>new</h4>
1231
-
1232
- <p>HatchFill.new(<span class="arg">background_color</span>,
1233
- <span class="arg">hatch_color</span>='white', <span class=
1234
- "arg">dist</span>=10) -&gt; <em>hatch_fill</em></p>
1235
- </div>
1236
-
1237
- <div class="desc">
1238
- <h4>Description</h4>
1239
-
1240
- <p>Creates a cross-hatched fill.</p>
1241
-
1242
- <h4>Arguments</h4>
1243
-
1244
- <dl>
1245
- <dt>background_color</dt>
1246
-
1247
- <dd>The image background color.</dd>
1248
-
1249
- <dt>hatch_color</dt>
1250
-
1251
- <dd>The color of the cross-hatch lines.</dd>
1252
-
1253
- <dt>dist</dt>
1254
-
1255
- <dd>The distance between cross-hatch lines, in pixels.</dd>
1256
- </dl>
1257
-
1258
- <h4>Example</h4>
1259
-
1260
- <p><a href="javascript:popup('hatchfill.rb.html')"><img src=
1261
- "ex/hatchfill.gif" alt="HatchFill example" title=
1262
- "Click to see the example script" /></a></p>
1263
- </div>
1264
-
1265
- <h3 id="TextureFill">class TextureFill <span class=
1266
- "superclass">&lt; Object</span></h3>
1267
-
1268
- <div class="sig">
1269
- <h4>new</h4>
1270
-
1271
- <p>TextureFill.new(<span class="arg">texture_image</span>)
1272
- -&gt; <em>texture_fill</em></p>
1273
- </div>
1274
-
1275
- <div class="desc">
1276
- <h5>Description</h5>
1277
-
1278
- <p>Creates a texture fill by tiling the <span class=
1279
- "arg">texture_image</span> to fill the image.</p>
1280
-
1281
- <h5>Arguments</h5>
1282
-
1283
- <p>The texture to be used as the background. May be an image or
1284
- imagelist. If <span class="arg">texture_image</span> is an
1285
- imagelist, uses the current image.</p>
1286
-
1287
- <h5>Example</h5>
1288
-
1289
- <p><a href="javascript:popup('texturefill.rb.html')"><img src=
1290
- "ex/texturefill.gif" alt="TextureFill example" title=
1291
- "Click to see the example script" /></a></p>
1292
- </div>
1293
-
1294
- <div class="subhd">
1295
- <h2 id="exception">Exception classes</h2>
1296
-
1297
- <h3 id="MagickError">class ImageMagickError <span class=
1298
- "superclass">&lt; StandardError</span></h3>
1299
-
1300
- <div class="desc">
1301
- <h4>Description</h4>
1302
-
1303
- <p>RMagick raises this exception when an ImageMagick function
1304
- returns an error condition.</p>
1305
- </div>
1306
-
1307
- <h3 id="FatalImageMagickError">class FatalImageMagickError
1308
- <span class="superclass">&lt; StandardError</span></h3>
1309
-
1310
- <div class="desc">
1311
- <h4>Description</h4>
1312
-
1313
- <p>RMagick raises this exception when ImageMagick raises a
1314
- fatal (unrecoverable) error condition.</p>
1315
- </div>
1316
-
1317
- <h3 id="DestroyedImageError">class DestroyedImageError
1318
- <span class="superclass">&lt; StandardError</span></h3>
1319
-
1320
- <div class="desc">
1321
- <h4>Description</h4>
1322
-
1323
- <p>RMagick raises this exception when any Image method
1324
- (except <a href="image1.html#destroyed_q">destroyed?</a> and
1325
- <a href="image2.html#inspect">inspect</a>) is called after an
1326
- image has been <a href=
1327
- "image1.html#destroy_bang">destroyed</a>.</p>
1328
- </div>
1329
- </div>
1330
-
1331
- <p class="spacer">&nbsp;</p>
1332
-
1333
- <div class="nav">
1334
- &laquo;&nbsp;<a href="draw.html">Prev</a> | <a href=
1335
- "index.html">Contents</a> | <a href=
1336
- "info.html">Next</a>&nbsp;&raquo;
1337
- </div>
1338
- </body>
1339
- </html>