rmagick 1.9.3 → 1.10.0

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

Potentially problematic release.


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

Files changed (62) hide show
  1. data/ChangeLog +18 -0
  2. data/README.html +12 -12
  3. data/README.txt +10 -10
  4. data/configure +728 -367
  5. data/configure.ac +134 -69
  6. data/doc/comtasks.html +11 -3
  7. data/doc/constants.html +162 -40
  8. data/doc/draw.html +2 -2
  9. data/doc/ex/crop_resized.rb +10 -0
  10. data/doc/ex/get_type_metrics.rb +26 -22
  11. data/doc/ex/vignette.rb +19 -0
  12. data/doc/ilist.html +0 -5
  13. data/doc/image1.html +219 -49
  14. data/doc/image2.html +115 -47
  15. data/doc/image3.html +105 -23
  16. data/doc/imageattrs.html +4 -23
  17. data/doc/imusage.html +1 -1
  18. data/doc/index.html +8 -9
  19. data/doc/info.html +23 -3
  20. data/doc/magick.html +1 -1
  21. data/doc/rvg.html +1 -1
  22. data/doc/rvgclip.html +1 -1
  23. data/doc/rvggroup.html +1 -1
  24. data/doc/rvgimage.html +1 -1
  25. data/doc/rvgpattern.html +1 -1
  26. data/doc/rvgshape.html +1 -1
  27. data/doc/rvgstyle.html +1 -1
  28. data/doc/rvgtext.html +3 -3
  29. data/doc/rvgtspan.html +1 -1
  30. data/doc/rvgtut.html +119 -101
  31. data/doc/rvguse.html +1 -1
  32. data/doc/rvgxform.html +1 -1
  33. data/doc/struct.html +17 -11
  34. data/doc/usage.html +22 -4
  35. data/examples/histogram.rb +48 -12
  36. data/examples/spinner.rb +49 -0
  37. data/ext/RMagick/MANIFEST +4 -1
  38. data/ext/RMagick/rmagick.h +62 -33
  39. data/ext/RMagick/rmagick_config.h.in +28 -31
  40. data/ext/RMagick/rmdraw.c +14 -6
  41. data/ext/RMagick/rmfill.c +2 -2
  42. data/ext/RMagick/rmilist.c +8 -36
  43. data/ext/RMagick/rmimage.c +370 -97
  44. data/ext/RMagick/rminfo.c +6 -6
  45. data/ext/RMagick/rmmain.c +114 -25
  46. data/ext/RMagick/rmutil.c +98 -35
  47. data/lib/RMagick.rb +17 -2
  48. data/lib/rvg/clippath.rb +2 -2
  49. data/lib/rvg/container.rb +2 -2
  50. data/lib/rvg/describable.rb +2 -2
  51. data/lib/rvg/embellishable.rb +2 -2
  52. data/lib/rvg/misc.rb +3 -3
  53. data/lib/rvg/paint.rb +2 -2
  54. data/lib/rvg/pathdata.rb +2 -2
  55. data/lib/rvg/rvg.rb +2 -2
  56. data/lib/rvg/stretchable.rb +2 -2
  57. data/lib/rvg/stylable.rb +2 -2
  58. data/lib/rvg/text.rb +2 -2
  59. data/lib/rvg/transformable.rb +2 -2
  60. data/lib/rvg/units.rb +2 -2
  61. data/rmagick.gemspec +1 -1
  62. metadata +362 -353
@@ -11,7 +11,7 @@
11
11
  "text/html; charset=us-ascii" />
12
12
  <meta name="GENERATOR" content="Quanta Plus" />
13
13
  <meta name="Copyright" content=
14
- "Copyright (C) 2005 by Timothy P. Hunter" />
14
+ "Copyright (C) 2006 by Timothy P. Hunter" />
15
15
  <link rel="stylesheet" type="text/css" href="css/doc.css" />
16
16
  <script type="text/javascript" src="scripts/doc.js">
17
17
  </script>
