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
@@ -1,5 +1,5 @@
1
1
  #--
2
- # $Id: stretchable.rb,v 1.2 2005/12/31 14:41:04 rmagick Exp $
2
+ # $Id: stretchable.rb,v 1.3 2006/07/18 22:24:59 rmagick Exp $
3
3
  # Copyright (C) 2006 Timothy P. Hunter
4
4
  #++
5
5
 
@@ -39,9 +39,9 @@ class Magick::RVG
39
39
  module Stretchable
40
40
 
41
41
  private
42
+ # Scale to fit
42
43
  def set_viewbox_none(width, height)
43
44
  sx, sy = 1.0, 1.0
44
- tx, ty = @vbx_x, @vbx_y
45
45
 
46
46
  if @vbx_width
47
47
  sx = width / @vbx_width
@@ -50,13 +50,12 @@ class Magick::RVG
50
50
  sy = height / @vbx_height
51
51
  end
52
52
 
53
- return [tx, ty, sx, sy]
53
+ return [sx, sy]
54
54
  end
55
55
 
56
56
  # Use align attribute to compute x- and y-offset from viewport's upper-left corner.
57
57
  def align_to_viewport(width, height, sx, sy)
58
- tx, ty = @vbx_x, @vbx_y
59
- tx += case @align
58
+ tx = case @align
60
59
  when /\AxMin/
61
60
  0
62
61
  when NilClass, /\AxMid/
@@ -65,7 +64,7 @@ class Magick::RVG
65
64
  width - @vbx_width*sx
66
65
  end
67
66
 
68
- ty += case @align
67
+ ty = case @align
69
68
  when /YMin\z/
70
69
  0
71
70
  when NilClass, /YMid\z/
@@ -79,15 +78,13 @@ class Magick::RVG
79
78
  # Scale to smaller viewbox dimension
80
79
  def set_viewbox_meet(width, height)
81
80
  sx = sy = [width / @vbx_width, height / @vbx_height].min
82
- tx, ty = align_to_viewport(width, height, sx, sy)
83
- return [tx, ty, sx, sy]
81
+ return [sx, sy]
84
82
  end
85
83
 
86
84
  # Scale to larger viewbox dimension
87
85
  def set_viewbox_slice(width, height)
88
86
  sx = sy = [width / @vbx_width, height / @vbx_height].max
89
- tx, ty = align_to_viewport(width, height, sx, sy)
90
- return [tx, ty, sx, sy]
87
+ return [sx, sy]
91
88
  end
92
89
 
93
90
  # Establish the viewbox as necessary
@@ -98,11 +95,14 @@ class Magick::RVG
98
95
  @vbx_y ||= 0.0
99
96
 
100
97
  if @align == 'none'
101
- tx, ty, sx, sy = set_viewbox_none(width, height)
98
+ sx, sy = set_viewbox_none(width, height)
99
+ tx, ty = 0, 0
102
100
  elsif @meet_or_slice == 'meet'
103
- tx, ty, sx, sy = set_viewbox_meet(width, height)
101
+ sx, sy = set_viewbox_meet(width, height)
102
+ tx, ty = align_to_viewport(width, height, sx, sy)
104
103
  else
105
- tx, ty, sx, sy = set_viewbox_slice(width, height)
104
+ sx, sy = set_viewbox_slice(width, height)
105
+ tx, ty = align_to_viewport(width, height, sx, sy)
106
106
  end
107
107
 
108
108
  # Establish clipping path around the current viewport
@@ -112,8 +112,12 @@ class Magick::RVG
112
112
  end
113
113
 
114
114
  gc.clip_path(name)
115
+ # Add a non-scaled translation if meet or slice
115
116
  gc.translate(tx, ty) if (tx.abs > 1.0e-10 || ty.abs > 1.0e-10)
117
+ # Scale viewbox as necessary
116
118
  gc.scale(sx, sy) if (sx != 1.0 || sy != 1.0)
119
+ # Add a scaled translation if non-0 origin
120
+ gc.translate(-@vbx_x, -@vbx_y) if (@vbx_x.abs != 0.0 || @vbx_y.abs != 0)
117
121
  end
118
122
 
119
123
  def initialize(*args, &block)
@@ -1,7 +1,7 @@
1
1
  require 'date'
2
2
  Gem::Specification.new do |s|
3
3
  s.name = %q{rmagick}
4
- s.version = "1.13.0"
4
+ s.version = "1.14.0"
5
5
  s.date = Date.today.to_s
6
6
  s.summary = %q{RMagick is an interface between the Ruby programming language and the ImageMagick and GraphicsMagick image processing libraries.}
7
7
  s.description =<<DESCRIPTION
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.8.99.1
2
+ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: rmagick
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.13.0
7
- date: 2006-06-28 00:00:00 -04:00
6
+ version: 1.14.0
7
+ date: 2006-09-28 00:00:00 -04:00
8
8
  summary: RMagick is an interface between the Ruby programming language and the ImageMagick and GraphicsMagick image processing libraries.
9
9
  require_paths:
10
10
  - lib
@@ -63,6 +63,7 @@ files:
63
63
  - doc/index.html
64
64
  - doc/info.html
65
65
  - doc/magick.html
