rmagick 1.7.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 (239) hide show
  1. data/ChangeLog +232 -0
  2. data/Makefile.in +28 -0
  3. data/README.html +404 -0
  4. data/README.txt +397 -0
  5. data/configure +8554 -0
  6. data/configure.ac +497 -0
  7. data/doc/comtasks.html +241 -0
  8. data/doc/constants.html +1195 -0
  9. data/doc/css/doc.css +299 -0
  10. data/doc/css/popup.css +34 -0
  11. data/doc/draw.html +3108 -0
  12. data/doc/ex/Adispatch.rb +43 -0
  13. data/doc/ex/Zconstitute.rb +9 -0
  14. data/doc/ex/adaptive_threshold.rb +19 -0
  15. data/doc/ex/add_noise.rb +18 -0
  16. data/doc/ex/affine.rb +48 -0
  17. data/doc/ex/affine_transform.rb +20 -0
  18. data/doc/ex/arc.rb +47 -0
  19. data/doc/ex/arcpath.rb +33 -0
  20. data/doc/ex/average.rb +15 -0
  21. data/doc/ex/axes.rb +64 -0
  22. data/doc/ex/bilevel_channel.rb +20 -0
  23. data/doc/ex/blur_image.rb +12 -0
  24. data/doc/ex/border.rb +10 -0
  25. data/doc/ex/bounding_box.rb +48 -0
  26. data/doc/ex/cbezier1.rb +40 -0
  27. data/doc/ex/cbezier2.rb +40 -0
  28. data/doc/ex/cbezier3.rb +40 -0
  29. data/doc/ex/cbezier4.rb +41 -0
  30. data/doc/ex/cbezier5.rb +41 -0
  31. data/doc/ex/cbezier6.rb +51 -0
  32. data/doc/ex/channel.rb +26 -0
  33. data/doc/ex/channel_threshold.rb +48 -0
  34. data/doc/ex/charcoal.rb +12 -0
  35. data/doc/ex/chop.rb +29 -0
  36. data/doc/ex/circle.rb +31 -0
  37. data/doc/ex/clip_path.rb +56 -0
  38. data/doc/ex/coalesce.rb +60 -0
  39. data/doc/ex/color_fill_to_border.rb +29 -0
  40. data/doc/ex/color_floodfill.rb +28 -0
  41. data/doc/ex/color_histogram.rb +60 -0
  42. data/doc/ex/color_reset.rb +11 -0
  43. data/doc/ex/colorize.rb +16 -0
  44. data/doc/ex/colors.rb +65 -0
  45. data/doc/ex/composite.rb +135 -0
  46. data/doc/ex/contrast.rb +37 -0
  47. data/doc/ex/crop.rb +31 -0
  48. data/doc/ex/crop_with_gravity.rb +46 -0
  49. data/doc/ex/cycle_colormap.rb +21 -0
  50. data/doc/ex/demo.rb +324 -0
  51. data/doc/ex/drawcomp.rb +42 -0
  52. data/doc/ex/drop_shadow.rb +60 -0
  53. data/doc/ex/edge.rb +11 -0
  54. data/doc/ex/ellipse.rb +43 -0
  55. data/doc/ex/emboss.rb +11 -0
  56. data/doc/ex/enhance.rb +28 -0
  57. data/doc/ex/equalize.rb +11 -0
  58. data/doc/ex/flatten_images.rb +38 -0
  59. data/doc/ex/flip.rb +11 -0
  60. data/doc/ex/flop.rb +11 -0
  61. data/doc/ex/fonts.rb +20 -0
  62. data/doc/ex/frame.rb +12 -0
  63. data/doc/ex/gaussian_blur.rb +11 -0
  64. data/doc/ex/get_multiline_type_metrics.rb +53 -0
  65. data/doc/ex/get_pixels.rb +48 -0
  66. data/doc/ex/get_type_metrics.rb +140 -0
  67. data/doc/ex/gradientfill.rb +27 -0
  68. data/doc/ex/grav.rb +44 -0
  69. data/doc/ex/gravity.rb +80 -0
  70. data/doc/ex/hatchfill.rb +27 -0
  71. data/doc/ex/images/Ballerina.jpg +0 -0
  72. data/doc/ex/images/Ballerina3.jpg +0 -0
  73. data/doc/ex/images/Button_0.gif +0 -0
  74. data/doc/ex/images/Button_1.gif +0 -0
  75. data/doc/ex/images/Button_2.gif +0 -0
  76. data/doc/ex/images/Button_3.gif +0 -0
  77. data/doc/ex/images/Button_4.gif +0 -0
  78. data/doc/ex/images/Button_5.gif +0 -0
  79. data/doc/ex/images/Button_6.gif +0 -0
  80. data/doc/ex/images/Button_7.gif +0 -0
  81. data/doc/ex/images/Button_8.gif +0 -0
  82. data/doc/ex/images/Button_9.gif +0 -0
  83. data/doc/ex/images/Button_A.gif +0 -0
  84. data/doc/ex/images/Button_B.gif +0 -0
  85. data/doc/ex/images/Button_C.gif +0 -0
  86. data/doc/ex/images/Button_D.gif +0 -0
  87. data/doc/ex/images/Button_E.gif +0 -0
  88. data/doc/ex/images/Button_F.gif +0 -0
  89. data/doc/ex/images/Button_G.gif +0 -0
  90. data/doc/ex/images/Button_H.gif +0 -0
  91. data/doc/ex/images/Button_I.gif +0 -0
  92. data/doc/ex/images/Button_J.gif +0 -0
  93. data/doc/ex/images/Button_K.gif +0 -0
  94. data/doc/ex/images/Button_L.gif +0 -0
  95. data/doc/ex/images/Button_M.gif +0 -0
  96. data/doc/ex/images/Button_N.gif +0 -0
  97. data/doc/ex/images/Button_O.gif +0 -0
  98. data/doc/ex/images/Button_P.gif +0 -0
  99. data/doc/ex/images/Button_Q.gif +0 -0
  100. data/doc/ex/images/Button_R.gif +0 -0
  101. data/doc/ex/images/Button_S.gif +0 -0
  102. data/doc/ex/images/Button_T.gif +0 -0
  103. data/doc/ex/images/Button_U.gif +0 -0
  104. data/doc/ex/images/Button_V.gif +0 -0
  105. data/doc/ex/images/Button_W.gif +0 -0
  106. data/doc/ex/images/Button_X.gif +0 -0
  107. data/doc/ex/images/Button_Y.gif +0 -0
  108. data/doc/ex/images/Button_Z.gif +0 -0
  109. data/doc/ex/images/Cheetah.jpg +0 -0
  110. data/doc/ex/images/Coffee.wmf +0 -0
  111. data/doc/ex/images/Flower_Hat.jpg +0 -0
  112. data/doc/ex/images/Gold_Statue.jpg +0 -0
  113. data/doc/ex/images/Hot_Air_Balloons.jpg +0 -0
  114. data/doc/ex/images/Hot_Air_Balloons_H.jpg +0 -0
  115. data/doc/ex/images/No.wmf +0 -0
  116. data/doc/ex/images/Polynesia.jpg +0 -0
  117. data/doc/ex/images/Red_Rocks.jpg +0 -0
  118. data/doc/ex/images/Shorts.jpg +0 -0
  119. data/doc/ex/images/Snake.wmf +0 -0
  120. data/doc/ex/images/Violin.jpg +0 -0
  121. data/doc/ex/images/graydient230x6.gif +0 -0
  122. data/doc/ex/images/logo400x83.gif +0 -0
  123. data/doc/ex/images/model.miff +0 -0
  124. data/doc/ex/images/notimplemented.gif +0 -0
  125. data/doc/ex/images/smile.miff +0 -0
  126. data/doc/ex/images/spin.gif +0 -0
  127. data/doc/ex/implode.rb +32 -0
  128. data/doc/ex/level.rb +12 -0
  129. data/doc/ex/level_channel.rb +33 -0
  130. data/doc/ex/line.rb +40 -0
  131. data/doc/ex/map.rb +28 -0
  132. data/doc/ex/map_f.rb +15 -0
  133. data/doc/ex/matte_fill_to_border.rb +42 -0
  134. data/doc/ex/matte_floodfill.rb +35 -0
  135. data/doc/ex/matte_replace.rb +42 -0
  136. data/doc/ex/median_filter.rb +28 -0
  137. data/doc/ex/modulate.rb +11 -0
  138. data/doc/ex/mono.rb +23 -0
  139. data/doc/ex/morph.rb +26 -0
  140. data/doc/ex/mosaic.rb +35 -0
  141. data/doc/ex/motion_blur.rb +11 -0
  142. data/doc/ex/negate.rb +11 -0
  143. data/doc/ex/negate_channel.rb +19 -0
  144. data/doc/ex/normalize.rb +11 -0
  145. data/doc/ex/oil_paint.rb +11 -0
  146. data/doc/ex/opacity.rb +38 -0
  147. data/doc/ex/opaque.rb +14 -0
  148. data/doc/ex/ordered_dither.rb +11 -0
  149. data/doc/ex/path.rb +62 -0
  150. data/doc/ex/pattern1.rb +25 -0
  151. data/doc/ex/pattern2.rb +26 -0
  152. data/doc/ex/polygon.rb +24 -0
  153. data/doc/ex/polyline.rb +23 -0
  154. data/doc/ex/posterize.rb +19 -0
  155. data/doc/ex/preview.rb +16 -0
  156. data/doc/ex/qbezierpath.rb +49 -0
  157. data/doc/ex/quantize-m.rb +25 -0
  158. data/doc/ex/radial_blur.rb +19 -0
  159. data/doc/ex/raise.rb +11 -0
  160. data/doc/ex/random_channel_threshold.rb +17 -0
  161. data/doc/ex/random_threshold_channel.rb +18 -0
  162. data/doc/ex/rectangle.rb +33 -0
  163. data/doc/ex/reduce_noise.rb +28 -0
  164. data/doc/ex/roll.rb +9 -0
  165. data/doc/ex/rotate.rb +43 -0
  166. data/doc/ex/rotate_f.rb +14 -0
  167. data/doc/ex/roundrect.rb +32 -0
  168. data/doc/ex/rubyname.rb +31 -0
  169. data/doc/ex/segment.rb +11 -0
  170. data/doc/ex/shade.rb +11 -0
  171. data/doc/ex/shave.rb +15 -0
  172. data/doc/ex/shear.rb +10 -0
  173. data/doc/ex/skewx.rb +50 -0
  174. data/doc/ex/skewy.rb +45 -0
  175. data/doc/ex/smile.rb +124 -0
  176. data/doc/ex/solarize.rb +11 -0
  177. data/doc/ex/splice.rb +16 -0
  178. data/doc/ex/spread.rb +11 -0
  179. data/doc/ex/stegano.rb +50 -0
  180. data/doc/ex/stroke_dasharray.rb +41 -0
  181. data/doc/ex/stroke_linecap.rb +44 -0
  182. data/doc/ex/stroke_linejoin.rb +48 -0
  183. data/doc/ex/stroke_width.rb +47 -0
  184. data/doc/ex/swirl.rb +17 -0
  185. data/doc/ex/text.rb +32 -0
  186. data/doc/ex/text_align.rb +36 -0
  187. data/doc/ex/text_antialias.rb +33 -0
  188. data/doc/ex/text_undercolor.rb +26 -0
  189. data/doc/ex/texture_fill_to_border.rb +34 -0
  190. data/doc/ex/texture_floodfill.rb +31 -0
  191. data/doc/ex/texturefill.rb +25 -0
  192. data/doc/ex/threshold.rb +13 -0
  193. data/doc/ex/to_blob.rb +14 -0
  194. data/doc/ex/translate.rb +37 -0
  195. data/doc/ex/transparent.rb +38 -0
  196. data/doc/ex/trim.rb +25 -0
  197. data/doc/ex/unsharp_mask.rb +28 -0
  198. data/doc/ex/viewex.rb +36 -0
  199. data/doc/ex/wave.rb +9 -0
  200. data/doc/ilist.html +1592 -0
  201. data/doc/image1.html +3009 -0
  202. data/doc/image2.html +2169 -0
  203. data/doc/image3.html +2815 -0
  204. data/doc/imageattrs.html +1319 -0
  205. data/doc/imusage.html +403 -0
  206. data/doc/index.html +418 -0
  207. data/doc/info.html +949 -0
  208. data/doc/magick.html +439 -0
  209. data/doc/scripts/doc.js +9 -0
  210. data/doc/struct.html +1334 -0
  211. data/doc/usage.html +1318 -0
  212. data/examples/describe.rb +44 -0
  213. data/examples/histogram.rb +289 -0
  214. data/examples/image_opacity.rb +29 -0
  215. data/examples/import_export.rb +31 -0
  216. data/examples/pattern_fill.rb +38 -0
  217. data/examples/rotating_text.rb +47 -0
  218. data/examples/thumbnail.rb +65 -0
  219. data/examples/vignette.rb +79 -0
  220. data/ext/RMagick/MANIFEST +239 -0
  221. data/ext/RMagick/extconf.rb.in +21 -0
  222. data/ext/RMagick/rmagick.h +938 -0
  223. data/ext/RMagick/rmagick_config.h.in +170 -0
  224. data/ext/RMagick/rmdraw.c +1308 -0
  225. data/ext/RMagick/rmfill.c +609 -0
  226. data/ext/RMagick/rmilist.c +685 -0
  227. data/ext/RMagick/rmimage.c +7980 -0
  228. data/ext/RMagick/rminfo.c +982 -0
  229. data/ext/RMagick/rmmain.c +1497 -0
  230. data/ext/RMagick/rmutil.c +2685 -0
  231. data/install.rb +1015 -0
  232. data/lib/RMagick.rb +1486 -0
  233. data/metaconfig.in +6 -0
  234. data/post-clean.rb +12 -0
  235. data/post-install.rb +36 -0
  236. data/post-setup.rb +245 -0
  237. data/rmagick.gemspec +22 -0
  238. data/uninstall.rb +71 -0
  239. metadata +286 -0