@@ -680,7 +680,7 @@ title.annotate(montage, 0,0,0,40, 'Named Colors') {
680
680
  <p>A Magick::TypeMetric struct. This structure has the
681
681
  following attributes. (The descriptions are taken from the
682
682
  <a href=
683
- "http://www.imagemagick.org/www/Magick++/TypeMetric.html">Magick++</a>
683
+ "http://www.imagemagick.org/Magick++/TypeMetric.html">Magick++</a>
684
684
  documentation and source code.)</p>
685
685
 
686
686
  <table summary="type metric attributes" class="simple_table">
@@ -0,0 +1,10 @@
1
+ #!/usr/local/bin/ruby -w
2
+ require 'RMagick'
3
+
4
+ # Demonstrate the crop_resize method
5
+
6
+ img = Magick::Image.read('images/Flower_Hat.jpg')[0]
7
+ thumbnail = img.crop_resized(76, 76)
8
+ thumbnail.write("crop_resized.jpg")
9
+
10
+
@@ -27,10 +27,11 @@ end # class Draw
27
27
 
28
28
 
29
29
  Origin_x = 110
30
- Origin_y = 220
30
+ Origin_y = 230
31
31
  Glyph = 'g'
32
+ Face = ARGV[0] ? ARGV[0] : "Times"
32
33
 
33
- canvas = Image.new(410,300,HatchFill.new('white', 'lightcyan2'))
34
+ canvas = Image.new(410,320,HatchFill.new('white', 'lightcyan2'))
34
35
 
35
36
  # Draw a big lowercase 'g' on the canvas. Leave room on all sides for
36
37
  # the labels. Use 'undercolor' to set off the glyph.
@@ -39,7 +40,7 @@ glyph.annotate(canvas, 0, 0, Origin_x, Origin_y, Glyph) do |opts|
39
40
  opts.pointsize = 124
40
41
  opts.stroke = 'none'
41
42
  opts.fill = 'black'
42
- opts.font_family = 'Times'
43
+ opts.font_family = Face
43
44
  opts.undercolor = '#ffff00c0'
44
45
  end
45
46
 
@@ -47,11 +48,12 @@ end
47
48
  metrics = glyph.get_type_metrics(canvas, Glyph)
48
49
 
49
50
  gc = Draw.new
51
+ gc.translate(Origin_x, Origin_y)
50
52
 
51
53
  # Draw the origin as a big red dot.
52
54
  gc.stroke('red')
53
55
  gc.fill('red')
54
- gc.circle(Origin_x, Origin_y, Origin_x, Origin_y+2)
56
+ gc.circle(0, 0, 0, 2)
55
57
 
56
58
  # All our lines will be medium-gray, dashed, and thin.
57
59
  gc.stroke('gray50')
@@ -60,26 +62,27 @@ gc.stroke_width(1)
60
62
  gc.fill('none')
61
63
 
62
64
  # baseline
63
- gc.line(Origin_x-10, Origin_y, Origin_x+metrics.width+20, Origin_y)
65
+ gc.line(-10, 0, metrics.width+20, 0)
64
66
 
65
67
  # a vertical line through the origin
66
- gc.line(Origin_x, 30, Origin_x, 270)
68
+ gc.line(0, -metrics.descent-metrics.height-10, 0, -metrics.descent+15)
67
69
 
68
70
  # descent
69
- gc.line(Origin_x-10, Origin_y-metrics.descent, Origin_x+metrics.width+20, Origin_y-metrics.descent)
71
+ gc.line(-10, -metrics.descent, metrics.width+20, -metrics.descent)
70
72
 
71
73
  # ascent
72
- gc.line(Origin_x-10, Origin_y-metrics.ascent, Origin_x+metrics.width+20, Origin_y-metrics.ascent)
74
+ gc.line(-10, -metrics.ascent, metrics.width+20, -metrics.ascent)
73
75
 
74
76
  # height
75
- gc.line(Origin_x-10, Origin_y-metrics.height, Origin_x+metrics.width+10, Origin_y-metrics.height)
77
+ gc.line(-10, -metrics.descent-metrics.height,
78
+ metrics.width+10, -metrics.descent-metrics.height)
76
79
 
77
80
  # width
78
- gc.line(Origin_x+metrics.width, 30, Origin_x+metrics.width, 270)
81
+ gc.line(metrics.width, -metrics.descent-metrics.height-10,
82
+ metrics.width, -metrics.descent+20)
79
83
 
80
84
  # max_advance
81
- gc.line(Origin_x+metrics.max_advance, Origin_y-metrics.descent-10,
82
- Origin_x+metrics.max_advance, 270)
85
+ gc.line(metrics.max_advance, -10, metrics.max_advance, -metrics.descent+20)
83
86
 
84
87
  gc.draw(canvas)
85
88
 
@@ -91,36 +94,37 @@ gc.pointsize(13)
91
94
  gc.fill('none')
92
95
  gc.stroke('black')
93
96
  gc.stroke_width(1)
97
+ gc.translate(Origin_x, Origin_y)
94
98
 
95
99
  # between origin and descent
96
100
  gc.push
97
- gc.translate(Origin_x+metrics.width+23, Origin_y)
101
+ gc.translate(metrics.width+23, 0)
98
102
  gc.brace(10, metrics.descent)
99
103
  gc.pop
100
104
 
101
105
  # between origin and ascent
102
106
  gc.push
103
- gc.translate(Origin_x+metrics.width+23, Origin_y)
107
+ gc.translate(metrics.width+23, 0)
104
108
  gc.brace(10, metrics.ascent)
105
109
  gc.pop
106
110
 
107
111
  # between origin and height
108
112
  gc.push
109
- gc.translate(Origin_x-13, Origin_y-metrics.height)
113
+ gc.translate(-13, -metrics.descent-metrics.height)
110
114
  gc.rotate(180)
111
115
  gc.brace(10, metrics.height)
112
116
  gc.pop
113
117
 
114
118
  # between origin and width
115
119
  gc.push
116
- gc.translate(Origin_x+metrics.width, 27.0)
120
+ gc.translate(metrics.width, -metrics.descent-metrics.height-10-3)
117
121
  gc.rotate(-90)
118
122
  gc.brace(10, metrics.width)
119
123
  gc.pop
120
124
 
121
125
  # between origin and max_advance
122
126
  gc.push
123
- gc.translate(Origin_x, Origin_y-metrics.descent+14)
127
+ gc.translate(0, -metrics.descent+15)
124
128
  gc.rotate(90)
125
129
  gc.brace(10, metrics.max_advance)
126
130
  gc.pop
@@ -128,11 +132,11 @@ gc.pop
128
132
  # Add labels
129
133
  gc.stroke('none')
130
134
  gc.fill('black')
131
- gc.text(Origin_x+metrics.width+40, Origin_y-(metrics.ascent/2)+4, 'ascent')
132
- gc.text(Origin_x+metrics.width+40, Origin_y-(metrics.descent/2)+4, 'descent')
133
- gc.text(Origin_x-60, Origin_y-metrics.height/2+4, 'height')
134
- gc.text(Origin_x+(metrics.width/2)-15, 15, 'width')
135
- gc.text(Origin_x+(metrics.max_advance)/2-38, 290, "max_advance")
135
+ gc.text(metrics.width+40, -(metrics.ascent/2)+4, 'ascent')
136
+ gc.text(metrics.width+40, -(metrics.descent/2)+4, 'descent')
137
+ gc.text(-60, -metrics.descent-metrics.height/2+4, 'height')
138
+ gc.text((metrics.width/2)-15, -metrics.descent-metrics.height-25, 'width')
139
+ gc.text((metrics.max_advance)/2-38, -metrics.descent+35, "max_advance")
136
140
 
137
141
  gc.draw(canvas)
138
142
  canvas.border!(1,1,'blue')
@@ -0,0 +1,19 @@
1
+ #! /usr/local/bin/ruby -w
2
+
3
+ require 'RMagick'
4
+
5
+ # Demonstrate the Image#vignette method.
6
+ # Compare this example with the vignette.rb script in the examples directory.
7
+
8
+ img = Magick::Image.read('images/Flower_Hat.jpg').first
9
+
10
+ begin
11
+ vignette = img.vignette
12
+ rescue NotImplementedError
13
+ vignette = Magick::Image.read('images/notimplemented.gif').first
14
+ vignette.resize!(img.columns, img.rows)
15
+ end
16
+
17
+ vignette.write('vignette.jpg')
18
+
19
+ exit
@@ -895,11 +895,6 @@ scene=1
895
895
 
896
896
  <p><a href="image2.html#inspect">Image#inspect</a></p>
897
897
 
898
- <h4>Magick API</h4>
899
-
900
- <p>The description is essentially the same as that provided by
901
- <a href=
902
- "http://www.imagemagick.org/www/api/image.html#describeimage">DescribeImageList</a></p>
903
898
  </div>
904
899
 
905
900
  <div class="sig">
@@ -4,7 +4,7 @@
4
4
  <html xmlns="http://www.w3.org/1999/xhtml">
5
5
  <head>
6
6
  <meta name="generator" content=
7
- "HTML Tidy for Linux/x86 (vers 1st March 2005), see www.w3.org" />
7
+ "HTML Tidy for Linux/x86 (vers 1st December 2004), see www.w3.org" />
8
8
 
9
9
  <title>RMagick: class Image (class and instance methods, part
10
10
  1)</title>
@@ -12,7 +12,7 @@
12
12
  "text/html; charset=us-ascii" />
13
13
  <meta name="GENERATOR" content="Quanta Plus" />
14
14
  <meta name="Copyright" content=
15
- "Copyright (C) 2005 by Timothy P. Hunter" />
15
+ "Copyright (C) 2006 by Timothy P. Hunter" />
16
16
  <link rel="stylesheet" type="text/css" href="css/doc.css" />
17
17
  <script type="text/javascript" src="scripts/doc.js">
18
18
  </script>
@@ -97,6 +97,9 @@ float: left;
97
97
 
98
98
  <li><a href="#add_noise">add_noise</a></li>
99
99
 
100
+ <li><a href=
101
+ "#add_noise_channel">add_noise_channel</a></li>
102
+
100
103
  <li><a href="#affine_transform">affine_transform</a></li>
101
104
 
102
105
  <li><a href="#annotate">annotate</a></li>
@@ -157,14 +160,14 @@ float: left;
157
160
  <li><a href="#composite_bang">composite!</a></li>
158
161
 
159
162
  <li><a href="#composite_affine">composite_affine</a></li>
163
+
164
+ <li><a href=
165
+ "#compress_colormap_bang">compress_colormap!</a></li>
160
166
  </ul>
161
167
  </div>
162
168
 
163
169
  <div class="toccol">
164
170
  <ul>
165
- <li><a href=
166
- "#compress_colormap_bang">compress_colormap!</a></li>
167
-
168
171
  <li><a href="#contrast">contrast</a></li>
169
172
 
170
173
  <li><a href="#convolve">convolve</a></li>
@@ -177,6 +180,10 @@ float: left;
177
180
 
178
181
  <li><a href="#crop_bang">crop!</a></li>
179
182
 
183
+ <li><a href="#crop_resized">crop_resized</a></li>
184
+
185
+ <li><a href="#crop_resized_bang">crop_resized!</a></li>
186
+
180
187
  <li><a href="#cycle_colormap">cycle_colormap</a></li>
181
188
 
182
189
  <li><a href="#despeckle">despeckle</a></li>
@@ -187,7 +194,8 @@ float: left;
187
194
 
188
195
  <li><a href="#display">display</a></li>
189
196
 
190
- <li><a href="#distortion_channel">distortion_channel</a></li>
197
+ <li><a href=
198
+ "#distortion_channel">distortion_channel</a></li>
191
199
 
192
200
  <li><a href="#dup">dup</a></li>
193
201
 
@@ -766,7 +774,7 @@ img = Magick::Image.read_inline(content)
766
774
  <h3 id="add_noise">add_noise</h3>
767
775
 
768
776
  <p><span class="arg">image</span>.add_noise(<span class=
769
- "arg">aNoiseType</span>) -&gt; <em>anImage</em></p>
777
+ "arg">noise_type</span>) -&gt; <em>anImage</em></p>
770
778
  </div>
