rmagick 1.13.0 → 1.14.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 (48) hide show
  1. data/ChangeLog +34 -0
  2. data/README.html +12 -29
  3. data/README.txt +10 -26
  4. data/configure +768 -73
  5. data/configure.ac +29 -26
  6. data/doc/comtasks.html +3 -4
  7. data/doc/constants.html +85 -67
  8. data/doc/draw.html +22 -0
  9. data/doc/ex/dissolve.rb +13 -0
  10. data/doc/ex/edge.rb +1 -1
  11. data/doc/ex/mask.rb +37 -0
  12. data/doc/ex/sketch.rb +25 -0
  13. data/doc/ex/watermark.rb +23 -0
  14. data/doc/ilist.html +11 -13
  15. data/doc/image1.html +601 -52
  16. data/doc/image2.html +637 -28
  17. data/doc/image3.html +339 -54
  18. data/doc/imageattrs.html +211 -41
  19. data/doc/imusage.html +41 -2
  20. data/doc/index.html +8 -6
  21. data/doc/info.html +57 -42
  22. data/doc/optequiv.html +1919 -0
  23. data/doc/rvg.html +45 -42
  24. data/doc/scripts/doc.js +14 -1
  25. data/doc/scripts/stripeTables.js +23 -0
  26. data/doc/usage.html +66 -15
  27. data/{doc/ex → examples}/demo.rb +0 -0
  28. data/examples/find_similar_region.rb +34 -0
  29. data/examples/import_export.rb +1 -1
  30. data/examples/pattern_fill.rb +2 -2
  31. data/examples/rotating_text.rb +2 -4
  32. data/examples/thumbnail.rb +1 -1
  33. data/ext/RMagick/MANIFEST +9 -4
  34. data/ext/RMagick/extconf.rb.in +1 -1
  35. data/ext/RMagick/rmagick.h +47 -10
  36. data/ext/RMagick/rmagick_config.h.in +24 -0
  37. data/ext/RMagick/rmdraw.c +32 -7
  38. data/ext/RMagick/rmilist.c +55 -37
  39. data/ext/RMagick/rmimage.c +1588 -447
  40. data/ext/RMagick/rminfo.c +94 -3
  41. data/ext/RMagick/rmmain.c +68 -7
  42. data/ext/RMagick/rmutil.c +67 -9
  43. data/lib/RMagick.rb +190 -53
  44. data/lib/rvg/stretchable.rb +17 -13
  45. data/rmagick.gemspec +1 -1
  46. metadata +11 -6
  47. data/doc/ex/level_channel.rb +0 -33
  48. data/doc/ex/opaque.rb +0 -14
@@ -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: RVG Reference: RVG Class</title>
10
10
  <meta http-equiv="Content-Type" content=
@@ -891,76 +891,79 @@ canvas.background_position = :scaled
891
891
 
892
892
  <h2 id="units" class="methods">Units</h2>
893
893
 
894
- <p>RVG supports a subset of the unit identifiers defined by the
895
- SVG specification. In RVG, unit identifiers are methods in the
896
- Float and Fixnum classes. The units are (for the most part)
897
- defined in terms of "dots per inch," accordingly, the unit
898
- identifier methods are added only if the value</p>
899
- <pre>
894
+ <div style="margin-left: 235px; margin-top:1em">
895
+ <p>RVG supports a subset of the unit identifiers defined by the
896
+ SVG specification. In RVG, unit identifiers are methods in the
897
+ Float and Fixnum classes. The units are (for the most part)
898
+ defined in terms of "dots per inch," accordingly, the unit
899
+ identifier methods are added only if the value</p>
900
+ <pre>
900
901
  Magick::RVG.dpi = NN
901
902
  </pre>
902
903
 
903
- <p>is defined, where NN is the number of "dots" (pixels) per inch
904
- you wish to use. (Hint: 90 is a good default.)</p>
904
+ <p>is defined, where NN is the number of "dots" (pixels) per
905
+ inch you wish to use. (Hint: 90 is a good default.)</p>
905
906
 
906
- <p>For example, to specify a length of 10 inches, you can use</p>
907
- <pre>
907
+ <p>For example, to specify a length of 10 inches, you can
908
+ use</p>
909
+ <pre>
908
910
  Magick::RVG.dpi = 90
909
911
  length = 10.in # =&gt; 900 pixels
910
912
  </pre>
911
913
 
