rmagick 1.14.1 → 1.15.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.
- data/ChangeLog +22 -0
- data/README.html +11 -63
- data/README.txt +8 -56
- data/configure +214 -787
- data/configure.ac +22 -24
- data/doc/comtasks.html +2 -2
- data/doc/constants.html +5 -6
- data/doc/draw.html +33 -14
- data/doc/ex/clip_path.rb +3 -0
- data/doc/ex/path.rb +1 -1
- data/doc/ex/polaroid.rb +23 -0
- data/doc/ex/tspan01.rb +2 -2
- data/doc/ex/tspan02.rb +2 -2
- data/doc/ex/tspan03.rb +3 -3
- data/doc/ex/wet_floor.rb +54 -0
- data/doc/ilist.html +83 -4
- data/doc/image1.html +4 -5
- data/doc/image2.html +395 -266
- data/doc/image3.html +104 -8
- data/doc/imageattrs.html +2 -2
- data/doc/imusage.html +2 -2
- data/doc/index.html +22 -18
- data/doc/info.html +28 -6
- data/doc/magick.html +125 -4
- data/doc/optequiv.html +196 -21
- data/doc/rvg.html +2 -2
- data/doc/rvgclip.html +2 -2
- data/doc/rvggroup.html +2 -2
- data/doc/rvgimage.html +2 -2
- data/doc/rvgpattern.html +2 -2
- data/doc/rvgshape.html +2 -2
- data/doc/rvgstyle.html +2 -2
- data/doc/rvgtext.html +2 -2
- data/doc/rvgtspan.html +2 -2
- data/doc/rvgtut.html +3 -3
- data/doc/rvguse.html +2 -2
- data/doc/rvgxform.html +2 -2
- data/doc/struct.html +2 -2
- data/doc/usage.html +26 -5
- data/ext/RMagick/MANIFEST +3 -1
- data/ext/RMagick/rmagick.h +46 -12
- data/ext/RMagick/rmagick_config.h.in +12 -2
- data/ext/RMagick/rmdraw.c +202 -62
- data/ext/RMagick/rmfill.c +36 -36
- data/ext/RMagick/rmilist.c +75 -31
- data/ext/RMagick/rmimage.c +640 -323
- data/ext/RMagick/rminfo.c +76 -15
- data/ext/RMagick/rmmain.c +107 -30
- data/ext/RMagick/rmutil.c +97 -68
- data/lib/RMagick.rb +11 -11
- data/lib/rvg/clippath.rb +38 -36
- data/lib/rvg/container.rb +120 -118
- data/lib/rvg/deep_equal.rb +44 -42
- data/lib/rvg/describable.rb +49 -47
- data/lib/rvg/embellishable.rb +399 -397
- data/lib/rvg/misc.rb +613 -603
- data/lib/rvg/paint.rb +38 -36
- data/lib/rvg/pathdata.rb +124 -122
- data/lib/rvg/rvg.rb +202 -198
- data/lib/rvg/stretchable.rb +132 -130
- data/lib/rvg/stylable.rb +101 -99
- data/lib/rvg/text.rb +173 -171
- data/lib/rvg/transformable.rb +120 -118
- data/lib/rvg/units.rb +60 -58
- data/rmagick.gemspec +1 -1
- metadata +5 -3
data/configure.ac
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
# RMagick configure.ac
|
3
3
|
|
4
|
-
AC_INIT(RMagick, 1.
|
4
|
+
AC_INIT(RMagick, 1.15.0, rmagick@rubyforge.org, RMagick-1.15.0.tar.gz)
|
5
5
|
echo "Configuring ${PACKAGE_STRING}"
|
6
6
|
|
7
7
|
AC_CONFIG_HEADER([ext/RMagick/rmagick_config.h])
|
@@ -77,9 +77,6 @@ AC_SUBST(MAGICKNAME)
|
|
77
77
|
AC_SUBST(MAGICKCONFIG)
|
78
78
|
AC_DEFINE_UNQUOTED(MAGICKNAME, $MAGICKNAME)
|
79
79
|
|
80
|
-
AC_CHECK_HEADER(magick/api.h, [],
|
81
|
-
[AC_MSG_ERROR([Can't find magick/api.h])])
|
82
|
-
|
83
80
|
# What standard functions?
|
84
81
|
AC_CHECK_FUNCS([snprintf])
|
85
82
|
|
@@ -104,8 +101,8 @@ AC_CHECK_FUNCS([AddNoiseImageChannel BilevelImageChannel BlackThresholdImage])
|
|
104
101
|
AC_CHECK_FUNCS([BlurImageChannel ClearMagickException CompareImageChannels])
|
105
102
|
AC_CHECK_FUNCS([CompareImageLayers CompositeImageChannel ContrastStretchImageChannel])
|
106
103
|
AC_CHECK_FUNCS([ConvolveImageChannel EvaluateImageChannel ExportImagePixels])
|
107
|
-
AC_CHECK_FUNCS([FuzzyColorCompare GammaImageChannel
|
108
|
-
AC_CHECK_FUNCS([GetColorHistogram GetColorInfoArray])
|
104
|
+
AC_CHECK_FUNCS([FuzzyColorCompare FxImageChannel GammaImageChannel])
|
105
|
+
AC_CHECK_FUNCS([GaussianBlurImageChannel GetColorHistogram GetColorInfoArray])
|
109
106
|
|
110
107
|
# We need to be able to query these symbols later in the configure script, so set a shell
|
111
108
|
# variable here as well as defining symbols.
|
@@ -156,11 +153,12 @@ fi
|
|
156
153
|
|
157
154
|
AC_CHECK_FUNCS([GrayscalePseudoClassImage ImagesToBlob ImportImagePixels])
|
158
155
|
AC_CHECK_FUNCS([InheritException InterpolatePixelColor InterpretImageAttributes IsColorSimilar])
|
159
|
-
AC_CHECK_FUNCS([IsImageSimilar NegateImageChannel])
|
160
|
-
AC_CHECK_FUNCS([NormalizeImageChannel
|
156
|
+
AC_CHECK_FUNCS([IsImageSimilar LinearStretchImage NegateImageChannel])
|
157
|
+
AC_CHECK_FUNCS([NormalizeImageChannel OrderedPosterizeImageChannel])
|
158
|
+
AC_CHECK_FUNCS([ParseSizeGeometry PolaroidImage PosterizeImage PreviewImage])
|
161
159
|
AC_CHECK_FUNCS([QuantumOperatorRegionImage RadialBlurImage RadialBlurImageChannel])
|
162
160
|
AC_CHECK_FUNCS([RandomChannelThresholdImage RandomThresholdImageChannel])
|
163
|
-
AC_CHECK_FUNCS([SeparateImageChannel SepiaToneImage])
|
161
|
+
AC_CHECK_FUNCS([RecolorImage SeparateImageChannel SepiaToneImage])
|
164
162
|
AC_CHECK_FUNCS([SetImageBackgroundColor SetImageChannelDepth SetImageColorspace SetImageExtent])
|
165
163
|
AC_CHECK_FUNCS([SetImageInfoFile SetImageOption SetImageStorageClass])
|
166
164
|
AC_CHECK_FUNCS([SetImageProgressMonitor ShadowImage SharpenImageChannel])
|
@@ -355,21 +353,6 @@ if test "$rm_cv_enum_logcolorspace" = yes; then
|
|
355
353
|
AC_DEFINE(HAVE_LOGCOLORSPACE)
|
356
354
|
fi
|
357
355
|
|
358
|
-
AC_CACHE_CHECK(for CopyCyanCompositeOp enum value, rm_cv_enum_copycyancompositeop,
|
359
|
-
[AC_TRY_COMPILE(
|
360
|
-
[#include <stdio.h>
|
361
|
-
#if HAVE_SYS_TYPES_H
|
362
|
-
#include <sys/types.h>
|
363
|
-
#endif
|
364
|
-
#include "magick/api.h"],
|
365
|
-
[CompositeOperator x; x = CopyCyanCompositeOp],
|
366
|
-
rm_cv_enum_copycyancompositeop='yes',
|
367
|
-
rm_cv_enum_copycyancompositeop='no')])
|
368
|
-
|
369
|
-
if test "$rm_cv_enum_copycyancompositeop" = yes; then
|
370
|
-
AC_DEFINE(HAVE_COPYCYANCOMPOSITEOP)
|
371
|
-
fi
|
372
|
-
|
373
356
|
AC_CACHE_CHECK(for ReplaceCompositeOp enum value, rm_cv_enum_replacecompositeop,
|
374
357
|
[AC_TRY_COMPILE(
|
375
358
|
[#include <stdio.h>
|
@@ -549,6 +532,21 @@ if test "$rm_cv_enum_maxevaluateoperator" = yes; then
|
|
549
532
|
AC_DEFINE(HAVE_MAXEVALUATEOPERATOR)
|
550
533
|
fi
|
551
534
|
|
535
|
+
AC_CACHE_CHECK(for PaletteBilevelMatteType enum value, rm_cv_enum_palettebilevelmattetype,
|
536
|
+
[AC_TRY_COMPILE(
|
537
|
+
[#include <stdio.h>
|
538
|
+
#if HAVE_SYS_TYPES_H
|
539
|
+
#include <sys/types.h>
|
540
|
+
#endif
|
541
|
+
#include "magick/api.h"],
|
542
|
+
[ImageType x; x = PaletteBilevelMatteType],
|
543
|
+
rm_cv_enum_palettebilevelmattetype='yes',
|
544
|
+
rm_cv_enum_palettebilevelmattetype='no')])
|
545
|
+
|
546
|
+
if test "$rm_cv_enum_palettebilevelmattetype" = yes; then
|
547
|
+
AC_DEFINE(HAVE_PALETTEBILEVELMATTETYPE)
|
548
|
+
fi
|
549
|
+
|
552
550
|
if test "$rm_have_getimagequantumdepth" = yes; then
|
553
551
|
# IM 6.0.5 changed the number of arguments to GetImageQuantumDepth.
|
554
552
|
AC_CACHE_CHECK(if GetImageQuantumDepth has only 1 argument, rm_cv_args_get_image_quantum_depth,
|
data/doc/comtasks.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<meta name="generator" content=
|
7
7
|
"HTML Tidy for Linux/x86 (vers 1st December 2004), see www.w3.org" />
|
8
8
|
|
9
|
-
<title>RMagick: Common Tasks</title>
|
9
|
+
<title>RMagick 1.15.0: Common Tasks</title>
|
10
10
|
<meta http-equiv="Content-Type" content=
|
11
11
|
"text/html; charset=us-ascii" />
|
12
12
|
<meta name="GENERATOR" content="Quanta Plus" />
|
@@ -31,7 +31,7 @@
|
|
31
31
|
</head>
|
32
32
|
|
33
33
|
<body>
|
34
|
-
<h6 id="header">RMagick User's Guide and Reference</h6>
|
34
|
+
<h6 id="header">RMagick 1.15.0 User's Guide and Reference</h6>
|
35
35
|
|
36
36
|
<div class="nav">
|
37
37
|
« <a href="optequiv.html">Prev</a> | <a href=
|
data/doc/constants.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<meta name="generator" content=
|
7
7
|
"HTML Tidy for Linux/x86 (vers 1st December 2004), see www.w3.org" />
|
8
8
|
|
9
|
-
<title>RMagick: Constants</title>
|
9
|
+
<title>RMagick 1.15.0: Constants</title>
|
10
10
|
<meta http-equiv="Content-Type" content=
|
11
11
|
"text/html; charset=us-ascii" />
|
12
12
|
<meta name="GENERATOR" content="Quanta Plus" />
|
@@ -61,7 +61,7 @@
|
|
61
61
|
</head>
|
62
62
|
|
63
63
|
<body>
|
64
|
-
<h6 id="header">RMagick User's Guide and Reference</h6>
|
64
|
+
<h6 id="header">RMagick 1.15.0 User's Guide and Reference</h6>
|
65
65
|
|
66
66
|
<div class="nav">
|
67
67
|
« <a href="info.html">Prev</a> | <a href=
|
@@ -155,7 +155,7 @@
|
|
155
155
|
|
156
156
|
<dd>An extended form of the <code>Version</code> constant with
|
157
157
|
the format shown here:<br />
|
158
|
-
<code>This is RMagick 1.10.0 ($Date:
|
158
|
+
<code>This is RMagick 1.10.0 ($Date: 2007/01/14 23:57:19 $)
|
159
159
|
Copyright (C) 2006 by Timothy P. Hunter<br />
|
160
160
|
Built with GraphicsMagick 1.2 unreleased Q16
|
161
161
|
http://www.GraphicsMagick.org/<br />
|
@@ -186,9 +186,6 @@
|
|
186
186
|
QuantumDepth and MaxRGB is summarized in this table.
|
187
187
|
|
188
188
|
<table summary="number of bits in a quantum" id="maxrgb">
|
189
|
-
<caption>
|
190
|
-
How MaxRGB and QuantumDepth are related
|
191
|
-
</caption>
|
192
189
|
|
193
190
|
<tr>
|
194
191
|
<th>QuantumDepth</th>
|
@@ -997,6 +994,8 @@ ruby -rRMagick -e"Magick::ColorspaceType.values {|cs| puts cs}"
|
|
997
994
|
<dt>ColorSeparationMatteType</dt>
|
998
995
|
|
999
996
|
<dt>OptimizeType</dt>
|
997
|
+
|
998
|
+
<dt>PaletteBilevelMatteType</dt>
|
1000
999
|
</dl>
|
1001
1000
|
|
1002
1001
|
<h3 class="const" id="InterlaceType">InterlaceType</h3>
|
data/doc/draw.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<meta name="generator" content=
|
7
7
|
"HTML Tidy for Linux/x86 (vers 1st December 2004), see www.w3.org" />
|
8
8
|
|
9
|
-
<title>RMagick: class Draw</title>
|
9
|
+
<title>RMagick 1.15.0: class Draw</title>
|
10
10
|
<meta http-equiv="Content-Type" content=
|
11
11
|
"text/html; charset=us-ascii" />
|
12
12
|
<meta name="GENERATOR" content="Quanta Plus" />
|
@@ -25,7 +25,7 @@
|
|
25
25
|
</head>
|
26
26
|
|
27
27
|
<body>
|
28
|
-
<h6 id="header">RMagick User's Guide and Reference</h6>
|
28
|
+
<h6 id="header">RMagick 1.15.0 User's Guide and Reference</h6>
|
29
29
|
|
30
30
|
<div class="nav">
|
31
31
|
« <a href="image3.html">Prev</a> | <a href=
|
@@ -272,7 +272,9 @@ gc = Draw.new
|
|
272
272
|
<h3 id="annotate">annotate</h3>
|
273
273
|
|
274
274
|
<p><span class="arg">draw.</span>annotate(<span class=
|
275
|
-
"arg">img
|
275
|
+
"arg">img</span>, <span class="arg">width</span>, <span class=
|
276
|
+
"arg">height</span>, <span class="arg">x</span>, <span class=
|
277
|
+
"arg">y</span>, <span class="arg">text</span>) <span class=
|
276
278
|
"arg">[ { additional parameters } ]</span> ->
|
277
279
|
<em>draw</em></p>
|
278
280
|
</div>
|
@@ -281,12 +283,15 @@ gc = Draw.new
|
|
281
283
|
<h4>Description</h4>
|
282
284
|
|
283
285
|
<p>Annotates a image with text. The text is positioned
|
284
|
-
according to the <code>gravity</code> attribute
|
285
|
-
<span class="arg">x</span
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
286
|
+
according to the <code>gravity</code> attribute around the
|
287
|
+
rectangle described by the <span class="arg">x</span>,
|
288
|
+
<span class="arg">y</span>, <span class="arg">width</span>, and
|
289
|
+
<span class="arg">height</span> arguments. If either of the
|
290
|
+
<span class="arg">width</span> or <span class=
|
291
|
+
"arg">height</span> arguments are 0, uses the image
|
292
|
+
width-<span class="arg">x</span> and the image
|
293
|
+
height-<span class="arg">y</span> to compute the rectangle
|
294
|
+
width and height. The attributes described in <a href=
|
290
295
|
"#attributes">annotate attributes</a>, below, influence the
|
291
296
|
appearance and position of the text. These attributes may be
|
292
297
|
set in the Draw object before calling <code>annotate</code>, or
|
@@ -303,13 +308,15 @@ gc = Draw.new
|
|
303
308
|
|
304
309
|
<dd>the image or imagelist to be annotated</dd>
|
305
310
|
|
306
|
-
<dt>
|
311
|
+
<dt>width</dt>
|
307
312
|
|
308
|
-
<dd>
|
313
|
+
<dd>width of the rectangle within which the text is
|
314
|
+
positioned</dd>
|
309
315
|
|
310
|
-
<dt>
|
316
|
+
<dt>height</dt>
|
311
317
|
|
312
|
-
<dd>
|
318
|
+
<dd>height of the rectangle within which the text is
|
319
|
+
positioned</dd>
|
313
320
|
|
314
321
|
<dt>x</dt>
|
315
322
|
|
@@ -1038,7 +1045,19 @@ draw.inspect »
|
|
1038
1045
|
masked.</p>
|
1039
1046
|
|
1040
1047
|
<p>Before using a clip-path, you must create it using the
|
1041
|
-
<a href="#define_clip_path">define_clip_path</a> method
|
1048
|
+
<a href="#define_clip_path">define_clip_path</a> method. You
|
1049
|
+
must precede <code>clip_path</code> with <a href=
|
1050
|
+
"#push">push</a> and terminate the primitives that draw within
|
1051
|
+
the clip path with <a href="#pop">pop</a>. For example,</p>
|
1052
|
+
<pre>
|
1053
|
+
gc.push
|
1054
|
+
gc.clip_path('mypath')
|
1055
|
+
# drawing primitives within the clip path
|
1056
|
+
gc.pop
|
1057
|
+
gc.draw
|
1058
|
+
</pre>
|
1059
|
+
|
1060
|
+
<p>Also see the example below.</p>
|
1042
1061
|
|
1043
1062
|
<h4>Arguments</h4>
|
1044
1063
|
|
data/doc/ex/clip_path.rb
CHANGED
@@ -15,6 +15,7 @@ pr.define_clip_path('example') {
|
|
15
15
|
}
|
16
16
|
|
17
17
|
# Enable the clip-path
|
18
|
+
pr.push
|
18
19
|
pr.clip_path('example')
|
19
20
|
|
20
21
|
# Composite the Flower Hat image over
|
@@ -34,6 +35,8 @@ girl.change_geometry("290") do |c,r|
|
|
34
35
|
rows = r
|
35
36
|
end
|
36
37
|
|
38
|
+
pr.pop
|
39
|
+
|
37
40
|
# Create a canvas to draw on, a bit bigger than the star.
|
38
41
|
canvas = Magick::Image.new(cols, rows)
|
39
42
|
|
data/doc/ex/path.rb
CHANGED
data/doc/ex/polaroid.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
#! /usr/local/bin/ruby -w
|
2
|
+
require 'RMagick'
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
# Demonstrate the Image#polaroid method
|
6
|
+
|
7
|
+
img = Magick::Image.read('images/Flower_Hat.jpg').first
|
8
|
+
img[:Caption] = "\nLosha\n" + Date.today.to_s
|
9
|
+
|
10
|
+
begin
|
11
|
+
picture = img.polaroid { self.gravity = Magick::CenterGravity }
|
12
|
+
|
13
|
+
# Composite it on a white background so the result is opaque.
|
14
|
+
background = Magick::Image.new(picture.columns, picture.rows)
|
15
|
+
result = background.composite(picture, Magick::CenterGravity, Magick::OverCompositeOp)
|
16
|
+
|
17
|
+
rescue NotImplementedError
|
18
|
+
result = Magick::Image.read('images/notimplemented.gif').first
|
19
|
+
result.resize!(img.columns, img.rows)
|
20
|
+
end
|
21
|
+
|
22
|
+
|
23
|
+
result.write('polaroid.jpg')
|
data/doc/ex/tspan01.rb
CHANGED
@@ -6,8 +6,8 @@ rvg = Magick::RVG.new(10.cm, 3.cm).viewbox(0,0,1000,300) do |canvas|
|
|
6
6
|
canvas.background_fill = 'white'
|
7
7
|
canvas.desc = "Example tspan01 - using tspan to change visual attributes"
|
8
8
|
canvas.g.styles(:font_family=>'Verdana', :font_size=>45) do |grp|
|
9
|
-
grp.text(200, 150, "You are
|
10
|
-
txt.tspan("not").styles(:font_weight=>'bold', :fill=>'red')
|
9
|
+
grp.text(200, 150, "You are").styles(:fill=>'blue') do |txt|
|
10
|
+
txt.tspan(" not").styles(:font_weight=>'bold', :fill=>'red')
|
11
11
|
txt.tspan(" a banana")
|
12
12
|
end
|
13
13
|
end
|
data/doc/ex/tspan02.rb
CHANGED
@@ -8,8 +8,8 @@ rvg = Magick::RVG.new(10.cm, 3.cm).viewbox(0,0,1000,300) do |canvas|
|
|
8
8
|
canvas.desc = "Example tspan02 - using tspan's dx and dy attributes for incremental positioning adjustments"
|
9
9
|
canvas.g.styles(:font_family=>'Verdana', :font_size=>45) do |_g|
|
10
10
|
_g.text(200, 150, "But you").styles(:fill=>'blue') do |txt|
|
11
|
-
txt.tspan("are
|
12
|
-
txt.tspan("a peach!").d(0, 100)
|
11
|
+
txt.tspan("are").d(100, -50).styles(:font_weight=>'bold', :fill=>'red')
|
12
|
+
txt.tspan(" a peach!").d(0, 100)
|
13
13
|
end
|
14
14
|
end
|
15
15
|
canvas.rect(996, 296, 1, 1).styles(:fill=>'none', :stroke=>'blue')
|
data/doc/ex/tspan03.rb
CHANGED
@@ -7,9 +7,9 @@ rvg = Magick::RVG.new(10.cm, 3.cm).viewbox(0,0,1000,300) do |canvas|
|
|
7
7
|
|
8
8
|
canvas.g.translate(100, 60) do |grp|
|
9
9
|
grp.text.styles(:font_family=>'Verdana', :font_size=>45) do |txt|
|
10
|
-
txt.tspan("Rotation
|
11
|
-
txt.tspan("propogates
|
12
|
-
tsp.tspan("to descendents").styles(:fill=>'green')
|
10
|
+
txt.tspan("Rotation")
|
11
|
+
txt.tspan(" propogates").rotate(20).styles(:fill=>'red') do |tsp|
|
12
|
+
tsp.tspan(" to descendents").styles(:fill=>'green')
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
data/doc/ex/wet_floor.rb
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'RMagick'
|
4
|
+
|
5
|
+
|
6
|
+
results = Magick::ImageList.new
|
7
|
+
|
8
|
+
img = Magick::Image.new(270, 60)
|
9
|
+
|
10
|
+
gc = Magick::Draw.new
|
11
|
+
gc.annotate(img, 0, 0, 0, -25, "RUBY!") do
|
12
|
+
gc.fill = '#c00'
|
13
|
+
gc.stroke = 'black'
|
14
|
+
gc.stroke_width = 2
|
15
|
+
gc.pointsize = 80
|
16
|
+
gc.font_weight = Magick::BoldWeight
|
17
|
+
gc.font_family = 'times'
|
18
|
+
gc.gravity = Magick::SouthGravity
|
19
|
+
end
|
20
|
+
|
21
|
+
# Add a little bit of shading
|
22
|
+
if Magick.const_defined? "HardLightCompositeOp"
|
23
|
+
shade = img.shade(true, 310, 30)
|
24
|
+
img.composite!(shade, Magick::CenterGravity, Magick::HardLightCompositeOp)
|
25
|
+
end
|
26
|
+
|
27
|
+
# Create the default reflection
|
28
|
+
reflection = img.wet_floor
|
29
|
+
|
30
|
+
ilist = Magick::ImageList.new
|
31
|
+
ilist << img << reflection
|
32
|
+
results << ilist.append(true)
|
33
|
+
|
34
|
+
# Change the initial level of transparency and the rate of transition
|
35
|
+
ilist[1] = img.wet_floor(0.25, 0.5)
|
36
|
+
results << ilist.append(true)
|
37
|
+
|
38
|
+
# Add a slant
|
39
|
+
xform = Magick::AffineMatrix.new(1.0, 0.0, Math::PI/4.0, 1.0, 0.0, 0.0)
|
40
|
+
ilist[1] = ilist[1].affine_transform(xform)
|
41
|
+
results << ilist.append(true)
|
42
|
+
|
43
|
+
# Add a ripple
|
44
|
+
ilist[1] = ilist[1].rotate(90).wave(2, 20).rotate(-90)
|
45
|
+
results << ilist.append(true)
|
46
|
+
|
47
|
+
# Montage into a single demo image. Use a white background so
|
48
|
+
# there won't be any problems with transparency in the browser.
|
49
|
+
result = results.montage do
|
50
|
+
self.geometry = '270x120'
|
51
|
+
self.tile = '1x4'
|
52
|
+
self.background_color = 'white'
|
53
|
+
end
|
54
|
+
result.write('wet_floor.gif')
|
data/doc/ilist.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<meta name="generator" content=
|
7
7
|
"HTML Tidy for Linux/x86 (vers 1st December 2004), see www.w3.org" />
|
8
8
|
|
9
|
-
<title>RMagick: class ImageList</title>
|
9
|
+
<title>RMagick 1.15.0: class ImageList</title>
|
10
10
|
<meta http-equiv="Content-Type" content=
|
11
11
|
"text/html; charset=us-ascii" />
|
12
12
|
<meta name="GENERATOR" content="Quanta Plus" />
|
@@ -20,7 +20,7 @@
|
|
20
20
|
</head>
|
21
21
|
|
22
22
|
<body>
|
23
|
-
<h6 id="header">RMagick User's Guide and Reference</h6>
|
23
|
+
<h6 id="header">RMagick 1.15.0 User's Guide and Reference</h6>
|
24
24
|
|
25
25
|
<div class="nav">
|
26
26
|
« <a href="magick.html">Prev</a> | <a href=
|
@@ -91,18 +91,20 @@
|
|
91
91
|
|
92
92
|
<li><a href="#from_blob">from_blob</a></li>
|
93
93
|
|
94
|
+
<li><a href="#fx">fx</a></li>
|
95
|
+
|
94
96
|
<li><a href="#inspect">inspect</a></li>
|
95
97
|
|
96
98
|
<li><a href="#map">map</a></li>
|
97
99
|
|
98
100
|
<li><a href="#montage">montage</a></li>
|
99
|
-
|
100
|
-
<li><a href="#morph">morph</a></li>
|
101
101
|
</ul>
|
102
102
|
</div>
|
103
103
|
|
104
104
|
<div class="toccol">
|
105
105
|
<ul>
|
106
|
+
<li><a href="#morph">morph</a></li>
|
107
|
+
|
106
108
|
<li><a href="#mosaic">mosaic</a></li>
|
107
109
|
|
108
110
|
<li><a href="#new_image">new_image</a></li>
|
@@ -860,6 +862,83 @@ ilist.display
|
|
860
862
|
<p>BlobToImageList</p>
|
861
863
|
</div>
|
862
864
|
|
865
|
+
<div class="sig">
|
866
|
+
<h3 id="fx">fx</h3>
|
867
|
+
|
868
|
+
<p>imagelist.fx(expression [, channel...]) -> anImage</p>
|
869
|
+
</div>
|
870
|
+
|
871
|
+
<div class="desc">
|
872
|
+
<h4>Description</h4>
|
873
|
+
|
874
|
+
<p>Applies the specified mathematical expression to the input
|
875
|
+
images. This method corresponds to ImageMagick's <a href=
|
876
|
+
"http://redux.imagemagick.org/script/fx.php">-fx</a>
|
877
|
+
operator.</p>
|
878
|
+
|
879
|
+
<h4>Arguments</h4>
|
880
|
+
|
881
|
+
<dl>
|
882
|
+
<dt>expression</dt>
|
883
|
+
|
884
|
+
<dd>A mathematical expression of the form accepted by the -fx
|
885
|
+
operator..</dd>
|
886
|
+
|
887
|
+
<dt>channel...</dt>
|
888
|
+
|
889
|
+
<dd>0 or more <a href=
|
890
|
+
"constants.html#ChannelType">ChannelType</a> arguments.
|
891
|
+
Specify the output channels. If no channels are specified the
|
892
|
+
result is set over all channels except the opacity
|
893
|
+
channel.</dd>
|
894
|
+
</dl>
|
895
|
+
|
896
|
+
<h4>Notes</h4>
|
897
|
+
|
898
|
+
<ul>
|
899
|
+
<li>Fx expressions are interpreted. Therefore this method can
|
900
|
+
be quite slow depending on the complexity of the expression.
|
901
|
+
Generally you will get better performance by accessing the
|
902
|
+
image pixels as <a href="struct.html#Pixel">Pixel</a> objects
|
903
|
+
(see <a href="image2.html#get_pixel">get_pixel</a> and
|
904
|
+
<a href="image3.html#view">view</a>) and using Ruby code to
|
905
|
+
perform the mathematics.</li>
|
906
|
+
|
907
|
+
<li>The <code>u</code> and <code>v</code> symbols refer to
|
908
|
+
the 0th and 1st image in the list. The image reference index
|
909
|
+
(<code>u[2]</code> for example) works as expected. The
|
910
|
+
current <a href="#scene">scene number</a> has no meaning in
|
911
|
+
the context of the <code>fx</code> method.</li>
|
912
|
+
|
913
|
+
<li>To specify a non-default pixel interpolation method, set
|
914
|
+
the <a href=
|
915
|
+
"imageattrs.html#pixel_interpolation_method">pixel_interpolation_method</a>
|
916
|
+
attribute of the last image in the list.</li>
|
917
|
+
</ul>
|
918
|
+
|
919
|
+
<h4>Returns</h4>
|
920
|
+
|
921
|
+
<p>The image created by the expression.</p>
|
922
|
+
|
923
|
+
<h4>Example</h4>
|
924
|
+
<pre>
|
925
|
+
# Produce a navy blue image from a black image
|
926
|
+
imgl = Magick::ImageList.new
|
927
|
+
imgl << Magick::Image.new(64, 64) {self.background_color = 'black'}
|
928
|
+
|
929
|
+
res = imgl.fx('1/2', Magick::BlueChannel)
|
930
|
+
</pre>
|
931
|
+
|
932
|
+
<h4>ImageMagick API</h4>
|
933
|
+
|
934
|
+
<p>FxImageChannel</p>
|
935
|
+
|
936
|
+
<h4>See also</h4>
|
937
|
+
|
938
|
+
<p><a href="image2.html#get_pixel">get_pixel</a>, <a href=
|
939
|
+
"image3.html#view">view</a></p>
|
940
|
+
</div>
|
941
|
+
|
863
942
|
<div class="sig">
|
864
943
|
<h3 id="inspect">inspect</h3>
|
865
944
|
|