771
779
 
772
780
  <div class="desc">
@@ -779,7 +787,7 @@ img = Magick::Image.read_inline(content)
779
787
  <h4>Arguments</h4>
780
788
 
781
789
  <p>A <a href="constants.html#NoiseType">NoiseType</a>
782
- constant.</p>
790
+ value.</p>
783
791
 
784
792
  <h4>Returns</h4>
785
793
 
@@ -790,8 +798,8 @@ img = Magick::Image.read_inline(content)
790
798
  <div class="noise_example_wrapper">
791
799
  <a href="javascript:popup('add_noise.rb.html')"><img src=
792
800
  "ex/images/Flower_Hat.jpg" alt="add_noise example" id=
793
- "add_noise_example" title=
794
- "Click to see the example script" /></a>
801
+ "add_noise_example" title="Click to see the example script"
802
+ /></a>
795
803
 
796
804
  <p>Click the NoiseType to see the effect.</p>
797
805
 
@@ -823,6 +831,54 @@ img = Magick::Image.read_inline(content)
823
831
  <h4>Magick API</h4>
824
832
 
825
833
  <p>AddNoiseImage</p>
834
+
835
+ <h4>See also</h4>
836
+
837
+ <p><a href="#add_noise_channel">add_noise_channel</a></p>
838
+ </div>
839
+
840
+ <div class="sig">
841
+ <h3 id="add_noise_channel">add_noise_channel</h3>
842
+
843
+ <p>image.add_noise_channel(<span class="arg">noise_type</span>
844
+ [,<span class="arg">channel</span>...]) -&gt;
845
+ <em>anImage</em></p>
846
+ </div>
847
+
848
+ <div class="desc">
849
+ <h4>Description</h4>
850
+
851
+ <p>Adds random noise to the specified channel or channels in
852
+ the image.</p>
853
+
854
+ <h4>Arguments</h4>
855
+
856
+ <dl>
857
+ <dt>noise_type</dt>
858
+
859
+ <dd>A <a href="constants.html#NoiseType">NoiseType</a>
860
+ value.</dd>
861
+
862
+ <dt>channel...</dt>
863
+
864
+ <dd>0 or more <a href=
865
+ "constants.html#ChannelType">ChannelType</a> arguments. If no
866
+ channels are specified, adds noise to all the channels.
867
+ Specifying no channel arguments has the same effect as the
868
+ <code>add_noise</code> method, above.</dd>
869
+ </dl>
870
+
871
+ <h4>Returns</h4>
872
+
873
+ <p>A new image</p>
874
+
875
+ <h4>Magick API</h4>
876
+
877
+ <p>AddNoiseImageChannel (available in ImageMagick 6.2.5)</p>
878
+
879
+ <h4>See also</h4>
880
+
881
+ <p><a href="#add_noise">add_noise</a></p>
826
882
  </div>
