rmagick 1.7.4 → 1.8.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 (130) hide show
  1. data/ChangeLog +10 -2
  2. data/README.html +284 -290
  3. data/README.txt +298 -307
  4. data/configure +180 -11
  5. data/configure.ac +18 -2
  6. data/doc/comtasks.html +1 -1
  7. data/doc/constants.html +15 -10
  8. data/doc/css/ref.css +67 -0
  9. data/doc/draw.html +1 -1
  10. data/doc/ex/InitialCoords.rb +24 -0
  11. data/doc/ex/NewCoordSys.rb +33 -0
  12. data/doc/ex/OrigCoordSys.rb +19 -0
  13. data/doc/ex/PreserveAspectRatio.rb +206 -0
  14. data/doc/ex/RotateScale.rb +38 -0
  15. data/doc/ex/Skew.rb +39 -0
  16. data/doc/ex/Use01.rb +17 -0
  17. data/doc/ex/Use02.rb +22 -0
  18. data/doc/ex/Use03.rb +17 -0
  19. data/doc/ex/ViewBox.rb +34 -0
  20. data/doc/ex/arcs01.rb +29 -0
  21. data/doc/ex/arcs02.rb +62 -0
  22. data/doc/ex/baseline_shift01.rb +19 -0
  23. data/doc/ex/bounding_box.rb +31 -37
  24. data/doc/ex/circle01.rb +18 -0
  25. data/doc/ex/cubic01.rb +46 -0
  26. data/doc/ex/cubic02.rb +95 -0
  27. data/doc/ex/drop_shadow.rb +1 -1
  28. data/doc/ex/ellipse01.rb +23 -0
  29. data/doc/ex/evenodd.rb +44 -0
  30. data/doc/ex/font_styles.rb +29 -0
  31. data/doc/ex/group.rb +27 -0
  32. data/doc/ex/image.rb +47 -0
  33. data/doc/ex/images/big-duck.gif +0 -0
  34. data/doc/ex/images/duck.gif +0 -0
  35. data/doc/ex/images/duck0.gif +0 -0
  36. data/doc/ex/images/duck1.gif +0 -0
  37. data/doc/ex/images/duck10.gif +0 -0
  38. data/doc/ex/images/duck11.gif +0 -0
  39. data/doc/ex/images/duck12.gif +0 -0
  40. data/doc/ex/images/duck13.gif +0 -0
  41. data/doc/ex/images/duck14.gif +0 -0
  42. data/doc/ex/images/duck15.gif +0 -0
  43. data/doc/ex/images/duck2.gif +0 -0
  44. data/doc/ex/images/duck3.gif +0 -0
  45. data/doc/ex/images/duck4.gif +0 -0
  46. data/doc/ex/images/duck5.gif +0 -0
  47. data/doc/ex/images/duck6.gif +0 -0
  48. data/doc/ex/images/duck7.gif +0 -0
  49. data/doc/ex/images/duck8.gif +0 -0
  50. data/doc/ex/images/duck9.gif +0 -0
  51. data/doc/ex/line01.rb +24 -0
  52. data/doc/ex/nested_rvg.rb +22 -0
  53. data/doc/ex/nonzero.rb +44 -0
  54. data/doc/ex/polygon01.rb +24 -0
  55. data/doc/ex/polyline01.rb +24 -0
  56. data/doc/ex/quad01.rb +37 -0
  57. data/doc/ex/rect01.rb +16 -0
  58. data/doc/ex/rect02.rb +23 -0
  59. data/doc/ex/rvg_clippath.rb +15 -0
  60. data/doc/ex/rvg_linecap.rb +44 -0
  61. data/doc/ex/rvg_linejoin.rb +42 -0
  62. data/doc/ex/rvg_opacity.rb +20 -0
  63. data/doc/ex/rvg_pattern.rb +27 -0
  64. data/doc/ex/rvg_stroke_dasharray.rb +13 -0
  65. data/doc/ex/sepiatone.rb +15 -0
  66. data/doc/ex/shadow.rb +37 -0
  67. data/doc/ex/smile.rb +9 -9
  68. data/doc/ex/stroke_fill.rb +12 -0
  69. data/doc/ex/text01.rb +18 -0
  70. data/doc/ex/text_styles.rb +22 -0
  71. data/doc/ex/texture_fill_to_border.rb +3 -3
  72. data/doc/ex/texture_floodfill.rb +3 -2
  73. data/doc/ex/tref01.rb +26 -0
  74. data/doc/ex/triangle01.rb +17 -0
  75. data/doc/ex/tspan01.rb +19 -0
  76. data/doc/ex/tspan02.rb +20 -0
  77. data/doc/ex/tspan03.rb +22 -0
  78. data/doc/ex/writing_mode01.rb +28 -0
  79. data/doc/ex/writing_mode02.rb +27 -0
  80. data/doc/ilist.html +1 -1
  81. data/doc/image1.html +66 -30
  82. data/doc/image2.html +1 -1
  83. data/doc/image3.html +274 -49
  84. data/doc/imageattrs.html +87 -10
  85. data/doc/imusage.html +1 -1
  86. data/doc/index.html +80 -39
  87. data/doc/info.html +149 -13
  88. data/doc/magick.html +1 -1
  89. data/doc/rvg.html +890 -0
  90. data/doc/rvgclip.html +249 -0
  91. data/doc/rvggroup.html +305 -0
  92. data/doc/rvgimage.html +288 -0
  93. data/doc/rvgpattern.html +456 -0
  94. data/doc/rvgshape.html +376 -0
  95. data/doc/rvgstyle.html +269 -0
  96. data/doc/rvgtext.html +464 -0
  97. data/doc/rvgtspan.html +237 -0
  98. data/doc/rvgtut.html +512 -0
  99. data/doc/rvguse.html +145 -0
  100. data/doc/rvgxform.html +294 -0
  101. data/doc/struct.html +9 -71
  102. data/doc/usage.html +22 -7
  103. data/ext/RMagick/MANIFEST +94 -2
  104. data/ext/RMagick/rmagick.h +10 -4
  105. data/ext/RMagick/rmagick_config.h.in +8 -2
  106. data/ext/RMagick/rmdraw.c +2 -2
  107. data/ext/RMagick/rmfill.c +2 -2
  108. data/ext/RMagick/rmilist.c +3 -3
  109. data/ext/RMagick/rmimage.c +152 -5
  110. data/ext/RMagick/rminfo.c +208 -2
  111. data/ext/RMagick/rmmain.c +14 -5
  112. data/ext/RMagick/rmutil.c +83 -22
  113. data/lib/RMagick.rb +2 -2
  114. data/lib/rvg/clippath.rb +46 -0
  115. data/lib/rvg/container.rb +129 -0
  116. data/lib/rvg/deep_equal.rb +54 -0
  117. data/lib/rvg/describable.rb +51 -0
  118. data/lib/rvg/embellishable.rb +395 -0
  119. data/lib/rvg/misc.rb +729 -0
  120. data/lib/rvg/paint.rb +48 -0
  121. data/lib/rvg/pathdata.rb +129 -0
  122. data/lib/rvg/rvg.rb +279 -0
  123. data/lib/rvg/stretchable.rb +150 -0
  124. data/lib/rvg/stylable.rb +116 -0
  125. data/lib/rvg/text.rb +185 -0
  126. data/lib/rvg/transformable.rb +131 -0
  127. data/lib/rvg/units.rb +64 -0
  128. data/rmagick.gemspec +1 -1
  129. data/uninstall.rb +3 -2
  130. metadata +96 -3