66
+ - doc/optequiv.html
66
67
  - doc/rvg.html
67
68
  - doc/rvgclip.html
68
69
  - doc/rvggroup.html
@@ -136,7 +137,7 @@ files:
136
137
  - doc/ex/cubic01.rb
137
138
  - doc/ex/cubic02.rb
138
139
  - doc/ex/cycle_colormap.rb
139
- - doc/ex/demo.rb
140
+ - doc/ex/dissolve.rb
140
141
  - doc/ex/drawcomp.rb
141
142
  - doc/ex/drop_shadow.rb
142
143
  - doc/ex/edge.rb
@@ -164,11 +165,11 @@ files:
164
165
  - doc/ex/image.rb
165
166
  - doc/ex/implode.rb
166
167
  - doc/ex/level.rb
167
- - doc/ex/level_channel.rb
168
168
  - doc/ex/line.rb
169
169
  - doc/ex/line01.rb
170
170
  - doc/ex/map.rb
171
171
  - doc/ex/map_f.rb
172
+ - doc/ex/mask.rb
172
173
  - doc/ex/matte_fill_to_border.rb
173
174
  - doc/ex/matte_floodfill.rb
174
175
  - doc/ex/matte_replace.rb
@@ -185,7 +186,6 @@ files:
185
186
  - doc/ex/normalize.rb
186
187
  - doc/ex/oil_paint.rb
187
188
  - doc/ex/opacity.rb
188
- - doc/ex/opaque.rb
189
189
  - doc/ex/ordered_dither.rb
190
190
  - doc/ex/path.rb
191
191
  - doc/ex/pattern1.rb
@@ -223,6 +223,7 @@ files:
223
223
  - doc/ex/shadow.rb
224
224
  - doc/ex/shave.rb
225
225
  - doc/ex/shear.rb
226
+ - doc/ex/sketch.rb
226
227
  - doc/ex/skewx.rb
227
228
  - doc/ex/skewy.rb
228
229
  - doc/ex/smile.rb
@@ -260,6 +261,7 @@ files:
260
261
  - doc/ex/unsharp_mask.rb
261
262
  - doc/ex/viewex.rb
262
263
  - doc/ex/vignette.rb
264
+ - doc/ex/watermark.rb
263
265
  - doc/ex/wave.rb
264
266
  - doc/ex/writing_mode01.rb
265
267
  - doc/ex/writing_mode02.rb
@@ -338,6 +340,7 @@ files:
338
340
  - doc/ex/images/smile.miff
339
341
  - doc/ex/images/spin.gif
340
342
  - doc/scripts/doc.js
343
+ - doc/scripts/stripeTables.js
341
344
  - ext/RMagick
342
345
  - ext/RMagick/MANIFEST
343
346
  - ext/RMagick/extconf.rb.in
@@ -351,6 +354,8 @@ files:
351
354
  - ext/RMagick/rmmain.c
352
355
  - ext/RMagick/rmutil.c
353
356
  - examples/describe.rb
357
+ - examples/demo.rb
358
+ - examples/find_similar_region.rb
354
359
  - examples/histogram.rb
355
360
  - examples/identify.rb
356
361
  - examples/image_opacity.rb
@@ -1,33 +0,0 @@
1
- #! /usr/local/bin/ruby -w
2
- require 'RMagick'
3
-
4
- # Demonstrate the Image#level_channel method
5
-
6
- before = Magick::Image.read('images/Flower_Hat.jpg').first
7
-
8
- # Let the final argument default
9
- begin
10
- red = before.level_channel(Magick::RedChannel, Magick::MaxRGB, 2)
11
- green = before.level_channel(Magick::GreenChannel,Magick::MaxRGB, 2)
12
- blue = before.level_channel(Magick::BlueChannel, Magick::MaxRGB, 2)
13
-
14
- # Composite the green image over the middle of the red image.
15
- # Composite the blue image over the right-hand side of the red image.
16
- green.crop!(red.columns/3, 0, red.columns/3, red.rows)
17
- blue.crop!(red.columns/3*2+1, 0, red.columns/3+1, red.rows)
18
- result = red.composite(green, Magick::CenterGravity, Magick::OverCompositeOp)
19
- result = result.composite(blue, Magick::EastGravity, Magick::OverCompositeOp)
20
-
21
- # Draw a black line between each of the three images.
22
- line = Magick::Draw.new
23
- line.line(result.columns/3, 0, result.columns/3, result.rows)
24
- line.line(result.columns/3*2+1, 0, result.columns/3*2+1, result.rows)
25
- line.draw(result)
26
-
27
- # Substitute the standard "Not Implemented" image
28
- rescue NotImplementedError
29
- result = Magick::Image.read("images/notimplemented.gif").first
30
- end
31
-
32
- result.write('level_channel.jpg')
33
- exit
@@ -1,14 +0,0 @@
1
- #! /usr/local/bin/ruby -w
2
- require 'RMagick'
3
- include Magick
4
-
5
- # Demonstrate the Image#opaque method.
6
-
7
- img = Image.read('images/Flower_Hat.jpg').first
8
-
9
- # Allow non-exact matches
10
- img.fuzz = 25
11
- img = img.opaque('white', 'red')
12
-
13
- img.write('opaque.jpg')
14
-