827
883
 
828
884
  <div class="sig">
@@ -905,7 +961,8 @@ img = Magick::Image.read_inline(content)
905
961
  <h3 id="bilevel_channel">bilevel_channel</h3>
906
962
 
907
963
  <p><span class="arg">image</span>.bilevel_channel(<span class=
908
- "arg">threshold</span> [,<span class="arg">channel...</span>]) = <em>aNewImage</em></p>
964
+ "arg">threshold</span> [,<span class="arg">channel...</span>])
965
+ = <em>aNewImage</em></p>
909
966
  </div>
910
967
 
911
968
  <div class="desc">
@@ -964,7 +1021,8 @@ img = Magick::Image.read_inline(content)
964
1021
 
965
1022
  <p><span class="arg">image</span>.blur_channel(<span class=
966
1023
  "arg">radius=0.0</span>, <span class=
967
- "arg">sigma=1.0</span><span class="arg">[, channel...]]</span>) -&gt; <em>anImage</em></p>
1024
+ "arg">sigma=1.0</span><span class="arg">[, channel...]]</span>)
1025
+ -&gt; <em>anImage</em></p>
968
1026
  </div>
969
1027
 
970
1028
  <div class="desc">
@@ -1144,12 +1202,13 @@ img = Magick::Image.read_inline(content)
1144
1202
  "padding: 10px; display: none;" id="borderless" onmouseout=