@@ -10,7 +10,7 @@
10
10
  <meta http-equiv="Content-Type" content=
11
11
  "text/html; charset=us-ascii" />
12
12
  <meta name="GENERATOR" content="Quanta Plus" />
13
- <meta name="Copyright" content="Copyright (C) 2004 by Timothy P. Hunter" />
13
+ <meta name="Copyright" content="Copyright (C) 2005 by Timothy P. Hunter" />
14
14
  <link rel="stylesheet" type="text/css" href="css/doc.css" />
15
15
  <script type="text/javascript" src="scripts/doc.js">
16
16
  </script>
@@ -0,0 +1,890 @@
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 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
+ &laquo;&nbsp;<a href="rvgtut.html">Prev</a> | <a href=
34
+ "index.html">Contents</a> | <a href=
35
+ "rvggroup.html">Next</a>&nbsp;&raquo;
36
+ </div>
37
+
38
+ <h1>class RVG <span class="superclass">&lt; 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>attributes</h3>
50
+
51
+ <div class="toccol">
52
+ <ul>
53
+ <li><a href=
54
+ "#RVG_background_fill">background_fill=</a></li>
55
+
56
+ <li><a href=
57
+ "#RVG_background_fill_opacity">background_fill_opacity=</a></li>
58
+
59
+ <li><a href=
60
+ "#RVG_background_image">background_image=</a></li>
61
+
62
+ <li><a href=
63
+ "#RVG_background_pattern">background_pattern=</a></li>
64
+
65
+ <li><a href=
66
+ "#RVG_background_position">background_position=</a></li>
67
+ </ul>
68
+ </div>
69
+
70
+ <div class="toccol">
71
+ <ul>
72
+ <li><a href="#RVG_canvas">canvas</a></li>
73
+
74
+ <li><a href="#RVG_desc">desc, desc=</a></li>
75
+
76
+ <li><a href="#RVG_height">height</a></li>
77
+
78
+ <li><a href="#RVG_metadata">metadata, metadata=</a></li>
79
+ </ul>
80
+ </div>
81
+
82
+ <div class="toccol">
83
+ <ul>
84
+ <li><a href="#RVG_title">title, title=</a></li>
85
+
86
+ <li><a href="#RVG_width">width</a></li>
87
+
88
+ <li><a href="#RVG_x">x</a></li>
89
+
90
+ <li><a href="#RVG_y">y</a></li>
91
+ </ul>
92
+ </div>
93
+
94
+ <h3>instance methods</h3>
95
+
96
+ <div>
97
+ <div class="toccol">
98
+ <ul>
99
+ <li><a href="#RVG_draw">draw</a></li>
100
+
101
+ <li><a href="#RVG_g">g</a></li>
102
+
103
+ <li><a href="#RVG_image">image</a></li>
104
+ </ul>
105
+ </div>
106
+
107
+ <div class="toccol">
108
+ <ul>
109
+ <li><a href=
110
+ "#RVG_preserve_aspect_ratio">preserve_aspect_ratio</a></li>
111
+
112
+ <li><a href="#RVG_rvg">rvg</a></li>
113
+
114
+ <li><a href="#RVG_text">text</a></li>
115
+ </ul>
116
+ </div>
117
+
118
+ <div class="toccol">
119
+ <ul>
120
+ <li><a href="#RVG_use">use</a></li>
121
+
122
+ <li><a href="#RVG_viewbox">viewbox</a></li>
123
+ </ul>
124
+ </div>
125
+ </div>
126
+
127
+ <h3>shared methods</h3>
128
+
129
+ <p>In addition to the methods listed above, <code>class
130
+ RVG</code> also implements the <a href=
131
+ "rvgstyle.html">styles</a> method, the <a href=
132
+ "rvgshape.html">shape methods</a> and the <a href=
133
+ "rvgxform.html">transform methods</a>.</p>
134
+ </div>
135
+
136
+ <h2 class="methods">class methods</h2>
137
+
138
+ <div class="sig">
139
+ <h3 id="RVG_new">new</h3>
140
+
141
+ <p>RVG.new(<span class="arg">width</span>=nil, <span class=
142
+ "arg">height</span>=nil) [ <span class="arg">{ |canvas| drawing
143
+ method calls }</span> ] -&gt; anRVG</p>
144
+ </div>
145
+
146
+ <div class="desc">
147
+ <h4>Description</h4>
148
+
149
+ <p>Creates a container that can have its own coordinate system.
150
+ Within the block, call drawing methods on <em>canvas</em> to
151
+ render shapes, text, and raster images in the container.</p>
152
+
153
+ <p>An RVG object is always the outermost container for a
154
+ drawing. Call the <a href="#draw">draw</a> method on the
155
+ returned RVG object to produce the final image.</p>
156
+
157
+ <h4>Arguments</h4>
158
+
159
+ <p>If the RVG object is the outermost container, <span class=
160
+ "arg">width</span> and <span class="arg">height</span> are
161
+ required and specify the width and height of the final drawing
162
+ in pixels. You can call <a href="#units">conversion methods</a>
163
+ to use units such as inches and millimeters instead of
164
+ pixels.</p>
165
+
166
+ <p>Otherwise, wid<span class="arg">th</span> and <span class=
167
+ "arg">height</span> specify the area of the viewbox. If the RVG
168
+ object will be used as an argument to the <a href=
169
+ "#Use_use">use</a> method, then <span class="arg">width</span>
170
+ and <span class="arg">height</span> may be omitted here, then
171
+ specified as arguments to <code>use</code>.</p>
172
+
173
+ <h4>Returns</h4>
174
+
175
+ <p>An RVG object</p>
176
+
177
+ <h4>Example</h4>
178
+
179
+ <p>See the <a href="rvgtut.html">tutorial</a> for a simple
180
+ example. The image below demonstrates an advanced use of
181
+ <code>RVG.new</code>. This example creates an RVG object that
182
+ draws an orange-and-green target. The <span class=
183
+ "arg">width</span> and <span class="arg">height</span>
184
+ arguments are omitted in the <code>RVG.new</code> call.
185
+ Instead, the viewport width and height are specified as
186
+ arguments to 4 invocations of <a href="#Use_use">use</a>. Each
187
+ <code>use</code> specifies a different viewport size, so the
188
+ same RVG object draws 4 different-sized targets.</p>
189
+
190
+ <p>Click the image to see the example script.</p>
191
+
192
+ <p><a href="javascript:popup('nested_rvg.rb.html')"><img src=
193
+ "ex/nested_rvg.gif" title="Click to see the example script"
194
+ alt="nested RVG example" /></a></p>
195
+
196
+ <h4>See also</h4>
197
+
198
+ <p><a href="#Group_class">Group</a></p>
199
+ </div>
200
+
201
+ <h2 class="methods">attributes</h2>
202
+
203
+ <div class="sig">
204
+ <h3 id='RVG_background_fill'>background_fill=</h3>
205
+
206
+ <p><span class="arg">canvas</span>.background_fill =
207
+ <span class="arg">value</span></p>
208
+ </div>
209
+
210
+ <div class="desc">
211
+ <h4>Description</h4>
212
+
213
+ <p>Specify a background fill color. The attribute value may be
214
+ either a <a href="struct.html#Pixel">pixel</a> or a <a href=
215
+ "imusage.html#color_names">color name.</a> The default fill
216
+ color is "#000000ff". This color is usually called "none". This
217
+ attribute has no effect on nested RVG objects.</p>
218
+
219
+ <h4>Example</h4>
220
+ <pre>
221
+ canvas.background_fill = 'white'
222
+ </pre>
223
+
224
+ <h4>Returns</h4><span class="arg">value</span>
225
+ </div>
226
+
227
+ <div class="sig">
228
+ <h3 id='RVG_background_fill_opacity'>
229
+ background_fill_opacity=</h3>
230
+
231
+ <p><span class="arg">canvas</span>.background_fill_opacity =
232
+ <span class="arg">value</span></p>
233
+ </div>
234
+
235
+ <div class="desc">
236
+ <h4>Description</h4>
237
+
238
+ <p>Specify the opacity of the background fill color when the
239
+ <a href="#RVG_background_fill">background fill</a> is not the
240
+ default. The value is a number between 0.0 (fully transparent)
241
+ and 1.0 (fully opaque). The default is 1.0. The attribute is
242
+ ignored unless <code>background_fill</code> is specified. This
243
+ attribute has no effect on nested RVG objects.</p>
244
+
245
+ <h4>Example</h4>
246
+ <pre>
247
+ canvas.background_fill = 'white'
248
+ canvas.background_fill_opacity = 0.50
249
+ </pre>
250
+
251
+ <h4>Returns</h4><span class="arg">value</span>
252
+ </div>
253
+
254
+ <div class="sig">
255
+ <h3 id='RVG_background_image'>background_image=</h3>
256
+
257
+ <p><span class="arg">canvas</span>.background_image =
258
+ <span class="arg">anImage</span></p>
259
+ </div>
260
+
261
+ <div class="desc">
262
+ <h4>Description</h4>
263
+
264
+ <p>Specify an image to be used as the canvas background. The
265
+ value is an <a href="image1.html#new">Image</a> object. This
266
+ attribute has no effect on nested RVG objects.</p>
267
+
268
+ <h4>Example</h4>
269
+ <pre>
270
+ canvas.background_image = Magick::Image.read('myBackground.gif').first
271
+ </pre>
272
+
273
+ <h4>Returns</h4><span class="arg">anImage</span>
274
+
275
+ <h4>See also</h4>
276
+
277
+ <p><a href=
278
+ "#RVG_background_position">background_position=</a></p>
279
+ </div>
280
+
281
+ <div class="sig">
282
+ <h3 id='RVG_background_pattern'>background_pattern=</h3>
283
+
284
+ <p><span class="arg">canvas</span>.background_pattern =
285
+ <span class="arg">aFill</span></p>
286
+ </div>
287
+
288
+ <div class="desc">
289
+ <h4>Description</h4>
290
+
291
+ <p>Specify an <a href="struct.html#fill">Fill object</a> to
292
+ fill the canvas background. This attribute has no effect on
293
+ nested RVG objects.</p>
294
+
295
+ <h4>Example</h4>
296
+ <pre>
297
+ canvas.background_pattern = Magick::GradientFill.new(0, 0, 0, 100, "#900", "#000")
298
+ </pre>
299
+
300
+ <h4>Returns</h4><span class="arg">aFill</span>
301
+ </div>
302
+
303
+ <div class="sig">
304
+ <h3 id='RVG_background_position'>background_position=</h3>
305
+
306
+ <p><span class="arg">canvas</span>.background_position =
307
+ <span class="arg">pos</span></p>
308
+ </div>
309
+
310
+ <div class="desc">
311
+ <h4>Description</h4>
312
+
313
+ <p>If the dimensions of the image specified by <a href=
314
+ "#RVG_background_image">background_image</a> do not exactly
315
+ match the canvas dimensions, this attribute specifies how to
316
+ position the image on the background. This attribute has no
317
+ effect on nested RVG objects.</p>
318
+
319
+ <h4>Argument</h4>The value of <span class="arg">pos</span> can
320
+ be any one of the following symbols :
321
+
322
+ <dl>
323
+ <dt>:scaled</dt>
324
+
325
+ <dd>The image is scaled to fit. The image proportions are not
326
+ retained.</dd>
327
+
328
+ <dt>:tiled</dt>
329
+
330
+ <dd>The image is tiled across the background.</dd>
331
+
332
+ <dt>:fit</dt>
333
+
334
+ <dd>The image is scaled to fit. The image proportions are
335
+ retained. Any part of the background that is not covered by
336
+ the image is colored with the <a href=
337
+ "#RVG_background_color">background color</a>.</dd>
338
+ </dl>
339
+
340
+ <h4>Example</h4>
341
+ <pre>
342
+ canvas.background_image = Magick::Image.read('myBackground.gif').first
343
+ canvas.background_position = :scaled
344
+ </pre>
345
+
346
+ <h4>Returns</h4><span class="arg">pos</span>
347
+ </div>
348
+
349
+ <div class="sig">
350
+ <h3 id='RVG_canvas'>canvas</h3>
351
+
352
+ <p><span class="arg">rvg</span>.canvas -&gt; anImage</p>
353
+ </div>
354
+
355
+ <div class="desc">
356
+ <h4>Description</h4>
357
+
358
+ <p>After the <a href="#RVG_draw">draw</a> method has been used,
359
+ returns the rendered image. This is the same image that
360
+ <a href="#RVG_draw">draw</a> returns.</p>
361
+
362
+ <h4>Returns</h4>
363
+
364
+ <p>An image</p>
365
+ </div>
366
+
367
+ <div class="sig">
368
+ <h3 id="RVG_desc">desc, desc=</h3>
369
+
370
+ <p><span class="arg">rvg</span>.desc -&gt; <span class=
371
+ "arg">aString</span><br />
372
+ <span class="arg">rvg</span>.desc = <span class=
373
+ "arg">aString</span></p>
374
+ </div>
375
+
376
+ <div class="desc">
377
+ <h4>Description</h4>Use the <code>desc</code> attribute to
378
+ assign a text description to the drawing. The description will
379
+ be assigned to the "desc" property of the resulting image. This
380
+ attribute has no effect on nested RVG objects.
381
+ </div>
382
+
383
+ <div class="sig">
384
+ <h3 id='RVG_height'>height</h3>
385
+
386
+ <p><span class="arg">rvg</span>.height -&gt; <span class=
387
+ "arg">height</span></p>
388
+ </div>
389
+
390
+ <div class="desc">
391
+ <h4>Description</h4>
392
+
393
+ <p>The height of the RVG object in user coordinates.</p>
394
+
395
+ <h4>See also</h4>
396
+
397
+ <p><a href="#RVG_width">width</a></p>
398
+ </div>
399
+
400
+ <div class="sig">
401
+ <h3 id="RVG_metadata">metadata, metadata=</h3>
402
+
403
+ <p><span class="arg">rvg</span>.metadata -&gt; <span class=
404
+ "arg">aString</span><br />
405
+ <span class="arg">rvg</span>.metadata = <span class=
406
+ "arg">aString</span></p>
407
+ </div>
408
+
409
+ <div class="desc">
410
+ <h4>Description</h4>Use the <code>metadata</code> attribute to
411
+ assign additional metadata to the drawing. The metadata string
412
+ will be assigned to the "metadata" property of the resulting
413
+ image. This attribute has no effect on nested RVG objects.
414
+ </div>
415
+
416
+ <div class="sig">
417
+ <h3 id="RVG_title">title, title=</h3>
418
+
419
+ <p><span class="arg">rvg</span>.title -&gt; <span class=
420
+ "arg">aString</span><br />
421
+ <span class="arg">rvg</span>.title = <span class=
422
+ "arg">aString</span></p>
423
+ </div>
424
+
425
+ <div class="desc">
426
+ <h4>Description</h4>Use the <code>title</code> attribute to
427
+ assign a title to the drawing. The title will be assigned to
428
+ the "title" property of the resulting image. This attribute has
429
+ no effect on nested RVG objects.
430
+ </div>
431
+
432
+ <div class="sig">
433
+ <h3 id='RVG_width'>width</h3>
434
+
435
+ <p><span class="arg">rvg</span>.width -&gt; <span class=
436
+ "arg">width</span></p>
437
+ </div>
438
+
439
+ <div class="desc">
440
+ <h4>Description</h4>
441
+
442
+ <p>The width of the RVG object in user coordinates.</p>
443
+
444
+ <h4>See also</h4>
445
+
446
+ <p><a href="#RVG_height">height</a></p>
447
+ </div>
448
+
449
+ <div class="sig">
450
+ <h3 id='RVG_x'>x</h3>
451
+
452
+ <p><span class="arg">rvg</span>.x -&gt; <span class=
453
+ "arg">x-offset</span></p>
454
+ </div>
455
+
456
+ <div class="desc">
457
+ <h4>Description</h4>
458
+
459
+ <p>If this RVG object is nested within another RVG object,
460
+ returns the x-offset in user coordinates from the upper-left
461
+ corner of the enclosing RVG object.</p>
462
+
463
+ <h4>See also</h4>
464
+
465
+ <p><a href="#RVG_y">y</a></p>
466
+ </div>
467
+
468
+ <div class="sig">
469
+ <h3 id='RVG_y'>y</h3>
470
+
471
+ <p><span class="arg">rvg</span>.y -&gt; <span class=
472
+ "arg">y-offset</span></p>
473
+ </div>
474
+
475
+ <div class="desc">
476
+ <h4>Description</h4>
477
+
478
+ <p>If this RVG object is nested within another RVG object,
479
+ returns the y-offset in user coordinates from the upper-left
480
+ corner of the enclosing RVG object.</p>
481
+
482
+ <h4>See also</h4>
483
+
484
+ <p><a href="#RVG_x">x</a></p>
485
+ </div>
486
+
487
+ <h2 class="methods">instance methods</h2>
488
+
489
+ <div class="sig">
490
+ <h3 id='RVG_draw'>draw</h3>
491
+
492
+ <p><span class="arg">rvg</span>.draw -&gt; anImage</p>
493
+ </div>
494
+
495
+ <div class="desc">
496
+ <h4>Description</h4>
497
+
498
+ <p>Causes all the drawing objects that have been added to the
499
+ canvas to be rendered.</p>
500
+
501
+ <p>Regardless of the order in which methods were called,
502
+ <code>draw</code> executes the methods in this order:</p>
503
+
504
+ <ol>
505
+ <li>transforms, in the order they were called.</li>
506
+
507
+ <li><code>viewbox</code> and
508
+ <code>preserve_aspect_ratio</code></li>
509
+
510
+ <li>styles</li>
511
+
512
+ <li>nested groups, RVG objects, shapes, text, and images, in
513
+ the order they were added to the containing object</li>
514
+ </ol>
515
+
516
+ <p>Nested groups and RVG objects also follow this sequence.</p>
517
+
518
+ <h4>Returns</h4>
519
+
520
+ <p>An image</p>
521
+
522
+ <h4>Example</h4>
523
+ <pre>
524
+ img = rvg.draw
525
+ img.write('myDrawing.jpg')
526
+ </pre>
527
+ </div>
528
+
529
+ <div class="sig">
530
+ <h3 id='RVG_g'>g</h3>
531
+
532
+ <p><span class="arg">rvg.</span>g [{|<span class=
533
+ "arg">grp</span>| ...}] -&gt; <span class=
534
+ "arg">aGroup</span></p>
535
+ </div>
536
+
537
+ <div class="desc">
538
+ <h4>Description</h4>
539
+
540
+ <p>Calls <a href="rvggroup.html#new">RVG::Group.new</a> to
541
+ construct a group and adds it to the enclosing RVG object.
542
+ Yields to a block if one is present, passing the new group as
543
+ an argument.</p>
544
+
545
+ <h4>Returns</h4>
546
+
547
+ <p>Returns the new group, so <code>RVG::Group</code> methods
548
+ can be chained to this method.</p>
549
+ </div>
550
+
551
+ <div class="sig">
552
+ <h3 id='RVG_image'>image</h3>
553
+
554
+ <p><span class="arg">rvg.</span>image(<span class=
555
+ "arg">raster_image</span>, <span class="arg">width</span>=nil,
556
+ <span class="arg">height</span>=nil, <span class=
557
+ "arg">x</span>=0, <span class="arg">y</span>=0) -&gt;
558
+ <span class="arg">anImage</span></p>
559
+ </div>
560
+
561
+ <div class="desc">
562
+ <h4>Description</h4>
563
+
564
+ <p>Calls <a href="rvgimage.html#new">RVG::Image.new</a> to
565
+ construct an image and adds it to the enclosing RVG object.</p>
566
+
567
+ <h4>Returns</h4>
568
+
569
+ <p>Returns the new image, so <code>RVG::Image</code> methods
570
+ can be chained to this method.</p>
571
+
572
+ <h4>Notes</h4>
573
+
574
+ <p>An <code>RVG::Image</code> object is <em>not</em> the same
575
+ as a <a href="image1.html">Magick::Image</a> object!</p>
576
+ </div>
577
+
578
+ <div class="sig">
579
+ <h3 id='RVG_preserve_aspect_ratio'>preserve_aspect_ratio</h3>
580
+
581
+ <p><span class=
582
+ "arg">rvg</span>.preserve_aspect_ratio(<span class=
583
+ "arg">align</span>, <span class=
584
+ "arg">meet_or_slice</span>='meet') [{|<span class=
585
+ "arg">self</span>| ...}] -&gt; <span class=
586
+ "arg">self</span></p>
587
+ </div>
588
+
589
+ <div class="desc">
590
+ <h4>Description</h4>
591
+
592
+ <p>If you use the <a href="#RVG_viewbox">viewbox</a> method and
593
+ the user coordinate system does not scale uniformly to the
594
+ default coordinate system (for example, the width and height of
595
+ the RVG object is 4x3 and the user coordinate system is 16x9),
596
+ use the <code>preserve_aspect_ratio</code> method to specify
597
+ whether or not the content is stretched to fit. If not, you can
598
+ specify how to fit the content into the space.</p>
599
+
600
+ <p><code>Preserve_aspect_ratio</code> yields to a block if one
601
+ is present, passing <span class="arg">self</span> as an
602
+ argument.</p>
603
+
604
+ <h4>Arguments</h4>
605
+
606
+ <dl>
607
+ <dt>align</dt>
608
+
609
+ <dd>
610
+ When the value of the <code>meet_or_slice</code> argument
611
+ is 'meet' or 'slice', this argument controls the placement
612
+ of the content within the viewport. The <code>align</code>
613
+ argument is the concatenation of an <em>x</em>-aligment and
614
+ a <em>y</em>-alignment. The values are shown in these
615
+ lists:
616
+
617
+ <h6><em>x</em>-alignment</h6>
618
+
619
+ <dl>
620
+ <dt>xMin</dt>
621
+
622
+ <dd>align the minimum <em>x</em> value of the content
623
+ with the left corner of the viewport.</dd>
624
+
625
+ <dt>xMid</dt>
626
+
627
+ <dd>vertically center the content within the
628
+ viewport.</dd>
629
+
630
+ <dt>xMax</dt>
631
+
632
+ <dd>align the maximum <em>x</em> value of the content
633
+ with the right corner of the viewport.</dd>
634
+ </dl>
635
+
636
+ <h6><em>y</em>-alignment</h6>
637
+
638
+ <dl>
639
+ <dt>YMin</dt>
640
+
641
+ <dd>align the minimum <em>y</em> value of the content
642
+ with the top of the viewport.</dd>
643
+
644
+ <dt>YMid</dt>
645
+
646
+ <dd>horizontally center the content within the
647
+ viewport.</dd>
648
+
649
+ <dt>YMax</dt>
650
+
651
+ <dd>align the maximum <em>y</em> value of the content
652
+ with the bottom of the viewport</dd>
653
+ </dl>
654
+ </dd>
655
+
656
+ <dt>meet_or_slice</dt>
657
+
658
+ <dd>
659
+ This argument can have one of these three values:
660
+
661
+ <dl>
662
+ <dt>'none'</dt>
663
+
664
+ <dd>The content is scaled as necessary so that it fits
665
+ exactly within the viewport. The aspect ratio is
666
+ <em>not</em> maintained.</dd>
667
+
668
+ <dt>'meet'</dt>
669
+
670
+ <dd>The content is scaled as necessary so that the larger
671
+ dimension exactly fits the viewport. There may be some
672
+ unused space in the viewport. The aspect ratio is
673
+ maintained.</dd>
674
+
675
+ <dt>'slice'</dt>
676
+
677
+ <dd>The content is scaled as necessary so that the
678
+ smaller dimension exactly fits the viewport. Some of the
679
+ content in the larger dimension may be cut off. The
680
+ aspect ratio is maintained.</dd>
681
+ </dl>
682
+ </dd>
683
+ </dl>
684
+
685
+ <h4>Example</h4>
686
+
687
+ <p><a href=
688
+ "javascript:popup('PreserveAspectRatio.rb.html')"><img src=
689
+ "ex/PreserveAspectRatio.gif" title=
690
+ "Click to see the example script" alt=
691
+ "preserve_aspect_ratio example" /></a></p>
692
+
693
+ <h4>Returns</h4>
694
+
695
+ <p><span class="arg">Self</span>, so other <code>RVG</code>
696
+ methods can be chained to this method.</p>
697
+
698
+ <h4>See Also</h4>
699
+
700
+ <p><a href="#RVG_viewbox">viewbox</a></p>
701
+ </div>
702
+
703
+ <div class="sig">
704
+ <h3 id="RVG_rvg">rvg</h3>
705
+
706
+ <p><span class="arg">rvg</span>.rvg(<span class=
707
+ "arg">width</span>, <span class="arg">height</span>,
708
+ <span class="arg">x</span>=0, <span class="arg">y</span>=0)
709
+ [{|<span class="arg">new_rvg</span>| ...}] -&gt; <span class=
710
+ "arg">anRVG</span></p>
711
+ </div>
712
+
713
+ <div class="desc">
714
+ <h4>Description</h4>
715
+
716
+ <p>This method constructs a new RVG object and adds it to the
717
+ enclosing RVG object. Each nested RVG object can use the
718
+ <a href="#RVG_viewbox">viewbox</a> method to define its own
719
+ coordinate system. The <code>rvg</code> method yields to a
720
+ block, passing the nested RVG object as an argument. Within the
721
+ block, any drawing objects added to the nested RVG object are
722
+ rendered within the nested RVG object's viewport.</p>
723
+
724
+ <h4>Arguments</h4>
725
+
726
+ <dl>
727
+ <dt>width, height</dt>
728
+
729
+ <dd>Specifies the viewport width and height. The units are in
730
+ the user coordinate system of the parent container.</dd>
731
+
732
+ <dt>x, y</dt>
733
+
734
+ <dd>The x- and y-axis offsets of the viewport upper-left
735
+ corner. The units are in the user coordinate system of the
736
+ parent container.</dd>
737
+ </dl>
738
+
739
+ <h4>Example</h4>
740
+
741
+ <p>See the example for <a href=
742
+ "#RVG_preserve_aspect_ratio">preserve_aspect_ratio</a>.</p>
743
+
744
+ <h4>Returns</h4>
745
+
746
+ <p>The <code>RVG</code> object, so other <code>RVG</code>
747
+ methods can be chained to this method.</p>
748
+ </div>
749
+
750
+ <div class="sig">
751
+ <h3 id='RVG_text'>text</h3>
752
+
753
+ <p><span class="arg">rvg.</span>text(<span class=
754
+ "arg">x</span>=0, <span class="arg">y</span>=0, <span class=
755
+ "arg">text</span>=nil) [{|<span class="arg">aText</span>| ...}]
756
+ -&gt; <span class="arg">aText</span></p>
757
+ </div>
758
+
759
+ <div class="desc">
760
+ <h4>Description</h4>
761
+
762
+ <p>Calls <a href="rvgtext.html#new">RVG::Text.new</a> to
763
+ construct a text object and adds it to the enclosing RVG
764
+ object. Yields to a block if one is present, passing the new
765
+ text object as an argument.</p>
766
+
767
+ <h4>Returns</h4>
768
+
769
+ <p>The <code>RVG::Text</code> object, so other
770
+ <code>RVG::Text</code> methods can be chained to this
771
+ method.</p>
772
+ </div>
773
+
774
+ <div class="sig">
775
+ <h3 id="RVG_use">use</h3>
776
+
777
+ <p><span class="arg">rvg</span>.use(<span class=
778
+ "arg">obj</span>, <span class="arg">x</span>=0, <span class=
779
+ "arg">y</span>=0, <span class="arg">width</span>=nil,
780
+ <span class="arg">height</span>=nil) -&gt; <span class=
781
+ "arg">aUse</span></p>
782
+ </div>
783
+
784
+ <div class="desc">
785
+ <h4>Description</h4>
786
+
787
+ <p>Calls <a href="rvguse.html#new">RVG::Use.new</a> to
788
+ constructs a <code>use</code> object and adds it to the RVG
789
+ object.</p>
790
+
791
+ <p>When the referenced argument is another RVG object,
792
+ <span class="arg">width</span> and <span class=
793
+ "arg">height</span> can be used to specify the width and height
794
+ of the viewport. If present and non-nil, these arguments
795
+ override any width and height specified when the RVG object was
796
+ created. You must specify the viewport size either when
797
+ creating the RVG object or when referencing it with
798
+ <code>use</code>.</p>
799
+
800
+ <h4>Examples</h4>
801
+
802
+ <p>See <a href="rvguse.html#new">RVG::Use.new</a></p>
803
+
804
+ <h4>Returns</h4>
805
+
806
+ <p>The <code>RVG::Use</code> object, so other
807
+ <code>RVG::Use</code> methods can be chained to this
808
+ method.</p>
809
+ </div>
810
+
811
+ <div class="sig">
812
+ <h3 id="RVG_viewbox">viewbox</h3>
813
+
814
+ <p><span class="arg">rvg</span>.viewbox(<span class=
815
+ "arg">min_x</span>, <span class="arg">min_y</span>,
816
+ <span class="arg">width</span>, <span class=
817
+ "arg">height</span>) [{|<span class="arg">self</span>| ...}]
818
+ -&gt; <span class="arg">rvg</span></p>
819
+ </div>
820
+
821
+ <div class="desc">
822
+ <h4>Description</h4>
823
+
824
+ <p>The area of the RVG object is called the <em>viewport</em>.
825
+ By default the origin of the coordinate system for an RVG
826
+ object is (0,0). The user coordinates are pixels and the width
827
+ and height are established by the <span class=
828
+ "arg">width</span> and <span class="arg">height</span>
829
+ arguments to <code>RVG.new</code>.</p>
830
+
831
+ <p>Use the <code>viewbox</code> method to superimpose a user
832
+ coordinate system on the viewport. The <code>viewbox</code>
833
+ method lets you set up a coordinate system using the units of
834
+ your choice.</p>
835
+
836
+ <p>The <code>viewbox</code> method yields to a block if one is
837
+ present, passing <code>self</code> as an argument.</p>
838
+
839
+ <h4>Arguments</h4>
840
+
841
+ <dl>
842
+ <dt>min_x, min_y</dt>
843
+
844
+ <dd>The minimum <em>x</em>-coordinate and
845
+ <em>y</em>-coordinate of the user coordinate system.</dd>
846
+
847
+ <dt>width, height</dt>
848
+
849
+ <dd>The width and height of the user coordinate system.</dd>
850
+ </dl>
851
+
852
+ <h4>Example</h4>
853
+
854
+ <p>In the following examples, because the <code>viewbox</code>
855
+ method specifies the dimensions of the coordinate system, the
856
+ dimensions specified for the graphic objects can remain the
857
+ same while the size of the canvas changes.</p>
858
+
859
+ <p><strong>Rendered into a 300x200 viewport</strong><a href=
860
+ "javascript:popup('ViewBox.rb.html')"><img src=
861
+ "ex/ViewBox_300x200.gif" title=
862
+ "Click to see the example script" alt=
863
+ "viewbox 300x200 example" /></a></p>
864
+
865
+ <p><strong>Rendered into a 150x200 viewport</strong><a href=
866
+ "javascript:popup('ViewBox.rb.html')"><img src=
867
+ "ex/ViewBox_150x200.gif" title=
868
+ "Click to see the example script" alt=
869
+ "viewbox 150x200 example" /></a></p>
870
+
871
+ <h4>Returns</h4>
872
+
873
+ <p><span class="arg">Self</span>, so other <code>RVG</code>
874
+ methods may be chained to <code>viewbox</code>.</p>
875
+
876
+ <h4>See Also</h4>
877
+
878
+ <p><a href=
879
+ "#RVG_preserve_aspect_ratio">preserve_aspect_ratio</a></p>
880
+ </div>
881
+
882
+ <p class="spacer">&nbsp;</p>
883
+
884
+ <div class="nav">
885
+ &laquo; <a href="rvgtut.html">Prev</a> | <a href=
886
+ "index.html">Contents</a> | <a href="rvggroup.html">Next</a>
887
+ &raquo;
888
+ </div>
889
+ </body>
890
+ </html>