rmagick 1.7.1
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 +232 -0
- data/Makefile.in +28 -0
- data/README.html +404 -0
- data/README.txt +397 -0
- data/configure +8554 -0
- data/configure.ac +497 -0
- data/doc/comtasks.html +241 -0
- data/doc/constants.html +1195 -0
- data/doc/css/doc.css +299 -0
- data/doc/css/popup.css +34 -0
- data/doc/draw.html +3108 -0
- data/doc/ex/Adispatch.rb +43 -0
- data/doc/ex/Zconstitute.rb +9 -0
- data/doc/ex/adaptive_threshold.rb +19 -0
- data/doc/ex/add_noise.rb +18 -0
- data/doc/ex/affine.rb +48 -0
- data/doc/ex/affine_transform.rb +20 -0
- data/doc/ex/arc.rb +47 -0
- data/doc/ex/arcpath.rb +33 -0
- data/doc/ex/average.rb +15 -0
- data/doc/ex/axes.rb +64 -0
- data/doc/ex/bilevel_channel.rb +20 -0
- data/doc/ex/blur_image.rb +12 -0
- data/doc/ex/border.rb +10 -0
- data/doc/ex/bounding_box.rb +48 -0
- data/doc/ex/cbezier1.rb +40 -0
- data/doc/ex/cbezier2.rb +40 -0
- data/doc/ex/cbezier3.rb +40 -0
- data/doc/ex/cbezier4.rb +41 -0
- data/doc/ex/cbezier5.rb +41 -0
- data/doc/ex/cbezier6.rb +51 -0
- data/doc/ex/channel.rb +26 -0
- data/doc/ex/channel_threshold.rb +48 -0
- data/doc/ex/charcoal.rb +12 -0
- data/doc/ex/chop.rb +29 -0
- data/doc/ex/circle.rb +31 -0
- data/doc/ex/clip_path.rb +56 -0
- data/doc/ex/coalesce.rb +60 -0
- data/doc/ex/color_fill_to_border.rb +29 -0
- data/doc/ex/color_floodfill.rb +28 -0
- data/doc/ex/color_histogram.rb +60 -0
- data/doc/ex/color_reset.rb +11 -0
- data/doc/ex/colorize.rb +16 -0
- data/doc/ex/colors.rb +65 -0
- data/doc/ex/composite.rb +135 -0
- data/doc/ex/contrast.rb +37 -0
- data/doc/ex/crop.rb +31 -0
- data/doc/ex/crop_with_gravity.rb +46 -0
- data/doc/ex/cycle_colormap.rb +21 -0
- data/doc/ex/demo.rb +324 -0
- data/doc/ex/drawcomp.rb +42 -0
- data/doc/ex/drop_shadow.rb +60 -0
- data/doc/ex/edge.rb +11 -0
- data/doc/ex/ellipse.rb +43 -0
- data/doc/ex/emboss.rb +11 -0
- data/doc/ex/enhance.rb +28 -0
- data/doc/ex/equalize.rb +11 -0
- data/doc/ex/flatten_images.rb +38 -0
- data/doc/ex/flip.rb +11 -0
- data/doc/ex/flop.rb +11 -0
- data/doc/ex/fonts.rb +20 -0
- data/doc/ex/frame.rb +12 -0
- data/doc/ex/gaussian_blur.rb +11 -0
- data/doc/ex/get_multiline_type_metrics.rb +53 -0
- data/doc/ex/get_pixels.rb +48 -0
- data/doc/ex/get_type_metrics.rb +140 -0
- data/doc/ex/gradientfill.rb +27 -0
- data/doc/ex/grav.rb +44 -0
- data/doc/ex/gravity.rb +80 -0
- data/doc/ex/hatchfill.rb +27 -0
- data/doc/ex/images/Ballerina.jpg +0 -0
- data/doc/ex/images/Ballerina3.jpg +0 -0
- data/doc/ex/images/Button_0.gif +0 -0
- data/doc/ex/images/Button_1.gif +0 -0
- data/doc/ex/images/Button_2.gif +0 -0
- data/doc/ex/images/Button_3.gif +0 -0
- data/doc/ex/images/Button_4.gif +0 -0
- data/doc/ex/images/Button_5.gif +0 -0
- data/doc/ex/images/Button_6.gif +0 -0
- data/doc/ex/images/Button_7.gif +0 -0
- data/doc/ex/images/Button_8.gif +0 -0
- data/doc/ex/images/Button_9.gif +0 -0
- data/doc/ex/images/Button_A.gif +0 -0
- data/doc/ex/images/Button_B.gif +0 -0
- data/doc/ex/images/Button_C.gif +0 -0
- data/doc/ex/images/Button_D.gif +0 -0
- data/doc/ex/images/Button_E.gif +0 -0
- data/doc/ex/images/Button_F.gif +0 -0
- data/doc/ex/images/Button_G.gif +0 -0
- data/doc/ex/images/Button_H.gif +0 -0
- data/doc/ex/images/Button_I.gif +0 -0
- data/doc/ex/images/Button_J.gif +0 -0
- data/doc/ex/images/Button_K.gif +0 -0
- data/doc/ex/images/Button_L.gif +0 -0
- data/doc/ex/images/Button_M.gif +0 -0
- data/doc/ex/images/Button_N.gif +0 -0
- data/doc/ex/images/Button_O.gif +0 -0
- data/doc/ex/images/Button_P.gif +0 -0
- data/doc/ex/images/Button_Q.gif +0 -0
- data/doc/ex/images/Button_R.gif +0 -0
- data/doc/ex/images/Button_S.gif +0 -0
- data/doc/ex/images/Button_T.gif +0 -0
- data/doc/ex/images/Button_U.gif +0 -0
- data/doc/ex/images/Button_V.gif +0 -0
- data/doc/ex/images/Button_W.gif +0 -0
- data/doc/ex/images/Button_X.gif +0 -0
- data/doc/ex/images/Button_Y.gif +0 -0
- data/doc/ex/images/Button_Z.gif +0 -0
- data/doc/ex/images/Cheetah.jpg +0 -0
- data/doc/ex/images/Coffee.wmf +0 -0
- data/doc/ex/images/Flower_Hat.jpg +0 -0
- data/doc/ex/images/Gold_Statue.jpg +0 -0
- data/doc/ex/images/Hot_Air_Balloons.jpg +0 -0
- data/doc/ex/images/Hot_Air_Balloons_H.jpg +0 -0
- data/doc/ex/images/No.wmf +0 -0
- data/doc/ex/images/Polynesia.jpg +0 -0
- data/doc/ex/images/Red_Rocks.jpg +0 -0
- data/doc/ex/images/Shorts.jpg +0 -0
- data/doc/ex/images/Snake.wmf +0 -0
- data/doc/ex/images/Violin.jpg +0 -0
- data/doc/ex/images/graydient230x6.gif +0 -0
- data/doc/ex/images/logo400x83.gif +0 -0
- data/doc/ex/images/model.miff +0 -0
- data/doc/ex/images/notimplemented.gif +0 -0
- data/doc/ex/images/smile.miff +0 -0
- data/doc/ex/images/spin.gif +0 -0
- data/doc/ex/implode.rb +32 -0
- data/doc/ex/level.rb +12 -0
- data/doc/ex/level_channel.rb +33 -0
- data/doc/ex/line.rb +40 -0
- data/doc/ex/map.rb +28 -0
- data/doc/ex/map_f.rb +15 -0
- data/doc/ex/matte_fill_to_border.rb +42 -0
- data/doc/ex/matte_floodfill.rb +35 -0
- data/doc/ex/matte_replace.rb +42 -0
- data/doc/ex/median_filter.rb +28 -0
- data/doc/ex/modulate.rb +11 -0
- data/doc/ex/mono.rb +23 -0
- data/doc/ex/morph.rb +26 -0
- data/doc/ex/mosaic.rb +35 -0
- data/doc/ex/motion_blur.rb +11 -0
- data/doc/ex/negate.rb +11 -0
- data/doc/ex/negate_channel.rb +19 -0
- data/doc/ex/normalize.rb +11 -0
- data/doc/ex/oil_paint.rb +11 -0
- data/doc/ex/opacity.rb +38 -0
- data/doc/ex/opaque.rb +14 -0
- data/doc/ex/ordered_dither.rb +11 -0
- data/doc/ex/path.rb +62 -0
- data/doc/ex/pattern1.rb +25 -0
- data/doc/ex/pattern2.rb +26 -0
- data/doc/ex/polygon.rb +24 -0
- data/doc/ex/polyline.rb +23 -0
- data/doc/ex/posterize.rb +19 -0
- data/doc/ex/preview.rb +16 -0
- data/doc/ex/qbezierpath.rb +49 -0
- data/doc/ex/quantize-m.rb +25 -0
- data/doc/ex/radial_blur.rb +19 -0
- data/doc/ex/raise.rb +11 -0
- data/doc/ex/random_channel_threshold.rb +17 -0
- data/doc/ex/random_threshold_channel.rb +18 -0
- data/doc/ex/rectangle.rb +33 -0
- data/doc/ex/reduce_noise.rb +28 -0
- data/doc/ex/roll.rb +9 -0
- data/doc/ex/rotate.rb +43 -0
- data/doc/ex/rotate_f.rb +14 -0
- data/doc/ex/roundrect.rb +32 -0
- data/doc/ex/rubyname.rb +31 -0
- data/doc/ex/segment.rb +11 -0
- data/doc/ex/shade.rb +11 -0
- data/doc/ex/shave.rb +15 -0
- data/doc/ex/shear.rb +10 -0
- data/doc/ex/skewx.rb +50 -0
- data/doc/ex/skewy.rb +45 -0
- data/doc/ex/smile.rb +124 -0
- data/doc/ex/solarize.rb +11 -0
- data/doc/ex/splice.rb +16 -0
- data/doc/ex/spread.rb +11 -0
- data/doc/ex/stegano.rb +50 -0
- data/doc/ex/stroke_dasharray.rb +41 -0
- data/doc/ex/stroke_linecap.rb +44 -0
- data/doc/ex/stroke_linejoin.rb +48 -0
- data/doc/ex/stroke_width.rb +47 -0
- data/doc/ex/swirl.rb +17 -0
- data/doc/ex/text.rb +32 -0
- data/doc/ex/text_align.rb +36 -0
- data/doc/ex/text_antialias.rb +33 -0
- data/doc/ex/text_undercolor.rb +26 -0
- data/doc/ex/texture_fill_to_border.rb +34 -0
- data/doc/ex/texture_floodfill.rb +31 -0
- data/doc/ex/texturefill.rb +25 -0
- data/doc/ex/threshold.rb +13 -0
- data/doc/ex/to_blob.rb +14 -0
- data/doc/ex/translate.rb +37 -0
- data/doc/ex/transparent.rb +38 -0
- data/doc/ex/trim.rb +25 -0
- data/doc/ex/unsharp_mask.rb +28 -0
- data/doc/ex/viewex.rb +36 -0
- data/doc/ex/wave.rb +9 -0
- data/doc/ilist.html +1592 -0
- data/doc/image1.html +3009 -0
- data/doc/image2.html +2169 -0
- data/doc/image3.html +2815 -0
- data/doc/imageattrs.html +1319 -0
- data/doc/imusage.html +403 -0
- data/doc/index.html +418 -0
- data/doc/info.html +949 -0
- data/doc/magick.html +439 -0
- data/doc/scripts/doc.js +9 -0
- data/doc/struct.html +1334 -0
- data/doc/usage.html +1318 -0
- data/examples/describe.rb +44 -0
- data/examples/histogram.rb +289 -0
- data/examples/image_opacity.rb +29 -0
- data/examples/import_export.rb +31 -0
- data/examples/pattern_fill.rb +38 -0
- data/examples/rotating_text.rb +47 -0
- data/examples/thumbnail.rb +65 -0
- data/examples/vignette.rb +79 -0
- data/ext/RMagick/MANIFEST +239 -0
- data/ext/RMagick/extconf.rb.in +21 -0
- data/ext/RMagick/rmagick.h +938 -0
- data/ext/RMagick/rmagick_config.h.in +170 -0
- data/ext/RMagick/rmdraw.c +1308 -0
- data/ext/RMagick/rmfill.c +609 -0
- data/ext/RMagick/rmilist.c +685 -0
- data/ext/RMagick/rmimage.c +7980 -0
- data/ext/RMagick/rminfo.c +982 -0
- data/ext/RMagick/rmmain.c +1497 -0
- data/ext/RMagick/rmutil.c +2685 -0
- data/install.rb +1015 -0
- data/lib/RMagick.rb +1486 -0
- data/metaconfig.in +6 -0
- data/post-clean.rb +12 -0
- data/post-install.rb +36 -0
- data/post-setup.rb +245 -0
- data/rmagick.gemspec +22 -0
- data/uninstall.rb +71 -0
- metadata +286 -0
data/doc/magick.html
ADDED
@@ -0,0 +1,439 @@
|
|
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 July 2003), see www.w3.org" />
|
8
|
+
|
9
|
+
<title>RMagick: module Magick</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="Copyright (C) 2004 by Timothy P. Hunter" />
|
14
|
+
<link rel="stylesheet" type="text/css" href="css/doc.css" />
|
15
|
+
<script type="text/javascript" src="scripts/doc.js">
|
16
|
+
</script>
|
17
|
+
<style type="text/css">
|
18
|
+
/*<![CDATA[*/
|
19
|
+
|
20
|
+
/* Styles local to this page. */
|
21
|
+
/*]]>*/
|
22
|
+
</style>
|
23
|
+
</head>
|
24
|
+
|
25
|
+
<body>
|
26
|
+
<h6 id="header">RMagick User's Guide and Reference</h6>
|
27
|
+
|
28
|
+
<div class="nav">
|
29
|
+
« <a href="comtasks.html">Prev</a> | <a href=
|
30
|
+
"index.html">Contents</a> | <a href=
|
31
|
+
"ilist.html">Next</a> »
|
32
|
+
</div>
|
33
|
+
|
34
|
+
<h1>module Magick</h1>
|
35
|
+
|
36
|
+
<div id="toc">
|
37
|
+
<h2>Table of Contents</h2>
|
38
|
+
|
39
|
+
<h3>module methods</h3>
|
40
|
+
|
41
|
+
<ul>
|
42
|
+
<li><a href="#colors">colors</a></li>
|
43
|
+
|
44
|
+
<li><a href="#fonts">fonts</a></li>
|
45
|
+
|
46
|
+
<li><a href="#formats">formats</a></li>
|
47
|
+
|
48
|
+
<li><a href=
|
49
|
+
"#set_cache_threshold">set_cache_threshold</a></li>
|
50
|
+
|
51
|
+
<li><a href="#set_monitor">set_monitor</a></li>
|
52
|
+
</ul>
|
53
|
+
</div>
|
54
|
+
|
55
|
+
<h2 class="methods">module methods</h2>
|
56
|
+
|
57
|
+
<div class="sig">
|
58
|
+
<h3 id="colors">colors</h3>
|
59
|
+
|
60
|
+
<p>Magick.colors <span class="arg">{ |color| block }</span>
|
61
|
+
-> <em>Magick</em><br />
|
62
|
+
Magick.colors -> <em>anArray</em></p>
|
63
|
+
</div>
|
64
|
+
|
65
|
+
<div class="desc">
|
66
|
+
<h4>Description</h4>
|
67
|
+
|
68
|
+
<p>Lists the <a href="imusage.html#color_names">named
|
69
|
+
colors</a>. If the optional block is present, calls the block
|
70
|
+
once for each color, passing a Magick::Color object. Otherwise,
|
71
|
+
returns an array of Magick::Color objects, one for each
|
72
|
+
color.</p>
|
73
|
+
|
74
|
+
<p>The Magick::Color class is a Struct class with the following
|
75
|
+
attributes:</p>
|
76
|
+
|
77
|
+
<table class="simple_table" summary="magic color attributes">
|
78
|
+
<caption>
|
79
|
+
Magick::Color attributes
|
80
|
+
</caption>
|
81
|
+
|
82
|
+
<tr>
|
83
|
+
<th>Attribute</th>
|
84
|
+
|
85
|
+
<th>Value</th>
|
86
|
+
</tr>
|
87
|
+
|
88
|
+
<tr>
|
89
|
+
<td>name</td>
|
90
|
+
|
91
|
+
<td>The color name. For example, "red".</td>
|
92
|
+
</tr>
|
93
|
+
|
94
|
+
<tr>
|
95
|
+
<td>compliance</td>
|
96
|
+
|
97
|
+
<td>A <a href=
|
98
|
+
"constants.html#ComplianceType">ComplianceType</a> value
|
99
|
+
such as X11Compliance.</td>
|
100
|
+
</tr>
|
101
|
+
|
102
|
+
<tr>
|
103
|
+
<td>color</td>
|
104
|
+
|
105
|
+
<td>A <a href="struct.html#Pixel">Pixel</a> object
|
106
|
+
containing the RGB values.</td>
|
107
|
+
</tr>
|
108
|
+
</table>
|
109
|
+
|
110
|
+
<h4>Returns</h4>
|
111
|
+
|
112
|
+
<p>If no block is associated with the call, returns an array of
|
113
|
+
Magick::Color objects.</p>
|
114
|
+
|
115
|
+
<h4>Example</h4>
|
116
|
+
|
117
|
+
<p>This is a small sample of <code>colors.miff</code>, the
|
118
|
+
complete image created by the example program.</p>
|
119
|
+
|
120
|
+
<p><a href="javascript:popup('colors.rb.html')"><img src=
|
121
|
+
"ex/colors.gif" title="Click to see the example script" alt=
|
122
|
+
"Magick::colors example" /></a></p>
|
123
|
+
|
124
|
+
<h4>Magick API</h4>
|
125
|
+
|
126
|
+
<p>GetColorInfo</p>
|
127
|
+
</div>
|
128
|
+
|
129
|
+
<div class="sig">
|
130
|
+
<h3 id="fonts">fonts</h3>
|
131
|
+
|
132
|
+
<p>Magick.fonts <span class="arg">{ |font| block }</span> ->
|
133
|
+
<em>Magick</em><br />
|
134
|
+
Magick.fonts -> <em>anArray</em></p>
|
135
|
+
</div>
|
136
|
+
|
137
|
+
<div class="desc">
|
138
|
+
<h4>Description</h4>
|
139
|
+
|
140
|
+
<p>Lists the fonts that ×Magick knows about. If the
|
141
|
+
optional block is present, calls the block once for each font,
|
142
|
+
passing a Magick::Font object. Otherwise, returns an array of
|
143
|
+
Magick::Font objects, one for each font.</p>
|
144
|
+
|
145
|
+
<p>The Magick::Font class is a Struct class with the following
|
146
|
+
attributes:</p>
|
147
|
+
|
148
|
+
<table summary="font class attributes" class="simple_table">
|
149
|
+
<caption>
|
150
|
+
Magick::Font attributes
|
151
|
+
</caption>
|
152
|
+
|
153
|
+
<tr>
|
154
|
+
<th>Attribute</th>
|
155
|
+
|
156
|
+
<th>Value</th>
|
157
|
+
</tr>
|
158
|
+
|
159
|
+
<tr>
|
160
|
+
<td>name</td>
|
161
|
+
|
162
|
+
<td>The font name. For example, "Palatino-Roman".</td>
|
163
|
+
</tr>
|
164
|
+
|
165
|
+
<tr>
|
166
|
+
<td>description</td>
|
167
|
+
|
168
|
+
<td>The font description. For example, "Palatino
|
169
|
+
Roman".</td>
|
170
|
+
</tr>
|
171
|
+
|
172
|
+
<tr>
|
173
|
+
<td>family</td>
|
174
|
+
|
175
|
+
<td>The font family. For example, "Palatino", "Helvetica",
|
176
|
+
or "Courier".</td>
|
177
|
+
</tr>
|
178
|
+
|
179
|
+
<tr>
|
180
|
+
<td>style</td>
|
181
|
+
|
182
|
+
<td>A <a href="constants.html#StyleType">StyleType</a>
|
183
|
+
value such as <code>NormalStyle</code>.</td>
|
184
|
+
</tr>
|
185
|
+
|
186
|
+
<tr>
|
187
|
+
<td>stretch</td>
|
188
|
+
|
189
|
+
<td>A <a href="constants.html#StretchType">StretchType</a>
|
190
|
+
value such as <code>NormalStretch</code>.</td>
|
191
|
+
</tr>
|
192
|
+
|
193
|
+
<tr>
|
194
|
+
<td>weight</td>
|
195
|
+
|
196
|
+
<td>The font weight, one of 100, 200, 300, 400, 500, 600,
|
197
|
+
700, 800, or 900.</td>
|
198
|
+
</tr>
|
199
|
+
|
200
|
+
<tr>
|
201
|
+
<td>encoding</td>
|
202
|
+
|
203
|
+
<td>The font encoding, such as "AppleRoman". May be
|
204
|
+
<code>nil</code>.</td>
|
205
|
+
</tr>
|
206
|
+
|
207
|
+
<tr>
|
208
|
+
<td>foundry</td>
|
209
|
+
|
210
|
+
<td>The font foundry. "URW", for example. May be
|
211
|
+
<code>nil</code>.</td>
|
212
|
+
</tr>
|
213
|
+
|
214
|
+
<tr>
|
215
|
+
<td>format</td>
|
216
|
+
|
217
|
+
<td>If the font is a Type1 font, has the value "type1",
|
218
|
+
otherwise <code>nil</code>.</td>
|
219
|
+
</tr>
|
220
|
+
</table>
|
221
|
+
|
222
|
+
<h4>Returns</h4>
|
223
|
+
|
224
|
+
<p>If no block is associated with the call, returns an array of
|
225
|
+
Magick::Font objects.</p>
|
226
|
+
|
227
|
+
<h4>Example</h4>
|
228
|
+
|
229
|
+
<p><a href="javscript:popup('fonts.rb.html')" title=
|
230
|
+
"The example script">fonts.rb</a></p>
|
231
|
+
|
232
|
+
<h4>Magick API</h4>
|
233
|
+
|
234
|
+
<p>GetFontInfo</p>
|
235
|
+
</div>
|
236
|
+
|
237
|
+
<div class="sig">
|
238
|
+
<h3 id="formats">formats</h3>
|
239
|
+
|
240
|
+
<p>Magick.formats <span class="arg">{ |f,v| block }</span>
|
241
|
+
-> <em>Magick</em><br />
|
242
|
+
Magick.formats -> <em>aHash</em></p>
|
243
|
+
</div>
|
244
|
+
|
245
|
+
<div class="desc">
|
246
|
+
<h4>Description</h4>
|
247
|
+
|
248
|
+
<p>Describes the image formats supported by ×Magick. If
|
249
|
+
the optional block is present, calls the block once for each
|
250
|
+
image format. The first argument, <em>f</em>, is the format
|
251
|
+
name. The second argument, <em>v</em>, is the properties string
|
252
|
+
described below.</p>
|
253
|
+
|
254
|
+
<h4>Returns</h4>A hash of image formats and their properties.
|
255
|
+
Each key in the returned hash is the name of a supported image
|
256
|
+
format. Each value is a string in the form "BRWA". The details
|
257
|
+
are in this table:
|
258
|
+
|
259
|
+
<table summary="format string symbols" class="simple_table">
|
260
|
+
<caption>
|
261
|
+
Format property codes
|
262
|
+
</caption>
|
263
|
+
|
264
|
+
<tr>
|
265
|
+
<th>Code</th>
|
266
|
+
|
267
|
+
<th>Definition</th>
|
268
|
+
</tr>
|
269
|
+
|
270
|
+
<tr>
|
271
|
+
<td>B</td>
|
272
|
+
|
273
|
+
<td>is "*" if the format has native blob support, and "-"
|
274
|
+
otherwise.</td>
|
275
|
+
</tr>
|
276
|
+
|
277
|
+
<tr>
|
278
|
+
<td>R</td>
|
279
|
+
|
280
|
+
<td>is "r" if ×Magick can read the format, and "-"
|
281
|
+
otherwise.</td>
|
282
|
+
</tr>
|
283
|
+
|
284
|
+
<tr>
|
285
|
+
<td>W</td>
|
286
|
+
|
287
|
+
<td>is "w" if ×Magick can write the format, and "-"
|
288
|
+
otherwise.</td>
|
289
|
+
</tr>
|
290
|
+
|
291
|
+
<tr>
|
292
|
+
<td>A</td>
|
293
|
+
|
294
|
+
<td>is "+" if the format supports multi-image files, and
|
295
|
+
"-" otherwise.</td>
|
296
|
+
</tr>
|
297
|
+
</table>
|
298
|
+
|
299
|
+
<h4>Example</h4>
|
300
|
+
<pre>
|
301
|
+
p Magick.formats »
|
302
|
+
{"TIF"=>"*rw+",
|
303
|
+
"H"=>"*rw-",
|
304
|
+
"MNG"=>"*rw+",
|
305
|
+
"NULL"=>"*rw-",
|
306
|
+
...
|
307
|
+
"G"=>"*rw+",
|
308
|
+
"GIF"=>"*rw+",
|
309
|
+
"PDB"=>"*rw+"}
|
310
|
+
</pre>
|
311
|
+
|
312
|
+
<h4>Magick API</h4>
|
313
|
+
|
314
|
+
<p>GetMagickInfo</p>
|
315
|
+
|
316
|
+
<h4>Note</h4>
|
317
|
+
|
318
|
+
<p>×Magick depends on external programs for some formats.
|
319
|
+
Depending on how ×Magick was installed on your system,
|
320
|
+
some formats may not be available. If you have questions, ask
|
321
|
+
your system administrator.</p>
|
322
|
+
</div>
|
323
|
+
|
324
|
+
<div class="sig">
|
325
|
+
<h3 id="set_cache_threshold">set_cache_threshold</h3>
|
326
|
+
|
327
|
+
<p>Magick.set_cache_threshold(<span class="arg">n</span>)</p>
|
328
|
+
</div>
|
329
|
+
|
330
|
+
<div class="desc">
|
331
|
+
<h4>Description</h4>
|
332
|
+
|
333
|
+
<p>Sets the amount of free memory allocated for the pixel
|
334
|
+
cache. <span class="imquote">Once this threshold is exceeded,
|
335
|
+
all subsequent pixels cache operations are to/from
|
336
|
+
disk.</span></p>
|
337
|
+
|
338
|
+
<h4>Arguments</h4>
|
339
|
+
|
340
|
+
<p>An integer number of megabytes.</p>
|
341
|
+
|
342
|
+
<h4>Example</h4>
|
343
|
+
<pre>
|
344
|
+
# set the cache threshold to 10Mb
|
345
|
+
Magick.set_cache_threshold(10)
|
346
|
+
</pre>
|
347
|
+
</div>
|
348
|
+
|
349
|
+
<div class="sig">
|
350
|
+
<h3 id="set_monitor">set_monitor</h3>
|
351
|
+
|
352
|
+
<p>Magick.set_monitor(<span class="arg">aProc</span>)</p>
|
353
|
+
</div>
|
354
|
+
|
355
|
+
<div class="desc">
|
356
|
+
<h4>Description</h4>
|
357
|
+
|
358
|
+
<p>Establish a monitor exit block. Some (see <a href=
|
359
|
+
"#monitor_notes">below</a>) RMagick methods will call the
|
360
|
+
monitor event block, passing parameters that describe how much
|
361
|
+
work there is to be done and how much of that work has already
|
362
|
+
been accomplished.</p>
|
363
|
+
|
364
|
+
<p>There can be at most one monitor block defined at a time. To
|
365
|
+
turn off monitoring, call
|
366
|
+
<code>Magick.set_monitor(nil)</code>.</p>
|
367
|
+
|
368
|
+
<h4>Arguments</h4>
|
369
|
+
|
370
|
+
<p>The argument is a <code>Proc</code> object. The Proc should
|
371
|
+
accept 3 arguments:</p>
|
372
|
+
|
373
|
+
<dl>
|
374
|
+
<dt>text</dt>
|
375
|
+
|
376
|
+
<dd>a String that describes the operation being
|
377
|
+
monitored.</dd>
|
378
|
+
|
379
|
+
<dt>quantum</dt>
|
380
|
+
|
381
|
+
<dd>a value between 0 and <code>span</code> that represents
|
382
|
+
the number of events that have been performed, images that
|
383
|
+
have been processed, etc.</dd>
|
384
|
+
|
385
|
+
<dt>span</dt>
|
386
|
+
|
387
|
+
<dd>The total number of events to be performed, images to be
|
388
|
+
processed, etc.</dd>
|
389
|
+
</dl>
|
390
|
+
|
391
|
+
<h4>Example</h4>
|
392
|
+
<pre>
|
393
|
+
monitor = Proc.new { |text, quantum, span|
|
394
|
+
printf("%s %3.0f%% complete\n", text, ((quantum/span.to_f)*100.0))
|
395
|
+
}
|
396
|
+
Magick.set_monitor(monitor)
|
397
|
+
</pre>
|
398
|
+
|
399
|
+
<h4>Magick API</h4>
|
400
|
+
|
401
|
+
<p>SetMonitorHandler</p>
|
402
|
+
|
403
|
+
<h4 id="monitor_notes">Note</h4>
|
404
|
+
|
405
|
+
<p>The list of methods which call the monitor block is
|
406
|
+
difficult to determine. The only sure way to find out is to
|
407
|
+
read the source code. In the Image class the list includes
|
408
|
+
<code>add_noise</code>, <code>blur_image</code>,
|
409
|
+
<code>channel</code>, <code>chop</code>, <code>colorize</code>,
|
410
|
+
<code>crop</code>, <code>colors</code>, <code>despeckle</code>,
|
411
|
+
<code>enhance</code>, <code>equalize</code>, <code>flip</code>,
|
412
|
+
<code>flop</code>, <code>frame</code>,
|
413
|
+
<code>gamma_correct</code>, <code>implode</code>,
|
414
|
+
<code>level</code>, <code>magnify</code>,
|
415
|
+
<code>median_filter</code>, <code>minify</code>,
|
416
|
+
<code>modulate</code>, <code>morph</code>, <code>negate</code>,
|
417
|
+
<code>normalize</code>, <code>oil_paint</code>,
|
418
|
+
<code>opaque</code>, <code>raise</code>,
|
419
|
+
<code>reduce_noise</code>, <code>resize</code>,
|
420
|
+
<code>roll</code>, <code>rotate</code>, <code>sample</code>,
|
421
|
+
<code>scale</code>, <code>segment</code>, <code>shade</code>,
|
422
|
+
<code>sharpen</code>, <code>shear</code>,
|
423
|
+
<code>solarize</code>, <code>spread</code>,
|
424
|
+
<code>stegano</code>, <code>stereo</code>, <code>swirl</code>,
|
425
|
+
<code>texture</code> <code>threshold</code>,
|
426
|
+
<code>transparent</code>, and <code>wave</code>. In the
|
427
|
+
ImageList class, the list includes <code>append</code>,
|
428
|
+
<code>average</code>, and <code>montage</code>.</p>
|
429
|
+
</div>
|
430
|
+
|
431
|
+
<p class="spacer"> </p>
|
432
|
+
|
433
|
+
<div class="nav">
|
434
|
+
« <a href="comtasks.html">Prev</a> | <a href=
|
435
|
+
"index.html">Contents</a> | <a href=
|
436
|
+
"ilist.html">Next</a> »
|
437
|
+
</div>
|
438
|
+
</body>
|
439
|
+
</html>
|
data/doc/scripts/doc.js
ADDED
data/doc/struct.html
ADDED
@@ -0,0 +1,1334 @@
|
|
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 July 2003), see www.w3.org" />
|
8
|
+
|
9
|
+
<title>RMagick: Miscellaneous classes</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) 2004 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
|
+
<style type="text/css">
|
19
|
+
/*<![CDATA[*/
|
20
|
+
|
21
|
+
/* Styles local to this page. */
|
22
|
+
.class h2 { /* Same as h2.methods but different background-color */
|
23
|
+
margin-top: 2em;
|
24
|
+
margin-bottom: .5em;
|
25
|
+
padding: .5em 5px .5em 5px;
|
26
|
+
background-color: #545454;
|
27
|
+
color: white;
|
28
|
+
clear: both;
|
29
|
+
}
|
30
|
+
.class h3 { /* Same as h2.methods */
|
31
|
+
margin-top: 0;
|
32
|
+
margin-bottom: 0;
|
33
|
+
padding: .5em 5px .5em 5px;
|
34
|
+
background-color: #663;
|
35
|
+
color: white;
|
36
|
+
}
|
37
|
+
|
38
|
+
.sig h4, .sig p {
|
39
|
+
background-color: #c0c0c0;
|
40
|
+
color: #000;
|
41
|
+
margin-top: 0;
|
42
|
+
}
|
43
|
+
|
44
|
+
.sig h4 { /* method name: total width 210px */
|
45
|
+
width: 205px;
|
46
|
+
float: left;
|
47
|
+
padding-left: 5px;
|
48
|
+
font-size: 110%;
|
49
|
+
}
|
50
|
+
|
51
|
+
.sig p {
|
52
|
+
padding-right: 5px;
|
53
|
+
padding-bottom: 1em;
|
54
|
+
}
|
55
|
+
|
56
|
+
.desc h5 {
|
57
|
+
position: relative;
|
58
|
+
left: -215px;
|
59
|
+
padding-left: 5px;
|
60
|
+
background-image: url(ex/images/graydient210x6.gif);
|
61
|
+
background-repeat: repeat-y;
|
62
|
+
color: black;
|
63
|
+
font-weight: normal;
|
64
|
+
font-size: small;
|
65
|
+
padding-bottom: 0;
|
66
|
+
margin-bottom: 0;
|
67
|
+
margin-top: 0;
|
68
|
+
}
|
69
|
+
|
70
|
+
.intro p {
|
71
|
+
padding-bottom: 1em;
|
72
|
+
margin-left: 215px;
|
73
|
+
}
|
74
|
+
|
75
|
+
.intro h3 {
|
76
|
+
padding-left: 5px;
|
77
|
+
background-color: white;
|
78
|
+
background-image: url(ex/images/graydient210x6.gif);
|
79
|
+
background-repeat: repeat-y;
|
80
|
+
color: black;
|
81
|
+
font-weight: normal;
|
82
|
+
font-size: small;
|
83
|
+
padding-bottom: 0;
|
84
|
+
margin: 0 0;
|
85
|
+
}
|
86
|
+
|
87
|
+
/*]]>*/
|
88
|
+
</style>
|
89
|
+
</head>
|
90
|
+
|
91
|
+
<body>
|
92
|
+
<h6 id="header">RMagick User's Guide and Reference</h6>
|
93
|
+
|
94
|
+
<div class="nav">
|
95
|
+
« <a href="draw.html">Prev</a> | <a href=
|
96
|
+
"index.html">Contents</a> | <a href=
|
97
|
+
"info.html">Next</a> »
|
98
|
+
</div>
|
99
|
+
|
100
|
+
<h1>Miscellaneous classes</h1>
|
101
|
+
|
102
|
+
<div id="toc">
|
103
|
+
<h2>Table of Contents</h2>
|
104
|
+
|
105
|
+
<h3><a href="#view">The Image::View class</a></h3>
|
106
|
+
|
107
|
+
<ul>
|
108
|
+
<li><a href="#view">Image::View</a></li>
|
109
|
+
</ul>
|
110
|
+
|
111
|
+
<h3><a href="#Geometry">The Geometry class</a></h3>
|
112
|
+
|
113
|
+
<ul>
|
114
|
+
<li><a href="#Geometry">Geometry</a></li>
|
115
|
+
</ul>
|
116
|
+
|
117
|
+
<h3><a href="#Pixel">The Pixel class</a></h3>
|
118
|
+
|
119
|
+
<ul>
|
120
|
+
<li><a href="#Pixel">Pixel</a></li>
|
121
|
+
</ul>
|
122
|
+
|
123
|
+
<h3><a href="#struct">Struct classes</a></h3>
|
124
|
+
|
125
|
+
<ul>
|
126
|
+
<li><a href="#AffineMatrix">AffineMatrix</a></li>
|
127
|
+
|
128
|
+
<li><a href="#Chromaticity">Chromaticity</a></li>
|
129
|
+
|
130
|
+
<li><a href="#Pixel">Pixel</a></li>
|
131
|
+
|
132
|
+
<li><a href="#Point">Point</a></li>
|
133
|
+
|
134
|
+
<li><a href="#Primary">Primary</a></li>
|
135
|
+
|
136
|
+
<li><a href="#Rectangle">Rectangle</a></li>
|
137
|
+
|
138
|
+
<li><a href="#Segment">Segment</a></li>
|
139
|
+
</ul>
|
140
|
+
|
141
|
+
<h3><a href="#fill">Fill classes</a></h3>
|
142
|
+
|
143
|
+
<ul>
|
144
|
+
<li><a href="#GradientFill">GradientFill</a></li>
|
145
|
+
|
146
|
+
<li><a href="#HatchFill">HatchFill</a></li>
|
147
|
+
|
148
|
+
<li><a href="#TextureFill">TextureFill</a></li>
|
149
|
+
</ul>
|
150
|
+
|
151
|
+
<h3><a href="#exception">Exception classes</a></h3>
|
152
|
+
|
153
|
+
<ul>
|
154
|
+
<li><a href="#MagickError">ImageMagickError</a></li>
|
155
|
+
</ul>
|
156
|
+
</div>
|
157
|
+
|
158
|
+
<div class="class">
|
159
|
+
<h2 id="view">The Image::View class</h2>
|
160
|
+
|
161
|
+
<div class="intro">
|
162
|
+
<h3>Introduction</h3>
|
163
|
+
|
164
|
+
<p>A view is a rectangle in an image. Within the view pixels
|
165
|
+
can be addressed by specifying their <code>[i][j]</code>
|
166
|
+
coordinates. The <span class="arg">i</span>, <span class=
|
167
|
+
"arg">j</span> index values can identify a single pixel or
|
168
|
+
multiple pixels. Pixels can be accessed or modified
|
169
|
+
individually or collectively. Pixel <em>channels</em> (that
|
170
|
+
is, the red, green, blue, and opacity components) can be
|
171
|
+
accessed or modified individually or collectively. The
|
172
|
+
<a href="#view_sync">sync</a> method stores modified pixels
|
173
|
+
back into the image.</p>
|
174
|
+
</div>
|
175
|
+
|
176
|
+
<h3>class Image::View <span class="superclass"><
|
177
|
+
Object</span></h3>
|
178
|
+
|
179
|
+
<div class="sig">
|
180
|
+
<h4>new</h4>
|
181
|
+
|
182
|
+
<p>Image::View.new(<span class="arg">img</span>, <span class=
|
183
|
+
"arg">x</span>, <span class="arg">y</span>, <span class=
|
184
|
+
"arg">width</span>, <span class="arg">height</span>) ->
|
185
|
+
aView</p>
|
186
|
+
</div>
|
187
|
+
|
188
|
+
<div class="desc">
|
189
|
+
<h5>Description</h5>
|
190
|
+
|
191
|
+
<p>The easiest way to use an <code>Image::View</code> object
|
192
|
+
is to create it with the <a href=
|
193
|
+
"image3.html#view">Image#view</a> method, which provides a
|
194
|
+
block-scoped view and automatic sync'ing. You probably won't
|
195
|
+
want to create a view by calling <code>new</code>.</p>
|
196
|
+
|
197
|
+
<h5>Arguments</h5>
|
198
|
+
|
199
|
+
<dl>
|
200
|
+
<dt>img</dt>
|
201
|
+
|
202
|
+
<dd>The image from which the view is taken.</dd>
|
203
|
+
|
204
|
+
<dt>x, y</dt>
|
205
|
+
|
206
|
+
<dd>The x- and y-offsets of the view relative to the
|
207
|
+
top-left corner of the image. Within the view, pixel
|
208
|
+
addresses are relative to the top-left corner of the
|
209
|
+
view.</dd>
|
210
|
+
|
211
|
+
<dt>width, height</dt>
|
212
|
+
|
213
|
+
<dd>The number of columns and the number of rows in the
|
214
|
+
view.</dd>
|
215
|
+
</dl>
|
216
|
+
|
217
|
+
<p>It is an error to specify a view that exceeds the
|
218
|
+
boundaries of the image.</p>
|
219
|
+
</div>
|
220
|
+
|
221
|
+
<div class="sig">
|
222
|
+
<h4>[][]</h4>
|
223
|
+
|
224
|
+
<p><span class="arg">view</span>[<span class=
|
225
|
+
"arg">i</span>][<span class="arg">j</span>] ->
|
226
|
+
<em>aPixel</em> or <em>anArray</em></p>
|
227
|
+
</div>
|
228
|
+
|
229
|
+
<div class="desc">
|
230
|
+
<h5>Description</h5>
|
231
|
+
|
232
|
+
<p>Return one or more pixels in the view. If i and j are each
|
233
|
+
a single integer value, returns a single pixel. For any other
|
234
|
+
indexes, returns an array of one or more pixels. If any index
|
235
|
+
exceeds the boundaries of the view, raises
|
236
|
+
<code>IndexError</code>.</p>
|
237
|
+
|
238
|
+
<h5>Arguments</h5>
|
239
|
+
|
240
|
+
<p>The <span class="arg">i</span> index identifies a set of
|
241
|
+
rows in the view. The <span class="arg">j</span> index
|
242
|
+
identifies a set of columns in the view. The pixels that are
|
243
|
+
returned are the intersection of these two sets. The indexes
|
244
|
+
can be:</p>
|
245
|
+
|
246
|
+
<dl>
|
247
|
+
<dt>omitted</dt>
|
248
|
+
|
249
|
+
<dd>If <span class="arg">i</span> is omitted, all the rows
|
250
|
+
are used. If <code>j</code> is omitted, all the columns are
|
251
|
+
used.</dd>
|
252
|
+
|
253
|
+
<dt>an integer</dt>
|
254
|
+
|
255
|
+
<dd>or an object that can be converted to an integer. A
|
256
|
+
single integer identifies a single row or column. Identify
|
257
|
+
a single pixel by specifying integers for both indexes. If
|
258
|
+
the index is negative, counts from the bottom row or right
|
259
|
+
column of the view.</dd>
|
260
|
+
|
261
|
+
<dt>start, length</dt>
|
262
|
+
|
263
|
+
<dd>Identifies the set of <code>length</code> rows or
|
264
|
+
columns starting with <code>start</code>. If
|
265
|
+
<code>start</code> is negative, starts at the bottom row or
|
266
|
+
right column of the view.</dd>
|
267
|
+
|
268
|
+
<dt>an object that responds to <code>each</code></dt>
|
269
|
+
|
270
|
+
<dd>The index may be any object that responds to
|
271
|
+
<code>each</code> by returning a sequence of objects that
|
272
|
+
can be converted to integers. An array with integer values
|
273
|
+
or a range of integers are two examples.</dd>
|
274
|
+
</dl>
|
275
|
+
|
276
|
+
<h5>Examples</h5>
|
277
|
+
<pre>
|
278
|
+
# Get the 2nd pixel in the 4th row of the view.
|
279
|
+
pixel = view[3][1] # returns a pixel
|
280
|
+
# Returns an array with only one value
|
281
|
+
pixels = view[[3]][[1]]
|
282
|
+
# Get all the pixels in the 4th row
|
283
|
+
pixels = view[3][]
|
284
|
+
# Use arrays to specify a non-contiguous set of rows and columns
|
285
|
+
pixels = view[[1,3,5]][[2,4,6]]
|
286
|
+
# Use ranges to specify a contigous set of rows and columns
|
287
|
+
pixels = view[1..5][2..6]
|
288
|
+
</pre>
|
289
|
+
</div>
|
290
|
+
|
291
|
+
<div class="sig">
|
292
|
+
<h4>[][].red<br />
|
293
|
+
[][].green<br />
|
294
|
+
[][].blue<br />
|
295
|
+
[][].opacity</h4>
|
296
|
+
|
297
|
+
<p>[<span class="arg">i</span>][<span class=
|
298
|
+
"arg">j</span>].red -> <em>anInteger</em> or
|
299
|
+
<em>anArray</em><br />
|
300
|
+
[<span class="arg">i</span>][<span class=
|
301
|
+
"arg">j</span>].green -> <em>anInteger</em> or
|
302
|
+
<em>anArray</em><br />
|
303
|
+
[<span class="arg">i</span>][<span class="arg">j</span>].blue
|
304
|
+
-> <em>anInteger</em> or <em>anArray</em><br />
|
305
|
+
[<span class="arg">i</span>][<span class=
|
306
|
+
"arg">j</span>].opacity -> <em>anInteger</em> or
|
307
|
+
<em>anArray</em></p>
|
308
|
+
</div>
|
309
|
+
|
310
|
+
<div class="desc">
|
311
|
+
<h5>Description</h5>
|
312
|
+
|
313
|
+
<p>If the indexes identify a single pixel, these methods
|
314
|
+
return the value of the red, green, blue, or opacity channel
|
315
|
+
of that pixel. If the indexes identify more than one pixel,
|
316
|
+
these methods return an array of values. See
|
317
|
+
<code>[][]</code> for a description of possible index
|
318
|
+
arguments.</p>
|
319
|
+
|
320
|
+
<h5>Examples</h5>
|
321
|
+
<pre>
|
322
|
+
# Get the value of the green channel of
|
323
|
+
# the top-left pixel in the view.
|
324
|
+
view[0][0] = Pixel(0,128,255)
|
325
|
+
g = view[0][0].green # returns 128
|
326
|
+
|
327
|
+
# Get the maximum value of the red channel
|
328
|
+
# for all the pixels in the top row of the view.
|
329
|
+
m = view[0][].red.max
|
330
|
+
</pre>
|
331
|
+
</div>
|
332
|
+
|
333
|
+
<div class="sig">
|
334
|
+
<h4>[][]=</h4>
|
335
|
+
|
336
|
+
<p><span class="arg">view</span>[<span class=
|
337
|
+
"arg">i</span>][<span class="arg">j</span>] = <em>rvalue</em>
|
338
|
+
-> <code>nil</code></p>
|
339
|
+
</div>
|
340
|
+
|
341
|
+
<div class="desc">
|
342
|
+
<h5>Description</h5>
|
343
|
+
|
344
|
+
<p>Replaces each pixel identified by the indexes with a
|
345
|
+
duplicate of <span class="arg">rvalue</span>. The rvalue is
|
346
|
+
either a <a href="#Pixel">Pixel</a> object or a <a href=
|
347
|
+
"imusage.html#color_name">color name</a>. If
|
348
|
+
<code>rvalue</code> is a color name, calls
|
349
|
+
<code>Pixel.from_color</code> to create a pixel.</p>
|
350
|
+
|
351
|
+
<h5>Arguments</h5>
|
352
|
+
|
353
|
+
<p>The indexes are the same as <code>[][]</code>, above.</p>
|
354
|
+
|
355
|
+
<dl>
|
356
|
+
<dt>rvalue</dt>
|
357
|
+
|
358
|
+
<dd>Either a pixel or a color name.</dd>
|
359
|
+
</dl>
|
360
|
+
</div>
|
361
|
+
|
362
|
+
<div class="sig">
|
363
|
+
<h4>[][].red=<br />
|
364
|
+
[][].green=<br />
|
365
|
+
[][].blue=<br />
|
366
|
+
[][].opacity=</h4>
|
367
|
+
|
368
|
+
<p>[<span class="arg">i</span>][<span class=
|
369
|
+
"arg">j</span>].red = <em>anInteger</em> ->
|
370
|
+
<code>nil</code><br />
|
371
|
+
[<span class="arg">i</span>][<span class=
|
372
|
+
"arg">j</span>].green = <em>anInteger</em> ->
|
373
|
+
<code>nil</code><br />
|
374
|
+
[<span class="arg">i</span>][<span class="arg">j</span>].blue
|
375
|
+
= <em>anInteger</em> -> <code>nil</code><br />
|
376
|
+
[<span class="arg">i</span>][<span class=
|
377
|
+
"arg">j</span>].opacity = <em>anInteger</em> ->
|
378
|
+
<code>nil</code></p>
|
379
|
+
</div>
|
380
|
+
|
381
|
+
<div class="desc">
|
382
|
+
<h5>Description</h5>
|
383
|
+
|
384
|
+
<p>Assigns <em>anInteger</em> to the red, green, blue, or
|
385
|
+
opacity channel of the pixel or pixels identified by the
|
386
|
+
indexes.</p>
|
387
|
+
|
388
|
+
<h5>Examples</h5>
|
389
|
+
<pre>
|
390
|
+
# Set the red channel of all the pixels in the 2nd
|
391
|
+
# row of the view to MaxRGB
|
392
|
+
view[1][].red = MaxRGB
|
393
|
+
# Set the green channel of the pixel at [20][30] to
|
394
|
+
# half that of its left-hand neighbor.
|
395
|
+
view[20][30].green = view[20][29].green * 0.5
|
396
|
+
</pre>
|
397
|
+
</div>
|
398
|
+
|
399
|
+
<div id="view_sync" class="sig">
|
400
|
+
<h4>sync</h4>
|
401
|
+
|
402
|
+
<p><span class="arg">view</span>.sync(<span class=
|
403
|
+
"arg">force</span>=<code>false</code>) ->
|
404
|
+
<code>true</code> or <code>false</code></p>
|
405
|
+
</div>
|
406
|
+
|
407
|
+
<div class="desc">
|
408
|
+
<h5>Description</h5>
|
409
|
+
|
410
|
+
<p>If any of the pixels in the view have been modified, this
|
411
|
+
method stores them in the image. If no pixels have been
|
412
|
+
modified, this method has no effect.</p>
|
413
|
+
|
414
|
+
<h5>Arguments</h5>
|
415
|
+
|
416
|
+
<dl>
|
417
|
+
<dt>force</dt>
|
418
|
+
|
419
|
+
<dd>If <code>true</code>, forces the view pixels to be
|
420
|
+
stored in the image even if none have been modified.</dd>
|
421
|
+
</dl>
|
422
|
+
|
423
|
+
<h5>Returns</h5>Returns <code>true</code> if the pixels were
|
424
|
+
stored in the image either because the <code>dirty</code>
|
425
|
+
flag was <code>true</code> or <code>force</code> was
|
426
|
+
<code>true</code>, <code>false</code> otherwise.
|
427
|
+
</div>
|
428
|
+
|
429
|
+
<div class="sig">
|
430
|
+
<h4>dirty<br />
|
431
|
+
dirty=</h4>
|
432
|
+
|
433
|
+
<p>view.dirty -> <code>true</code> or
|
434
|
+
<code>false</code><br />
|
435
|
+
view.dirty = <code>true</code> or <code>false</code></p>
|
436
|
+
</div>
|
437
|
+
|
438
|
+
<div class="desc">
|
439
|
+
<h5>Description</h5>
|
440
|
+
|
441
|
+
<p>Any modification to a pixel in the view causes the
|
442
|
+
<code>dirty</code> attribute to be set to <code>true</code>.
|
443
|
+
You can (although normally you don't need to) set
|
444
|
+
<code>dirty=true</code> to force <code>sync</code> to store
|
445
|
+
the pixels in the image, or set <code>dirty=false</code> to
|
446
|
+
keep <code>sync</code> from storing the pixels.</p>
|
447
|
+
</div>
|
448
|
+
|
449
|
+
<div class="sig">
|
450
|
+
<h4>x<br />
|
451
|
+
y<br />
|
452
|
+
width<br />
|
453
|
+
height</h4>
|
454
|
+
|
455
|
+
<p>x -> anInteger<br />
|
456
|
+
y -> anInteger<br />
|
457
|
+
width -> anInteger<br />
|
458
|
+
height -> anInteger</p>
|
459
|
+
</div>
|
460
|
+
|
461
|
+
<div class="desc">
|
462
|
+
<h5>Description</h5>
|
463
|
+
|
464
|
+
<p>The <span class="arg">x</span>, <span class=
|
465
|
+
"arg">y</span>, <span class="arg">width</span>, and
|
466
|
+
<span class="arg">height</span> arguments specified when the
|
467
|
+
view was created.</p>
|
468
|
+
</div>
|
469
|
+
</div>
|
470
|
+
|
471
|
+
<div class="class" id="Geometry">
|
472
|
+
<h2>The Geometry class</h2>
|
473
|
+
|
474
|
+
<div class="intro">
|
475
|
+
<h3>Introduction</h3>
|
476
|
+
|
477
|
+
<p>The Geometry class contains the same information as an
|
478
|
+
×Magick <a href="imusage.html#geometry">geometry
|
479
|
+
string</a>. Geometry objects are interchangable with geometry
|
480
|
+
strings.</p>
|
481
|
+
</div>
|
482
|
+
|
483
|
+
<h3>class Geometry <span class="superclass"><
|
484
|
+
Object</span></h3>
|
485
|
+
|
486
|
+
<div class="sig">
|
487
|
+
<h4>new</h4>
|
488
|
+
|
489
|
+
<p>Geometry.<span class="arg">new</span>(<span class=
|
490
|
+
"arg">width</span>=nil, <span class="arg">height</span>=nil,
|
491
|
+
<span class="arg">x</span>=nil, <span class=
|
492
|
+
"arg">y</span>=nil, <span class="arg">flag</span>=nil) ->
|
493
|
+
<em>aGeometry</em></p>
|
494
|
+
</div>
|
495
|
+
|
496
|
+
<div class="desc">
|
497
|
+
<h5>Description</h5>
|
498
|
+
|
499
|
+
<p>Constructs a new <code>Geometry</code> object.</p>
|
500
|
+
|
501
|
+
<h5>Attributes</h5>
|
502
|
+
|
503
|
+
<p>A geometry string has the general form
|
504
|
+
"WxH+x+y[!@%<>]. In a <code>Geometry</code> object,</p>
|
505
|
+
|
506
|
+
<dl>
|
507
|
+
<dt>width</dt>
|
508
|
+
|
509
|
+
<dd>specifies the W value</dd>
|
510
|
+
|
511
|
+
<dt>height</dt>
|
512
|
+
|
513
|
+
<dd>specifies the H value</dd>
|
514
|
+
|
515
|
+
<dt>x, y</dt>
|
516
|
+
|
517
|
+
<dd>specify the x and y values, respectively</dd>
|
518
|
+
|
519
|
+
<dt>flag</dt>
|
520
|
+
|
521
|
+
<dd>one of the constants shown in this table:</dd>
|
522
|
+
</dl>
|
523
|
+
|
524
|
+
<table summary="geometry flag constants" class=
|
525
|
+
"simple_table">
|
526
|
+
<caption>
|
527
|
+
<strong>Geometry flag constants</strong>
|
528
|
+
</caption>
|
529
|
+
|
530
|
+
<tr>
|
531
|
+
<td align="center"><strong>Constant<br />
|
532
|
+
name</strong></td>
|
533
|
+
|
534
|
+
<td align="center"><strong>Geometry<br />
|
535
|
+
string flag</strong></td>
|
536
|
+
|
537
|
+
<td align="center"><strong>Explanation</strong></td>
|
538
|
+
</tr>
|
539
|
+
|
540
|
+
<tr>
|
541
|
+
<td>PercentGeometry</td>
|
542
|
+
|
543
|
+
<td align="center">%</td>
|
544
|
+
|
545
|
+
<td>Normally the attributes are treated as pixels. Use
|
546
|
+
this flag when the <code>width</code> and
|
547
|
+
<code>height</code> attributes represent
|
548
|
+
<em>percentages</em>. For example, 125x75 means 125% of
|
549
|
+
the height and 75% of the width. The <code>x</code> and
|
550
|
+
<code>y</code> attributes are not affected by this
|
551
|
+
flag.</td>
|
552
|
+
</tr>
|
553
|
+
|
554
|
+
<tr>
|
555
|
+
<td>AspectGeometry</td>
|
556
|
+
|
557
|
+
<td align="center">!</td>
|
558
|
+
|
559
|
+
<td>Use this flag when you want to force the new image to
|
560
|
+
have exactly the size specified by the the
|
561
|
+
<code>width</code> and <code>height</code>
|
562
|
+
attributes.</td>
|
563
|
+
</tr>
|
564
|
+
|
565
|
+
<tr>
|
566
|
+
<td>LessGeometry</td>
|
567
|
+
|
568
|
+
<td align="center"><</td>
|
569
|
+
|
570
|
+
<td>Use this flag when you want to change the size of the
|
571
|
+
image only if both its width and height are smaller the
|
572
|
+
values specified by those attributes. The image size is
|
573
|
+
changed proportionally.</td>
|
574
|
+
</tr>
|
575
|
+
|
576
|
+
<tr>
|
577
|
+
<td>GreaterGeometry</td>
|
578
|
+
|
579
|
+
<td align="center">></td>
|
580
|
+
|
581
|
+
<td>Use this flag when you want to change the size of the
|
582
|
+
image if either its width and height exceed the values
|
583
|
+
specified by those attributes. The image size is changed
|
584
|
+
proportionally.</td>
|
585
|
+
</tr>
|
586
|
+
|
587
|
+
<tr>
|
588
|
+
<td>AreaGeometry</td>
|
589
|
+
|
590
|
+
<td align="center">@</td>
|
591
|
+
|
592
|
+
<td>This flag is useful only with a single
|
593
|
+
<code>width</code> attribute. When present, it means the
|
594
|
+
<code>width</code> attribute represents the total area of
|
595
|
+
the image in pixels.</td>
|
596
|
+
</tr>
|
597
|
+
</table>
|
598
|
+
|
599
|
+
<p>If any attribute is omitted the default is nil or 0.</p>
|
600
|
+
|
601
|
+
<h5>Example</h5>
|
602
|
+
<pre>
|
603
|
+
g = Magick::Geometry.new(100,200,nil,nil,Magick::AspectGeometry)
|
604
|
+
</pre>
|
605
|
+
</div>
|
606
|
+
</div>
|
607
|
+
|
608
|
+
<div class="sig">
|
609
|
+
<h4>from_s</h4>
|
610
|
+
|
611
|
+
<p>Geometry.<span class="arg">from_s</span>(<span class=
|
612
|
+
"arg">string</span>) -> <em>aGeometry</em></p>
|
613
|
+
</div>
|
614
|
+
|
615
|
+
<div class="desc">
|
616
|
+
<h5>Description</h5>
|
617
|
+
|
618
|
+
<p>Constructs a new <code>Geometry</code> object from a
|
619
|
+
<a href="imusage.html#geometry">geometry string</a>.</p>
|
620
|
+
</div>
|
621
|
+
|
622
|
+
<div class="sig">
|
623
|
+
<h4>to_s</h4>
|
624
|
+
|
625
|
+
<p><span class="arg">geometry.</span>to_s() ->
|
626
|
+
<em>aString</em></p>
|
627
|
+
</div>
|
628
|
+
|
629
|
+
<div class="desc">
|
630
|
+
<h5>Description</h5>
|
631
|
+
|
632
|
+
<p>Returns the string equivalent of the <code>Geometry</code>
|
633
|
+
object..</p>
|
634
|
+
</div>
|
635
|
+
|
636
|
+
<div class="class" id="Pixel">
|
637
|
+
<h2>The Pixel class</h2>
|
638
|
+
|
639
|
+
<div class="intro">
|
640
|
+
<h3>Introduction</h3>
|
641
|
+
|
642
|
+
<p>A pixel describes the smallest individually addressable
|
643
|
+
part of an image. In the RBG <a href=
|
644
|
+
"constants.html#ColorspaceType">colorspace</a>, a pixel's
|
645
|
+
color is described by its intensity in the red, green, and
|
646
|
+
blue channels. Its opacity is described by its intensity in
|
647
|
+
the opacity (also called alpha, or matte) channel. In the
|
648
|
+
CMYK colorspace a pixel's color is described by its intensity
|
649
|
+
in the cyan, magenta, yellow and black (K) channels.
|
650
|
+
Intensity is a value between 0 and <a href=
|
651
|
+
"constants.html#MaxRGB">MaxRGB</a>.</p>
|
652
|
+
|
653
|
+
<p>Usually, RMagick methods operate on entire images or on
|
654
|
+
groups of pixels that have been selected by their position or
|
655
|
+
color. Some methods, such as <a href=
|
656
|
+
"image2.html#pixel_color">pixel_color</a> and <a href=
|
657
|
+
"image3.html#view">view</a>, operate on individual pixels or
|
658
|
+
even on the RGBA (or CMYK) components thereof.</p>
|
659
|
+
</div>
|
660
|
+
|
661
|
+
<h3>class Pixel <span class="superclass"><
|
662
|
+
Object</span><br />
|
663
|
+
<span class="mixin">mixes in Comparable, Observable</span></h3>
|
664
|
+
|
665
|
+
<div class="sig">
|
666
|
+
<h4>new</h4>
|
667
|
+
|
668
|
+
<p>Pixel.<span class="arg">new</span>(<span class=
|
669
|
+
"arg">red</span>, <span class="arg">green</span>,
|
670
|
+
<span class="arg">blue</span>, <span class=
|
671
|
+
"arg">opacity</span>) -> <em>aPixel</em></p>
|
672
|
+
</div>
|
673
|
+
|
674
|
+
<div class="desc">
|
675
|
+
<h5>Description</h5>
|
676
|
+
|
677
|
+
<p>Constructs a pixel object from the specified red, green,
|
678
|
+
blue, and opacity intensities. The intensity is a number
|
679
|
+
between 0 and <a href=
|
680
|
+
"constants.html#Miscellaneous_constants">MaxRGB</a>.</p>
|
681
|
+
|
682
|
+
<h5>Attributes</h5>
|
683
|
+
|
684
|
+
<dl>
|
685
|
+
<dt>red, green, blue</dt>
|
686
|
+
|
687
|
+
<dd>The red, green, and blue intensities of the pixel,
|
688
|
+
respectively. If the colorspace is <a href=
|
689
|
+
"constants.html#ColorspaceType">CMYKColorspace</a>, these
|
690
|
+
attributes are interpreted as the cyan, magenta, and yellow
|
691
|
+
intensities.</dd>
|
692
|
+
|
693
|
+
<dt>opacity</dt>
|
694
|
+
|
695
|
+
<dd>The opacity level. Higher intensities are more
|
696
|
+
transparent. If the colorspace is CMYKColorspace, this
|
697
|
+
attribute is interpreted as the black intensity.</dd>
|
698
|
+
</dl>
|
699
|
+
</div>
|
700
|
+
|
701
|
+
<div class="sig">
|
702
|
+
<h4>from_color</h4>
|
703
|
+
|
704
|
+
<p>Pixel.<span class="arg">from_color</span>(<span class=
|
705
|
+
"arg">color_name</span>) -> <em>aPixel</em></p>
|
706
|
+
</div>
|
707
|
+
|
708
|
+
<div class="desc">
|
709
|
+
<h5>Description</h5>
|
710
|
+
|
711
|
+
<p>Constructs a new Pixel object from the <a href=
|
712
|
+
"imusage.html#color_names">color name</a>. Raises
|
713
|
+
ArgumentError if the name is unknown.</p>
|
714
|
+
</div>
|
715
|
+
|
716
|
+
<div class="sig">
|
717
|
+
<h4>from_HSL</h4>
|
718
|
+
|
719
|
+
<p>Pixel.<span class="arg">from_HSL</span>(<span class=
|
720
|
+
"arg">[hue, saturation, luminosity]</span>) ->
|
721
|
+
<em>aPixel</em></p>
|
722
|
+
</div>
|
723
|
+
|
724
|
+
<div class="desc">
|
725
|
+
<h5>Description</h5>
|
726
|
+
|
727
|
+
<p>Constructs a pixel object from the specified array
|
728
|
+
of 3 values: hue, saturation, and luminosity.</p>
|
729
|
+
</div>
|
730
|
+
|
731
|
+
<div class="sig">
|
732
|
+
<h4 id="spaceship"><=></h4>
|
733
|
+
|
734
|
+
<p><span class="arg">pixel1</span> <=> <span class=
|
735
|
+
"arg">pixel2</span> -> -1, 0, <em>or</em> 1</p>
|
736
|
+
</div>
|
737
|
+
|
738
|
+
<div class="desc">
|
739
|
+
<h5>Description</h5>
|
740
|
+
|
741
|
+
<p>Returns -1, 0, or 1 depending on if <span class=
|
742
|
+
"arg">pixel1</span> is "less than," equal, or "greater than"
|
743
|
+
the <span class="arg">pixel2</span>.</p>
|
744
|
+
|
745
|
+
<p>Since there is no way to rank order pixels, and thus
|
746
|
+
determine if one pixel is "greater than" or "less than"
|
747
|
+
another, this method uses an arbitrary algorithm that ensures
|
748
|
+
these two conditions:</p>
|
749
|
+
|
750
|
+
<ol>
|
751
|
+
<li>pixels with equal RGBA (or CMYK) values compare equal,
|
752
|
+
and</li>
|
753
|
+
|
754
|
+
<li>comparing the same two unequal pixels always returns
|
755
|
+
the same result.</li>
|
756
|
+
</ol>
|
757
|
+
|
758
|
+
<h5>Returns</h5>
|
759
|
+
|
760
|
+
<p>-1, 0, or 1</p>
|
761
|
+
|
762
|
+
<h5>See also</h5>
|
763
|
+
|
764
|
+
<p><a href="#fcmp">fcmp</a></p>
|
765
|
+
</div>
|
766
|
+
|
767
|
+
<div class="sig">
|
768
|
+
<h4 id="fcmp">fcmp</h4>
|
769
|
+
|
770
|
+
<p><span class="arg">pixel</span>.fcmp(<span class=
|
771
|
+
"arg">aPixel</span>, <span class="arg">fuzz</span>=0.0,
|
772
|
+
<span class="arg">colorspace</span>=RGBColorspace) ->
|
773
|
+
<code>true</code> <em>or</em> <code>false</code></p>
|
774
|
+
</div>
|
775
|
+
|
776
|
+
<div class="desc">
|
777
|
+
<h5>Description</h5>
|
778
|
+
|
779
|
+
<p>Returns true if the argument is the same color as
|
780
|
+
<span class="arg">pixel</span>.</p>
|
781
|
+
|
782
|
+
<h5>Arguments</h5>
|
783
|
+
|
784
|
+
<dl>
|
785
|
+
<dt>pixel</dt>
|
786
|
+
|
787
|
+
<dd>The pixel to which the receiver is compared.</dd>
|
788
|
+
|
789
|
+
<dt>fuzz</dt>
|
790
|
+
|
791
|
+
<dd>The amount of fuzz to allow before the colors are
|
792
|
+
considered to be different.</dd>
|
793
|
+
|
794
|
+
<dt>colorspace</dt>
|
795
|
+
|
796
|
+
<dd>If the pixels are in the CMYK colorspace, specify
|
797
|
+
<a href=
|
798
|
+
"constants.html#ColorspaceType">Magick::CMYKColorspace</a>.</dd>
|
799
|
+
</dl>
|
800
|
+
|
801
|
+
<h5>Returns</h5>
|
802
|
+
|
803
|
+
<p><code>true</code> or <code>false</code></p>
|
804
|
+
|
805
|
+
<h5>See also</h5>
|
806
|
+
|
807
|
+
<p><a href="#spaceship"><=></a></p>
|
808
|
+
</div>
|
809
|
+
|
810
|
+
<div class="sig">
|
811
|
+
<h4>intensity</h4>
|
812
|
+
|
813
|
+
<p><span class="arg">pixel</span>.intensity() ->
|
814
|
+
anInteger</p>
|
815
|
+
</div>
|
816
|
+
|
817
|
+
<div class="desc">
|
818
|
+
<h5>Description</h5>
|
819
|
+
|
820
|
+
<p>Returns the intensity of the pixel. The intensity is
|
821
|
+
computed as 0.299*R+0.587*G+0.114*B.</p>
|
822
|
+
</div>
|
823
|
+
|
824
|
+
<div class="sig">
|
825
|
+
<h4>to_color</h4>
|
826
|
+
|
827
|
+
<p><span class="arg">pixel</span>.to_color(<span class=
|
828
|
+
"arg">compliance</span>=AllCompliance, <span class=
|
829
|
+
"arg">matte</span>=<code>false</code>, <span class=
|
830
|
+
"arg">depth</span>=<code>QuantumDepth</code>) ->
|
831
|
+
<em>aString</em></p>
|
832
|
+
</div>
|
833
|
+
|
834
|
+
<div class="desc">
|
835
|
+
<h5>Description</h5>
|
836
|
+
|
837
|
+
<p>Returns the <a href="imusage.html#color_names">color
|
838
|
+
name</a> corresponding the the pixel values. If there is no
|
839
|
+
such named color in the specified color standard, returns a
|
840
|
+
string in the form "#RRGGBBOO" or, if the depth is 16,
|
841
|
+
"#RRRRGGGGBBBBOOOO".</p>
|
842
|
+
|
843
|
+
<h5>Arguments</h5>
|
844
|
+
|
845
|
+
<dl>
|
846
|
+
<dt>compliance</dt>
|
847
|
+
|
848
|
+
<dd>A <a href=
|
849
|
+
"constants.html#ComplianceType">ComplianceType</a>
|
850
|
+
constant. The default value of AllCompliance causes
|
851
|
+
<code>to_color</code> to search for a color name in any of
|
852
|
+
the 3 defined color standards.</dd>
|
853
|
+
|
854
|
+
<dt>matte</dt>
|
855
|
+
|
856
|
+
<dd>If false, the pixel's opacity attribute is
|
857
|
+
ignored.</dd>
|
858
|
+
|
859
|
+
<dt>depth</dt>
|
860
|
+
|
861
|
+
<dd>An image depth. The default is the quantum depth used
|
862
|
+
when ×Magick was compiled. The values 16 and 32 can
|
863
|
+
be used only when ×Magick was compiled with the
|
864
|
+
appropriate QuantumDepth.</dd>
|
865
|
+
</dl>
|
866
|
+
|
867
|
+
<h5>See also</h5>
|
868
|
+
|
869
|
+
<p>Compare this method to <a href=
|
870
|
+
"image3.html#to_color">Image#to_color</a>, in which the
|
871
|
+
<span class="arg">matte</span> and <span class=
|
872
|
+
"arg">depth</span> values are taken from an image.</p>
|
873
|
+
</div>
|
874
|
+
|
875
|
+
<div class="sig">
|
876
|
+
<h4>to_HSL</h4>
|
877
|
+
|
878
|
+
<p><span class="arg">pixel</span>.to_HSL ->
|
879
|
+
<em>anArray</em></p>
|
880
|
+
</div>
|
881
|
+
|
882
|
+
<div class="desc">
|
883
|
+
<h5>Description</h5>
|
884
|
+
|
885
|
+
<p>Converts the RGB representation of the pixel to hue,
|
886
|
+
saturation, and luminosity values.</p>
|
887
|
+
|
888
|
+
<h5>Returns</h5>
|
889
|
+
|
890
|
+
<p>An array of the form <code>[hue, saturation,
|
891
|
+
luminosity]</code>.</p>
|
892
|
+
</div>
|
893
|
+
</div>
|
894
|
+
|
895
|
+
<div class="class">
|
896
|
+
<h2 id="struct">Struct classes</h2>
|
897
|
+
|
898
|
+
<div class="intro">
|
899
|
+
<h3>Introduction</h3>
|
900
|
+
|
901
|
+
<p>These classes are created by the Struct class and are used
|
902
|
+
to create objects used as attribute and argument values in
|
903
|
+
other RMagick classes. Like all the classes created by
|
904
|
+
Struct, these classes define both getter and setter methods
|
905
|
+
for their attributes. That is, for an attribute <em>x</em>
|
906
|
+
both the <code>x</code> and <code>x=</code> methods are
|
907
|
+
defined.</p>
|
908
|
+
|
909
|
+
<p>The <code>Pixel</code> and <code>Geometry</code> classes
|
910
|
+
define additional constructors and conversion methods.</p>
|
911
|
+
</div>
|
912
|
+
|
913
|
+
<h3 id="AffineMatrix">class AffineMatrix <span class=
|
914
|
+
"superclass">< Struct</span></h3>
|
915
|
+
|
916
|
+
<div class="sig">
|
917
|
+
<h4>new</h4>
|
918
|
+
|
919
|
+
<p>AffineMatrix.<span class="arg">new</span>(<span class=
|
920
|
+
"arg">sx</span>, <span class="arg">rx</span>, <span class=
|
921
|
+
"arg">ry</span>, <span class="arg">sy</span>, <span class=
|
922
|
+
"arg">tx</span>, <span class="arg">ty</span>) ->
|
923
|
+
<em>anAffineMatrix</em></p>
|
924
|
+
</div>
|
925
|
+
|
926
|
+
<div class="desc">
|
927
|
+
<h5>Description</h5>
|
928
|
+
|
929
|
+
<p>An AffineMatrix object describes a coordinate
|
930
|
+
transformation. This object is used as an argument to the
|
931
|
+
<a href=
|
932
|
+
"image1.html#affine_transform">Image#affine_transform</a>,
|
933
|
+
<a href=
|
934
|
+
"image1.html#composite_affine">Image#composite_affine</a>,
|
935
|
+
and <a href="draw.html#affine_eq">Draw#affine</a>
|
936
|
+
methods.</p>
|
937
|
+
|
938
|
+
<h5>Attributes</h5>
|
939
|
+
|
940
|
+
<dl>
|
941
|
+
<dt>sx, sy</dt>
|
942
|
+
|
943
|
+
<dd>The amount of scaling on the x- and y- axes.</dd>
|
944
|
+
|
945
|
+
<dt>rx, ry</dt>
|
946
|
+
|
947
|
+
<dd>The amount of rotation on the x- and y-axes, in
|
948
|
+
radians.</dd>
|
949
|
+
|
950
|
+
<dt>tx, ty</dt>
|
951
|
+
|
952
|
+
<dd>The amount of translation on the x- and y-axes, in
|
953
|
+
pixels.</dd>
|
954
|
+
</dl>
|
955
|
+
</div>
|
956
|
+
|
957
|
+
<h3 id="Chromaticity">class Chromaticity <span class=
|
958
|
+
"superclass">< Struct</span></h3>
|
959
|
+
|
960
|
+
<div class="sig">
|
961
|
+
<h4>new</h4>
|
962
|
+
|
963
|
+
<p>Chromaticity.<span class="arg">new</span>(<span class=
|
964
|
+
"arg">red_primary</span>, <span class=
|
965
|
+
"arg">green_primary</span>, <span class=
|
966
|
+
"arg">blue_primary</span>, <span class=
|
967
|
+
"arg">white_point</span>) -> <em>aChromaticity</em></p>
|
968
|
+
</div>
|
969
|
+
|
970
|
+
<div class="desc">
|
971
|
+
<h5>Description</h5>
|
972
|
+
|
973
|
+
<p>A Chromaticity object represents chromaticity values for
|
974
|
+
the <a href=
|
975
|
+
"imageattrs.html#chromaticity">Image#chromaticity</a>
|
976
|
+
attribute.</p>
|
977
|
+
|
978
|
+
<h5>Attributes</h5>
|
979
|
+
|
980
|
+
<p>The attribute values are <a href="#Primary">Primary</a>
|
981
|
+
objects.</p>
|
982
|
+
|
983
|
+
<dl>
|
984
|
+
<dt>red_primary</dt>
|
985
|
+
|
986
|
+
<dd>Red primary point (e.g. red_primary.x=0.64,
|
987
|
+
red_primary.y=0.33)</dd>
|
988
|
+
|
989
|
+
<dt>green_primary</dt>
|
990
|
+
|
991
|
+
<dd>Green primary point (e.g. green_primary.x=0.3,
|
992
|
+
green_primary.y=0.6)</dd>
|
993
|
+
|
994
|
+
<dt>blue_primary</dt>
|
995
|
+
|
996
|
+
<dd>Blue primary point (e.g. blue_primary.x=0.15,
|
997
|
+
blue_primary.y=0.06)</dd>
|
998
|
+
|
999
|
+
<dt>white_point</dt>
|
1000
|
+
|
1001
|
+
<dd>White point (e.g. white_point.x=0.3127,
|
1002
|
+
white_point.y=0.329)</dd>
|
1003
|
+
</dl>
|
1004
|
+
</div>
|
1005
|
+
|
1006
|
+
<h3 id="Point">class Point <span class="superclass"><
|
1007
|
+
Struct</span></h3>
|
1008
|
+
|
1009
|
+
<div class="sig">
|
1010
|
+
<h4>new</h4>
|
1011
|
+
|
1012
|
+
<p>Point.new(<span class="arg">x</span>, <span class=
|
1013
|
+
"arg">y</span>) -> <em>aPoint</em></p>
|
1014
|
+
</div>
|
1015
|
+
|
1016
|
+
<div class="desc">
|
1017
|
+
<h5>Description</h5>
|
1018
|
+
|
1019
|
+
<p>The value of the <code>pixels_per_em</code> attribute in
|
1020
|
+
the TypeMetric struct returned by <a href=
|
1021
|
+
"draw.html#get_type_metrics">Draw#get_type_metrics</a> is a
|
1022
|
+
<code>Point</code> object..</p>
|
1023
|
+
|
1024
|
+
<h5>Attributes</h5>
|
1025
|
+
|
1026
|
+
<dl>
|
1027
|
+
<dt>x</dt>
|
1028
|
+
|
1029
|
+
<dd>Character width</dd>
|
1030
|
+
|
1031
|
+
<dt>y</dt>
|
1032
|
+
|
1033
|
+
<dd>Character height</dd>
|
1034
|
+
</dl>
|
1035
|
+
</div>
|
1036
|
+
|
1037
|
+
<h3 id="Primary">class Primary <span class="superclass"><
|
1038
|
+
Struct</span></h3>
|
1039
|
+
|
1040
|
+
<div class="sig">
|
1041
|
+
<h4>new</h4>
|
1042
|
+
|
1043
|
+
<p>Primary.new(<span class="arg">x</span>, <span class=
|
1044
|
+
"arg">y</span>, <span class="arg">z</span>) ->
|
1045
|
+
<em>aPrimary</em></p>
|
1046
|
+
</div>
|
1047
|
+
|
1048
|
+
<div class="desc">
|
1049
|
+
<h5>Description</h5>
|
1050
|
+
|
1051
|
+
<p>See <a href="#Chromaticity">class Chromaticity</a>.</p>
|
1052
|
+
|
1053
|
+
<h5>Attributes</h5>
|
1054
|
+
|
1055
|
+
<dl>
|
1056
|
+
<dt>x</dt>
|
1057
|
+
|
1058
|
+
<dd>X ordinate</dd>
|
1059
|
+
|
1060
|
+
<dt>y</dt>
|
1061
|
+
|
1062
|
+
<dd>Y ordinate</dd>
|
1063
|
+
|
1064
|
+
<dt>z</dt>
|
1065
|
+
|
1066
|
+
<dd>Z ordinate. This attribute is always ignored.</dd>
|
1067
|
+
</dl>
|
1068
|
+
</div>
|
1069
|
+
|
1070
|
+
<h3 id="Rectangle">class Rectangle <span class=
|
1071
|
+
"superclass">< Struct</span></h3>
|
1072
|
+
|
1073
|
+
<div class="sig">
|
1074
|
+
<h4>new</h4>
|
1075
|
+
|
1076
|
+
<p>Rectangle.new(<span class="arg">width</span>, <span class=
|
1077
|
+
"arg">height</span>, <span class="arg">x</span>, <span class=
|
1078
|
+
"arg">y</span>) -> <em>aRectangle</em></p>
|
1079
|
+
</div>
|
1080
|
+
|
1081
|
+
<div class="desc">
|
1082
|
+
<h5>Description</h5>
|
1083
|
+
|
1084
|
+
<p>The value of the <a href=
|
1085
|
+
"imageattrs.html#tile_info">Image#tile_info</a> and <a href=
|
1086
|
+
"imageattrs.html#bounding_box">Image#bounding_box</a>
|
1087
|
+
attributes.</p>
|
1088
|
+
|
1089
|
+
<h5>Attributes</h5>
|
1090
|
+
|
1091
|
+
<dl>
|
1092
|
+
<dt>width</dt>
|
1093
|
+
|
1094
|
+
<dd>Rectangle width</dd>
|
1095
|
+
|
1096
|
+
<dt>height</dt>
|
1097
|
+
|
1098
|
+
<dd>Rectangle height</dd>
|
1099
|
+
|
1100
|
+
<dt>x</dt>
|
1101
|
+
|
1102
|
+
<dd>Offset from the left edge of the image</dd>
|
1103
|
+
|
1104
|
+
<dt>y</dt>
|
1105
|
+
|
1106
|
+
<dd>Offset from the top edge of the image</dd>
|
1107
|
+
</dl>
|
1108
|
+
</div>
|
1109
|
+
|
1110
|
+
<h3 id="Segment">class Segment <span class="superclass"><
|
1111
|
+
Struct</span></h3>
|
1112
|
+
|
1113
|
+
<div class="sig">
|
1114
|
+
<h4>new</h4>
|
1115
|
+
|
1116
|
+
<p>Segment.new(<span class="arg">x1</span>, <span class=
|
1117
|
+
"arg">y1</span>, <span class="arg">x2</span>, <span class=
|
1118
|
+
"arg">y2</span>) -> <em>aSegment</em></p>
|
1119
|
+
</div>
|
1120
|
+
|
1121
|
+
<div class="desc">
|
1122
|
+
<h5>Description</h5>
|
1123
|
+
|
1124
|
+
<p>The value of the <code>bounds</code> attribute in the
|
1125
|
+
<a href="draw.html#get_type_metrics">TypeMetric</a>
|
1126
|
+
class.</p>
|
1127
|
+
|
1128
|
+
<h5>Attributes</h5>
|
1129
|
+
|
1130
|
+
<p><em>x1</em>, <em>y1</em>, <em>x2</em>, <em>y2</em></p>
|
1131
|
+
</div>
|
1132
|
+
</div>
|
1133
|
+
|
1134
|
+
<div class="class">
|
1135
|
+
<h2 id="fill">Fill classes</h2>
|
1136
|
+
|
1137
|
+
<div class="intro">
|
1138
|
+
<h3>Introduction</h3>
|
1139
|
+
|
1140
|
+
<p>The <a href="image.html#new">Image#new</a> and <a href=
|
1141
|
+
"ilist.html#new_image">ImageList#new_image</a> methods accept
|
1142
|
+
a <code>Fill</code> object as an optional third argument. A
|
1143
|
+
<code>Fill</code> object is an instance of a <em>Fill
|
1144
|
+
class</em>. Fill classes are designed to support custom
|
1145
|
+
background fills. Each <code>Fill</code> class defines only
|
1146
|
+
two methods, <code>initialize</code> and <code>fill</code>.
|
1147
|
+
The <code>initialize</code> method is called from the
|
1148
|
+
application to create an instance of the fill class. It
|
1149
|
+
accepts any arguments and does whatever is necessary to
|
1150
|
+
create the fill. The <code>fill</code> method is called from
|
1151
|
+
the initialize method of the new image object, after the
|
1152
|
+
image is completely initialized. The <code>fill</code> method
|
1153
|
+
gets the image as its only argument and sends whatever
|
1154
|
+
methods are necessary to the image to fill the image's
|
1155
|
+
background.</p>
|
1156
|
+
|
1157
|
+
<p>RMagick supplies three Fill classes,
|
1158
|
+
<code><strong>HatchFill</strong></code>,
|
1159
|
+
<code><strong>GradientFill</strong></code>, and
|
1160
|
+
<code><strong>TextureFill</strong></code>. These classes are
|
1161
|
+
explained below. The <code>HatchFill</code> class is intended
|
1162
|
+
as an example of how to write a <code>Fill</code> class and
|
1163
|
+
is written in pure Ruby. You can read it in RMagick.rb.</p>
|
1164
|
+
</div>
|
1165
|
+
|
1166
|
+
<h3 id="GradientFill">class GradientFill <span class=
|
1167
|
+
"superclass">< Object</span></h3>
|
1168
|
+
|
1169
|
+
<div class="sig">
|
1170
|
+
<h4>new</h4>
|
1171
|
+
|
1172
|
+
<p><span class="arg">GradientFill.new(<em>x1</em>,
|
1173
|
+
<em>y1</em>, <em>x2</em>, <em>y2</em>, <em>start_color</em>,
|
1174
|
+
<em>end_color</em>) -></span> <em>aGradientFill</em></p>
|
1175
|
+
</div>
|
1176
|
+
|
1177
|
+
<div class="desc">
|
1178
|
+
<h5>Description</h5>
|
1179
|
+
|
1180
|
+
<p>Creates a gradient fill. The <span class="arg">x1</span>,
|
1181
|
+
<span class="arg">y1</span>, and <span class="arg">x2</span>,
|
1182
|
+
<span class="arg">y2</span> arguments describe either a line
|
1183
|
+
or a point. If <span class="arg">x1</span> != <span class=
|
1184
|
+
"arg">x2</span> or <span class="arg">y1</span> !=
|
1185
|
+
<span class="arg">y2</span>, then the arguments describe the
|
1186
|
+
starting line for the gradient. The gradient will start with
|
1187
|
+
<span class="arg">start_color</span> at the starting line and
|
1188
|
+
gradually transform to <span class="arg">end_color</span> as
|
1189
|
+
the distance increases from the starting line.</p>
|
1190
|
+
|
1191
|
+
<p>If <span class="arg">x1</span> == <span class=
|
1192
|
+
"arg">x2</span> and <span class="arg">y1</span> ==
|
1193
|
+
<span class="arg">y2</span>, the gradient radiates from the
|
1194
|
+
specified point, gradually transforming from <span class=
|
1195
|
+
"arg">start_color</span> to <span class=
|
1196
|
+
"arg">end_color</span>.</p>
|
1197
|
+
|
1198
|
+
<p>The line or point does not have to lie within the image
|
1199
|
+
bounds.</p>
|
1200
|
+
|
1201
|
+
<h5>Arguments</h5>
|
1202
|
+
|
1203
|
+
<dl>
|
1204
|
+
<dt>x1, y1</dt>
|
1205
|
+
|
1206
|
+
<dd>One of the starting line end-points.</dd>
|
1207
|
+
|
1208
|
+
<dt>x2, y2</dt>
|
1209
|
+
|
1210
|
+
<dd>The other end-point on the starting line.</dd>
|
1211
|
+
|
1212
|
+
<dt>start_color</dt>
|
1213
|
+
|
1214
|
+
<dd>The color at the starting line.</dd>
|
1215
|
+
|
1216
|
+
<dt>end_color</dt>
|
1217
|
+
|
1218
|
+
<dd>The color to which the gradient transforms.</dd>
|
1219
|
+
</dl>
|
1220
|
+
|
1221
|
+
<h5>Example</h5>
|
1222
|
+
|
1223
|
+
<p><a href=
|
1224
|
+
"javascript:popup('gradientfill.rb.html')"><img src=
|
1225
|
+
"ex/gradientfill.gif" alt="GradientFill example" title=
|
1226
|
+
"Click to see the example script" /></a></p>
|
1227
|
+
</div>
|
1228
|
+
|
1229
|
+
<h3 id="HatchFill">class HatchFill <span class=
|
1230
|
+
"superclass">< Object</span></h3>
|
1231
|
+
|
1232
|
+
<div class="sig">
|
1233
|
+
<h4>new</h4>
|
1234
|
+
|
1235
|
+
<p>HatchFill.new(<span class="arg">background_color</span>,
|
1236
|
+
<span class="arg">hatch_color</span>='white', <span class=
|
1237
|
+
"arg">dist</span>=10) -> <em>aHatchFill</em></p>
|
1238
|
+
</div>
|
1239
|
+
|
1240
|
+
<div class="desc">
|
1241
|
+
<h4>Description</h4>
|
1242
|
+
|
1243
|
+
<p>Creates a cross-hatched fill.</p>
|
1244
|
+
|
1245
|
+
<h4>Arguments</h4>
|
1246
|
+
|
1247
|
+
<dl>
|
1248
|
+
<dt>background_color</dt>
|
1249
|
+
|
1250
|
+
<dd>The image background color.</dd>
|
1251
|
+
|
1252
|
+
<dt>hatch_color</dt>
|
1253
|
+
|
1254
|
+
<dd>The color of the cross-hatch lines.</dd>
|
1255
|
+
|
1256
|
+
<dt>dist</dt>
|
1257
|
+
|
1258
|
+
<dd>The distance between cross-hatch lines, in pixels.</dd>
|
1259
|
+
</dl>
|
1260
|
+
|
1261
|
+
<h4>Example</h4>
|
1262
|
+
|
1263
|
+
<p><a href="javascript:popup('hatchfill.rb.html')"><img src=
|
1264
|
+
"ex/hatchfill.gif" alt="HatchFill example" title=
|
1265
|
+
"Click to see the example script" /></a></p>
|
1266
|
+
</div>
|
1267
|
+
|
1268
|
+
<h3 id="TextureFill">class TextureFill <span class=
|
1269
|
+
"superclass">< Object</span></h3>
|
1270
|
+
|
1271
|
+
<div class="sig">
|
1272
|
+
<h4>new</h4>
|
1273
|
+
|
1274
|
+
<p>TextureFill.new(<span class="arg">texture_image</span>)
|
1275
|
+
-> <em>aTextureFill</em></p>
|
1276
|
+
</div>
|
1277
|
+
|
1278
|
+
<div class="desc">
|
1279
|
+
<h5>Description</h5>
|
1280
|
+
|
1281
|
+
<p>Creates a texture fill by tiling the <span class=
|
1282
|
+
"arg">texture_image</span> to fill the image.</p>
|
1283
|
+
|
1284
|
+
<h5>Arguments</h5>
|
1285
|
+
|
1286
|
+
<p>The texture to be used as the background. May be an image
|
1287
|
+
or imagelist. If <span class="arg">texture_image</span> is an
|
1288
|
+
imagelist, uses the current image.</p>
|
1289
|
+
|
1290
|
+
<h5>Example</h5>
|
1291
|
+
|
1292
|
+
<p><a href=
|
1293
|
+
"javascript:popup('texturefill.rb.html')"><img src="ex/texturefill.gif"
|
1294
|
+
alt="TextureFill example" title=
|
1295
|
+
"Click to see the example script" /></a></p>
|
1296
|
+
</div>
|
1297
|
+
</div>
|
1298
|
+
|
1299
|
+
<div class="class">
|
1300
|
+
<h2 id="exception">Exception classes</h2>
|
1301
|
+
|
1302
|
+
<h3 id="MagickError">class ImageMagickError <span class=
|
1303
|
+
"superclass">< StandardError</span></h3>
|
1304
|
+
|
1305
|
+
<div class="desc">
|
1306
|
+
<h4>Description</h4>
|
1307
|
+
|
1308
|
+
<p>When an ×Magick function returns an error condition,
|
1309
|
+
RMagick raises an <code>ImageMagickError</code>
|
1310
|
+
exception.</p>
|
1311
|
+
|
1312
|
+
<h4>Attributes</h4>
|
1313
|
+
|
1314
|
+
<dl>
|
1315
|
+
<dt>magick_location</dt>
|
1316
|
+
|
1317
|
+
<dd>With GraphicsMagick 1.1, this attribute contains a
|
1318
|
+
string that indicates the source file (module), function
|
1319
|
+
and line number in which GraphicsMagick raised the error.
|
1320
|
+
The string is in the form <tt><function> at
|
1321
|
+
<module>:<line></tt>. (Get-only.)</dd>
|
1322
|
+
</dl>
|
1323
|
+
</div>
|
1324
|
+
</div>
|
1325
|
+
|
1326
|
+
<p class="spacer"> </p>
|
1327
|
+
|
1328
|
+
<div class="nav">
|
1329
|
+
« <a href="draw.html">Prev</a> | <a href=
|
1330
|
+
"index.html">Contents</a> | <a href=
|
1331
|
+
"info.html">Next</a> »
|
1332
|
+
</div>
|
1333
|
+
</body>
|
1334
|
+
</html>
|