1145
1203
  "this.style.display='none'; bordered.style.display='';" src=
1146
1204
  "ex/images/Flower_Hat.jpg" alt="border example" title=
1147
- "Click to see the example script" /> <img id="bordered"
1148
- onmouseover=
1205
+ "Click to see the example script" /> <img id=
1206
+ "bordered" onmouseover=
1149
1207
  "this.style.display='none'; borderless.style.display='';" src=
1150
- "ex/border.jpg" alt="border example" /></a><img src=
1151
- "ex/images/spin.gif" alt="" class="spin" style="left: 224px;"
1152
- title="Mouse over the example to see the original image" /></p>
1208
+ "ex/border.jpg" alt="border example"
1209
+ /></a><img src="ex/images/spin.gif" alt="" class=
1210
+ "spin" style="left: 224px;" title=
1211
+ "Mouse over the example to see the original image" /></p>
1153
1212
 
1154
1213
  <h4>See also</h4>
1155
1214
 
@@ -1265,7 +1324,7 @@ mona.change_geometry!('320x240') { |cols, rows, img|
1265
1324
  <h4>Arguments</h4>
1266
1325
 
1267
1326
  <p>A <a href="constants.html#ChannelType">ChannelType</a>
1268
- constant.</p>
1327
+ value.</p>
1269
1328
 
1270
1329
  <h4>Returns</h4>
1271
1330
 
@@ -1294,8 +1353,7 @@ mona.change_geometry!('320x240') { |cols, rows, img|
1294
1353
  <h3 id="channel_depth">channel_depth</h3>
1295
1354
 
1296
1355
  <p><span class="arg">image</span>.channel_depth([<span class=
1297
- "arg">channel</span>...])
1298
- -&gt; <em>aNumeric</em></p>
1356
+ "arg">channel</span>...]) -&gt; <em>aNumeric</em></p>
1299
1357
  </div>
1300
1358
 
1301
1359
  <div class="desc">