912
- <p>If the dpi is defined, the following methods are added to
913
- <code>Float</code> and <code>Fixnum</code></p>
914
+ <p>If the dpi is defined, the following methods are added to
915
+ <code>Float</code> and <code>Fixnum</code></p>
914
916
 
915
- <dl>
916
- <dt>px</dt>
917
+ <dl>
918
+ <dt>px</dt>
917
919
 
918
- <dd>Pixel. The default unit of measurement.</dd>
920
+ <dd>Pixel. The default unit of measurement.</dd>
919
921
 
920
- <dt>in</dt>
922
+ <dt>in</dt>
921
923
 
922
- <dd>Converts inches to pixels</dd>
924
+ <dd>Converts inches to pixels</dd>
923
925
 
924
- <dt>mm</dt>
926
+ <dt>mm</dt>
925
927
 
926
- <dd>Converts millimeters to pixels</dd>
928
+ <dd>Converts millimeters to pixels</dd>
927
929
 
928
- <dt>cm</dt>
930
+ <dt>cm</dt>
929
931
 
930
- <dd>Converts centimeters to pixels</dd>
932
+ <dd>Converts centimeters to pixels</dd>
931
933
 
932
- <dt>pt</dt>
934
+ <dt>pt</dt>
933
935
 
934
- <dd>Converts points to pixels. There are 72 points to the
935
- inch.</dd>
936
+ <dd>Converts points to pixels. There are 72 points to the
937
+ inch.</dd>
936
938
 
937
- <dt>pc</dt>
939
+ <dt>pc</dt>
938
940
 
939
- <dd>Converts picas to pixels. There are 12 points to the
940
- pica.</dd>
941
+ <dd>Converts picas to pixels. There are 12 points to the
942
+ pica.</dd>
941
943
 
942
- <dt>deg</dt>
944
+ <dt>deg</dt>
943
945
 
944
- <dd>Degrees. The default unit of rotation.</dd>
946
+ <dd>Degrees. The default unit of rotation.</dd>
945
947
 
946
- <dt>rad</dt>
948
+ <dt>rad</dt>
947
949
 
948
- <dd>Converts radians to degrees.</dd>
950
+ <dd>Converts radians to degrees.</dd>
949
951
 
950
- <dt>grad</dt>
952
+ <dt>grad</dt>
951
953
 
952
- <dd>Converts grads to degrees. There are 400 grads in a
953
- circle.</dd>
954
+ <dd>Converts grads to degrees. There are 400 grads in a
955
+ circle.</dd>
954
956
 
955
- <dt>pct</dt>
957
+ <dt>pct</dt>
956
958
 
957
- <dd>This conversion takes an numeric argument and returns a
958
- percentage of the argument. For example 20.pct(150) -&gt;
959
- 30</dd>
960
- </dl>
959
+ <dd>This conversion takes an numeric argument and returns a
960
+ percentage of the argument. For example 20.pct(150) -&gt;
961
+ 30</dd>
962
+ </dl>
961
963
 
962
- <p>SVG also supports <em>em</em> and <em>ex</em>, which are
963
- measurements based on the font size. RVG does not.</p>
964
+ <p>SVG also supports <em>em</em> and <em>ex</em>, which are
965
+ measurements based on the font size. RVG does not.</p>
966
+ </div>
964
967
 
965
968
  <p class="spacer">&nbsp;</p>
966
969
 
@@ -1,4 +1,3 @@
1
-
2
1
  // Show an example script in a popup window
