rmagick 1.7.4 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of rmagick might be problematic. Click here for more details.
- data/ChangeLog +10 -2
- data/README.html +284 -290
- data/README.txt +298 -307
- data/configure +180 -11
- data/configure.ac +18 -2
- data/doc/comtasks.html +1 -1
- data/doc/constants.html +15 -10
- data/doc/css/ref.css +67 -0
- data/doc/draw.html +1 -1
- data/doc/ex/InitialCoords.rb +24 -0
- data/doc/ex/NewCoordSys.rb +33 -0
- data/doc/ex/OrigCoordSys.rb +19 -0
- data/doc/ex/PreserveAspectRatio.rb +206 -0
- data/doc/ex/RotateScale.rb +38 -0
- data/doc/ex/Skew.rb +39 -0
- data/doc/ex/Use01.rb +17 -0
- data/doc/ex/Use02.rb +22 -0
- data/doc/ex/Use03.rb +17 -0
- data/doc/ex/ViewBox.rb +34 -0
- data/doc/ex/arcs01.rb +29 -0
- data/doc/ex/arcs02.rb +62 -0
- data/doc/ex/baseline_shift01.rb +19 -0
- data/doc/ex/bounding_box.rb +31 -37
- data/doc/ex/circle01.rb +18 -0
- data/doc/ex/cubic01.rb +46 -0
- data/doc/ex/cubic02.rb +95 -0
- data/doc/ex/drop_shadow.rb +1 -1
- data/doc/ex/ellipse01.rb +23 -0
- data/doc/ex/evenodd.rb +44 -0
- data/doc/ex/font_styles.rb +29 -0
- data/doc/ex/group.rb +27 -0
- data/doc/ex/image.rb +47 -0
- data/doc/ex/images/big-duck.gif +0 -0
- data/doc/ex/images/duck.gif +0 -0
- data/doc/ex/images/duck0.gif +0 -0
- data/doc/ex/images/duck1.gif +0 -0
- data/doc/ex/images/duck10.gif +0 -0
- data/doc/ex/images/duck11.gif +0 -0
- data/doc/ex/images/duck12.gif +0 -0
- data/doc/ex/images/duck13.gif +0 -0
- data/doc/ex/images/duck14.gif +0 -0
- data/doc/ex/images/duck15.gif +0 -0
- data/doc/ex/images/duck2.gif +0 -0
- data/doc/ex/images/duck3.gif +0 -0
- data/doc/ex/images/duck4.gif +0 -0
- data/doc/ex/images/duck5.gif +0 -0
- data/doc/ex/images/duck6.gif +0 -0
- data/doc/ex/images/duck7.gif +0 -0
- data/doc/ex/images/duck8.gif +0 -0
- data/doc/ex/images/duck9.gif +0 -0
- data/doc/ex/line01.rb +24 -0
- data/doc/ex/nested_rvg.rb +22 -0
- data/doc/ex/nonzero.rb +44 -0
- data/doc/ex/polygon01.rb +24 -0
- data/doc/ex/polyline01.rb +24 -0
- data/doc/ex/quad01.rb +37 -0
- data/doc/ex/rect01.rb +16 -0
- data/doc/ex/rect02.rb +23 -0
- data/doc/ex/rvg_clippath.rb +15 -0
- data/doc/ex/rvg_linecap.rb +44 -0
- data/doc/ex/rvg_linejoin.rb +42 -0
- data/doc/ex/rvg_opacity.rb +20 -0
- data/doc/ex/rvg_pattern.rb +27 -0
- data/doc/ex/rvg_stroke_dasharray.rb +13 -0
- data/doc/ex/sepiatone.rb +15 -0
- data/doc/ex/shadow.rb +37 -0
- data/doc/ex/smile.rb +9 -9
- data/doc/ex/stroke_fill.rb +12 -0
- data/doc/ex/text01.rb +18 -0
- data/doc/ex/text_styles.rb +22 -0
- data/doc/ex/texture_fill_to_border.rb +3 -3
- data/doc/ex/texture_floodfill.rb +3 -2
- data/doc/ex/tref01.rb +26 -0
- data/doc/ex/triangle01.rb +17 -0
- data/doc/ex/tspan01.rb +19 -0
- data/doc/ex/tspan02.rb +20 -0
- data/doc/ex/tspan03.rb +22 -0
- data/doc/ex/writing_mode01.rb +28 -0
- data/doc/ex/writing_mode02.rb +27 -0
- data/doc/ilist.html +1 -1
- data/doc/image1.html +66 -30
- data/doc/image2.html +1 -1
- data/doc/image3.html +274 -49
- data/doc/imageattrs.html +87 -10
- data/doc/imusage.html +1 -1
- data/doc/index.html +80 -39
- data/doc/info.html +149 -13
- data/doc/magick.html +1 -1
- data/doc/rvg.html +890 -0
- data/doc/rvgclip.html +249 -0
- data/doc/rvggroup.html +305 -0
- data/doc/rvgimage.html +288 -0
- data/doc/rvgpattern.html +456 -0
- data/doc/rvgshape.html +376 -0
- data/doc/rvgstyle.html +269 -0
- data/doc/rvgtext.html +464 -0
- data/doc/rvgtspan.html +237 -0
- data/doc/rvgtut.html +512 -0
- data/doc/rvguse.html +145 -0
- data/doc/rvgxform.html +294 -0
- data/doc/struct.html +9 -71
- data/doc/usage.html +22 -7
- data/ext/RMagick/MANIFEST +94 -2
- data/ext/RMagick/rmagick.h +10 -4
- data/ext/RMagick/rmagick_config.h.in +8 -2
- data/ext/RMagick/rmdraw.c +2 -2
- data/ext/RMagick/rmfill.c +2 -2
- data/ext/RMagick/rmilist.c +3 -3
- data/ext/RMagick/rmimage.c +152 -5
- data/ext/RMagick/rminfo.c +208 -2
- data/ext/RMagick/rmmain.c +14 -5
- data/ext/RMagick/rmutil.c +83 -22
- data/lib/RMagick.rb +2 -2
- data/lib/rvg/clippath.rb +46 -0
- data/lib/rvg/container.rb +129 -0
- data/lib/rvg/deep_equal.rb +54 -0
- data/lib/rvg/describable.rb +51 -0
- data/lib/rvg/embellishable.rb +395 -0
- data/lib/rvg/misc.rb +729 -0
- data/lib/rvg/paint.rb +48 -0
- data/lib/rvg/pathdata.rb +129 -0
- data/lib/rvg/rvg.rb +279 -0
- data/lib/rvg/stretchable.rb +150 -0
- data/lib/rvg/stylable.rb +116 -0
- data/lib/rvg/text.rb +185 -0
- data/lib/rvg/transformable.rb +131 -0
- data/lib/rvg/units.rb +64 -0
- data/rmagick.gemspec +1 -1
- data/uninstall.rb +3 -2
- metadata +96 -3
data/doc/rvgimage.html
ADDED
@@ -0,0 +1,288 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3
|
+
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
5
|
+
<head>
|
6
|
+
<meta name="generator" content=
|
7
|
+
"HTML Tidy for Linux/x86 (vers 1st March 2005), see www.w3.org" />
|
8
|
+
|
9
|
+
<title>RMagick: RVG Reference: RVG::Image Class</title>
|
10
|
+
<meta http-equiv="Content-Type" content=
|
11
|
+
"text/html; charset=us-ascii" />
|
12
|
+
<meta name="GENERATOR" content="Quanta Plus" />
|
13
|
+
<meta name="Copyright" content=
|
14
|
+
"Copyright (C) 2005 by Timothy P. Hunter" />
|
15
|
+
<link rel="stylesheet" type="text/css" href="css/doc.css" />
|
16
|
+
<script type="text/javascript" src="scripts/doc.js">
|
17
|
+
</script>
|
18
|
+
<script type="text/javascript">
|
19
|
+
//<![CDATA[
|
20
|
+
//]]>
|
21
|
+
</script>
|
22
|
+
<style type="text/css">
|
23
|
+
/*<![CDATA[*/
|
24
|
+
}
|
25
|
+
/*]]>*/
|
26
|
+
</style>
|
27
|
+
</head>
|
28
|
+
|
29
|
+
<body>
|
30
|
+
<h6 id="header">RMagick User's Guide and Reference</h6>
|
31
|
+
|
32
|
+
<div class="nav">
|
33
|
+
« <a href="rvggroup.html">Prev</a> | <a href=
|
34
|
+
"index.html">Contents</a> | <a href=
|
35
|
+
"rvgpattern.html">Next</a> »
|
36
|
+
</div>
|
37
|
+
|
38
|
+
<h1>class RVG::Image <span class="superclass"><
|
39
|
+
Object</span></h1>
|
40
|
+
|
41
|
+
<div id="toc">
|
42
|
+
<h2>Table of Contents</h2>
|
43
|
+
|
44
|
+
<h3>class methods</h3>
|
45
|
+
|
46
|
+
<ul>
|
47
|
+
<li><a href="#new">new</a></li>
|
48
|
+
</ul>
|
49
|
+
|
50
|
+
<h3>attributes</h3>
|
51
|
+
|
52
|
+
<ul>
|
53
|
+
<li><a href="#desc">desc, desc=</a></li>
|
54
|
+
|
55
|
+
<li><a href="#metadata">metadata, metadata=</a></li>
|
56
|
+
|
57
|
+
<li><a href="#title">title, title=</a></li>
|
58
|
+
</ul>
|
59
|
+
|
60
|
+
<h3>instance methods</h3>
|
61
|
+
|
62
|
+
<ul>
|
63
|
+
<li><a href=
|
64
|
+
"#preserve_aspect_ratio">preserve_aspect_ratio</a></li>
|
65
|
+
</ul>
|
66
|
+
|
67
|
+
<h3>shared methods</h3>
|
68
|
+
|
69
|
+
<p>In addition to the methods listed above, <code>class
|
70
|
+
RVG::Image</code> also implements the <a href=
|
71
|
+
"rvgstyle.html">styles</a> method and the <a href=
|
72
|
+
"rvgxform.html">transform methods</a>.</p>
|
73
|
+
</div>
|
74
|
+
|
75
|
+
<h2 class="methods">class methods</h2>
|
76
|
+
|
77
|
+
<div class="sig">
|
78
|
+
<h3 id="new">new</h3>
|
79
|
+
|
80
|
+
<p><span class="arg">RVG::Image</span>.new(<span class=
|
81
|
+
"arg">raster_image</span>, <span class="arg">width</span>=nil,
|
82
|
+
<span class="arg">height</span>=nil, <span class=
|
83
|
+
"arg">x</span>=0, <span class="arg">y</span>=0) ->
|
84
|
+
<span class="arg">anImage</span></p>
|
85
|
+
</div>
|
86
|
+
|
87
|
+
<div class="desc">
|
88
|
+
<h4>Description</h4>
|
89
|
+
|
90
|
+
<p>Constructs a raster image object. The viewbox is defined by
|
91
|
+
the image bounds. This method is usually called indirectly via
|
92
|
+
the <code>image</code> method in the <a href=
|
93
|
+
"rvg.html#RVG_image">RVG</a>, <a href=
|
94
|
+
"rvggroup.html#image">RVG::Group</a>, or <a href=
|
95
|
+
"rvgpattern.html">RVG::Pattern</a> classes.</p>
|
96
|
+
|
97
|
+
<h4>Arguments</h4>
|
98
|
+
|
99
|
+
<dl>
|
100
|
+
<dt>raster_image</dt>
|
101
|
+
|
102
|
+
<dd>A <a href="image1.html#new">Magick::Image</a>
|
103
|
+
object.</dd>
|
104
|
+
|
105
|
+
<dt>width, height</dt>
|
106
|
+
|
107
|
+
<dd>The width and height of the rectangle in which the image
|
108
|
+
is placed.</dd>
|
109
|
+
|
110
|
+
<dt>x, y</dt>
|
111
|
+
|
112
|
+
<dd>The <em>x-</em> and <em>y</em>-axis location of the
|
113
|
+
rectangle in which the image is placed.</dd>
|
114
|
+
</dl>
|
115
|
+
|
116
|
+
<h4>Example</h4>
|
117
|
+
|
118
|
+
<p>See <a href=
|
119
|
+
"#preserve_aspect_ratio">preserve_aspect_ratio</a></p>
|
120
|
+
</div>
|
121
|
+
|
122
|
+
<h2 class="methods">attributes</h2>
|
123
|
+
|
124
|
+
<div class="sig">
|
125
|
+
<h3 id="desc">desc, desc=</h3>
|
126
|
+
|
127
|
+
<p><span class="arg">image</span>.desc -> <span class=
|
128
|
+
"arg">aString</span><br />
|
129
|
+
<span class="arg">image</span>.desc = <span class=
|
130
|
+
"arg">aString</span></p>
|
131
|
+
</div>
|
132
|
+
|
133
|
+
<div class="desc">
|
134
|
+
<h4>Description</h4>Use the <code>desc</code> attribute to
|
135
|
+
assign a text description to the image.
|
136
|
+
</div>
|
137
|
+
|
138
|
+
<div class="sig">
|
139
|
+
<h3 id="metadata">metadata, metadata=</h3>
|
140
|
+
|
141
|
+
<p><span class="arg">image</span>.metadata -> <span class=
|
142
|
+
"arg">aString</span><br />
|
143
|
+
<span class="arg">image</span>.metadata = <span class=
|
144
|
+
"arg">aString</span></p>
|
145
|
+
</div>
|
146
|
+
|
147
|
+
<div class="desc">
|
148
|
+
<h4>Description</h4>Use the <code>metadata</code> attribute to
|
149
|
+
assign additional metadata to the image.
|
150
|
+
</div>
|
151
|
+
|
152
|
+
<div class="sig">
|
153
|
+
<h3 id="RVG_title">title, title=</h3>
|
154
|
+
|
155
|
+
<p><span class="arg">image</span>.title -> <span class=
|
156
|
+
"arg">aString</span><br />
|
157
|
+
<span class="arg">image</span>.title = <span class=
|
158
|
+
"arg">aString</span></p>
|
159
|
+
</div>
|
160
|
+
|
161
|
+
<div class="desc">
|
162
|
+
<h4>Description</h4>Use the <code>title</code> attribute to
|
163
|
+
assign a title to the image.
|
164
|
+
</div>
|
165
|
+
|
166
|
+
<h2 class="methods">instance methods</h2>
|
167
|
+
|
168
|
+
<div class="sig">
|
169
|
+
<p><span class=
|
170
|
+
"arg">image</span>.preserve_aspect_ratio(<span class=
|
171
|
+
"arg">align</span>, <span class=
|
172
|
+
"arg">meet_or_slice</span>='meet') -> <span class=
|
173
|
+
"arg">self</span></p>
|
174
|
+
</div>
|
175
|
+
|
176
|
+
<div class="desc">
|
177
|
+
<h4>Description</h4>
|
178
|
+
|
179
|
+
<p>Use <code>preserve_aspect_ratio</code> to specify whether or
|
180
|
+
not the image is stretched to fit the rectangle in which it is
|
181
|
+
placed. If not, you can specify how to fit the image into the
|
182
|
+
space.</p>
|
183
|
+
|
184
|
+
<h4>Arguments</h4>
|
185
|
+
|
186
|
+
<dl>
|
187
|
+
<dt>align</dt>
|
188
|
+
|
189
|
+
<dd>
|
190
|
+
When the value of the <code>meet_or_slice</code> argument
|
191
|
+
is 'meet' or 'slice', this argument controls the placement
|
192
|
+
of the image within the viewport. The <code>align</code>
|
193
|
+
argument is the concatenation of an <em>x</em>-aligment and
|
194
|
+
a <em>y</em>-alignment. The values are shown in these
|
195
|
+
lists:
|
196
|
+
|
197
|
+
<h6><em>x</em>-alignment</h6>
|
198
|
+
|
199
|
+
<dl>
|
200
|
+
<dt>xMin</dt>
|
201
|
+
|
202
|
+
<dd>align the minimum <em>x</em> value of the image with
|
203
|
+
the left corner of the viewport.</dd>
|
204
|
+
|
205
|
+
<dt>xMid</dt>
|
206
|
+
|
207
|
+
<dd>vertically center the image within the viewport.</dd>
|
208
|
+
|
209
|
+
<dt>xMax</dt>
|
210
|
+
|
211
|
+
<dd>align the maximum <em>x</em> value of the image with
|
212
|
+
the right corner of the viewport.</dd>
|
213
|
+
</dl>
|
214
|
+
|
215
|
+
<h6><em>y</em>-alignment</h6>
|
216
|
+
|
217
|
+
<dl>
|
218
|
+
<dt>YMin</dt>
|
219
|
+
|
220
|
+
<dd>align the minimum <em>y</em> value of the image with
|
221
|
+
the top of the viewport.</dd>
|
222
|
+
|
223
|
+
<dt>YMid</dt>
|
224
|
+
|
225
|
+
<dd>horizontally center the image within the
|
226
|
+
viewport.</dd>
|
227
|
+
|
228
|
+
<dt>YMax</dt>
|
229
|
+
|
230
|
+
<dd>align the maximum <em>y</em> value of the image with
|
231
|
+
the bottom of the viewport</dd>
|
232
|
+
</dl>
|
233
|
+
</dd>
|
234
|
+
|
235
|
+
<dt>meet_or_slice</dt>
|
236
|
+
|
237
|
+
<dd>
|
238
|
+
This argument can have one of these three values:
|
239
|
+
|
240
|
+
<dl>
|
241
|
+
<dt>'none'</dt>
|
242
|
+
|
243
|
+
<dd>The image is scaled as necessary so that it fits
|
244
|
+
exactly within the viewport. The aspect ratio is
|
245
|
+
<em>not</em> maintained.</dd>
|
246
|
+
|
247
|
+
<dt>'meet'</dt>
|
248
|
+
|
249
|
+
<dd>The image is scaled as necessary so that the larger
|
250
|
+
dimension exactly fits the viewport. There may be some
|
251
|
+
unused space in the viewport. The aspect ratio is
|
252
|
+
maintained.</dd>
|
253
|
+
|
254
|
+
<dt>'slice'</dt>
|
255
|
+
|
256
|
+
<dd>The image is scaled as necessary so that the smaller
|
257
|
+
dimension exactly fits the viewport. Some of the image in
|
258
|
+
the larger dimension may be cut off. The aspect ratio is
|
259
|
+
maintained.</dd>
|
260
|
+
</dl>
|
261
|
+
</dd>
|
262
|
+
</dl>
|
263
|
+
|
264
|
+
<h4>Example</h4>
|
265
|
+
|
266
|
+
<p><a href="javascript:popup('image.rb.html')"><img src=
|
267
|
+
"ex/image.gif" title="Click to see the example script" alt=
|
268
|
+
"preserve_aspect_ratio example" /></a></p>
|
269
|
+
|
270
|
+
<h4>Returns</h4>
|
271
|
+
|
272
|
+
<p><span class="arg">self</span></p>
|
273
|
+
|
274
|
+
<h4>See Also</h4>
|
275
|
+
|
276
|
+
<p><a href=
|
277
|
+
"#RVG_preserve_aspect_ratio">RVG#preserve_aspect_ratio</a></p>
|
278
|
+
</div>
|
279
|
+
|
280
|
+
<p class="spacer"> </p>
|
281
|
+
|
282
|
+
<div class="nav">
|
283
|
+
« <a href="rvggroup.html">Prev</a> | <a href=
|
284
|
+
"index.html">Contents</a> | <a href=
|
285
|
+
"rvgpattern.html">Next</a> »
|
286
|
+
</div>
|
287
|
+
</body>
|
288
|
+
</html>
|
data/doc/rvgpattern.html
ADDED
@@ -0,0 +1,456 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3
|
+
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
5
|
+
<head>
|
6
|
+
<meta name="generator" content=
|
7
|
+
"HTML Tidy for Linux/x86 (vers 1st March 2005), see www.w3.org" />
|
8
|
+
|
9
|
+
<title>RMagick: RVG Reference: RVG::Pattern Class</title>
|
10
|
+
<meta http-equiv="Content-Type" content=
|
11
|
+
"text/html; charset=us-ascii" />
|
12
|
+
<meta name="GENERATOR" content="Quanta Plus" />
|
13
|
+
<meta name="Copyright" content=
|
14
|
+
"Copyright (C) 2005 by Timothy P. Hunter" />
|
15
|
+
<link rel="stylesheet" type="text/css" href="css/doc.css" />
|
16
|
+
<script type="text/javascript" src="scripts/doc.js">
|
17
|
+
</script>
|
18
|
+
<script type="text/javascript">
|
19
|
+
//<![CDATA[
|
20
|
+
//]]>
|
21
|
+
</script>
|
22
|
+
<style type="text/css">
|
23
|
+
/*<![CDATA[*/
|
24
|
+
}
|
25
|
+
/*]]>*/
|
26
|
+
</style>
|
27
|
+
</head>
|
28
|
+
|
29
|
+
<body>
|
30
|
+
<h6 id="header">RMagick User's Guide and Reference</h6>
|
31
|
+
|
32
|
+
<div class="nav">
|
33
|
+
« <a href="rvgimage.html">Prev</a> | <a href=
|
34
|
+
"index.html">Contents</a> | <a href=
|
35
|
+
"rvgclip.html">Next</a> »
|
36
|
+
</div>
|
37
|
+
|
38
|
+
<h1>class RVG::Pattern <span class="superclass">< Object</span></h1>
|
39
|
+
|
40
|
+
<div id="toc">
|
41
|
+
<h2>Table of Contents</h2>
|
42
|
+
|
43
|
+
<h3>class methods</h3>
|
44
|
+
|
45
|
+
<ul>
|
46
|
+
<li><a href="#new">new</a></li>
|
47
|
+
</ul>
|
48
|
+
|
49
|
+
<h3>instance methods</h3>
|
50
|
+
<div>
|
51
|
+
<div class="toccol">
|
52
|
+
<ul>
|
53
|
+
<li><a href="#g">g</a></li>
|
54
|
+
<li><a href="#image">image</a></li>
|
55
|
+
<li><a href=
|
56
|
+
"#preserve_aspect_ratio">preserve_aspect_ratio</a></li>
|
57
|
+
</ul>
|
58
|
+
</div>
|
59
|
+
|
60
|
+
<div class="toccol">
|
61
|
+
<ul>
|
62
|
+
|
63
|
+
<li><a href="#rvg">rvg</a></li>
|
64
|
+
|
65
|
+
<li><a href="#text">text</a></li>
|
66
|
+
</ul>
|
67
|
+
</div>
|
68
|
+
|
69
|
+
<div class="toccol">
|
70
|
+
<ul>
|
71
|
+
<li><a href="#use">use</a></li>
|
72
|
+
|
73
|
+
<li><a href="#viewbox">viewbox</a></li>
|
74
|
+
</ul>
|
75
|
+
</div>
|
76
|
+
</div>
|
77
|
+
|
78
|
+
<h3>shared methods</h3>
|
79
|
+
|
80
|
+
<p> <p>In addition to the methods listed above, this class
|
81
|
+
also implements the <a href=
|
82
|
+
"rvgstyle.html">styles</a> method, the <a href=
|
83
|
+
"rvgshape.html">shape methods</a> and the <a href=
|
84
|
+
"rvgxform.html">transform methods</a>.</p></p>
|
85
|
+
</div>
|
86
|
+
|
87
|
+
<h2 class="methods">class methods</h2>
|
88
|
+
<div class="sig">
|
89
|
+
<h3 id="new">new</h3>
|
90
|
+
|
91
|
+
<p>RVG::Pattern.new(<span class="arg">width</span>=0, <span class="arg">height</span>=0, <span class="arg">x</span>=0, <span class="arg">y</span>=0) [ <span class="arg">{ |pattern| drawing
|
92
|
+
method calls }</span> ] -> aPattern</p>
|
93
|
+
</div>
|
94
|
+
|
95
|
+
<div class="desc">
|
96
|
+
<h4>Description</h4>
|
97
|
+
|
98
|
+
<p>Creates a pattern that can be used with the <code>:fill</code> and <code>:stroke</code> styles.</p>
|
99
|
+
<p>Define the pattern in the associated block. The pattern can be composed of <a href="rvgshape.html">shapes</a>,
|
100
|
+
<a href="rvgtext.html#new">text</a>, <a href="rvgimage.html#new">raster images</a>, <a href="rvggroup.html#new">groups</a>, and <a href="rvg.html#RVG_new">RVG objects</a>.
|
101
|
+
You can use the <a href="rvguse.html#new">use</a> method to include graphic objects in the pattern.</p>
|
102
|
+
|
103
|
+
<h4>Arguments</h4>
|
104
|
+
<dl>
|
105
|
+
<dt>width, height</dt>
|
106
|
+
<dd>These arguments define the pattern viewport.</dd>
|
107
|
+
<dt>x, y</dt>
|
108
|
+
<dd>Specify the starting offset of the pattern. The pattern will be repeated at <span class="arg">x</span><code>+m*width</code> and <span class="arg">y</span><code>+n*height</code> offsets.</dd>
|
109
|
+
</dl>
|
110
|
+
|
111
|
+
<h4>Example</h4>
|
112
|
+
<p><a href=
|
113
|
+
"javascript:popup('rvg_pattern.rb.html')"><img src="ex/rvg_pattern.gif"
|
114
|
+
title="Click to see the example script" alt=
|
115
|
+
"pattern example" /></a></p>
|
116
|
+
|
117
|
+
</div>
|
118
|
+
|
119
|
+
<h2 class="methods">instance methods</h2>
|
120
|
+
<div class="sig">
|
121
|
+
<h3 id='g'>g</h3>
|
122
|
+
|
123
|
+
<p><span class="arg">pattern.</span>g [{|<span class=
|
124
|
+
"arg">grp</span>| ...}] -> <span class=
|
125
|
+
"arg">aGroup</span></p>
|
126
|
+
</div>
|
127
|
+
|
128
|
+
<div class="desc">
|
129
|
+
<h4>Description</h4>
|
130
|
+
|
131
|
+
<p>Calls <a href="rvggroup.html#new">RVG::Group.new</a> to
|
132
|
+
construct a group and adds it to the pattern.
|
133
|
+
Yields to a block if one is present, passing the new group as
|
134
|
+
an argument.</p>
|
135
|
+
|
136
|
+
<h4>Returns</h4>
|
137
|
+
|
138
|
+
<p>Returns the new group, so <code>RVG::Group</code> methods
|
139
|
+
can be chained to this method.</p>
|
140
|
+
</div>
|
141
|
+
|
142
|
+
<div class="sig">
|
143
|
+
<h3 id='image'>image</h3>
|
144
|
+
|
145
|
+
<p><span class="arg">pattern.</span>image(<span class=
|
146
|
+
"arg">raster_image</span>, <span class="arg">width</span>=nil,
|
147
|
+
<span class="arg">height</span>=nil, <span class=
|
148
|
+
"arg">x</span>=0, <span class="arg">y</span>=0) ->
|
149
|
+
<span class="arg">anImage</span></p>
|
150
|
+
</div>
|
151
|
+
|
152
|
+
<div class="desc">
|
153
|
+
<h4>Description</h4>
|
154
|
+
|
155
|
+
<p>Calls <a href="rvgimage.html#new">RVG::Image.new</a> to
|
156
|
+
construct an image and adds it to the pattern.</p>
|
157
|
+
|
158
|
+
<h4>Returns</h4>
|
159
|
+
|
160
|
+
<p>Returns the new image, so <code>RVG::Image</code> methods
|
161
|
+
can be chained to this method.</p>
|
162
|
+
|
163
|
+
</div>
|
164
|
+
|
165
|
+
<div class="sig">
|
166
|
+
<h3 id='preserve_aspect_ratio'>preserve_aspect_ratio</h3>
|
167
|
+
|
168
|
+
<p><span class=
|
169
|
+
"arg">pattern</span>.preserve_aspect_ratio(<span class=
|
170
|
+
"arg">align</span>, <span class=
|
171
|
+
"arg">meet_or_slice</span>='meet') [{|<span class=
|
172
|
+
"arg">self</span>| ...}] -> <span class=
|
173
|
+
"arg">self</span></p>
|
174
|
+
</div>
|
175
|
+
|
176
|
+
<div class="desc">
|
177
|
+
<h4>Description</h4>
|
178
|
+
|
179
|
+
<p>If you use the <a href="#viewbox">viewbox</a> method and
|
180
|
+
the user coordinate system does not scale uniformly to the
|
181
|
+
default coordinate system,
|
182
|
+
use the <code>preserve_aspect_ratio</code> method to specify
|
183
|
+
whether or not the content is stretched to fit. If not, you can
|
184
|
+
specify how to fit the content into the space.</p>
|
185
|
+
|
186
|
+
<p><code>Preserve_aspect_ratio</code> yields to a block if one
|
187
|
+
is present, passing <span class="arg">self</span> as an
|
188
|
+
argument.</p>
|
189
|
+
|
190
|
+
<h4>Arguments</h4>
|
191
|
+
|
192
|
+
<dl>
|
193
|
+
<dt>align</dt>
|
194
|
+
|
195
|
+
<dd>
|
196
|
+
When the value of the <code>meet_or_slice</code> argument
|
197
|
+
is 'meet' or 'slice', this argument controls the placement
|
198
|
+
of the content within the viewport. The <code>align</code>
|
199
|
+
argument is the concatenation of an <em>x</em>-aligment and
|
200
|
+
a <em>y</em>-alignment. The values are shown in these
|
201
|
+
lists:
|
202
|
+
|
203
|
+
<h6><em>x</em>-alignment</h6>
|
204
|
+
|
205
|
+
<dl>
|
206
|
+
<dt>xMin</dt>
|
207
|
+
|
208
|
+
<dd>align the minimum <em>x</em> value of the content
|
209
|
+
with the left corner of the viewport.</dd>
|
210
|
+
|
211
|
+
<dt>xMid</dt>
|
212
|
+
|
213
|
+
<dd>vertically center the content within the
|
214
|
+
viewport.</dd>
|
215
|
+
|
216
|
+
<dt>xMax</dt>
|
217
|
+
|
218
|
+
<dd>align the maximum <em>x</em> value of the content
|
219
|
+
with the right corner of the viewport.</dd>
|
220
|
+
</dl>
|
221
|
+
|
222
|
+
<h6><em>y</em>-alignment</h6>
|
223
|
+
|
224
|
+
<dl>
|
225
|
+
<dt>YMin</dt>
|
226
|
+
|
227
|
+
<dd>align the minimum <em>y</em> value of the content
|
228
|
+
with the top of the viewport.</dd>
|
229
|
+
|
230
|
+
<dt>YMid</dt>
|
231
|
+
|
232
|
+
<dd>horizontally center the content within the
|
233
|
+
viewport.</dd>
|
234
|
+
|
235
|
+
<dt>YMax</dt>
|
236
|
+
|
237
|
+
<dd>align the maximum <em>y</em> value of the content
|
238
|
+
with the bottom of the viewport</dd>
|
239
|
+
</dl>
|
240
|
+
</dd>
|
241
|
+
|
242
|
+
<dt>meet_or_slice</dt>
|
243
|
+
|
244
|
+
<dd>
|
245
|
+
This argument can have one of these three values:
|
246
|
+
|
247
|
+
<dl>
|
248
|
+
<dt>'none'</dt>
|
249
|
+
|
250
|
+
<dd>The content is scaled as necessary so that it fits
|
251
|
+
exactly within the viewport. The aspect ratio is
|
252
|
+
<em>not</em> maintained.</dd>
|
253
|
+
|
254
|
+
<dt>'meet'</dt>
|
255
|
+
|
256
|
+
<dd>The content is scaled as necessary so that the larger
|
257
|
+
dimension exactly fits the viewport. There may be some
|
258
|
+
unused space in the viewport. The aspect ratio is
|
259
|
+
maintained.</dd>
|
260
|
+
|
261
|
+
<dt>'slice'</dt>
|
262
|
+
|
263
|
+
<dd>The content is scaled as necessary so that the
|
264
|
+
smaller dimension exactly fits the viewport. Some of the
|
265
|
+
content in the larger dimension may be cut off. The
|
266
|
+
aspect ratio is maintained.</dd>
|
267
|
+
</dl>
|
268
|
+
</dd>
|
269
|
+
</dl>
|
270
|
+
|
271
|
+
<h4>Example</h4>
|
272
|
+
|
273
|
+
<p>See the RVG class <a href="rvg.html#RVG_preserve_aspect_ratio">example</a>.</p>
|
274
|
+
|
275
|
+
<h4>Returns</h4>
|
276
|
+
|
277
|
+
<p><span class="arg">Self</span>, so other <code>RVG::Pattern</code>
|
278
|
+
methods can be chained to this method.</p>
|
279
|
+
|
280
|
+
<h4>See Also</h4>
|
281
|
+
|
282
|
+
<p><a href="#viewbox">viewbox</a></p>
|
283
|
+
</div>
|
284
|
+
|
285
|
+
<div class="sig">
|
286
|
+
<h3 id="rvg">rvg</h3>
|
287
|
+
|
288
|
+
<p><span class="arg">pattern</span>.rvg(<span class=
|
289
|
+
"arg">width</span>, <span class="arg">height</span>,
|
290
|
+
<span class="arg">x</span>=0, <span class="arg">y</span>=0)
|
291
|
+
[{|<span class="arg">new_rvg</span>| ...}] -> <span class=
|
292
|
+
"arg">aPattern</span></p>
|
293
|
+
</div>
|
294
|
+
|
295
|
+
<div class="desc">
|
296
|
+
<h4>Description</h4>
|
297
|
+
|
298
|
+
<p>This method constructs a new RVG object and adds it to the
|
299
|
+
pattern. Each nested RVG object can use the
|
300
|
+
<a href="rvg.html#RVG_viewbox">viewbox</a> method to define its own
|
301
|
+
coordinate system. The <code>rvg</code> method yields to a
|
302
|
+
block, passing the nested RVG object as an argument. Within the
|
303
|
+
block, any drawing objects added to the nested RVG object are
|
304
|
+
rendered within the nested RVG object's viewport.</p>
|
305
|
+
|
306
|
+
<h4>Arguments</h4>
|
307
|
+
|
308
|
+
<dl>
|
309
|
+
<dt>width, height</dt>
|
310
|
+
|
311
|
+
<dd>Specifies the viewport width and height. The units are in
|
312
|
+
the user coordinate system of the parent container.</dd>
|
313
|
+
|
314
|
+
<dt>x, y</dt>
|
315
|
+
|
316
|
+
<dd>The x- and y-axis offsets of the viewport upper-left
|
317
|
+
corner. The units are in the user coordinate system of the
|
318
|
+
parent container.</dd>
|
319
|
+
</dl>
|
320
|
+
|
321
|
+
<h4>Example</h4>
|
322
|
+
|
323
|
+
<p>See the example for <a href=
|
324
|
+
"#RVG_preserve_aspect_ratio">preserve_aspect_ratio</a>
|
325
|
+
in <code>class RVG</code>.</p>
|
326
|
+
|
327
|
+
<h4>Returns</h4>
|
328
|
+
|
329
|
+
<p>The <code>RVG</code> object, so other <code>RVG</code>
|
330
|
+
methods can be chained to this method.</p>
|
331
|
+
</div>
|
332
|
+
|
333
|
+
<div class="sig">
|
334
|
+
<h3 id='RVG_text'>text</h3>
|
335
|
+
|
336
|
+
<p><span class="arg">pattern.</span>text(<span class=
|
337
|
+
"arg">x</span>=0, <span class="arg">y</span>=0, <span class=
|
338
|
+
"arg">text</span>=nil) [{|<span class="arg">aText</span>| ...}]
|
339
|
+
-> <span class="arg">aText</span></p>
|
340
|
+
</div>
|
341
|
+
|
342
|
+
<div class="desc">
|
343
|
+
<h4>Description</h4>
|
344
|
+
|
345
|
+
<p>Calls <a href="rvgtext.html#new">RVG::Text.new</a> to
|
346
|
+
construct a text object and adds it to the pattern. Yields to a block if one is present, passing the new
|
347
|
+
text object as an argument.</p>
|
348
|
+
|
349
|
+
<h4>Returns</h4>
|
350
|
+
|
351
|
+
<p>The <code>RVG::Text</code> object, so other
|
352
|
+
<code>RVG::Text</code> methods can be chained to this
|
353
|
+
method.</p>
|
354
|
+
</div>
|
355
|
+
|
356
|
+
<div class="sig">
|
357
|
+
<h3 id="RVG_use">use</h3>
|
358
|
+
|
359
|
+
<p><span class="arg">pattern</span>.use(<span class=
|
360
|
+
"arg">obj</span>, <span class="arg">x</span>=0, <span class=
|
361
|
+
"arg">y</span>=0, <span class="arg">width</span>=nil,
|
362
|
+
<span class="arg">height</span>=nil) -> <span class=
|
363
|
+
"arg">aUse</span></p>
|
364
|
+
</div>
|
365
|
+
|
366
|
+
<div class="desc">
|
367
|
+
<h4>Description</h4>
|
368
|
+
|
369
|
+
<p>Calls <a href="rvguse.html#new">RVG::Use.new</a> to
|
370
|
+
constructs a <code>use</code> object and adds it to the pattern.</p>
|
371
|
+
|
372
|
+
<p>When the referenced argument is an RVG object,
|
373
|
+
<span class="arg">width</span> and <span class=
|
374
|
+
"arg">height</span> can be used to specify the width and height
|
375
|
+
of the viewport. If present and non-nil, these arguments
|
376
|
+
override any width and height specified when the RVG object was
|
377
|
+
created. You must specify the viewport size either when
|
378
|
+
creating the RVG object or when referencing it with
|
379
|
+
<code>use</code>.</p>
|
380
|
+
|
381
|
+
<h4>Examples</h4>
|
382
|
+
|
383
|
+
<p>See <a href="rvguse.html#new">RVG::Use.new</a></p>
|
384
|
+
|
385
|
+
<h4>Returns</h4>
|
386
|
+
|
387
|
+
<p>The <code>RVG::Use</code> object, so other
|
388
|
+
<code>RVG::Use</code> methods can be chained to this
|
389
|
+
method.</p>
|
390
|
+
</div>
|
391
|
+
|
392
|
+
<div class="sig">
|
393
|
+
<h3 id="viewbox">viewbox</h3>
|
394
|
+
|
395
|
+
<p><span class="arg">pattern</span>.viewbox(<span class="arg">min_x</span>, <span class=
|
396
|
+
"arg">min_y</span>, <span class="arg">width</span>,
|
397
|
+
<span class="arg">height</span>) [{|<span class=
|
398
|
+
"arg">self</span>| ...}] -> <span class="arg">rvg</span></p>
|
399
|
+
</div>
|
400
|
+
|
401
|
+
<div class="desc">
|
402
|
+
<h4>Description</h4>
|
403
|
+
|
404
|
+
<p>The area of the pattern is called the <em>viewport</em>.
|
405
|
+
By default the origin of the coordinate system for an pattern is (0,0). The user coordinates are pixels and the width
|
406
|
+
and height are established by the <span class=
|
407
|
+
"arg">width</span> and <span class="arg">height</span>
|
408
|
+
arguments to <code>RVG::Pattern.new</code>.</p>
|
409
|
+
|
410
|
+
<p>Use the <code>viewbox</code> method to superimpose a user
|
411
|
+
coordinate system on the viewport. The <code>viewbox</code>
|
412
|
+
method lets you set up a coordinate system using the units of
|
413
|
+
your choice.</p>
|
414
|
+
|
415
|
+
<p>The <code>viewbox</code> method yields to a block if one is
|
416
|
+
present, passing <code>self</code> as an argument.</p>
|
417
|
+
|
418
|
+
<h4>Arguments</h4>
|
419
|
+
|
420
|
+
<dl>
|
421
|
+
<dt>min_x, min_y</dt>
|
422
|
+
|
423
|
+
<dd>The minimum <em>x</em>-coordinate and
|
424
|
+
<em>y</em>-coordinate of the user coordinate system.</dd>
|
425
|
+
|
426
|
+
<dt>width, height</dt>
|
427
|
+
|
428
|
+
<dd>The width and height of the user coordinate system.</dd>
|
429
|
+
</dl>
|
430
|
+
|
431
|
+
<h4>Example</h4>
|
432
|
+
|
433
|
+
<p>See the <a href="rvg.html#RVG_viewbox">example</a> for the <code>RVG </code>class.</p>
|
434
|
+
|
435
|
+
<h4>Returns</h4>
|
436
|
+
|
437
|
+
<p><span class="arg">Self</span>, so other <code>RVG::Pattern</code>
|
438
|
+
methods may be chained to <code>viewbox</code>.</p>
|
439
|
+
|
440
|
+
<h4>See Also</h4>
|
441
|
+
|
442
|
+
<p><a href=
|
443
|
+
"#preserve_aspect_ratio">preserve_aspect_ratio</a></p>
|
444
|
+
</div>
|
445
|
+
|
446
|
+
|
447
|
+
|
448
|
+
<p class="spacer"> </p>
|
449
|
+
|
450
|
+
<div class="nav">
|
451
|
+
« <a href="rvgimage.html">Prev</a> | <a href=
|
452
|
+
"index.html">Contents</a> | <a href=
|
453
|
+
"rvgclip.html">Next</a> »
|
454
|
+
</div>
|
455
|
+
</body>
|
456
|
+
</html>
|