@@ -1310,7 +1368,7 @@ mona.change_geometry!('320x240') { |cols, rows, img|
1310
1368
  <dt>channel...</dt>
1311
1369
 
1312
1370
  <dd>Zero or more <a href=
1313
- "constants.html#ChannelType">ChannelType</a> constants. If no
1371
+ "constants.html#ChannelType">ChannelType</a> values. If no
1314
1372
  arguments are specified, the default is all channels.</dd>
1315
1373
  </dl>
1316
1374
 
@@ -1332,8 +1390,8 @@ mona.change_geometry!('320x240') { |cols, rows, img|
1332
1390
  <h3 id="channel_extrema">channel_extrema</h3>
1333
1391
 
1334
1392
  <p><span class="arg">image</span>.channel_extrema([<span class=
1335
- "arg">channel</span>...])
1336
- -&gt; <em>[aNumeric, aNumeric]</em></p>
1393
+ "arg">channel</span>...]) -&gt; <em>[aNumeric,
1394
+ aNumeric]</em></p>
1337
1395
  </div>
1338
1396
 
1339
1397
  <div class="desc">
@@ -1375,8 +1433,8 @@ mona.change_geometry!('320x240') { |cols, rows, img|
1375
1433
  <h3 id="channel_mean">channel_mean</h3>
1376
1434
 
1377
1435
  <p><span class="arg">image</span>.channel_mean([<span class=
1378
- "arg">channel</span>...])
1379
- -&gt; <em>[aNumeric, aNumeric]</em></p>
1436
+ "arg">channel</span>...]) -&gt; <em>[aNumeric,
1437
+ aNumeric]</em></p>
1380
1438
  </div>
1381
1439
 
1382
1440
  <div class="desc">
@@ -1913,9 +1971,8 @@ f.color_reset!(red)
1913
1971
 
1914
1972
  <dt>metric</dt>
1915
1973
 
1916
- <dd>
1917
- The desired distortion metric. A <a href="constants.html#MetricType">MetricType</a> value.
1918
- </dd>
1974
+ <dd>The desired distortion metric. A <a href=
1975
+ "constants.html#MetricType">MetricType</a> value.</dd>
1919
1976
 
1920
1977
  <dt>channel...</dt>
1921
1978
 
@@ -1935,8 +1992,8 @@ f.color_reset!(red)
1935
1992
  <h4>See also</h4>
1936
1993
 
1937
1994
  <p><a href="#difference">difference</a>, <a href=
1938
- "#spaceship">&lt;=&gt;</a>,
1939
- <a href="#distortion_channel">distortion_channel</a></p>
1995
+ "#spaceship">&lt;=&gt;</a>, <a href=
1996
+ "#distortion_channel">distortion_channel</a></p>
1940
1997
 
1941
1998
  <h4>Magick API</h4>
1942
1999
 
@@ -1996,7 +2053,7 @@ f.color_reset!(red)
1996
2053
 
1997
2054
  <dd>A <a href=
1998
2055
  "constants.html#CompositeOperator">CompositeOperator</a>
1999
- constant.</dd>
2056
+ value.</dd>
2000
2057
  </dl>
2001
2058
  </dd>
2002
2059
 
@@ -2014,7 +2071,7 @@ f.color_reset!(red)
2014
2071
 
2015
2072
  <dd>
2016
2073
  A <a href="constants.html#GravityType">GravityType</a>
2017
- constant that specifies the location of <em>img</em> on
2074
+ value that specifies the location of <em>img</em> on
2018
2075
  <em>image</em>:
2019
2076
 
2020
2077
  <dl>
@@ -2069,7 +2126,7 @@ f.color_reset!(red)
2069
2126
 
2070
2127
  <dd>A <a href=
2071
2128
  "constants.html#CompositeOperator">CompositeOperator</a>
2072
- constant.</dd>
2129
+ value.</dd>
2073
2130
  </dl>
2074
2131
  </dd>
2075
2132
 
@@ -2086,7 +2143,7 @@ f.color_reset!(red)
2086
2143
  <dt>gravity</dt>
2087
2144
 
2088
2145
  <dd>A <a href=
2089
- "constants.html#GravityType">GravityType</a> constant. If
2146
+ "constants.html#GravityType">GravityType</a> value. If
2090
2147
  the argument is NorthEastGravity, EastGravity, or
2091
2148
  SouthEastGravity, the x-offset is measured from the right
2092
2149
  side of the image. If the argument is SouthEastGravity,
@@ -2104,7 +2161,7 @@ f.color_reset!(red)
2104
2161
 
2105
2162
  <dd>A <a href=
2106
2163
  "constants.html#CompositeOperator">CompositeOperator</a>
2107
- constant.</dd>
2164
+ value.</dd>
2108
2165
  </dl>
2109
2166
  </dd>
2110
2167
  </dl>