@@ -0,0 +1,65 @@
1
+ require 'RMagick'
2
+ include Magick
3
+
4
+ puts <<END_INFO
5
+
6
+ This example demonstrates how to make a thumbnail of an image.
7
+ An image is resized to the target size (retaining its original
8
+ aspect ratio, of course) and then "mounted" on a square background
9
+ with raised edges.
10
+
11
+ Usage:
12
+
13
+ ruby thumbnail.rb <filename <size>>
14
+
15
+ where `filename' is the name of an image file and `size' is the
16
+ size of the thumbnail in pixels. The default size is 120 pixels.
17
+ If you don't specify any arguments this script uses a default
18
+ image.
19
+
20
+ END_INFO
21
+
22
+ DEFAULT_SIZE = 120
23
+
24
+ case ARGV.length
25
+ when 2
26
+ size = ARGV[1].to_i
27
+ image = ARGV[0]
28
+ when 1
29
+ image = ARGV[0]
30
+ size = DEFAULT_SIZE
31
+ else
32
+ size = DEFAULT_SIZE
33
+ image = "../doc/ex/images/Flower_Hat.jpg"
34
+ end
35
+
36
+ geom = "#{size}x#{size}"
37
+
38
+ # Read the image and resize it. The `change_geometry' method
39
+ # computes the new image geometry and yields to a block. The
40
+ # return value of the block is the return value of the method.
41
+
42
+ img = Image.read(image)[0]
43
+ img.change_geometry!(geom) { |cols, rows| img.thumbnail! cols, rows }
44
+
45
+ # We need a background to display the thumbnail.
46
+ # Create a square, neutral gray background with raised edges.
47
+ # Make this background slightly larger than the image to allow
48
+ # for the raised border. A 3-pixel raised edge means that the
49
+ # background needs to be 6 pixels larger in each dimension.
50
+
51
+ bg = Image.new(size+6, size+6) { self.background_color = "gray75" }
52
+ bg = bg.raise(3,3)
53
+
54
+ # Just for the purposes of this example, display the thumbnail background on
55
+ # a larger white background.
56
+
57
+ white_bg = Image.new(size+50, size+50) {self.background_color = "white"}
58
+ white_bg = white_bg.composite(bg, CenterGravity, OverCompositeOp)
59
+
60
+ # Finally, center the thumbnail on the gray background.
61
+ thumbnail = white_bg.composite(img, CenterGravity, OverCompositeOp)
62
+
63
+ thumbnail.display
64
+ exit
65
+
@@ -0,0 +1,79 @@
1
+ require 'RMagick'
2
+ include Magick
3
+
4
+ puts <<END_INFO
5
+
6
+ vi-gnette (n.) vin-'yet
7
+ A picture that shades off gradually into the surrounding paper.
8
+ Merriam-Webster Dictionary
9
+
10
+ Vignettes are frequently used in formal portraiture and advertising
11
+ images. This example creates a vignette from a picture of a ballerina.
12
+ It takes a few seconds to run. Be patient.
13
+
14
+ END_INFO
15
+
16
+ ballerina = Image.read("../doc/ex/images/Ballerina3.jpg")[0]
17
+
18
+ # Note: this technique won't work with every image. To make a pretty
19
+ # vignette you need an image with a uniform, fairly dark background.
20
+
21
+ # Start by drawing a white oval on a black background. (Although you don't
22
+ # have to use an oval at all! Any shape will work. Try a rounded rectangle.)
23
+ # The black pixels correspond to pixels in the image that will become
24
+ # transparent. The white pixels correspond to pixels in the image that will
25
+ # remain unchanged. Gray pixels, introduced by the blurring below, will
26
+ # become more or less transparent depending on how dark or light the pixel is.
27
+
28
+ # The size of the oval is arbitrary - in this case it's 90% of the
29
+ # size of the image.
30
+
31
+ oval = Image.new(ballerina.columns, ballerina.rows) {self.background_color = 'black'}
32
+ gc = Draw.new
33
+ gc.stroke('white')
34
+ gc.fill('white')
35
+ gc.ellipse(ballerina.columns/2, ballerina.rows/2,
36
+ ballerina.columns/2-(ballerina.columns*0.10),
37
+ ballerina.rows/2-(ballerina.rows*0.10), 0, 360)
38
+ gc.draw(oval)
39
+
40
+ # Add a lot of blurring to the oval. I use blur_image because it's much faster
41
+ # than the gaussian_blur method and produces no observable difference. The
42
+ # exact amount of blurring is a judgment call. The higher the 2nd argument, the
43
+ # more blurring, although increasing the value above 20 doesn't seem to add any
44
+ # additional blurriness.
45
+
46
+ oval = oval.blur_image(0, 20)
47
+
48
+ # The CopyOpacityCompositeOp transforms the opacity level of each image pixel
49
+ # according to the intensity of the composite image pixels. In this case, the
50
+ # black pixels outside the oval become transparent and the white pixels inside
51
+ # the oval remain opaque. Each gray pixel around the border of the oval has a
52
+ # varying level of transparency depending on how dark or light it is.
53
+
54
+ ballerina.matte = true # Ensure the ballerina image's opacity channel is enabled.
55
+ oval.matte = false # Force the CopyOpacityCompositeOp to use pixel intensity
56
+ # to determine how much transparency to add to the ballerina
57
+ # pixels.
58
+
59
+ ballerina = ballerina.composite(oval, CenterGravity, CopyOpacityCompositeOp)
60
+
61
+ # Since the vignette has multiple levels of transparency, we can't
62
+ # save it as a GIF or a JPEG. The PNG format can handle it, though.
63
+
64
+ begin
65
+ ballerina.write("vignette.png")
66
+ rescue ImageMagickError
67
+ puts "Write failed. No PNG support?"
68
+ # In case PNG support isn't installed, just ignore the exception.
69
+ end
70
+
71
+ # At this point the vignette is complete. However, the `display' method only
72
+ # supports 1`level of transparency. Therefore, composite the vignette over a
73
+ # standard "checkerboard" background. The resulting image will be 100% opaque.
74
+
75
+ checkerboard = Image.read("pattern:checkerboard") {self.size = "#{ballerina.columns}x#{ballerina.rows}"}
76
+ vignette = checkerboard[0].composite(ballerina, CenterGravity, OverCompositeOp)
77
+ vignette.display
78
+ exit
79
+
@@ -0,0 +1,239 @@
1
+ MANIFEST for RMagick-1.7.1 - 13:58:08 12/25/04
2
+
3
+ configure
4
+ lib/RMagick.rb
5
+ examples/vignette.rb
6
+ examples/thumbnail.rb
7
+ examples/rotating_text.rb
8
+ examples/pattern_fill.rb
9
+ examples/import_export.rb
10
+ examples/image_opacity.rb
11
+ examples/histogram.rb
12
+ examples/describe.rb
13
+ uninstall.rb
14
+ post-setup.rb
15
+ post-install.rb
16
+ post-clean.rb
17
+ metaconfig.in
18
+ install.rb
19
+ configure.ac
20
+ README.txt
21
+ README.html
22
+ Makefile.in
23
+ ChangeLog
24
+ ext/RMagick/rmutil.c
25
+ ext/RMagick/rmmain.c
26
+ ext/RMagick/rminfo.c
27
+ ext/RMagick/rmimage.c
28
+ ext/RMagick/rmilist.c
29
+ ext/RMagick/rmfill.c
30
+ ext/RMagick/rmdraw.c
31
+ ext/RMagick/rmagick_config.h.in
32
+ ext/RMagick/rmagick.h
33
+ ext/RMagick/extconf.rb.in
34
+ ext/RMagick/MANIFEST
35
+ doc/scripts/doc.js
36
+ doc/usage.html
37
+ doc/struct.html
38
+ doc/magick.html
39
+ doc/info.html
40
+ doc/index.html
41
+ doc/imusage.html
42
+ doc/imageattrs.html
43
+ doc/image3.html
44
+ doc/image2.html
45
+ doc/image1.html
46
+ doc/ilist.html
47
+ doc/draw.html
48
+ doc/constants.html
49
+ doc/comtasks.html
50
+ doc/ex/wave.rb
51
+ doc/ex/viewex.rb
52
+ doc/ex/unsharp_mask.rb
53
+ doc/ex/trim.rb
54
+ doc/ex/transparent.rb
55
+ doc/ex/translate.rb
56
+ doc/ex/to_blob.rb
57
+ doc/ex/threshold.rb
58
+ doc/ex/texturefill.rb
59
+ doc/ex/texture_floodfill.rb
60
+ doc/ex/texture_fill_to_border.rb
61
+ doc/ex/text_undercolor.rb
62
+ doc/ex/text_antialias.rb
63
+ doc/ex/text_align.rb
64
+ doc/ex/text.rb
65
+ doc/ex/swirl.rb
66
+ doc/ex/stroke_width.rb
67
+ doc/ex/stroke_linejoin.rb
68
+ doc/ex/stroke_linecap.rb
69
+ doc/ex/stroke_dasharray.rb
70
+ doc/ex/stegano.rb
71
+ doc/ex/spread.rb
72
+ doc/ex/splice.rb
73
+ doc/ex/solarize.rb
74
+ doc/ex/smile.rb
75
+ doc/ex/skewy.rb
76
+ doc/ex/skewx.rb
77
+ doc/ex/shear.rb
78
+ doc/ex/shave.rb
79
+ doc/ex/shade.rb
80
+ doc/ex/segment.rb
81
+ doc/ex/rubyname.rb
82
+ doc/ex/roundrect.rb
83
+ doc/ex/rotate_f.rb
84
+ doc/ex/rotate.rb
85
+ doc/ex/roll.rb
86
+ doc/ex/reduce_noise.rb
87
+ doc/ex/rectangle.rb
88
+ doc/ex/random_threshold_channel.rb
89
+ doc/ex/random_channel_threshold.rb
90
+ doc/ex/raise.rb
91
+ doc/ex/radial_blur.rb
92
+ doc/ex/quantize-m.rb
93
+ doc/ex/qbezierpath.rb
94
+ doc/ex/preview.rb
95
+ doc/ex/posterize.rb
96
+ doc/ex/polyline.rb
97
+ doc/ex/polygon.rb
98
+ doc/ex/pattern2.rb
99
+ doc/ex/pattern1.rb
100
+ doc/ex/path.rb
101
+ doc/ex/ordered_dither.rb
102
+ doc/ex/opaque.rb
103
+ doc/ex/opacity.rb
104
+ doc/ex/oil_paint.rb
105
+ doc/ex/normalize.rb
106
+ doc/ex/negate_channel.rb
107
+ doc/ex/negate.rb
108
+ doc/ex/motion_blur.rb
109
+ doc/ex/mosaic.rb
110
+ doc/ex/morph.rb
111
+ doc/ex/mono.rb
112
+ doc/ex/modulate.rb
113
+ doc/ex/median_filter.rb
114
+ doc/ex/matte_replace.rb
115
+ doc/ex/matte_floodfill.rb
116
+ doc/ex/matte_fill_to_border.rb
117
+ doc/ex/map_f.rb
118
+ doc/ex/map.rb
119
+ doc/ex/line.rb
120
+ doc/ex/level_channel.rb
121
+ doc/ex/level.rb
122
+ doc/ex/implode.rb
123
+ doc/ex/hatchfill.rb
124
+ doc/ex/gravity.rb
125
+ doc/ex/grav.rb
126
+ doc/ex/gradientfill.rb
127
+ doc/ex/get_type_metrics.rb
128
+ doc/ex/get_pixels.rb
129
+ doc/ex/get_multiline_type_metrics.rb
130
+ doc/ex/gaussian_blur.rb
131
+ doc/ex/frame.rb
132
+ doc/ex/fonts.rb
133
+ doc/ex/flop.rb
134
+ doc/ex/flip.rb
135
+ doc/ex/flatten_images.rb
136
+ doc/ex/equalize.rb
137
+ doc/ex/enhance.rb
138
+ doc/ex/emboss.rb
139
+ doc/ex/ellipse.rb
140
+ doc/ex/edge.rb
141
+ doc/ex/drop_shadow.rb
142
+ doc/ex/drawcomp.rb
143
+ doc/ex/demo.rb
144
+ doc/ex/cycle_colormap.rb
145
+ doc/ex/crop_with_gravity.rb
146
+ doc/ex/crop.rb
147
+ doc/ex/contrast.rb
148
+ doc/ex/composite.rb
149
+ doc/ex/colors.rb
150
+ doc/ex/colorize.rb
151
+ doc/ex/color_reset.rb
152
+ doc/ex/color_histogram.rb
153
+ doc/ex/color_floodfill.rb
154
+ doc/ex/color_fill_to_border.rb
155
+ doc/ex/coalesce.rb
156
+ doc/ex/clip_path.rb
157
+ doc/ex/circle.rb
158
+ doc/ex/chop.rb
159
+ doc/ex/charcoal.rb
160
+ doc/ex/channel_threshold.rb
161
+ doc/ex/channel.rb
162
+ doc/ex/cbezier6.rb
163
+ doc/ex/cbezier5.rb
164
+ doc/ex/cbezier4.rb
165
+ doc/ex/cbezier3.rb
166
+ doc/ex/cbezier2.rb
167
+ doc/ex/cbezier1.rb
168
+ doc/ex/bounding_box.rb
169
+ doc/ex/border.rb
170
+ doc/ex/blur_image.rb
171
+ doc/ex/bilevel_channel.rb
172
+ doc/ex/axes.rb
173
+ doc/ex/average.rb
174
+ doc/ex/arcpath.rb
175
+ doc/ex/arc.rb
176
+ doc/ex/affine_transform.rb
177
+ doc/ex/affine.rb
178
+ doc/ex/add_noise.rb
179
+ doc/ex/adaptive_threshold.rb
180
+ doc/ex/Zconstitute.rb
181
+ doc/ex/Adispatch.rb
182
+ doc/ex/images/spin.gif
183
+ doc/ex/images/smile.miff
184
+ doc/ex/images/notimplemented.gif
185
+ doc/ex/images/model.miff
186
+ doc/ex/images/logo400x83.gif
187
+ doc/ex/images/graydient230x6.gif
188
+ doc/ex/images/Violin.jpg
189
+ doc/ex/images/Snake.wmf
190
+ doc/ex/images/Shorts.jpg
191
+ doc/ex/images/Red_Rocks.jpg
192
+ doc/ex/images/Polynesia.jpg
193
+ doc/ex/images/No.wmf
194
+ doc/ex/images/Hot_Air_Balloons_H.jpg
195
+ doc/ex/images/Hot_Air_Balloons.jpg
196
+ doc/ex/images/Gold_Statue.jpg
197
+ doc/ex/images/Flower_Hat.jpg
198
+ doc/ex/images/Coffee.wmf
199
+ doc/ex/images/Cheetah.jpg
200
+ doc/ex/images/Button_Z.gif
201
+ doc/ex/images/Button_Y.gif
202
+ doc/ex/images/Button_X.gif
203
+ doc/ex/images/Button_W.gif
204
+ doc/ex/images/Button_V.gif
205
+ doc/ex/images/Button_U.gif
206
+ doc/ex/images/Button_T.gif
207
+ doc/ex/images/Button_S.gif
208
+ doc/ex/images/Button_R.gif
209
+ doc/ex/images/Button_Q.gif
210
+ doc/ex/images/Button_P.gif
211
+ doc/ex/images/Button_O.gif
212
+ doc/ex/images/Button_N.gif
213
+ doc/ex/images/Button_M.gif
214
+ doc/ex/images/Button_L.gif
215
+ doc/ex/images/Button_K.gif
216
+ doc/ex/images/Button_J.gif
217
+ doc/ex/images/Button_I.gif
218
+ doc/ex/images/Button_H.gif
219
+ doc/ex/images/Button_G.gif
220
+ doc/ex/images/Button_F.gif
221
+ doc/ex/images/Button_E.gif
222
+ doc/ex/images/Button_D.gif
223
+ doc/ex/images/Button_C.gif
224
+ doc/ex/images/Button_B.gif
225
+ doc/ex/images/Button_A.gif
226
+ doc/ex/images/Button_9.gif
227
+ doc/ex/images/Button_8.gif
228
+ doc/ex/images/Button_7.gif
229
+ doc/ex/images/Button_6.gif
230
+ doc/ex/images/Button_5.gif
231
+ doc/ex/images/Button_4.gif
232
+ doc/ex/images/Button_3.gif
233
+ doc/ex/images/Button_2.gif
234
+ doc/ex/images/Button_1.gif
235
+ doc/ex/images/Button_0.gif
236
+ doc/ex/images/Ballerina3.jpg
237
+ doc/ex/images/Ballerina.jpg
238
+ doc/css/doc.css
239
+ doc/css/popup.css
@@ -0,0 +1,21 @@
1
+ # extconf.rb.in -> extconf.rb
2
+ # creates a Makefile to make RMagick.so
3
+
4
+ require 'mkmf'
5
+
6
+ # Pass along Ruby's version number
7
+ VERSION_NUMBER = '0x'+RUBY_VERSION.tr('.','')
8
+
9
+ $CFLAGS = "-std=gnu99 -Wall -g @CFLAGS@"
10
+ $CPPFLAGS = "-DRUBY_VERSION=#{VERSION_NUMBER} @CPPFLAGS@"
11
+
12
+ if RUBY_VERSION >= '1.8.0'
13
+ $DLDFLAGS = "@LDFLAGS@"
14
+ else
15
+ $LDFLAGS = "@LDFLAGS@"
16
+ end
17
+
18
+ $LOCAL_LIBS = "@LOCAL_LIBS@"
19
+
20
+ create_makefile("RMagick")
21
+
@@ -0,0 +1,938 @@
1
+ /* $Id: rmagick.h,v 1.75 2004/12/15 23:58:33 rmagick Exp $ */
2
+ /*=============================================================================
3
+ | Copyright (C) 2004 by Timothy P. Hunter
4
+ | Name: rmagick.h
5
+ | Purpose: RMagick declarations and definitions
6
+ | Author: Tim Hunter
7
+ \============================================================================*/
8
+
9
+ #ifndef _RMAGICK_H_
10
+ #define _RMAGICK_H_
11
+
12
+ #include <assert.h>
13
+ #include <stdio.h>
14
+ #include <ctype.h>
15
+ #include <stdlib.h>
16
+ #include <math.h>
17
+ #include <time.h>
18
+ #include <sys/types.h>
19
+ #include "ruby.h"
20
+ #include "intern.h"
21
+ #include "rubyio.h"
22
+ #include "magick/api.h"
23
+
24
+
25
+
26
+ // Undef ImageMagick's versions of these symbols
27
+ #undef PACKAGE_VERSION
28
+ #undef PACKAGE_NAME
29
+ #undef PACKAGE_STRING
30
+ #undef PACKAGE_BUGREPORT
31
+ #undef PACKAGE_TARNAME
32
+ #include "rmagick_config.h"
33
+
34
+ // Define a pair of macros that make it easier to code
35
+ // 1.6 and 1.8 alternatives. Code enclosed in RUBY18()
36
+ // is present when compiled for 1.8.0 and later. Code
37
+ // enclosed in RUBY16 is present for 1.6 versions.
38
+ #if RUBY_VERSION >= 0x180
39
+ #define RUBY18(d) d
40
+ #define RUBY16(d)
41
+ #else
42
+ #define RUBY18(d)
43
+ #define RUBY16(d) d
44
+ #endif
45
+
46
+ #if !defined(ULONG2NUM)
47
+ #define ULONG2NUM(v) UINT2NUM(v)
48
+ #endif
49
+
50
+
51
+ // Define a version of StringValuePtr that works in both 1.6 and 1.8.
52
+ #if !defined(StringValuePtr)
53
+ #define STRING_PTR(v) rm_string_value_ptr(&(v))
54
+ #else
55
+ #define STRING_PTR(v) StringValuePtr(v)
56
+ #endif
57
+
58
+ // Safe replacement for rb_str2cstr
59
+ #define STRING_PTR_LEN(v,l) rm_string_value_ptr_len(&(v), &(l))
60
+
61
+ #undef DegreesToRadians // defined in ImageMagick.h in 6.0.2
62
+ #define DegreesToRadians(x) ((x)*3.14159265358979323846/180.0)
63
+
64
+ typedef ImageInfo Info; // Make type name match class name
65
+ typedef PixelPacket Pixel;
66
+
67
+ // Montage
68
+ typedef struct
69
+ {
70
+ CompositeOperator compose;
71
+ MontageInfo *info;
72
+ } Montage;
73
+
74
+ // Draw
75
+ struct TmpFile_Name
76
+ {
77
+ struct TmpFile_Name *next;
78
+ char name[1];
79
+ };
80
+
81
+ typedef struct
82
+ {
83
+ DrawInfo *info; // the DrawInfo struct
84
+ VALUE primitives; // the primitive string
85
+ struct TmpFile_Name *tmpfile_ary;
86
+ } Draw; // make the type match the class name
87
+
88
+ // Enum
89
+ typedef struct
90
+ {
91
+ ID id;
92
+ int val;
93
+ } MagickEnum;
94
+
95
+ #undef False // defined in deprecate.h in 6.0.2
96
+ #undef True // defined in deprecate.h in 6.0.2
97
+ typedef enum
98
+ {
99
+ False = 0,
100
+ True = 1
101
+ }
102
+ boolean;
103
+
104
+ typedef enum {
105
+ AnyWeight,
106
+ NormalWeight,
107
+ BoldWeight,
108
+ BolderWeight,
109
+ LighterWeight
110
+ } WeightType;
111
+
112
+ // Draw#text_anchor AnchorType argument
113
+ typedef enum {
114
+ StartAnchor = 1,
115
+ MiddleAnchor = 2,
116
+ EndAnchor = 3
117
+ } AnchorType;
118
+
119
+
120
+ typedef struct
121
+ {
122
+ unsigned char id; // Dumped image id = 0xd1
123
+ unsigned char mj; // Major format number = 1
124
+ unsigned char mi; // Minor format number = 0
125
+ unsigned char len; // Length of image magick string
126
+ char magick[MaxTextExtent]; // magick string
127
+ } DumpedImage;
128
+
129
+ #define DUMPED_IMAGE_ID 0xd1
130
+ #define DUMPED_IMAGE_MAJOR_VERS 1
131
+ #define DUMPED_IMAGE_MINOR_VERS 0
132
+
133
+ #define MAGICK_LOC "magick_location" // instance variable name in ImageMagickError class
134
+
135
+ #define MAX_GEOM_STR 51 // max length of a geometry string
136
+
137
+ #if defined(HAVE_QUANTUMOPERATORREGIONIMAGE) || defined(HAVE_EVALUATEIMAGECHANNEL)
138
+ /*
139
+ * Both ImageMagick and GraphicsMagick define an enum type for quantum-level
140
+ * expressions, but they're different types. The QuantumExpressionOperator
141
+ * type is an adapter type that can be mapped to either one.
142
+ */
143
+ typedef enum _QuantumExpressionOperator
144
+ {
145
+ UndefinedQuantumOperator,
146
+ AddQuantumOperator,
147
+ AndQuantumOperator,
148
+ DivideQuantumOperator,
149
+ LShiftQuantumOperator,
150
+ MultiplyQuantumOperator,
151
+ OrQuantumOperator,
152
+ RShiftQuantumOperator,
153
+ SubtractQuantumOperator,
154
+ XorQuantumOperator
155
+ } QuantumExpressionOperator ;
156
+ #endif
157
+
158
+
159
+ /*
160
+ ImageMagick used simply size_t and off_t in 5.5.1, then defined the
161
+ Extended(Un)SignedIntegralType from 5.5.2 thru 5.5.7. The 5.5.8 release
162
+ deprecates these types and uses Magick(Un)SignedType instead.
163
+ GraphicsMagick 1.1. introduced the magick_(u)int64_t type.
164
+
165
+ Here, if we don't already have magick_(u)int64_t, define them.
166
+ */
167
+ #if !defined(HAVE_MAGICK_INT64_T)
168
+ #if defined(HAVE_MAGICKOFFSETTYPE)
169
+ typedef MagickOffsetType magick_int64_t;
170
+ #elif defined(HAVE_EXTENDEDSIGNEDINTEGRALTYPE)
171
+ typedef ExtendedSignedIntegralType magick_int64_t;
172
+ #else
173
+ typedef off_t magick_int64_t;
174
+ #endif
175
+ #endif
176
+
177
+ #if !defined(HAVE_MAGICK_UINT64_T)
178
+ #if defined(HAVE_MAGICKSIZETYPE)
179
+ typedef MagickSizeType magick_uint64_t;
180
+ #elif defined(HAVE_EXTENDEDUNSIGNEDINTEGRALTYPE)
181
+ typedef ExtendedUnsignedIntegralType magick_uint64_t;
182
+ #else
183
+ typedef size_t magick_uint64_t;
184
+ #endif
185
+ #endif
186
+
187
+ #if !defined(HAVE_MAGICKBOOLEANTYPE)
188
+ typedef unsigned int MagickBooleanType;
189
+ #endif
190
+
191
+ // This implements the "omitted storage class model" for external variables.
192
+ // (Ref: Harbison & Steele.) The rmmain.c file defines MAIN, which causes
193
+ // the single defining declarations to be generated. No other source files
194
+ // define MAIN and therefore generate referencing declarations.
195
+ #undef EXTERN
196
+ #if defined(MAIN)
197
+ #define EXTERN
198
+ #else
199
+ #define EXTERN extern
200
+ #endif
201
+
202
+ /*
203
+ * RMagick Module and Class VALUEs
204
+ */
205
+ EXTERN VALUE Module_Magick;
206
+ EXTERN VALUE Class_ImageList;
207
+ EXTERN VALUE Class_Info;
208
+ EXTERN VALUE Class_Draw;
209
+ EXTERN VALUE Class_Image;
210
+ EXTERN VALUE Class_Montage;
211
+ EXTERN VALUE Class_ImageMagickError;
212
+ EXTERN VALUE Class_GradientFill;
213
+ EXTERN VALUE Class_TextureFill;
214
+ EXTERN VALUE Class_AffineMatrix;
215
+ EXTERN VALUE Class_Chromaticity;
216
+ EXTERN VALUE Class_Color;
217
+ EXTERN VALUE Class_Font;
218
+ EXTERN VALUE Class_Geometry;
219
+ EXTERN VALUE Class_GeometryValue; // Defined in RMagick.rb
220
+ EXTERN VALUE Class_Pixel;
221
+ EXTERN VALUE Class_Point;
222
+ EXTERN VALUE Class_Primary;
223
+ EXTERN VALUE Class_Rectangle;
224
+ EXTERN VALUE Class_Segment;
225
+ EXTERN VALUE Class_TypeMetric;
226
+ #if defined(HAVE_COMPAREIMAGECHANNELS)
227
+ EXTERN VALUE Class_MetricType;
228
+ #endif
229
+ #if defined(HAVE_QUANTUMOPERATORREGIONIMAGE) || defined(HAVE_EVALUATEIMAGECHANNEL)
230
+ EXTERN VALUE Class_QuantumExpressionOperator;
231
+ #endif
232
+ #if defined(HAVE_GETIMAGESTATISTICS)
233
+ EXTERN VALUE Class_Statistics;
234
+ EXTERN VALUE Class_StatisticsChannel;
235
+ #endif
236
+
237
+ // Enum classes
238
+ EXTERN VALUE Class_Enum;
239
+ EXTERN VALUE Class_AlignType;
240
+ EXTERN VALUE Class_AnchorType;
241
+ EXTERN VALUE Class_ChannelType;
242
+ EXTERN VALUE Class_ClassType;
243
+ EXTERN VALUE Class_ColorspaceType;
244
+ EXTERN VALUE Class_ComplianceType;
245
+ EXTERN VALUE Class_CompositeOperator;
246
+ EXTERN VALUE Class_CompressionType;
247
+ EXTERN VALUE Class_DecorationType;
248
+ EXTERN VALUE Class_DisposeType;
249
+ EXTERN VALUE Class_EndianType;
250
+ EXTERN VALUE Class_FilterTypes;
251
+ EXTERN VALUE Class_GravityType;
252
+ EXTERN VALUE Class_ImageType;
253
+ EXTERN VALUE Class_InterlaceType;
254
+ EXTERN VALUE Class_NoiseType;
255
+ EXTERN VALUE Class_PaintMethod;
256
+ EXTERN VALUE Class_PreviewType;
257
+ EXTERN VALUE Class_RenderingIntent;
258
+ EXTERN VALUE Class_ResolutionType;
259
+ EXTERN VALUE Class_StretchType;
260
+ EXTERN VALUE Class_StyleType;
261
+ EXTERN VALUE Class_WeightType;
262
+
263
+ /*
264
+ * Commonly-used IDs
265
+ */
266
+ EXTERN ID ID__dummy_img_; // "_dummy_img_"
267
+ EXTERN ID ID_changed; // "changed"
268
+ EXTERN ID ID_call; // "call"
269
+ EXTERN ID ID_cur_image; // "cur_image"
270
+ EXTERN ID ID_dup; // "dup"
271
+ EXTERN ID ID_enumerators; // "enumerators"
272
+ EXTERN ID ID_fill; // "fill"
273
+ EXTERN ID ID_flag; // "flag"
274
+ EXTERN ID ID_from_s; // "from_s"
275
+ EXTERN ID ID_Geometry; // "Geometry"
276
+ EXTERN ID ID_GeometryValue; // "GeometryValue"
277
+ EXTERN ID ID_height; // "height"
278
+ EXTERN ID ID_initialize_copy; // "initialize_copy"
279
+ EXTERN ID ID_length; // "length"
280
+ EXTERN ID ID_notify_observers; // "notify_observers"
281
+ EXTERN ID ID_new; // "new"
282
+ EXTERN ID ID_push; // "push"
283
+ EXTERN ID ID_spaceship; // "<=>
284
+ EXTERN ID ID_to_s; // "to_s"
285
+ EXTERN ID ID_values; // "values"
286
+ EXTERN ID ID_width; // "width"
287
+ EXTERN ID ID_x; // "x"
288
+ EXTERN ID ID_y; // "y"
289
+
290
+
291
+ #if defined(HAVE_GETNEXTIMAGEINLIST)
292
+ #define GET_NEXT_IMAGE(a) GetNextImageInList(a)
293
+ #else
294
+ #define GET_NEXT_IMAGE(a) (a)->next
295
+ #endif
296
+
297
+ #if defined(HAVE_GETLOCALEEXCEPTIONMESSAGE)
298
+ #define GET_MSG(s,t) GetLocaleExceptionMessage((s), (t))
299
+ #else
300
+ #define GET_MSG(s,t) t
301
+ #endif
302
+
303
+
304
+ #define min(a,b) ((a)<(b)?(a):(b))
305
+ #define max(a,b) ((a)>(b)?(a):(b))
306
+
307
+ #define Q(N) Q2(N)
308
+ #define Q2(N) #N
309
+
310
+ /*
311
+ Handle warnings & errors
312
+
313
+ For ExceptionInfo structures in auto storage. Destroys the
314
+ ExceptionInfo structure (releasing any IM storage) before
315
+ calling rb_raise.
316
+ */
317
+ #define HANDLE_ERROR rm_handle_error(&exception);
318
+ // For ExceptionInfo structures in images.
319
+ #define HANDLE_ERROR_IMG(img) rm_handle_error(&((img)->exception));
320
+
321
+ /*
322
+ Map the QuantumDepth to a StorageType.
323
+ */
324
+ #if QuantumDepth == 8
325
+ #define FIX_STG_TYPE CharPixel
326
+ #elif QuantumDepth == 16
327
+ #define FIX_STG_TYPE ShortPixel
328
+ #else // QuantumDepth == 32
329
+ #define FIX_STG_TYPE LongPixel
330
+ #endif
331
+
332
+
333
+ /*
334
+ Call rb_define_method for an attribute accessor method
335
+ */
336
+ #define DCL_ATTR_READER(class, attr) \
337
+ rb_define_method(Class_##class, #attr, class##_##attr, 0);
338
+ #define DCL_ATTR_WRITER(class, attr) \
339
+ rb_define_method(Class_##class, #attr "=", class##_##attr##_eq, 1);
340
+ #define DCL_ATTR_ACCESSOR(class, attr) \
341
+ DCL_ATTR_READER(class, attr) \
342
+ DCL_ATTR_WRITER(class, attr)
343
+
344
+ /*
345
+ Define simple attribute accessor methods (boolean, int, string, and double types)
346
+ */
347
+ #define C_bool_to_R_bool(attr) (attr) ? Qtrue : Qfalse
348
+ #define R_bool_to_C_bool(attr) RTEST(attr)
349
+ #define C_int_to_R_int(attr) INT2FIX(attr)
350
+ #define R_int_to_C_int(attr) NUM2INT(attr)
351
+ #define C_long_to_R_long(attr) INT2NUM(attr)
352
+ #define R_long_to_C_long(attr) NUM2LONG(attr)
353
+ #define C_ulong_to_R_ulong(attr) UINT2NUM(attr)
354
+ #define R_ulong_to_C_ulong(attr) NUM2ULONG(attr)
355
+ #define C_str_to_R_str(attr) attr ? rb_str_new2(attr) : Qnil
356
+ #define C_dbl_to_R_dbl(attr) rb_float_new(attr)
357
+ #define R_dbl_to_C_dbl(attr) NUM2DBL(attr)
358
+
359
+ #define DEF_ATTR_READER(class, attr, type) \
360
+ VALUE class##_##attr(VALUE self)\
361
+ {\
362
+ class *ptr;\
363
+ Data_Get_Struct(self, class, ptr);\
364
+ return C_##type##_to_R_##type(ptr->attr);\
365
+ }
366
+
367
+ // Use when attribute name is different from the field name
368
+ #define DEF_ATTR_READERF(class, attr, field, type) \
369
+ VALUE class##_##attr(VALUE self)\
370
+ {\
371
+ class *ptr;\
372
+ Data_Get_Struct(self, class, ptr);\
373
+ return C_##type##_to_R_##type(ptr->field);\
374
+ }
375
+ #define DEF_ATTR_WRITER(class, attr, type) \
376
+ VALUE class##_##attr##_eq(VALUE self, VALUE val)\
377
+ {\
378
+ class *ptr;\
379
+ rm_check_frozen(self);\
380
+ Data_Get_Struct(self, class, ptr);\
381
+ ptr->attr = R_##type##_to_C_##type(val);\
382
+ return self;\
383
+ }
384
+ #define DEF_ATTR_ACCESSOR(class, attr, type)\
385
+ DEF_ATTR_READER(class, attr, type)\
386
+ DEF_ATTR_WRITER(class, attr, type)
387
+
388
+ /*
389
+ * Declare attribute accessors
390
+ */
391
+ #define ATTR_READER(class, attr) \
392
+ extern VALUE class##_##attr(VALUE);
393
+ #define ATTR_WRITER(class, attr) \
394
+ extern VALUE class##_##attr##_eq(VALUE, VALUE);
395
+ #define ATTR_ACCESSOR(class, attr) \
396
+ ATTR_READER(class, attr)\
397
+ ATTR_WRITER(class, attr)
398
+
399
+ /*
400
+ * Declare Pixel channel attribute writers
401
+ */
402
+ #define DEF_PIXEL_CHANNEL_WRITER(_channel_) \
403
+ extern VALUE \
404
+ Pixel_##_channel_##_eq(VALUE self, VALUE v) \
405
+ { \
406
+ Pixel *pixel; \
407
+ \
408
+ rm_check_frozen(self); \
409
+ Data_Get_Struct(self, Pixel, pixel); \
410
+ pixel->_channel_ = (Quantum) NUM2UINT(v); \
411
+ rb_funcall(self, ID_changed, 0); \
412
+ rb_funcall(self, ID_notify_observers, 1, self); \
413
+ return INT2NUM(pixel->_channel_); \
414
+ }
415
+
416
+
417
+ /*
418
+ * Enum constants - define a subclass of Enum for the specified enumeration.
419
+ * Define an instance of the subclass for each member in the enumeration.
420
+ * Initialize each instance with its name and value.
421
+ */
422
+ #define DEF_ENUM(tag) {\
423
+ VALUE _cls, _enum;\
424
+ _cls = Class_##tag = rm_define_enum_type(#tag);
425
+
426
+ #define ENUMERATOR(val)\
427
+ _enum = rm_enum_new(_cls, ID2SYM(rb_intern(#val)), INT2FIX(val));\
428
+ rb_define_const(Module_Magick, #val, _enum);
429
+ #define END_ENUM }
430
+
431
+ // Define a Magick module constant
432
+ #define DEF_CONST(constant) rb_define_const(Module_Magick, #constant, INT2FIX(constant))
433
+
434
+
435
+ // Convert a Ruby enum constant back to a C enum member.
436
+ #define VALUE_TO_ENUM(value, e, type) \
437
+ do {\
438
+ MagickEnum *magick_enum;\
439
+ if (CLASS_OF(value) != Class_##type)\
440
+ rb_raise(rb_eTypeError, "wrong enumeration type - expected %s, got %s"\
441
+ , rb_class2name(Class_##type),rb_class2name(CLASS_OF(value)));\
442
+ Data_Get_Struct(value, MagickEnum, magick_enum);\
443
+ e = (type)(magick_enum->val);\
444
+ } while(0)
445
+
446
+
447
+
448
+ // Method, external function declarations. These declarations are
449
+ // grouped by the source file in which the methods are defined.
450
+
451
+ // We don't need any "extern/no extern" stuff here. An external function
452
+ // declaration can refer to a function defined in another source file or
453
+ // the same source file.
454
+
455
+ // rmdraw.c
456
+ ATTR_WRITER(Draw, affine)
457
+ ATTR_WRITER(Draw, align)
458
+ ATTR_WRITER(Draw, decorate)
459
+ ATTR_WRITER(Draw, density)
460
+ ATTR_WRITER(Draw, encoding)
461
+ ATTR_WRITER(Draw, fill)
462
+ ATTR_WRITER(Draw, font)
463
+ ATTR_WRITER(Draw, font_family)
464
+ ATTR_WRITER(Draw, font_stretch)
465
+ ATTR_WRITER(Draw, font_style)
466
+ ATTR_WRITER(Draw, font_weight)
467
+ ATTR_WRITER(Draw, gravity)
468
+ ATTR_WRITER(Draw, pointsize)
469
+ ATTR_WRITER(Draw, rotation)
470
+ ATTR_WRITER(Draw, stroke)
471
+ ATTR_WRITER(Draw, stroke_width)
472
+ ATTR_WRITER(Draw, text_antialias)
473
+ ATTR_WRITER(Draw, undercolor)
474
+ extern VALUE Draw_annotate(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE);
475
+ extern VALUE Draw_clone(VALUE);
476
+ extern VALUE Draw_composite(int, VALUE *, VALUE);
477
+ extern VALUE Draw_draw(VALUE, VALUE);
478
+ extern VALUE Draw_dup(VALUE);
479
+ extern VALUE Draw_get_multiline_type_metrics(int, VALUE *, VALUE);
480
+ extern VALUE Draw_get_type_metrics(int, VALUE *, VALUE);
481
+ extern VALUE Draw_init_copy(VALUE, VALUE);
482
+ extern VALUE Draw_initialize(VALUE);
483
+ extern VALUE Draw_inspect(VALUE);
484
+ #if defined(HAVE_RB_DEFINE_ALLOC_FUNC)
485
+ extern VALUE Draw_alloc(VALUE);
486
+ #else
487
+ extern VALUE Draw_new(VALUE);
488
+ #endif
489
+ extern VALUE Draw_primitive(VALUE, VALUE);
490
+
491
+ ATTR_WRITER(Montage, background_color)
492
+ ATTR_WRITER(Montage, border_color)
493
+ ATTR_WRITER(Montage, border_width)
494
+ ATTR_WRITER(Montage, compose)
495
+ ATTR_WRITER(Montage, filename)
496
+ ATTR_WRITER(Montage, fill)
497
+ ATTR_WRITER(Montage, font)
498
+ ATTR_WRITER(Montage, frame)
499
+ ATTR_WRITER(Montage, geometry)
500
+ ATTR_WRITER(Montage, gravity)
501
+ ATTR_WRITER(Montage, matte_color)
502
+ ATTR_WRITER(Montage, pointsize)
503
+ ATTR_WRITER(Montage, shadow)
504
+ ATTR_WRITER(Montage, stroke)
505
+ ATTR_WRITER(Montage, texture)
506
+ ATTR_WRITER(Montage, tile)
507
+ ATTR_WRITER(Montage, title)
508
+ extern VALUE Montage_initialize(VALUE);
509
+ #if defined(HAVE_RB_DEFINE_ALLOC_FUNC)
510
+ extern VALUE Montage_alloc(VALUE);
511
+ #else
512
+ extern VALUE Montage_new(VALUE);
513
+ #endif
514
+ extern VALUE rm_montage_new(void);
515
+
516
+
517
+ // rmmain.c
518
+ extern VALUE rm_montage_new(void);
519
+
520
+
521
+ // rmilist.c
522
+ extern VALUE ImageList_animate(int, VALUE *, VALUE);
523
+ extern VALUE ImageList_append(VALUE, VALUE);
524
+ extern VALUE ImageList_average(VALUE);
525
+ extern VALUE ImageList_coalesce(VALUE);
526
+ extern VALUE ImageList_deconstruct(VALUE);
527
+ extern VALUE ImageList_display(VALUE);
528
+ extern VALUE ImageList_flatten_images(VALUE);
529
+ extern VALUE ImageList_map(VALUE, VALUE, VALUE);
530
+ extern VALUE ImageList_montage(VALUE);
531
+ extern VALUE ImageList_morph(VALUE, VALUE);
532
+ extern VALUE ImageList_mosaic(VALUE);
533
+ extern VALUE ImageList_quantize(int, VALUE*, VALUE);
534
+ extern VALUE ImageList_to_blob(VALUE);
535
+ extern VALUE ImageList_write(VALUE, VALUE);
536
+
537
+ extern VALUE rm_imagelist_new(void);
538
+ extern VALUE rm_imagelist_from_images(Image *);
539
+ extern Image *rm_images_from_imagelist(VALUE);
540
+ extern VALUE rm_imagelist_scene_eq(VALUE, VALUE);
541
+ extern int rm_imagelist_length(VALUE);
542
+ extern void rm_imagelist_push(VALUE, VALUE);
543
+
544
+
545
+ // rminfo.c
546
+ ATTR_ACCESSOR(Info, antialias)
547
+ ATTR_ACCESSOR(Info, background_color)
548
+ ATTR_ACCESSOR(Info, border_color)
549
+ ATTR_ACCESSOR(Info, colorspace)
550
+ ATTR_ACCESSOR(Info, compression)
551
+ ATTR_ACCESSOR(Info, density)
552
+ ATTR_ACCESSOR(Info, depth)
553
+ ATTR_ACCESSOR(Info, dither)
554
+ ATTR_ACCESSOR(Info, extract)
555
+ ATTR_ACCESSOR(Info, filename)
556
+ ATTR_ACCESSOR(Info, font)
557
+ ATTR_ACCESSOR(Info, format)
558
+ ATTR_ACCESSOR(Info, fuzz)
559
+ ATTR_ACCESSOR(Info, group)
560
+ ATTR_ACCESSOR(Info, image_type)
561
+ ATTR_ACCESSOR(Info, interlace)
562
+ ATTR_ACCESSOR(Info, matte_color)
563
+ ATTR_ACCESSOR(Info, monochrome)
564
+ ATTR_ACCESSOR(Info, number_scenes)
565
+ ATTR_ACCESSOR(Info, page)
566
+ ATTR_ACCESSOR(Info, pen)
567
+ // ATTR_ACCESSOR(Info, ping) obsolete
568
+ // ATTR_ACCESSOR(Info, pointsize)
569
+ ATTR_ACCESSOR(Info, quality)
570
+ ATTR_ACCESSOR(Info, scene)
571
+ ATTR_ACCESSOR(Info, server_name)
572
+ ATTR_ACCESSOR(Info, subimage)
573
+ ATTR_ACCESSOR(Info, subrange)
574
+ ATTR_ACCESSOR(Info, tile)
575
+ ATTR_ACCESSOR(Info, size)
576
+ ATTR_ACCESSOR(Info, units)
577
+ ATTR_ACCESSOR(Info, view)
578
+ //ATTR_ACCESSOR(Info, verbose)
579
+
580
+ #if defined(HAVE_RB_DEFINE_ALLOC_FUNC)
581
+ extern VALUE Info_alloc(VALUE);
582
+ #else
583
+ extern VALUE Info_new(VALUE);
584
+ #endif
585
+
586
+ extern VALUE Info_define(int, VALUE *, VALUE);
587
+ extern VALUE Info_initialize(VALUE);
588
+ extern VALUE rm_info_new(void);
589
+
590
+
591
+ // rmimage.c
592
+ ATTR_ACCESSOR(Image, background_color)
593
+ ATTR_READER(Image, base_columns)
594
+ ATTR_READER(Image, base_filename)
595
+ ATTR_READER(Image, base_rows)
596
+ ATTR_ACCESSOR(Image, blur)
597
+ ATTR_ACCESSOR(Image, border_color)
598
+ ATTR_READER(Image, bounding_box)
599
+ ATTR_ACCESSOR(Image, chromaticity)
600
+ ATTR_WRITER(Image, clip_mask)
601
+ ATTR_ACCESSOR(Image, color_profile)
602
+ ATTR_READER(Image, colors)
603
+ ATTR_ACCESSOR(Image, colorspace)
604
+ ATTR_READER(Image, columns)
605
+ ATTR_ACCESSOR(Image, compose)
606
+ ATTR_ACCESSOR(Image, compression)
607
+ ATTR_ACCESSOR(Image, delay)
608
+ ATTR_ACCESSOR(Image, density)
609
+ ATTR_READER(Image, depth)
610
+ ATTR_READER(Image, directory)
611
+ ATTR_ACCESSOR(Image, dispose)
612
+ ATTR_ACCESSOR(Image, endian)
613
+ ATTR_ACCESSOR(Image, extract_info)
614
+ ATTR_READER(Image, filename)
615
+ ATTR_READER(Image, filesize)
616
+ ATTR_ACCESSOR(Image, filter)
617
+ ATTR_ACCESSOR(Image, format)
618
+ ATTR_ACCESSOR(Image, fuzz)
619
+ ATTR_ACCESSOR(Image, gamma)
620
+ ATTR_ACCESSOR(Image, geometry)
621
+ ATTR_ACCESSOR(Image, image_type)
622
+ ATTR_ACCESSOR(Image, interlace)
623
+ ATTR_ACCESSOR(Image, iptc_profile)
624
+ ATTR_ACCESSOR(Image, iterations)
625
+ ATTR_ACCESSOR(Image, matte)
626
+ ATTR_ACCESSOR(Image, matte_color)
627
+ ATTR_READER(Image, mean_error_per_pixel)
628
+ ATTR_READER(Image, mime_type)
629
+ ATTR_ACCESSOR(Image, montage)
630
+ ATTR_READER(Image, normalized_mean_error)
631
+ ATTR_READER(Image, normalized_maximum_error)
632
+ ATTR_READER(Image, number_colors)
633
+ ATTR_ACCESSOR(Image, offset)
634
+ ATTR_WRITER(Image, opacity)
635
+ ATTR_ACCESSOR(Image, page)
636
+ ATTR_READER(Image, quantum_depth)
637
+ ATTR_ACCESSOR(Image, rendering_intent)
638
+ ATTR_READER(Image, rows)
639
+ ATTR_READER(Image, scene)
640
+ ATTR_ACCESSOR(Image, start_loop)
641
+ ATTR_ACCESSOR(Image, class_type)
642
+ ATTR_ACCESSOR(Image, tile_info)
643
+ ATTR_READER(Image, total_colors)
644
+ ATTR_ACCESSOR(Image, units)
645
+ ATTR_ACCESSOR(Image, x_resolution)
646
+ ATTR_ACCESSOR(Image, y_resolution)
647
+
648
+ #if defined(HAVE_RB_DEFINE_ALLOC_FUNC)
649
+ extern VALUE Image_alloc(VALUE);
650
+ extern VALUE Image_initialize(int, VALUE *, VALUE);
651
+ #else
652
+ extern VALUE Image_new(int, VALUE *, VALUE);
653
+ extern VALUE Image_initialize(VALUE, VALUE, VALUE, VALUE, VALUE);
654
+ #endif
655
+
656
+ extern VALUE Image_adaptive_threshold(int, VALUE *, VALUE);
657
+ extern VALUE Image_add_noise(VALUE, VALUE);
658
+ extern VALUE Image_affine_transform(VALUE, VALUE);
659
+ extern VALUE Image_aref(VALUE, VALUE);
660
+ extern VALUE Image_aset(VALUE, VALUE, VALUE);
661
+ extern VALUE Image_properties(VALUE);
662
+ extern VALUE Image_bilevel_channel(int, VALUE *, VALUE);
663
+ extern VALUE Image_black_threshold(int, VALUE *, VALUE);
664
+ extern VALUE Image_blur_image(int, VALUE *, VALUE);
665
+ extern VALUE Image_blur_channel(int, VALUE *, VALUE);
666
+ extern VALUE Image_border(VALUE, VALUE, VALUE, VALUE);
667
+ extern VALUE Image_border_bang(VALUE, VALUE, VALUE, VALUE);
668
+ extern VALUE Image_capture(int, VALUE *, VALUE);
669
+ extern VALUE Image_change_geometry(VALUE, VALUE);
670
+ extern VALUE Image_changed_q(VALUE);
671
+ extern VALUE Image_channel(VALUE, VALUE);
672
+ extern VALUE Image_compare_channel(int, VALUE *, VALUE);
673
+ extern VALUE Image_channel_depth(int, VALUE *, VALUE);
674
+ extern VALUE Image_channel_extrema(int, VALUE *, VALUE);
675
+ extern VALUE Image_channel_mean(int, VALUE *, VALUE);
676
+ extern VALUE Image_channel_threshold(int, VALUE *, VALUE);
677
+ extern VALUE Image_charcoal(int, VALUE *, VALUE);
678
+ extern VALUE Image_chop(VALUE, VALUE, VALUE, VALUE, VALUE);
679
+ extern VALUE Image_clone(VALUE);
680
+ extern VALUE Image_color_flood_fill(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE);
681
+ extern VALUE Image_color_histogram(VALUE);
682
+ extern VALUE Image_colorize(int, VALUE *, VALUE);
683
+ extern VALUE Image_colormap(int, VALUE *, VALUE);
684
+ extern VALUE Image_composite(int, VALUE *, VALUE);
685
+ extern VALUE Image_composite_bang(int, VALUE *, VALUE);
686
+ extern VALUE Image_composite_affine(VALUE, VALUE, VALUE);
687
+ extern VALUE Image_compress_colormap_bang(VALUE);
688
+ extern VALUE Image_constitute(VALUE, VALUE, VALUE, VALUE, VALUE);
689
+ extern VALUE Image_contrast(int, VALUE *, VALUE);
690
+ extern VALUE Image_convolve(VALUE, VALUE, VALUE);
691
+ extern VALUE Image_convolve_channel(int, VALUE *, VALUE);
692
+ extern VALUE Image_copy(VALUE);
693
+ extern VALUE Image_crop(int, VALUE *, VALUE);
694
+ extern VALUE Image_crop_bang(int, VALUE *, VALUE);
695
+ extern VALUE Image_cycle_colormap(VALUE, VALUE);
696
+ extern VALUE Image_despeckle(VALUE);
697
+ extern VALUE Image_difference(VALUE, VALUE);
698
+ extern VALUE Image_dispatch(int, VALUE *, VALUE);
699
+ extern VALUE Image_display(VALUE);
700
+ extern VALUE Image__dump(VALUE, VALUE);
701
+ extern VALUE Image_dup(VALUE);
702
+ extern VALUE Image_each_profile(VALUE);
703
+ extern VALUE Image_edge(int, VALUE *, VALUE);
704
+ extern VALUE Image_emboss(int, VALUE *, VALUE);
705
+ extern VALUE Image_enhance(VALUE);
706
+ extern VALUE Image_equalize(VALUE);
707
+ extern VALUE Image_erase_bang(VALUE);
708
+ extern VALUE Image_export_pixels(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE);
709
+ extern VALUE Image_flip(VALUE);
710
+ extern VALUE Image_flip_bang(VALUE);
711
+ extern VALUE Image_flop(VALUE);
712
+ extern VALUE Image_flop_bang(VALUE);
713
+ extern VALUE Image_frame(int, VALUE *, VALUE);
714
+ extern VALUE Image_from_blob(VALUE, VALUE);
715
+ extern VALUE Image_gamma_channel(int, VALUE *, VALUE);
716
+ extern VALUE Image_gamma_correct(int, VALUE *, VALUE);
717
+ extern VALUE Image_gaussian_blur(int, VALUE *, VALUE);
718
+ extern VALUE Image_gaussian_blur_channel(int, VALUE *, VALUE);
719
+ extern VALUE Image_get_pixels(VALUE, VALUE, VALUE, VALUE, VALUE);
720
+ extern VALUE Image_gray_q(VALUE);
721
+ extern VALUE Image_grayscale_pseudo_class(int, VALUE *, VALUE);
722
+ extern VALUE Image_implode(int, VALUE *, VALUE);
723
+ extern VALUE Image_import_pixels(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE);
724
+ extern VALUE Image_init_copy(VALUE, VALUE);
725
+ extern VALUE Image_inspect(VALUE);
726
+ extern VALUE Image_level(int, VALUE *, VALUE);
727
+ extern VALUE Image_level_channel(int, VALUE *, VALUE);
728
+ extern VALUE Image__load(VALUE, VALUE);
729
+ extern VALUE Image_magnify(VALUE);
730
+ extern VALUE Image_magnify_bang(VALUE);
731
+ extern VALUE Image_map(int, VALUE *, VALUE);
732
+ extern VALUE Image_matte_flood_fill(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE);
733
+ extern VALUE Image_median_filter(int, VALUE *, VALUE);
734
+ extern VALUE Image_minify(VALUE);
735
+ extern VALUE Image_minify_bang(VALUE);
736
+ extern VALUE Image_modulate(int, VALUE *, VALUE);
737
+ extern VALUE Image_monochrome_q(VALUE);
738
+ extern VALUE Image_motion_blur(VALUE, VALUE, VALUE, VALUE);
739
+ extern VALUE Image_negate(int, VALUE *, VALUE);
740
+ extern VALUE Image_negate_channel(int, VALUE *, VALUE);
741
+ extern VALUE Image_normalize(VALUE);
742
+ extern VALUE Image_normalize_channel(int, VALUE *, VALUE);
743
+ extern VALUE Image_oil_paint(int, VALUE *, VALUE);
744
+ extern VALUE Image_opaque(VALUE, VALUE, VALUE);
745
+ extern VALUE Image_opaque_q(VALUE);
746
+ extern VALUE Image_ordered_dither(VALUE);
747
+ extern VALUE Image_palette_q(VALUE);
748
+ extern VALUE Image_ping(VALUE, VALUE);
749
+ extern VALUE Image_pixel_color(int, VALUE *, VALUE);
750
+ // VALUE Image_plasma(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE);
751
+ extern VALUE Image_posterize(int, VALUE *, VALUE);
752
+ extern VALUE Image_preview(VALUE, VALUE);
753
+ extern VALUE Image_profile_bang(VALUE, VALUE, VALUE);
754
+ extern VALUE Image_quantize(int, VALUE *, VALUE);
755
+ extern VALUE Image_quantization_error(VALUE);
756
+ extern VALUE Image_quantum_operator(int, VALUE *, VALUE);
757
+ extern VALUE Image_radial_blur(VALUE, VALUE);
758
+ extern VALUE Image_raise(int, VALUE *, VALUE);
759
+ extern VALUE Image_random_channel_threshold(VALUE, VALUE, VALUE);
760
+ extern VALUE Image_random_threshold_channel(int, VALUE *, VALUE);
761
+ extern VALUE Image_read(VALUE, VALUE);
762
+ extern VALUE Image_read_inline(VALUE, VALUE);
763
+ extern VALUE Image_reduce_noise(VALUE, VALUE);
764
+ extern VALUE Image_resize(int, VALUE *, VALUE);
765
+ extern VALUE Image_resize_bang(int, VALUE *, VALUE);
766
+ extern VALUE Image_roll(VALUE, VALUE, VALUE);
767
+ extern VALUE Image_rotate(VALUE, VALUE);
768
+ extern VALUE Image_rotate_bang(VALUE, VALUE);
769
+ extern VALUE Image_sample(int, VALUE *, VALUE);
770
+ extern VALUE Image_sample_bang(int, VALUE *, VALUE);
771
+ extern VALUE Image_scale(int, VALUE *, VALUE);
772
+ extern VALUE Image_scale_bang(int, VALUE *, VALUE);
773
+ extern VALUE Image_segment(int, VALUE *, VALUE);
774
+ extern VALUE Image_set_channel_depth(VALUE, VALUE, VALUE);
775
+ extern VALUE Image_shade(int, VALUE *, VALUE);
776
+ extern VALUE Image_sharpen(int, VALUE *, VALUE);
777
+ extern VALUE Image_sharpen_channel(int, VALUE *, VALUE);
778
+ extern VALUE Image_shave(VALUE, VALUE, VALUE);
779
+ extern VALUE Image_shave_bang(VALUE, VALUE, VALUE);
780
+ extern VALUE Image_shear(VALUE, VALUE, VALUE);
781
+ extern VALUE Image_signature(VALUE);
782
+ extern VALUE Image_solarize(int, VALUE *, VALUE);
783
+ extern VALUE Image_spaceship(VALUE, VALUE);
784
+ extern VALUE Image_splice(int, VALUE *, VALUE);
785
+ extern VALUE Image_spread(int, VALUE *, VALUE);
786
+ extern VALUE Image_statistics(VALUE);
787
+ extern VALUE Image_stegano(VALUE, VALUE, VALUE);
788
+ extern VALUE Image_stereo(VALUE, VALUE);
789
+ extern VALUE Image_store_pixels(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE);
790
+ extern VALUE Image_strip_bang(VALUE);
791
+ extern VALUE Image_swirl(VALUE, VALUE);
792
+ extern VALUE Image_texture_flood_fill(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE);
793
+ extern VALUE Image_threshold(VALUE, VALUE);
794
+ extern VALUE Image_thumbnail(int, VALUE *, VALUE);
795
+ extern VALUE Image_thumbnail_bang(int, VALUE *, VALUE);
796
+ extern VALUE Image_tint(int, VALUE *, VALUE);
797
+ extern VALUE Image_to_blob(VALUE);
798
+ extern VALUE Image_to_color(VALUE, VALUE);
799
+ extern VALUE Image_transparent(int, VALUE *, VALUE);
800
+ extern VALUE Image_trim(VALUE);
801
+ extern VALUE Image_trim_bang(VALUE);
802
+ extern VALUE Image_unsharp_mask(int, VALUE *, VALUE);
803
+ extern VALUE Image_unsharp_mask_channel(int, VALUE *, VALUE);
804
+ extern VALUE Image_wave(int, VALUE *, VALUE);
805
+ extern VALUE Image_white_threshold(int, VALUE *, VALUE);
806
+ extern VALUE Image_write(VALUE, VALUE);
807
+
808
+ extern VALUE rm_image_new(Image *);
809
+
810
+
811
+ // rmfill.c
812
+ #if defined(HAVE_RB_DEFINE_ALLOC_FUNC)
813
+ extern VALUE GradientFill_alloc(VALUE);
814
+ #else
815
+ extern VALUE GradientFill_new(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE);
816
+ #endif
817
+
818
+ extern VALUE GradientFill_initialize(VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE);
819
+ extern VALUE GradientFill_fill(VALUE, VALUE);
820
+
821
+ #if defined(HAVE_RB_DEFINE_ALLOC_FUNC)
822
+ extern VALUE TextureFill_alloc(VALUE);
823
+ #else
824
+ extern VALUE TextureFill_new(VALUE, VALUE);
825
+ #endif
826
+
827
+ extern VALUE TextureFill_initialize(VALUE, VALUE);
828
+ extern VALUE TextureFill_fill(VALUE, VALUE);
829
+
830
+
831
+ // rmutil.c
832
+ extern VALUE ChromaticityInfo_to_s(VALUE);
833
+ extern VALUE ChromaticityInfo_new(ChromaticityInfo *);
834
+ extern void Color_to_PixelPacket(PixelPacket *, VALUE);
835
+ extern VALUE Color_to_s(VALUE);
836
+ extern VALUE Color_from_ColorInfo(const ColorInfo *);
837
+ extern VALUE ClassType_new(ClassType);
838
+ extern VALUE ColorspaceType_new(ColorspaceType);
839
+ extern VALUE CompressionType_new(CompressionType);
840
+ extern VALUE EndianType_new(EndianType);
841
+ extern VALUE FilterTypes_new(FilterTypes);
842
+ extern VALUE Font_to_s(VALUE);
843
+ extern VALUE ImageList_cur_image(VALUE);
844
+ extern VALUE ImageMagickError_initialize(int, VALUE *, VALUE);
845
+ extern VALUE ImageType_new(ImageType);
846
+ extern VALUE InterlaceType_new(InterlaceType);
847
+
848
+ #if defined(HAVE_RB_DEFINE_ALLOC_FUNC)
849
+ extern VALUE Pixel_alloc(VALUE);
850
+ #else
851
+ extern VALUE Pixel_new(int, VALUE *, VALUE);
852
+ #endif
853
+ ATTR_ACCESSOR(Pixel, red)
854
+ ATTR_ACCESSOR(Pixel, green)
855
+ ATTR_ACCESSOR(Pixel, blue)
856
+ ATTR_ACCESSOR(Pixel, opacity)
857
+ extern VALUE Pixel_case_eq(VALUE, VALUE);
858
+ extern VALUE Pixel_clone(VALUE);
859
+ extern VALUE Pixel_dup(VALUE);
860
+ extern VALUE Pixel_fcmp(int, VALUE *, VALUE);
861
+ extern VALUE Pixel_from_color(VALUE, VALUE);
862
+ extern VALUE Pixel_from_HSL(VALUE, VALUE);
863
+ extern VALUE Pixel_initialize(int, VALUE *, VALUE);
864
+ extern VALUE Pixel_init_copy(VALUE, VALUE);
865
+ extern VALUE Pixel_intensity(VALUE);
866
+ extern VALUE Pixel_spaceship(VALUE, VALUE);
867
+ extern VALUE Pixel_to_color(int, VALUE *, VALUE);
868
+ extern VALUE Pixel_to_HSL(VALUE);
869
+ extern VALUE Pixel_to_s(VALUE);
870
+ extern VALUE PixelPacket_to_Color_Name(Image *, PixelPacket *);
871
+ extern VALUE PixelPacket_to_Color_Name_Info(Info *, PixelPacket *);
872
+ extern VALUE Pixel_from_PixelPacket(PixelPacket *);
873
+
874
+ extern void Point_to_PointInfo(PointInfo *, VALUE);
875
+ extern VALUE PointInfo_to_Point(PointInfo *);
876
+ extern VALUE PrimaryInfo_to_s(VALUE);
877
+ extern VALUE PrimaryInfo_from_PrimaryInfo(PrimaryInfo *);
878
+ extern VALUE RectangleInfo_to_s(VALUE);
879
+ extern VALUE Rectangle_from_RectangleInfo(RectangleInfo *);
880
+ extern VALUE RenderingIntent_new(RenderingIntent);
881
+ extern VALUE ResolutionType_new(ResolutionType);
882
+ extern VALUE SegmentInfo_to_s(VALUE);
883
+ extern VALUE Segment_from_SegmentInfo(SegmentInfo *);
884
+ extern void AffineMatrix_to_AffineMatrix(AffineMatrix *, VALUE);
885
+ extern void ChromaticityInfo_to_ChromaticityInfo(ChromaticityInfo *, VALUE);
886
+ extern void Color_to_ColorInfo(ColorInfo *, VALUE);
887
+ extern void PrimaryInfo_to_PrimaryInfo(PrimaryInfo *, VALUE);
888
+ extern void Rectangle_to_RectangleInfo(RectangleInfo *, VALUE);
889
+ extern void Segment_to_SegmentInfo(SegmentInfo *, VALUE);
890
+ extern void Font_to_TypeInfo(TypeInfo *, VALUE);
891
+ extern void TypeMetric_to_TypeMetric(TypeMetric *, VALUE);
892
+ extern VALUE Font_from_TypeInfo(TypeInfo *);
893
+ extern VALUE TypeMetric_to_s(VALUE);
894
+ extern VALUE TypeMetric_from_TypeMetric(TypeMetric *);
895
+ #if defined(HAVE_GETIMAGESTATISTICS)
896
+ extern VALUE Statistics_new(ImageStatistics *);
897
+ #endif
898
+
899
+ #if defined(HAVE_RB_DEFINE_ALLOC_FUNC)
900
+ extern VALUE Enum_alloc(VALUE);
901
+ #else
902
+ extern VALUE Enum_new(VALUE, VALUE, VALUE);
903
+ #endif
904
+ extern VALUE Enum_initialize(VALUE, VALUE, VALUE);
905
+ extern VALUE Enum_to_s(VALUE);
906
+ extern VALUE Enum_to_i(VALUE);
907
+ extern VALUE Enum_spaceship(VALUE, VALUE);
908
+ extern VALUE Enum_case_eq(VALUE, VALUE);
909
+ extern VALUE Enum_type_initialize(VALUE, VALUE, VALUE);
910
+ extern VALUE Enum_type_each(VALUE);
911
+
912
+
913
+ extern void *magick_malloc(const size_t);
914
+ extern void magick_free(void *);
915
+ extern void *magick_realloc(void *, size_t);
916
+ extern void magick_clone_string(char **, const char *);
917
+ extern VALUE rm_enum_new(VALUE, VALUE, VALUE);
918
+ extern VALUE rm_no_freeze(VALUE);
919
+ #if !defined(StringValuePtr)
920
+ extern char *rm_string_value_ptr(volatile VALUE *);
921
+ #endif
922
+ extern char *rm_string_value_ptr_len(volatile VALUE *, long *);
923
+ extern void rm_check_ary_len(VALUE, int);
924
+ extern void rm_check_frozen(VALUE);
925
+ extern VALUE rm_obj_to_s(VALUE);
926
+ extern double rm_fuzz_to_dbl(VALUE fuzz);
927
+ extern VALUE rm_define_enum_type(char *);
928
+ extern void rm_write_temp_image(Image *, char *);
929
+ extern void rm_delete_temp_image(char *);
930
+ extern void rm_not_implemented(void);
931
+ extern void rm_handle_error(ExceptionInfo *);
932
+ extern void rm_handle_all_errors(Image *);
933
+ extern void rm_attr_write(VALUE, VALUE);
934
+ extern void rm_get_geometry(VALUE, long *, long *, unsigned long *, unsigned long *, int *);
935
+ extern void rm_split(Image *);
936
+
937
+ #endif
938
+