3
2
  function popup(URL) {
4
3
  day = new Date();
@@ -6,4 +5,18 @@ function popup(URL) {
6
5
  eval("page" + id + " = window.open(URL, '" + id + "','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1');");
7
6
  }
8
7
 
8
+ // Run a function on window onload event
9
+ function addLoadEvent(func) {
10
+ var oldonload = window.onload;
11
+ if (typeof window.onload != 'function') {
12
+ window.onload = func;
13
+ }
14
+ else {
15
+ window.onload = function () {
16
+ oldonload();
17
+ func();
18
+ }
19
+ }
20
+ }
21
+
9
22
 
@@ -0,0 +1,23 @@
1
+ // Alternate gray/white rows in all the tables having the class "striped"
2
+ function stripeTables() {
3
+ if (!document.getElementsByTagName) {
4
+ return false;
5
+ }
6
+ var tables = document.getElementsByTagName("table");
7
+ for (var i = 0; i < tables.length; i++) {
8
+ if (tables[i].className == "striped") {
9
+ var gray = true;
10
+ var rows = tables[i].getElementsByTagName("tr");
11
+ for (var j = 0; j < rows.length; j++) {
12
+ if (gray) {
13
+ rows[j].style.backgroundColor = "#f0f0f0";
14
+ gray = false;
15
+ }
16
+ else {
17
+ gray = true;
18
+ }
19
+ }
20
+ }
21
+ }
22
+ }
23
+
@@ -401,6 +401,10 @@ exit
401
401
 
402
402
  <dd>Set an image property</dd>
403
403
 
404
+ <dt><a href="image1.html#add_profile">add_profile</a></dt>
405
+
406
+ <dd>Add an ICC, IPTC, or generic profile</dd>
407
+
404
408
  <dt><a href="image1.html#changed_q">changed?</a></dt>
405
409
 
406
410
  <dd>Has the image been changed?</dd>
@@ -448,6 +452,11 @@ exit
448
452
 
449
453
  <dd class="ilist">Return a deep copy of the imagelist</dd>
450
454
 
455
+ <dt><a href=
456
+ "image1.html#delete_profile">delete_profile</a></dt>
457
+
458
+ <dd>Delete an ICC, IPTC, or generic profile</dd>
459
+
451
460
  <dt><a href="image1.html#difference">difference</a></dt>
452
461
 
453
462
  <dd>Compute the difference between two images</dd>
@@ -481,6 +490,11 @@ exit
481
490
 
482
491
  <dd>Extract pixel data from the image into a string</dd>
483
492
 
493
+ <dt><a href=
494
+ "image2.html#find_similar_region">find_similar_region</a></dt>
495
+
496
+ <dd>Search for a rectangle matching the target</dd>
497
+
484
498
  <dt><a href=
485
499
  "image2.html#get_exif_by_entry">get_exif_by_entry</a>,
486
500
  <a href=
@@ -552,6 +566,11 @@ exit
552
566
 
553
567
  <dd>Strip the image of all comments and profiles</dd>
554
568
 
569
+ <dt><a href=
570
+ "image3.html#unique_colors">unique_colors</a></dt>
571
+
572
+ <dd>Construct an image from the unique colors</dd>
573
+
555
574
  <dt><a href="image3.html#view">view</a></dt>
556
575
 
557
576
  <dd>Access pixels by their coordinates.</dd>
@@ -623,6 +642,11 @@ exit
623
642
 
624
643
  <dd>Halve the size of the image</dd>
625
644
 
645
+ <dt><a href="image3.html#resample">resample</a></dt>
646
+
647
+ <dd>Resample the image to the specified horizontal and
648
+ vertical resolution</dd>
649
+
626
650
  <dt><a href="image3.html#resize">resize</a></dt>
627
651
 
628
652
  <dd>Resize the image using a filter</dd>
@@ -773,29 +797,18 @@ exit
773
797
  <dd>Create a vertical mirror image</dd>
774
798
  </dl>
775
799
 
776
- <h4>Transform</h4>
800
+ <h4>Composite</h4>
777
801
 
778
802
  <dl>
779
- <dt class="ilist"><a href="ilist.html#append">append</a></dt>
780
-
781
- <dd class="ilist">Append all the images in the imagelist into
782
- a single image</dd>
783
-
784
803
  <dt class="ilist"><a href=
785
804
  "ilist.html#average">average</a></dt>
786
805
 
787
806
  <dd class="ilist">Average all the images in the imagelist
788
807
  into a single image</dd>
789
808
 
790
- <dt><a href="image1.html#chop">chop</a></dt>
791
-
792
- <dd>Chop a region from the image</dd>
809
+ <dt><a href="image1.html#blend">blend</a></dt>
793
810
 
794
- <dt class="ilist"><a href=
795
- "ilist.html#coalesce">coalesce</a></dt>
796
-
797
- <dd class="ilist">Merge successive images in the imagelist
798
- into a new imagelist</dd>
811
+ <dd>Blend two images together</dd>
799
812
 
800
813
  <dt><a href="image1.html#composite">composite</a></dt>
801
814
 
@@ -807,6 +820,37 @@ exit
807
820
  <dd>Composite the image onto another image as dictated by an
808
821
  affine matrix</dd>
809
822
 
823
+ <dt><a href="image1.html#displace">displace</a></dt>
824
+
825
+ <dd>Distort the image using a displacement map</dd>
826
+
827
+ <dt><a href="image1.html#dissolve">dissolve</a></dt>
828
+
829
+ <dd>Dissolve two images into each other</dd>
830
+
831
+ <dt><a href="image3.html#watermark">watermark</a></dt>
832
+
833
+ <dd>Composite a watermark onto the image</dd>
834
+ </dl>
835
+
836
+ <h4>Transform</h4>
837
+
838
+ <dl>
839
+ <dt class="ilist"><a href="ilist.html#append">append</a></dt>
840
+
841
+ <dd class="ilist">Append all the images in the imagelist into
842
+ a single image</dd>
843
+
844
+ <dt><a href="image1.html#chop">chop</a></dt>
845
+
846
+ <dd>Chop a region from the image</dd>
847
+
848
+ <dt class="ilist"><a href=
849
+ "ilist.html#coalesce">coalesce</a></dt>
850
+
851
+ <dd class="ilist">Merge successive images in the imagelist
852
+ into a new imagelist</dd>
853
+
810
854
  <dt><a href="image1.html#crop">crop</a></dt>
811
855
 
812
856
  <dd>Extract a region from the image</dd>
@@ -961,7 +1005,10 @@ exit
961
1005
 
962
1006
  <dd>Force all pixels below the threshold into black</dd>
963
1007
 
964
- <dt><a href="image1.html#blur_image">blur_image</a>, <a href=
1008
+ <dt><a href="image1.html#adaptive_blur">adaptive_blur</a>,
1009
+ <a href=
1010
+ "image1.html#adaptive_blur_channel">adaptive_blur_channel</a>,
1011
+ <a href="image1.html#blur_image">blur_image</a>, <a href=
965
1012
  "image1.html#blur_channel">blur_channel</a>, <a href=
966
1013
  "image2.html#gaussian_blur">gaussian_blur</a>, <a href=
967
1014
  "image2.html#gaussian_blur_channel">gaussian_blur_channel</a>,
@@ -1045,6 +1092,10 @@ exit
1045
1092
 
1046
1093
  <dd>Add a shadow to an image</dd>
1047
1094
 
1095
+ <dt><a href="image3.html#sketch">sketch</a></dt>
1096
+
1097
+ <dd>Simulate a pencil sketch</dd>
1098
+
1048
1099
  <dt><a href="image3.html#solarize">solarize</a></dt>
1049
1100
 
1050
1101
  <dd>Apply a special effect to the image, similar to the
File without changes
@@ -0,0 +1,34 @@
1
+ require 'RMagick'
2
+
3
+ # The Image#find_similar_region searches for a region in the image
4
+ # similar to the target. This example uses a rectangle from the image
5
+ # as the target, assuring that find_similar_region will succeed.
6
+
7
+ # Draw a red rectangle over the image that shows where the target matched.
8
+
9
+ img = Magick::Image.read('../doc/ex/images/Flower_Hat.jpg').first
10
+ target = img.crop(21, 94, 118, 126)
11
+
12
+ begin
13
+ res = img.find_similar_region(target)
14
+ if res
15
+ gc = Magick::Draw.new
16
+ gc.stroke('red')
17
+ gc.stroke_width(2)
18
+ gc.fill('none')
19
+ gc.rectangle(res[0], res[1], res[0]+target.columns, res[1]+target.rows)
20
+ gc.draw(img)
21
+ img.matte = false
22
+ puts "Found similar region. Writing `find_similar_region.gif'..."
23
+ img.write('find_similar_region.gif')
24
+ else
25
+ puts "No match!"
26
+ end
27
+ rescue NotImplementedError
28
+ $stderr.puts <<-END_MSG
29
+ The find_similar_region method is not supported by this version of
30
+ ImageMagick/GraphicsMagick.
31
+ END_MSG
32
+ end
33
+
34
+ exit
@@ -27,5 +27,5 @@ rescue NotImplementedError
27
27
  exit
28
28
  end
29
29
 
30
- copy.display
30
+ copy.write("copy.gif")
31
31
  exit
@@ -13,7 +13,7 @@ puts <<END_INFO
13
13
  This example demonstrates the PATTERN: image format, which is
14
14
  new in ImageMagick 5.5.7. Specify the name of any of the
15
15
  supported patterns as an argument. For example, try "checkerboard".
16
-
16
+
17
17
  END_INFO
18
18
 
19
19
  class PatternFill < Magick::TextureFill
@@ -34,5 +34,5 @@ end
34
34
  attrs = Image.ping("pattern:#{pattern}").first
35
35
 
36
36
  tryit = Image.new(10*attrs.columns, 10*attrs.rows, PatternFill.new(pattern))
37
- tryit.display
37
+ tryit.write("pattern_fill.gif")
38
38
  exit
@@ -39,9 +39,7 @@ animation = ImageList.new
39
39
 
40
40
  animation.delay = 8
41
41
 
42
- # ignored if ImageMagick not configured with ZLIB
43
- animation.compression = ZipCompression
44
42
  #animation.animate
45
- puts "...Writing rotating_text.miff"
46
- animation.write("rotating_text.miff")
43
+ puts "...Writing rotating_text.gif"
44
+ animation.write("rotating_text.gif")
47
45
  exit
@@ -60,6 +60,6 @@ white_bg = white_bg.composite(bg, CenterGravity, OverCompositeOp)
60
60
  # Finally, center the thumbnail on the gray background.
61
61
  thumbnail = white_bg.composite(img, CenterGravity, OverCompositeOp)
62
62
 
63
- thumbnail.display
63
+ thumbnail.write("thumbnail.gif")
64
64
  exit
65
65
 
@@ -1,4 +1,4 @@
1
- MANIFEST for RMagick-1.13.0 - 19:03:30 06/28/06
1
+ MANIFEST for RMagick-1.14.0 - 18:45:26 09/28/06
2
2
 
3
3
  configure
4
4
  README.html
@@ -26,6 +26,8 @@ examples/import_export.rb
26
26
  examples/image_opacity.rb
27
27
  examples/identify.rb
28
28
  examples/histogram.rb
29
+ examples/find_similar_region.rb
30
+ examples/demo.rb
29
31
  examples/describe.rb
30
32
  uninstall.rb
31
33
  setup.rb
@@ -51,6 +53,7 @@ ext/RMagick/rmagick_config.h.in
51
53
  ext/RMagick/rmagick.h
52
54
  ext/RMagick/extconf.rb.in
53
55
  ext/RMagick/MANIFEST
56
+ doc/scripts/stripeTables.js
54
57
  doc/scripts/doc.js
55
58
  doc/usage.html
56
59
  doc/struct.html
@@ -66,6 +69,7 @@ doc/rvgimage.html
66
69
  doc/rvggroup.html
67
70
  doc/rvgclip.html
68
71
  doc/rvg.html
72
+ doc/optequiv.html
69
73
  doc/magick.html
70
74
  doc/info.html
71
75
  doc/index.html
@@ -81,6 +85,7 @@ doc/comtasks.html
81
85
  doc/ex/writing_mode02.rb
82
86
  doc/ex/writing_mode01.rb
83
87
  doc/ex/wave.rb
88
+ doc/ex/watermark.rb
84
89
  doc/ex/vignette.rb
85
90
  doc/ex/viewex.rb
86
91
  doc/ex/unsharp_mask.rb
@@ -118,6 +123,7 @@ doc/ex/solarize.rb
118
123
  doc/ex/smile.rb
119
124
  doc/ex/skewy.rb
120
125
  doc/ex/skewx.rb
126
+ doc/ex/sketch.rb
121
127
  doc/ex/shear.rb
122
128
  doc/ex/shave.rb
123
129
  doc/ex/shadow.rb
@@ -155,7 +161,6 @@ doc/ex/pattern2.rb
155
161
  doc/ex/pattern1.rb
156
162
  doc/ex/path.rb
157
163
  doc/ex/ordered_dither.rb
158
- doc/ex/opaque.rb
159
164
  doc/ex/opacity.rb
160
165
  doc/ex/oil_paint.rb
161
166
  doc/ex/normalize.rb
@@ -172,11 +177,11 @@ doc/ex/median_filter.rb
172
177
  doc/ex/matte_replace.rb
173
178
  doc/ex/matte_floodfill.rb
174
179
  doc/ex/matte_fill_to_border.rb
180
+ doc/ex/mask.rb
175
181
  doc/ex/map_f.rb
176
182
  doc/ex/map.rb
177
183
  doc/ex/line01.rb
178
184
  doc/ex/line.rb
179
- doc/ex/level_channel.rb
180
185
  doc/ex/level.rb
181
186
  doc/ex/implode.rb
182
187
  doc/ex/image.rb
@@ -204,7 +209,7 @@ doc/ex/ellipse.rb
204
209
  doc/ex/edge.rb
205
210
  doc/ex/drop_shadow.rb
206
211
  doc/ex/drawcomp.rb
207
- doc/ex/demo.rb
212
+ doc/ex/dissolve.rb
208
213
  doc/ex/cycle_colormap.rb
209
214
  doc/ex/cubic02.rb
210
215
  doc/ex/cubic01.rb