@@ -2330,7 +2387,8 @@ f.colors &raquo; 108
2330
2387
 
2331
2388
  <p><span class="arg">image</span>.convolve_channel(<span class=
2332
2389
  "arg">order</span>, <span class="arg">kernel</span> [,
2333
- <span class="arg">channel</span>...]) -&gt; <em>anImage</em></p>
2390
+ <span class="arg">channel</span>...]) -&gt;
2391
+ <em>anImage</em></p>
2334
2392
  </div>
2335
2393
 
2336
2394
  <div class="desc">
@@ -2451,7 +2509,7 @@ f2 = f.copy
2451
2509
 
2452
2510
  <dd>
2453
2511
  A <a href="constants.html#GravityType">GravityType</a>
2454
- constant specifying the position of the rectangle.
2512
+ value specifying the position of the rectangle.
2455
2513
 
2456
2514
  <dl>
2457
2515
  <dt>NorthWestGravity</dt>
@@ -2515,7 +2573,7 @@ f2 = f.copy
2515
2573
  <dt>gravity</dt>
2516
2574
 
2517
2575
  <dd>A <a href=
2518
- "constants.html#GravityType">GravityType</a> constant. If
2576
+ "constants.html#GravityType">GravityType</a> value. If
2519
2577
  the argument is NorthEastGravity, EastGravity, or
2520
2578
  SouthEastGravity, the <em>x-</em>offset is measured from
2521
2579
  the right side of the image. If the argument is
@@ -2608,6 +2666,102 @@ cropped = img.crop(x, y, width, height, true)
2608
2666
  <p>self</p>
2609
2667
  </div>
2610
2668
 
2669
+ <div class="sig">
2670
+ <h3 id="crop_resized">crop_resized</h3>
2671
+
2672
+ <p><span class="arg">image</span>.crop_resized(<span class=
2673
+ "arg">width</span>, <span class="arg">height</span>,
2674
+ <span class=
2675
+ "arg">gravity</span>=<code>Magick::CenterGravity</code>) -&gt;
2676
+ <span class="arg">anImage</span></p>
2677
+ </div>
2678
+
2679
+ <div class="desc">
2680
+ <h4>Description</h4>
2681
+
2682
+ <p>Creates an image with the size specified by <span class=
2683
+ "arg">width</span> and <span class="arg">height</span> having
2684
+ the same aspect ratio as the target image. Use
2685
+ <code>crop_resized</code> to produce a thumbnail image with an
2686
+ exact size.</p>
2687
+
2688
+ <p>If necessary, <code>crop_resized</code> resizes the image
2689
+ such that its smaller dimension exactly fits the rectangle
2690
+ specified by <span class="arg">width</span> and <span class=
2691
+ "arg">height</span>. If the resulting image exceeds the
2692
+ rectangle's size in the image's larger dimension,
2693
+ <code>crop_resized</code> crops the image to fit the rectangle
2694
+ exactly. Use <span class="arg">gravity</span> to specify which
2695
+ portion of the image to crop.</p>
2696
+
2697
+ <h4>Arguments</h4>
2698
+
2699
+ <dl>
2700
+ <dt>width</dt>
2701
+
2702
+ <dd>The width of the resulting image in pixels</dd>
2703
+
2704
+ <dt>height</dt>
2705
+
2706
+ <dd>The height of the resulting image in pixels</dd>
2707
+
2708
+ <dt>gravity</dt>
2709
+
2710
+ <dd>Use this argument to specify which portion of the image
2711
+ to retain when cropping. The value can be any <a href=
2712
+ "constants.html#GravityType">GravityType</a> value. The
2713
+ effect is the same as the <span class="arg">gravity</span>
2714
+ argument to the <a href="#crop"><code>crop</code></a> method.
2715
+ The default is <code>CenterGravity</code>.</dd>
2716
+ </dl>
2717
+
2718
+ <h4>Returns</h4>
2719
+
2720
+ <p>A new image</p>
2721
+
2722
+ <h4>Example</h4>
2723
+
2724
+ <p>In this example, some rows have been cropped from the top
2725
+ and bottom to produce a square thumbnail from a rectangular
2726
+ image without distorting the image.</p>
2727
+
2728
+ <p class="rollover"><a href=
2729
+ "javascript:popup('crop_resized.rb.html')">
2730
+ <!-- This img tag displays the original image when the mouse is over -->
2731
+ <img id="cropless" style="display: none" onmouseout=
2732
+ "this.style.display='none';cropped.style.display='';" src=
2733
+ "ex/images/Flower_Hat.jpg" alt="crop_resize example" title=
2734
+ "Click to see the example script" />
2735
+ <!-- This img tag displays the framed image when the mouse is not over-->
2736
+ <img style=
2737
+ "padding-left:62px; padding-right: 62px; padding-top: 87px;padding-bottom:87px;"
2738
+ id="cropped" onmouseover=
2739
+ "this.style.display='none';cropless.style.display='';" src=
2740
+ "ex/crop_resized.jpg" alt="frame example" /></a>
2741
+ <img src="ex/images/spin.gif" alt="" style=
2742
+ "margin-bottom: 230px" title=
2743
+ "Mouse over the example to see the original image" /></p>
2744
+ </div>
2745
+
2746
+ <div class="sig">
2747
+ <h3 id="crop_resize_bang">crop_resized!</h3>
2748
+
2749
+ <p><span class="arg">image</span>.crop_resized!(<span class=
2750
+ "arg">width</span>, <span class="arg">height</span>,
2751
+ <span class=
2752
+ "arg">gravity</span>=<code>Magick::CenterGravity</code>) -&gt;
2753
+ <span class="arg">image</span></p>
2754
+ </div>
2755
+
2756
+ <div class="desc">
2757
+ <h4>Description</h4>The in-place form of <a href=
2758
+ "#crop_resized">crop_resized</a>.
2759
+
2760
+ <h4>Returns</h4>
2761
+
2762
+ <p>self</p>
2763
+ </div>
2764
+
2611
2765
  <div class="sig">
2612
2766
  <h3 id="cycle_colormap">cycle_colormap</h3>
2613
2767
 
@@ -2860,24 +3014,34 @@ exit
2860
3014
  </div>
2861
3015
 
2862
3016
  <div class="sig">
2863
- <h3 id="distortion_channel">distortion_channel</h3>
2864
- <p><span class="arg">image</span>.distortion_channel(<span class="arg">reconstructed_image</span>, <span class="arg">metric</span>[, <span class="arg">channel</span>...]) -&gt; <em>aFloat</em></p>
3017
+ <h3 id="distortion_channel">distortion_channel</h3>
3018
+
3019
+ <p><span class=
3020
+ "arg">image</span>.distortion_channel(<span class=
3021
+ "arg">reconstructed_image</span>, <span class=
3022
+ "arg">metric</span>[, <span class="arg">channel</span>...])
3023
+ -&gt; <em>aFloat</em></p>
2865
3024
  </div>
2866
3025
 
2867
3026
  <div class="desc">
2868
- <h4>Description</h4>
2869
- <p class="imquote">(C)ompares one or more image channels of an image to a reconstructed image and returns the specified distortion metric.</p>
3027
+ <h4>Description</h4>
3028
+
3029
+ <p class="imquote">(C)ompares one or more image channels of an
3030
+ image to a reconstructed image and returns the specified
3031
+ distortion metric.</p>
3032
+
2870
3033
  <h4>Arguments</h4>
3034
+
2871
3035
  <dl>
2872
- <dt>reconstructed_image</dt>
3036
+ <dt>reconstructed_image</dt>
3037
+
2873
3038
  <dd>Either an imagelist or an image. If an imagelist, uses
2874
3039
  the current image.</dd>
2875
3040
 
2876
3041
  <dt>metric</dt>
2877
3042
 
2878
- <dd>
2879
- The desired distortion metric. A <a href="constants.html#MetricType">MetricType</a> value.
2880
- </dd>
3043
+ <dd>The desired distortion metric. A <a href=
3044
+ "constants.html#MetricType">MetricType</a> value.</dd>
2881
3045
 
2882
3046
  <dt>channel...</dt>
2883
3047
 
@@ -2887,12 +3051,18 @@ exit
2887
3051
  distortion value. If no channels are specified, compares all
2888
3052
  channels.</dd>
2889
3053
  </dl>
3054
+
2890
3055
  <h4>Returns</h4>
3056
+
2891
3057
  <h4>Magick API</h4>
2892
- <p>GetImageChannelDistortion (available in ImageMagick 6.2.0)</p>
3058
+
3059
+ <p>GetImageChannelDistortion (available in ImageMagick
3060
+ 6.2.0)</p>
3061
+
2893
3062
  <h4>See also</h4>
2894
- <p><a href="#compare_channel">compare_channel</a>,
2895
- <a href="#difference">difference</a></p>
3063
+
3064
+ <p><a href="#compare_channel">compare_channel</a>, <a href=
3065
+ "#difference">difference</a></p>
2896
3066
  </div>
2897
3067
 
2898
3068
  <div class="sig">