rdp-rmagick 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +769 -0
- data/Doxyfile +1514 -0
- data/README-Mac-OSX.txt +1 -0
- data/README.md +231 -0
- data/build_tarball.rake +215 -0
- data/doc/comtasks.html +287 -0
- data/doc/constants.html +1581 -0
- data/doc/css/doc.css +299 -0
- data/doc/css/popup.css +34 -0
- data/doc/css/ref.css +67 -0
- data/doc/draw.html +3269 -0
- data/doc/ex/InitialCoords.rb +23 -0
- data/doc/ex/NewCoordSys.rb +32 -0
- data/doc/ex/OrigCoordSys.rb +18 -0
- data/doc/ex/PreserveAspectRatio.rb +205 -0
- data/doc/ex/RotateScale.rb +37 -0
- data/doc/ex/Skew.rb +38 -0
- data/doc/ex/Use01.rb +16 -0
- data/doc/ex/Use02.rb +21 -0
- data/doc/ex/Use03.rb +16 -0
- data/doc/ex/ViewBox.rb +33 -0
- data/doc/ex/adaptive_threshold.rb +10 -0
- data/doc/ex/add_noise.rb +17 -0
- data/doc/ex/affine.rb +48 -0
- data/doc/ex/affine_transform.rb +20 -0
- data/doc/ex/arc.rb +49 -0
- data/doc/ex/arcpath.rb +33 -0
- data/doc/ex/arcs01.rb +28 -0
- data/doc/ex/arcs02.rb +61 -0
- data/doc/ex/average.rb +15 -0
- data/doc/ex/axes.rb +64 -0
- data/doc/ex/baseline_shift01.rb +18 -0
- data/doc/ex/bilevel_channel.rb +9 -0
- data/doc/ex/blur_image.rb +12 -0
- data/doc/ex/border.rb +10 -0
- data/doc/ex/bounding_box.rb +44 -0
- data/doc/ex/cbezier1.rb +42 -0
- data/doc/ex/cbezier2.rb +42 -0
- data/doc/ex/cbezier3.rb +42 -0
- data/doc/ex/cbezier4.rb +43 -0
- data/doc/ex/cbezier5.rb +43 -0
- data/doc/ex/cbezier6.rb +53 -0
- data/doc/ex/channel.rb +26 -0
- data/doc/ex/charcoal.rb +12 -0
- data/doc/ex/chop.rb +29 -0
- data/doc/ex/circle.rb +33 -0
- data/doc/ex/circle01.rb +17 -0
- data/doc/ex/clip_path.rb +60 -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 +48 -0
- data/doc/ex/color_reset.rb +11 -0
- data/doc/ex/colorize.rb +16 -0
- data/doc/ex/colors.rb +64 -0
- data/doc/ex/compose_mask.rb +23 -0
- data/doc/ex/composite.rb +135 -0
- data/doc/ex/composite_layers.rb +53 -0
- data/doc/ex/composite_tiled.rb +23 -0
- data/doc/ex/contrast.rb +36 -0
- data/doc/ex/crop.rb +31 -0
- data/doc/ex/crop_with_gravity.rb +46 -0
- data/doc/ex/cubic01.rb +45 -0
- data/doc/ex/cubic02.rb +94 -0
- data/doc/ex/cycle_colormap.rb +21 -0
- data/doc/ex/dissolve.rb +13 -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 +45 -0
- data/doc/ex/ellipse01.rb +22 -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/evenodd.rb +43 -0
- data/doc/ex/fill_pattern.rb +26 -0
- data/doc/ex/flatten_images.rb +36 -0
- data/doc/ex/flip.rb +11 -0
- data/doc/ex/flop.rb +11 -0
- data/doc/ex/font_styles.rb +34 -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 +42 -0
- data/doc/ex/get_pixels.rb +48 -0
- data/doc/ex/get_type_metrics.rb +146 -0
- data/doc/ex/gradientfill.rb +27 -0
- data/doc/ex/grav.rb +46 -0
- data/doc/ex/gravity.rb +79 -0
- data/doc/ex/group.rb +26 -0
- data/doc/ex/hatchfill.rb +27 -0
- data/doc/ex/image.rb +46 -0
- data/doc/ex/images/Apple.miff +0 -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/Leaf.miff +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/Rocks_On_Beach.miff +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/Yellow_Rose.miff +0 -0
- data/doc/ex/images/big-duck.gif +0 -0
- data/doc/ex/images/duck.gif +0 -0
- data/doc/ex/images/duck0.gif +0 -0
- data/doc/ex/images/duck1.gif +0 -0
- data/doc/ex/images/duck10.gif +0 -0
- data/doc/ex/images/duck11.gif +0 -0
- data/doc/ex/images/duck12.gif +0 -0
- data/doc/ex/images/duck13.gif +0 -0
- data/doc/ex/images/duck14.gif +0 -0
- data/doc/ex/images/duck15.gif +0 -0
- data/doc/ex/images/duck2.gif +0 -0
- data/doc/ex/images/duck3.gif +0 -0
- data/doc/ex/images/duck4.gif +0 -0
- data/doc/ex/images/duck5.gif +0 -0
- data/doc/ex/images/duck6.gif +0 -0
- data/doc/ex/images/duck7.gif +0 -0
- data/doc/ex/images/duck8.gif +0 -0
- data/doc/ex/images/duck9.gif +0 -0
- data/doc/ex/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 +34 -0
- data/doc/ex/level.rb +11 -0
- data/doc/ex/level_colors.rb +11 -0
- data/doc/ex/line.rb +42 -0
- data/doc/ex/line01.rb +23 -0
- data/doc/ex/mask.rb +36 -0
- data/doc/ex/matte_fill_to_border.rb +40 -0
- data/doc/ex/matte_floodfill.rb +33 -0
- data/doc/ex/matte_replace.rb +40 -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 +9 -0
- data/doc/ex/nested_rvg.rb +21 -0
- data/doc/ex/nonzero.rb +43 -0
- data/doc/ex/normalize.rb +11 -0
- data/doc/ex/oil_paint.rb +11 -0
- data/doc/ex/opacity.rb +37 -0
- data/doc/ex/ordered_dither.rb +11 -0
- data/doc/ex/path.rb +64 -0
- data/doc/ex/pattern1.rb +25 -0
- data/doc/ex/pattern2.rb +26 -0
- data/doc/ex/polaroid.rb +28 -0
- data/doc/ex/polygon.rb +24 -0
- data/doc/ex/polygon01.rb +23 -0
- data/doc/ex/polyline.rb +23 -0
- data/doc/ex/polyline01.rb +23 -0
- data/doc/ex/posterize.rb +8 -0
- data/doc/ex/preview.rb +9 -0
- data/doc/ex/qbezierpath.rb +52 -0
- data/doc/ex/quad01.rb +36 -0
- data/doc/ex/quantize-m.rb +25 -0
- data/doc/ex/radial_blur.rb +9 -0
- data/doc/ex/raise.rb +8 -0
- data/doc/ex/random_threshold_channel.rb +13 -0
- data/doc/ex/rect01.rb +15 -0
- data/doc/ex/rect02.rb +22 -0
- data/doc/ex/rectangle.rb +35 -0
- data/doc/ex/reduce_noise.rb +28 -0
- data/doc/ex/remap.rb +12 -0
- data/doc/ex/remap_images.rb +21 -0
- data/doc/ex/resize_to_fill.rb +10 -0
- data/doc/ex/resize_to_fit.rb +10 -0
- data/doc/ex/roll.rb +9 -0
- data/doc/ex/rotate.rb +45 -0
- data/doc/ex/rotate_f.rb +14 -0
- data/doc/ex/roundrect.rb +34 -0
- data/doc/ex/rubyname.rb +30 -0
- data/doc/ex/rvg_clippath.rb +14 -0
- data/doc/ex/rvg_linecap.rb +43 -0
- data/doc/ex/rvg_linejoin.rb +41 -0
- data/doc/ex/rvg_opacity.rb +19 -0
- data/doc/ex/rvg_pattern.rb +26 -0
- data/doc/ex/rvg_stroke_dasharray.rb +12 -0
- data/doc/ex/segment.rb +11 -0
- data/doc/ex/sepiatone.rb +8 -0
- data/doc/ex/shade.rb +11 -0
- data/doc/ex/shadow.rb +31 -0
- data/doc/ex/shave.rb +15 -0
- data/doc/ex/shear.rb +10 -0
- data/doc/ex/sketch.rb +18 -0
- data/doc/ex/skewx.rb +52 -0
- data/doc/ex/skewy.rb +47 -0
- data/doc/ex/smile.rb +125 -0
- data/doc/ex/solarize.rb +11 -0
- data/doc/ex/sparse_color.rb +55 -0
- data/doc/ex/splice.rb +9 -0
- data/doc/ex/spread.rb +11 -0
- data/doc/ex/stegano.rb +55 -0
- data/doc/ex/stroke_dasharray.rb +43 -0
- data/doc/ex/stroke_fill.rb +11 -0
- data/doc/ex/stroke_linecap.rb +44 -0
- data/doc/ex/stroke_linejoin.rb +48 -0
- data/doc/ex/stroke_width.rb +49 -0
- data/doc/ex/swirl.rb +17 -0
- data/doc/ex/text.rb +37 -0
- data/doc/ex/text01.rb +17 -0
- data/doc/ex/text_align.rb +36 -0
- data/doc/ex/text_antialias.rb +38 -0
- data/doc/ex/text_styles.rb +21 -0
- data/doc/ex/text_undercolor.rb +28 -0
- data/doc/ex/texture_fill_to_border.rb +34 -0
- data/doc/ex/texture_floodfill.rb +32 -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 +39 -0
- data/doc/ex/transparent.rb +38 -0
- data/doc/ex/transpose.rb +9 -0
- data/doc/ex/transverse.rb +9 -0
- data/doc/ex/tref01.rb +25 -0
- data/doc/ex/triangle01.rb +16 -0
- data/doc/ex/trim.rb +24 -0
- data/doc/ex/tspan01.rb +18 -0
- data/doc/ex/tspan02.rb +19 -0
- data/doc/ex/tspan03.rb +21 -0
- data/doc/ex/unsharp_mask.rb +28 -0
- data/doc/ex/viewex.rb +35 -0
- data/doc/ex/vignette.rb +12 -0
- data/doc/ex/watermark.rb +28 -0
- data/doc/ex/wave.rb +9 -0
- data/doc/ex/wet_floor.rb +59 -0
- data/doc/ex/writing_mode01.rb +27 -0
- data/doc/ex/writing_mode02.rb +26 -0
- data/doc/ilist.html +2056 -0
- data/doc/image1.html +4680 -0
- data/doc/image2.html +3665 -0
- data/doc/image3.html +4522 -0
- data/doc/imageattrs.html +1638 -0
- data/doc/imusage.html +514 -0
- data/doc/index.html +416 -0
- data/doc/info.html +1499 -0
- data/doc/magick.html +565 -0
- data/doc/optequiv.html +2435 -0
- data/doc/rvg.html +975 -0
- data/doc/rvgclip.html +248 -0
- data/doc/rvggroup.html +305 -0
- data/doc/rvgimage.html +289 -0
- data/doc/rvgpattern.html +475 -0
- data/doc/rvgshape.html +406 -0
- data/doc/rvgstyle.html +270 -0
- data/doc/rvgtext.html +465 -0
- data/doc/rvgtspan.html +238 -0
- data/doc/rvgtut.html +530 -0
- data/doc/rvguse.html +145 -0
- data/doc/rvgxform.html +294 -0
- data/doc/scripts/doc.js +22 -0
- data/doc/scripts/stripeTables.js +23 -0
- data/doc/struct.html +1339 -0
- data/doc/usage.html +1621 -0
- data/examples/constitute.rb +7 -0
- data/examples/crop_with_gravity.rb +46 -0
- data/examples/demo.rb +324 -0
- data/examples/describe.rb +44 -0
- data/examples/find_similar_region.rb +34 -0
- data/examples/histogram.rb +325 -0
- data/examples/identify.rb +187 -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 +45 -0
- data/examples/spinner.rb +50 -0
- data/examples/thumbnail.rb +65 -0
- data/examples/vignette.rb +79 -0
- data/ext/RMagick/Makefile +180 -0
- data/ext/RMagick/RMagick2.so +0 -0
- data/ext/RMagick/extconf.h +119 -0
- data/ext/RMagick/extconf.rb +406 -0
- data/ext/RMagick/mkmf.log +3022 -0
- data/ext/RMagick/rmagick.c +394 -0
- data/ext/RMagick/rmagick.h +1307 -0
- data/ext/RMagick/rmagick.o +0 -0
- data/ext/RMagick/rmdraw.c +1991 -0
- data/ext/RMagick/rmdraw.o +0 -0
- data/ext/RMagick/rmenum.c +1224 -0
- data/ext/RMagick/rmenum.o +0 -0
- data/ext/RMagick/rmfill.c +717 -0
- data/ext/RMagick/rmfill.o +0 -0
- data/ext/RMagick/rmilist.c +1217 -0
- data/ext/RMagick/rmilist.o +0 -0
- data/ext/RMagick/rmimage.c +15099 -0
- data/ext/RMagick/rmimage.o +0 -0
- data/ext/RMagick/rminfo.c +2567 -0
- data/ext/RMagick/rminfo.o +0 -0
- data/ext/RMagick/rmmain.c +1705 -0
- data/ext/RMagick/rmmain.o +0 -0
- data/ext/RMagick/rmmontage.c +511 -0
- data/ext/RMagick/rmmontage.o +0 -0
- data/ext/RMagick/rmpixel.c +1103 -0
- data/ext/RMagick/rmpixel.o +0 -0
- data/ext/RMagick/rmstruct.c +1047 -0
- data/ext/RMagick/rmstruct.o +0 -0
- data/ext/RMagick/rmutil.c +1730 -0
- data/ext/RMagick/rmutil.o +0 -0
- data/lib/RMagick.rb +1962 -0
- data/lib/rvg/clippath.rb +48 -0
- data/lib/rvg/container.rb +131 -0
- data/lib/rvg/deep_equal.rb +56 -0
- data/lib/rvg/describable.rb +53 -0
- data/lib/rvg/embellishable.rb +417 -0
- data/lib/rvg/misc.rb +740 -0
- data/lib/rvg/paint.rb +55 -0
- data/lib/rvg/pathdata.rb +131 -0
- data/lib/rvg/rvg.rb +283 -0
- data/lib/rvg/stretchable.rb +168 -0
- data/lib/rvg/stylable.rb +124 -0
- data/lib/rvg/text.rb +187 -0
- data/lib/rvg/to_c.rb +103 -0
- data/lib/rvg/transformable.rb +133 -0
- data/lib/rvg/units.rb +66 -0
- data/metaconfig +7 -0
- data/post-clean.rb +12 -0
- data/post-install.rb +50 -0
- data/post-setup.rb +254 -0
- data/rmagick.gemspec +20 -0
- data/setup.rb +1585 -0
- data/test/Draw.rb +121 -0
- data/test/Image1.rb +762 -0
- data/test/Image2.rb +1308 -0
- data/test/Image3.rb +1001 -0
- data/test/ImageList1.rb +808 -0
- data/test/ImageList2.rb +389 -0
- data/test/Image_attributes.rb +682 -0
- data/test/Import_Export.rb +116 -0
- data/test/Info.rb +349 -0
- data/test/Magick.rb +364 -0
- data/test/Pixel.rb +120 -0
- data/test/Preview.rb +62 -0
- data/test/all_basic.rb +39 -0
- data/test/cmyk.icm +0 -0
- data/test/srgb.icm +0 -0
- data/test/test.0 +0 -0
- data/uninstall.rb +74 -0
- metadata +455 -0
@@ -0,0 +1,23 @@
|
|
1
|
+
// Alternate gray/white rows in all the tables having the class "striped"
|
2
|
+
function stripeTables() {
|
3
|
+
if (!document.getElementsByTagName) {
|
4
|
+
return false;
|
5
|
+
}
|
6
|
+
var tables = document.getElementsByTagName("table");
|
7
|
+
for (var i = 0; i < tables.length; i++) {
|
8
|
+
if (tables[i].className == "striped") {
|
9
|
+
var gray = true;
|
10
|
+
var rows = tables[i].getElementsByTagName("tr");
|
11
|
+
for (var j = 0; j < rows.length; j++) {
|
12
|
+
if (gray) {
|
13
|
+
rows[j].style.backgroundColor = "#f0f0f0";
|
14
|
+
gray = false;
|
15
|
+
}
|
16
|
+
else {
|
17
|
+
gray = true;
|
18
|
+
}
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
data/doc/struct.html
ADDED
@@ -0,0 +1,1339 @@
|
|
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 6 November 2007), see www.w3.org" />
|
8
|
+
|
9
|
+
<title>RMagick 0.0.0: 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) 2006 by Timothy P. Hunter" />
|
15
|
+
<link rel="stylesheet" type="text/css" href="css/doc.css" />
|
16
|
+
<link rel="stylesheet" type="text/css" href="css/ref.css" />
|
17
|
+
<script type="text/javascript" src="scripts/doc.js">
|
18
|
+
</script>
|
19
|
+
<style type="text/css">
|
20
|
+
/*<![CDATA[*/
|
21
|
+
|
22
|
+
/* Styles local to this page. */
|
23
|
+
|
24
|
+
|
25
|
+
/*]]>*/
|
26
|
+
</style>
|
27
|
+
</head>
|
28
|
+
|
29
|
+
<body>
|
30
|
+
<h6 id="header">RMagick 0.0.0 User's Guide and Reference</h6>
|
31
|
+
|
32
|
+
<div class="nav">
|
33
|
+
« <a href="draw.html">Prev</a> | <a href=
|
34
|
+
"index.html">Contents</a> | <a href=
|
35
|
+
"info.html">Next</a> »
|
36
|
+
</div>
|
37
|
+
|
38
|
+
<h1>Miscellaneous classes</h1>
|
39
|
+
|
40
|
+
<div id="toc">
|
41
|
+
<h2>Table of Contents</h2>
|
42
|
+
|
43
|
+
<h3><a href="#view">The Image::View class</a></h3>
|
44
|
+
|
45
|
+
<ul>
|
46
|
+
<li><a href="#view">Image::View</a></li>
|
47
|
+
</ul>
|
48
|
+
|
49
|
+
<h3><a href="#Geometry">The Geometry class</a></h3>
|
50
|
+
|
51
|
+
<ul>
|
52
|
+
<li><a href="#Geometry">Geometry</a></li>
|
53
|
+
</ul>
|
54
|
+
|
55
|
+
<h3><a href="#Pixel">The Pixel class</a></h3>
|
56
|
+
|
57
|
+
<ul>
|
58
|
+
<li><a href="#Pixel">Pixel</a></li>
|
59
|
+
</ul>
|
60
|
+
|
61
|
+
<h3><a href="#struct">Struct classes</a></h3>
|
62
|
+
|
63
|
+
<ul>
|
64
|
+
<li><a href="#AffineMatrix">AffineMatrix</a></li>
|
65
|
+
|
66
|
+
<li><a href="#Chromaticity">Chromaticity</a></li>
|
67
|
+
|
68
|
+
<li><a href="#Pixel">Pixel</a></li>
|
69
|
+
|
70
|
+
<li><a href="#Point">Point</a></li>
|
71
|
+
|
72
|
+
<li><a href="#Primary">Primary</a></li>
|
73
|
+
|
74
|
+
<li><a href="#Rectangle">Rectangle</a></li>
|
75
|
+
|
76
|
+
<li><a href="#Segment">Segment</a></li>
|
77
|
+
</ul>
|
78
|
+
|
79
|
+
<h3><a href="#fill">Fill classes</a></h3>
|
80
|
+
|
81
|
+
<ul>
|
82
|
+
<li><a href="#GradientFill">GradientFill</a></li>
|
83
|
+
|
84
|
+
<li><a href="#HatchFill">HatchFill</a></li>
|
85
|
+
|
86
|
+
<li><a href="#TextureFill">TextureFill</a></li>
|
87
|
+
</ul>
|
88
|
+
|
89
|
+
<h3><a href="#exception">Exception classes</a></h3>
|
90
|
+
|
91
|
+
<ul>
|
92
|
+
<li><a href="#MagickError">ImageMagickError</a></li>
|
93
|
+
|
94
|
+
<li><a href=
|
95
|
+
"#FatalImageMagickError">FatalImageMagickError</a></li>
|
96
|
+
|
97
|
+
<li><a href=
|
98
|
+
"#DestroyedImageError">DestroyedImageError</a></li>
|
99
|
+
</ul>
|
100
|
+
</div>
|
101
|
+
|
102
|
+
<div class="subhd">
|
103
|
+
<h2 id="view">The Image::View class</h2>
|
104
|
+
|
105
|
+
<div class="intro">
|
106
|
+
<h3>Introduction</h3>
|
107
|
+
|
108
|
+
<p>A view is a rectangle in an image. Within the view pixels
|
109
|
+
can be addressed by specifying their <code>[i][j]</code>
|
110
|
+
coordinates. The <span class="arg">i</span>, <span class=
|
111
|
+
"arg">j</span> index values can identify a single pixel or
|
112
|
+
multiple pixels. Pixels can be accessed or modified
|
113
|
+
individually or collectively. Pixel <em>channels</em> (that
|
114
|
+
is, the red, green, blue, and opacity components) can be
|
115
|
+
accessed or modified individually or collectively. The
|
116
|
+
<a href="#view_sync">sync</a> method stores modified pixels
|
117
|
+
back into the image.</p>
|
118
|
+
</div>
|
119
|
+
|
120
|
+
<h3>class Image::View <span class="superclass"><
|
121
|
+
Object</span></h3>
|
122
|
+
|
123
|
+
<div class="sig">
|
124
|
+
<h4>new</h4>
|
125
|
+
|
126
|
+
<p>Image::View.new(<span class="arg">img</span>, <span class=
|
127
|
+
"arg">x</span>, <span class="arg">y</span>, <span class=
|
128
|
+
"arg">width</span>, <span class="arg">height</span>) ->
|
129
|
+
<em>view</em></p>
|
130
|
+
</div>
|
131
|
+
|
132
|
+
<div class="desc">
|
133
|
+
<h5>Description</h5>
|
134
|
+
|
135
|
+
<p>The easiest way to use an <code>Image::View</code> object
|
136
|
+
is to create it with the <a href=
|
137
|
+
"image3.html#view">Image#view</a> method, which provides a
|
138
|
+
block-scoped view and automatic syncing. You probably won't
|
139
|
+
want to create a view by calling <code>new</code>.</p>
|
140
|
+
|
141
|
+
<h5>Arguments</h5>
|
142
|
+
|
143
|
+
<dl>
|
144
|
+
<dt>img</dt>
|
145
|
+
|
146
|
+
<dd>The image from which the view is taken.</dd>
|
147
|
+
|
148
|
+
<dt>x, y</dt>
|
149
|
+
|
150
|
+
<dd>The x- and y-offsets of the view relative to the
|
151
|
+
top-left corner of the image. Within the view, pixel
|
152
|
+
addresses are relative to the top-left corner of the
|
153
|
+
view.</dd>
|
154
|
+
|
155
|
+
<dt>width, height</dt>
|
156
|
+
|
157
|
+
<dd>The number of columns and the number of rows in the
|
158
|
+
view.</dd>
|
159
|
+
</dl>
|
160
|
+
|
161
|
+
<p>It is an error to specify a view that exceeds the
|
162
|
+
boundaries of the image.</p>
|
163
|
+
</div>
|
164
|
+
|
165
|
+
<div class="sig">
|
166
|
+
<h4>[][]</h4>
|
167
|
+
|
168
|
+
<p><span class="arg">view</span>[<span class=
|
169
|
+
"arg">i</span>][<span class="arg">j</span>] ->
|
170
|
+
<em>pixel</em> or <em>array</em></p>
|
171
|
+
</div>
|
172
|
+
|
173
|
+
<div class="desc">
|
174
|
+
<h5>Description</h5>
|
175
|
+
|
176
|
+
<p>Return one or more pixels in the view. If i and j are each
|
177
|
+
a single integer value, returns a single pixel. For any other
|
178
|
+
indexes, returns an array of one or more pixels. If any index
|
179
|
+
exceeds the boundaries of the view, raises
|
180
|
+
<code>IndexError</code>.</p>
|
181
|
+
|
182
|
+
<h5>Arguments</h5>
|
183
|
+
|
184
|
+
<p>The <span class="arg">i</span> index identifies a set of
|
185
|
+
rows in the view. The <span class="arg">j</span> index
|
186
|
+
identifies a set of columns in the view. The pixels that are
|
187
|
+
returned are the intersection of these two sets. The indexes
|
188
|
+
can be:</p>
|
189
|
+
|
190
|
+
<dl>
|
191
|
+
<dt>omitted</dt>
|
192
|
+
|
193
|
+
<dd>If <span class="arg">i</span> is omitted, all the rows
|
194
|
+
are used. If <code>j</code> is omitted, all the columns are
|
195
|
+
used.</dd>
|
196
|
+
|
197
|
+
<dt>an integer</dt>
|
198
|
+
|
199
|
+
<dd>or an object that can be converted to an integer. A
|
200
|
+
single integer identifies a single row or column. Identify
|
201
|
+
a single pixel by specifying integers for both indexes. If
|
202
|
+
the index is negative, counts from the bottom row or right
|
203
|
+
column of the view.</dd>
|
204
|
+
|
205
|
+
<dt>start, length</dt>
|
206
|
+
|
207
|
+
<dd>Identifies the set of <code>length</code> rows or
|
208
|
+
columns starting with <code>start</code>. If
|
209
|
+
<code>start</code> is negative, starts at the bottom row or
|
210
|
+
right column of the view.</dd>
|
211
|
+
|
212
|
+
<dt>an object that responds to <code>each</code></dt>
|
213
|
+
|
214
|
+
<dd>The index may be any object that responds to
|
215
|
+
<code>each</code> by returning a sequence of objects that
|
216
|
+
can be converted to integers. An array with integer values
|
217
|
+
or a range of integers are two examples.</dd>
|
218
|
+
</dl>
|
219
|
+
|
220
|
+
<h5>Examples</h5>
|
221
|
+
<pre>
|
222
|
+
# Get the 2nd pixel in the 4th row of the view.
|
223
|
+
pixel = view[3][1] # returns a pixel
|
224
|
+
# Returns an array with only one value
|
225
|
+
pixels = view[[3]][[1]]
|
226
|
+
# Get all the pixels in the 4th row
|
227
|
+
pixels = view[3][]
|
228
|
+
# Use arrays to specify a non-contiguous set of rows and columns
|
229
|
+
pixels = view[[1,3,5]][[2,4,6]]
|
230
|
+
# Use ranges to specify a contiguous set of rows and columns
|
231
|
+
pixels = view[1..5][2..6]
|
232
|
+
</pre>
|
233
|
+
</div>
|
234
|
+
|
235
|
+
<div class="sig">
|
236
|
+
<h4>[][].red<br />
|
237
|
+
[][].green<br />
|
238
|
+
[][].blue<br />
|
239
|
+
[][].opacity</h4>
|
240
|
+
|
241
|
+
<p>[<span class="arg">i</span>][<span class=
|
242
|
+
"arg">j</span>].red -> <em>integer</em> or
|
243
|
+
<em>array</em><br />
|
244
|
+
[<span class="arg">i</span>][<span class=
|
245
|
+
"arg">j</span>].green -> <em>integer</em> or
|
246
|
+
<em>array</em><br />
|
247
|
+
[<span class="arg">i</span>][<span class="arg">j</span>].blue
|
248
|
+
-> <em>integer</em> or <em>array</em><br />
|
249
|
+
[<span class="arg">i</span>][<span class=
|
250
|
+
"arg">j</span>].opacity -> <em>integer</em> or
|
251
|
+
<em>array</em></p>
|
252
|
+
</div>
|
253
|
+
|
254
|
+
<div class="desc">
|
255
|
+
<h5>Description</h5>
|
256
|
+
|
257
|
+
<p>If the indexes identify a single pixel, these methods
|
258
|
+
return the value of the red, green, blue, or opacity channel
|
259
|
+
of that pixel. If the indexes identify more than one pixel,
|
260
|
+
these methods return an array of values. See
|
261
|
+
<code>[][]</code> for a description of possible index
|
262
|
+
arguments.</p>
|
263
|
+
|
264
|
+
<h5>Examples</h5>
|
265
|
+
<pre>
|
266
|
+
# Get the value of the green channel of
|
267
|
+
# the top-left pixel in the view.
|
268
|
+
view[0][0] = Pixel(0,128,255)
|
269
|
+
g = view[0][0].green # returns 128
|
270
|
+
|
271
|
+
# Get the maximum value of the red channel
|
272
|
+
# for all the pixels in the top row of the view.
|
273
|
+
m = view[0][].red.max
|
274
|
+
</pre>
|
275
|
+
</div>
|
276
|
+
|
277
|
+
<div class="sig">
|
278
|
+
<h4>[][]=</h4>
|
279
|
+
|
280
|
+
<p><span class="arg">view</span>[<span class=
|
281
|
+
"arg">i</span>][<span class="arg">j</span>] =
|
282
|
+
<em>rvalue</em></p>
|
283
|
+
</div>
|
284
|
+
|
285
|
+
<div class="desc">
|
286
|
+
<h5>Description</h5>
|
287
|
+
|
288
|
+
<p>Replaces each pixel identified by the indexes with a
|
289
|
+
duplicate of <span class="arg">rvalue</span>. The rvalue is
|
290
|
+
either a <a href="#Pixel">Pixel</a> object or a <a href=
|
291
|
+
"imusage.html#color_name">color name</a>. If
|
292
|
+
<code>rvalue</code> is a color name, calls
|
293
|
+
<code>Pixel.from_color</code> to create a pixel.</p>
|
294
|
+
|
295
|
+
<h5>Arguments</h5>
|
296
|
+
|
297
|
+
<p>The indexes are the same as <code>[][]</code>, above.</p>
|
298
|
+
|
299
|
+
<dl>
|
300
|
+
<dt>rvalue</dt>
|
301
|
+
|
302
|
+
<dd>Either a pixel or a color name.</dd>
|
303
|
+
</dl>
|
304
|
+
</div>
|
305
|
+
|
306
|
+
<div class="sig">
|
307
|
+
<h4>[][].red=<br />
|
308
|
+
[][].green=<br />
|
309
|
+
[][].blue=<br />
|
310
|
+
[][].opacity=</h4>
|
311
|
+
|
312
|
+
<p>[<span class="arg">i</span>][<span class=
|
313
|
+
"arg">j</span>].red = <em>integer</em><br />
|
314
|
+
[<span class="arg">i</span>][<span class=
|
315
|
+
"arg">j</span>].green = <em>integer</em><br />
|
316
|
+
[<span class="arg">i</span>][<span class="arg">j</span>].blue
|
317
|
+
= <em>integer</em><br />
|
318
|
+
[<span class="arg">i</span>][<span class=
|
319
|
+
"arg">j</span>].opacity = <em>integer</em></p>
|
320
|
+
</div>
|
321
|
+
|
322
|
+
<div class="desc">
|
323
|
+
<h5>Description</h5>
|
324
|
+
|
325
|
+
<p>Assigns <em>integer</em> to the red, green, blue, or
|
326
|
+
opacity channel of the pixel or pixels identified by the
|
327
|
+
indexes.</p>
|
328
|
+
|
329
|
+
<h5>Examples</h5>
|
330
|
+
<pre>
|
331
|
+
# Set the red channel of all the pixels in the 2nd
|
332
|
+
# row of the view to QuantumRange
|
333
|
+
view[1][].red = QuantumRange
|
334
|
+
# Set the green channel of the pixel at [20][30] to
|
335
|
+
# half that of its left-hand neighbor.
|
336
|
+
view[20][30].green = view[20][29].green * 0.5
|
337
|
+
</pre>
|
338
|
+
</div>
|
339
|
+
|
340
|
+
<div id="view_sync" class="sig">
|
341
|
+
<h4>sync</h4>
|
342
|
+
|
343
|
+
<p><span class="arg">view</span>.sync(<span class=
|
344
|
+
"arg">force</span>=<code>false</code>) ->
|
345
|
+
<code>true</code> or <code>false</code></p>
|
346
|
+
</div>
|
347
|
+
|
348
|
+
<div class="desc">
|
349
|
+
<h5>Description</h5>
|
350
|
+
|
351
|
+
<p>If any of the pixels in the view have been modified, this
|
352
|
+
method stores them in the image. If no pixels have been
|
353
|
+
modified, this method has no effect.</p>
|
354
|
+
|
355
|
+
<h5>Arguments</h5>
|
356
|
+
|
357
|
+
<dl>
|
358
|
+
<dt>force</dt>
|
359
|
+
|
360
|
+
<dd>If <code>true</code>, forces the view pixels to be
|
361
|
+
stored in the image even if none have been modified.</dd>
|
362
|
+
</dl>
|
363
|
+
|
364
|
+
<h5>Returns</h5>Returns <code>true</code> if the pixels were
|
365
|
+
stored in the image either because the <code>dirty</code>
|
366
|
+
flag was <code>true</code> or <code>force</code> was
|
367
|
+
<code>true</code>, <code>false</code> otherwise.
|
368
|
+
</div>
|
369
|
+
|
370
|
+
<div class="sig">
|
371
|
+
<h4>dirty<br />
|
372
|
+
dirty=</h4>
|
373
|
+
|
374
|
+
<p>view.dirty -> <code>true</code> or
|
375
|
+
<code>false</code><br />
|
376
|
+
view.dirty = <code>true</code> or <code>false</code></p>
|
377
|
+
</div>
|
378
|
+
|
379
|
+
<div class="desc">
|
380
|
+
<h5>Description</h5>
|
381
|
+
|
382
|
+
<p>Any modification to a pixel in the view causes the
|
383
|
+
<code>dirty</code> attribute to be set to <code>true</code>.
|
384
|
+
You can (although normally you don't need to) set
|
385
|
+
<code>dirty=true</code> to force <code>sync</code> to store
|
386
|
+
the pixels in the image, or set <code>dirty=false</code> to
|
387
|
+
keep <code>sync</code> from storing the pixels.</p>
|
388
|
+
</div>
|
389
|
+
|
390
|
+
<div class="sig">
|
391
|
+
<h4>x<br />
|
392
|
+
y<br />
|
393
|
+
width<br />
|
394
|
+
height</h4>
|
395
|
+
|
396
|
+
<p>x -> integer<br />
|
397
|
+
y -> integer<br />
|
398
|
+
width -> integer<br />
|
399
|
+
height -> integer</p>
|
400
|
+
</div>
|
401
|
+
|
402
|
+
<div class="desc">
|
403
|
+
<h5>Description</h5>
|
404
|
+
|
405
|
+
<p>The <span class="arg">x</span>, <span class=
|
406
|
+
"arg">y</span>, <span class="arg">width</span>, and
|
407
|
+
<span class="arg">height</span> arguments specified when the
|
408
|
+
view was created.</p>
|
409
|
+
</div>
|
410
|
+
</div>
|
411
|
+
|
412
|
+
<div class="subhd" id="Geometry">
|
413
|
+
<h2>The Geometry class</h2>
|
414
|
+
|
415
|
+
<div class="intro">
|
416
|
+
<h3>Introduction</h3>
|
417
|
+
|
418
|
+
<p>The Geometry class contains the same information as an
|
419
|
+
ImageMagick <a href="imusage.html#geometry">geometry
|
420
|
+
string</a>. Geometry objects are interchangeable with
|
421
|
+
geometry strings.</p>
|
422
|
+
</div>
|
423
|
+
|
424
|
+
<h3>class Geometry <span class="superclass"><
|
425
|
+
Object</span></h3>
|
426
|
+
|
427
|
+
<div class="sig">
|
428
|
+
<h4>new</h4>
|
429
|
+
|
430
|
+
<p>Geometry.new(<span class="arg">width</span>=nil,
|
431
|
+
<span class="arg">height</span>=nil, <span class=
|
432
|
+
"arg">x</span>=nil, <span class="arg">y</span>=nil,
|
433
|
+
<span class="arg">flag</span>=nil) ->
|
434
|
+
<em>geometry</em></p>
|
435
|
+
</div>
|
436
|
+
|
437
|
+
<div class="desc">
|
438
|
+
<h5>Description</h5>
|
439
|
+
|
440
|
+
<p>Constructs a new <code>Geometry</code> object.</p>
|
441
|
+
|
442
|
+
<h5>Attributes</h5>
|
443
|
+
|
444
|
+
<p>A geometry string has the general form
|
445
|
+
"WxH+x+y[!@%<>]. In a <code>Geometry</code> object,</p>
|
446
|
+
|
447
|
+
<dl>
|
448
|
+
<dt>width</dt>
|
449
|
+
|
450
|
+
<dd>specifies the W value</dd>
|
451
|
+
|
452
|
+
<dt>height</dt>
|
453
|
+
|
454
|
+
<dd>specifies the H value</dd>
|
455
|
+
|
456
|
+
<dt>x, y</dt>
|
457
|
+
|
458
|
+
<dd>specify the x and y values, respectively</dd>
|
459
|
+
|
460
|
+
<dt>flag</dt>
|
461
|
+
|
462
|
+
<dd>one of the constants shown in this table:</dd>
|
463
|
+
</dl>
|
464
|
+
|
465
|
+
<table summary="geometry flag constants" class=
|
466
|
+
"simple_table">
|
467
|
+
<caption>
|
468
|
+
<strong>Geometry flag constants</strong>
|
469
|
+
</caption>
|
470
|
+
|
471
|
+
<tr>
|
472
|
+
<td align="center"><strong>Constant<br />
|
473
|
+
name</strong></td>
|
474
|
+
|
475
|
+
<td align="center"><strong>Geometry<br />
|
476
|
+
string flag</strong></td>
|
477
|
+
|
478
|
+
<td align="center"><strong>Explanation</strong></td>
|
479
|
+
</tr>
|
480
|
+
|
481
|
+
<tr>
|
482
|
+
<td valign="top">PercentGeometry</td>
|
483
|
+
|
484
|
+
<td valign="top" align="center">%</td>
|
485
|
+
|
486
|
+
<td>Normally the attributes are treated as pixels. Use
|
487
|
+
this flag when the <code>width</code> and
|
488
|
+
<code>height</code> attributes represent
|
489
|
+
<em>percentages</em>. For example, 125x75 means 125% of
|
490
|
+
the height and 75% of the width. The <code>x</code> and
|
491
|
+
<code>y</code> attributes are not affected by this
|
492
|
+
flag.</td>
|
493
|
+
</tr>
|
494
|
+
|
495
|
+
<tr>
|
496
|
+
<td valign="top">AspectGeometry</td>
|
497
|
+
|
498
|
+
<td valign="top" align="center">!</td>
|
499
|
+
|
500
|
+
<td>Use this flag when you want to force the new image to
|
501
|
+
have exactly the size specified by the the
|
502
|
+
<code>width</code> and <code>height</code>
|
503
|
+
attributes.</td>
|
504
|
+
</tr>
|
505
|
+
|
506
|
+
<tr>
|
507
|
+
<td valign="top">LessGeometry</td>
|
508
|
+
|
509
|
+
<td valign="top" align="center"><</td>
|
510
|
+
|
511
|
+
<td>Use this flag when you want to change the size of the
|
512
|
+
image only if both its width and height are smaller the
|
513
|
+
values specified by those attributes. The image size is
|
514
|
+
changed proportionally.</td>
|
515
|
+
</tr>
|
516
|
+
|
517
|
+
<tr>
|
518
|
+
<td valign="top">GreaterGeometry</td>
|
519
|
+
|
520
|
+
<td valign="top" align="center">></td>
|
521
|
+
|
522
|
+
<td>Use this flag when you want to change the size of the
|
523
|
+
image if either its width and height exceed the values
|
524
|
+
specified by those attributes. The image size is changed
|
525
|
+
proportionally.</td>
|
526
|
+
</tr>
|
527
|
+
|
528
|
+
<tr>
|
529
|
+
<td valign="top">AreaGeometry</td>
|
530
|
+
|
531
|
+
<td valign="top" align="center">@</td>
|
532
|
+
|
533
|
+
<td>This flag is useful only with a single
|
534
|
+
<code>width</code> attribute. When present, it means the
|
535
|
+
<code>width</code> attribute represents the total area of
|
536
|
+
the image in pixels.</td>
|
537
|
+
</tr>
|
538
|
+
|
539
|
+
<tr>
|
540
|
+
<td valign="top">MinimumGeometry</td>
|
541
|
+
|
542
|
+
<td valign="top" align="center">^</td>
|
543
|
+
|
544
|
+
<td class="imquote">Use ^ to set a minimum image size
|
545
|
+
limit. The geometry 640x480^, for example, means the
|
546
|
+
image width will not be less than 640 and the image
|
547
|
+
height will not be less than 480 pixels after the resize.
|
548
|
+
One of those dimensions will match the requested size,
|
549
|
+
but the image will likely overflow the space requested to
|
550
|
+
preserve its aspect ratio.</td>
|
551
|
+
</tr>
|
552
|
+
</table>
|
553
|
+
|
554
|
+
<p>If any attribute is omitted the default is nil or 0.</p>
|
555
|
+
|
556
|
+
<h5>Example</h5>
|
557
|
+
<pre>
|
558
|
+
g = Magick::Geometry.new(100,200,nil,nil,Magick::AspectGeometry)
|
559
|
+
</pre>
|
560
|
+
</div>
|
561
|
+
</div>
|
562
|
+
|
563
|
+
<div class="sig">
|
564
|
+
<h4>from_s</h4>
|
565
|
+
|
566
|
+
<p>Geometry.<span class="arg">from_s</span>(<span class=
|
567
|
+
"arg">string</span>) -> <em>geometry</em></p>
|
568
|
+
</div>
|
569
|
+
|
570
|
+
<div class="desc">
|
571
|
+
<h5>Description</h5>
|
572
|
+
|
573
|
+
<p>Constructs a new <code>Geometry</code> object from a
|
574
|
+
<a href="imusage.html#geometry">geometry string</a>.</p>
|
575
|
+
</div>
|
576
|
+
|
577
|
+
<div class="sig">
|
578
|
+
<h4>to_s</h4>
|
579
|
+
|
580
|
+
<p><span class="arg">geom.</span>to_s() ->
|
581
|
+
<em>string</em></p>
|
582
|
+
</div>
|
583
|
+
|
584
|
+
<div class="desc">
|
585
|
+
<h5>Description</h5>
|
586
|
+
|
587
|
+
<p>Returns the string equivalent of the <code>Geometry</code>
|
588
|
+
object..</p>
|
589
|
+
</div>
|
590
|
+
|
591
|
+
<div class="subhd" id="Pixel">
|
592
|
+
<h2>The Pixel class</h2>
|
593
|
+
|
594
|
+
<div class="intro">
|
595
|
+
<h3>Introduction</h3>
|
596
|
+
|
597
|
+
<p>A pixel describes the smallest individually addressable
|
598
|
+
part of an image. In the RGB <a href=
|
599
|
+
"constants.html#ColorspaceType">colorspace</a>, a pixel's
|
600
|
+
color is described by its intensity in the red, green, and
|
601
|
+
blue channels. Its opacity is described by its intensity in
|
602
|
+
the opacity (also called alpha, or matte) channel. In the
|
603
|
+
CMYK colorspace a pixel's color is described by its intensity
|
604
|
+
in the cyan, magenta, yellow and black (K) channels.
|
605
|
+
Intensity is a value between 0 and <a href=
|
606
|
+
"constants.html#QuantumRange">QuantumRange</a>.</p>
|
607
|
+
|
608
|
+
<p>Usually, RMagick methods operate on entire images or on
|
609
|
+
groups of pixels that have been selected by their position or
|
610
|
+
color. Some methods, such as <a href=
|
611
|
+
"image2.html#pixel_color">pixel_color</a> and <a href=
|
612
|
+
"image3.html#view">view</a>, operate on individual pixels or
|
613
|
+
even on the RGBA (or CMYK) components thereof.</p>
|
614
|
+
</div>
|
615
|
+
|
616
|
+
<h3>class Pixel <span class="superclass"><
|
617
|
+
Object</span><br />
|
618
|
+
<span class="mixin">mixes in Comparable, Observable</span></h3>
|
619
|
+
|
620
|
+
<div class="sig">
|
621
|
+
<h4>new</h4>
|
622
|
+
|
623
|
+
<p>Pixel.new(<span class="arg">red</span>, <span class=
|
624
|
+
"arg">green</span>, <span class="arg">blue</span>,
|
625
|
+
<span class="arg">opacity</span>) -> <em>pixel</em></p>
|
626
|
+
</div>
|
627
|
+
|
628
|
+
<div class="desc">
|
629
|
+
<h5>Description</h5>
|
630
|
+
|
631
|
+
<p>Constructs a pixel object from the specified red, green,
|
632
|
+
blue, and opacity intensities. The intensity is a number
|
633
|
+
between 0 and <a href=
|
634
|
+
"constants.html#Miscellaneous_constants">QuantumRange</a>.</p>
|
635
|
+
|
636
|
+
<h5>Attributes</h5>
|
637
|
+
|
638
|
+
<dl>
|
639
|
+
<dt>red, green, blue</dt>
|
640
|
+
|
641
|
+
<dd>The red, green, and blue intensities of the pixel,
|
642
|
+
respectively. If the colorspace is <a href=
|
643
|
+
"constants.html#ColorspaceType">CMYKColorspace</a>, these
|
644
|
+
attributes are interpreted as the cyan, magenta, and yellow
|
645
|
+
intensities.</dd>
|
646
|
+
|
647
|
+
<dt>opacity</dt>
|
648
|
+
|
649
|
+
<dd>The opacity level. Higher intensities are more
|
650
|
+
transparent. If the colorspace is CMYKColorspace, this
|
651
|
+
attribute is interpreted as the black intensity.</dd>
|
652
|
+
|
653
|
+
<dt>cyan, magenta, yellow, black</dt>
|
654
|
+
|
655
|
+
<dd>These attributes are aliases for <code>red</code>,
|
656
|
+
<code>green</code>, <code>blue</code>, and
|
657
|
+
<code>opacity</code>, respectively.</dd>
|
658
|
+
</dl>
|
659
|
+
</div>
|
660
|
+
|
661
|
+
<div class="sig">
|
662
|
+
<h4>from_color</h4>
|
663
|
+
|
664
|
+
<p>Pixel.from_color(<span class="arg">color_name</span>)
|
665
|
+
-> <em>pixel</em></p>
|
666
|
+
</div>
|
667
|
+
|
668
|
+
<div class="desc">
|
669
|
+
<h5>Description</h5>
|
670
|
+
|
671
|
+
<p>Constructs a new Pixel object from the <a href=
|
672
|
+
"imusage.html#color_names">color name</a>. Raises
|
673
|
+
ArgumentError if the name is unknown.</p>
|
674
|
+
</div>
|
675
|
+
|
676
|
+
<div class="sig">
|
677
|
+
<h4 id="from_hsla">from_hsla</h4>
|
678
|
+
|
679
|
+
<p>Pixel.from_hsla(<span class="arg">hue</span>, <span class=
|
680
|
+
"arg">saturation</span>, <span class="arg">lightness</span>,
|
681
|
+
<span class="arg">alpha</span>=1.0) -> <em>pixel</em></p>
|
682
|
+
</div>
|
683
|
+
|
684
|
+
<div class="desc">
|
685
|
+
<h5>Description</h5>
|
686
|
+
|
687
|
+
<p>Constructs a pixel object from the specified
|
688
|
+
arguments.</p>
|
689
|
+
|
690
|
+
<h5>Arguments</h5>
|
691
|
+
|
692
|
+
<dl>
|
693
|
+
<dt>hue</dt>
|
694
|
+
|
695
|
+
<dd>Either a String percentage (e.g., "25%") or a value in
|
696
|
+
the range [0.0, 360.0).</dd>
|
697
|
+
|
698
|
+
<dt>saturation</dt>
|
699
|
+
|
700
|
+
<dd>Either a String percentage (e.g., "25%") or a value in
|
701
|
+
the range [0.0, 255.0].</dd>
|
702
|
+
|
703
|
+
<dt>lightness</dt>
|
704
|
+
|
705
|
+
<dd>Either a String percentage (e.g., "25%") or a value in
|
706
|
+
the range [0.0, 255.0].</dd>
|
707
|
+
|
708
|
+
<dt>alpha</dt>
|
709
|
+
|
710
|
+
<dd>Either a String percentage (e.g., "25%") or a value in
|
711
|
+
the range [0.0, 1.0], where 1.0 is fully opaque and 0.0 is
|
712
|
+
fully transparent. This argument may be omitted. The default
|
713
|
+
is 1.0.</dd>
|
714
|
+
</dl>
|
715
|
+
|
716
|
+
<h5>See also</h5>
|
717
|
+
|
718
|
+
<p><a href="#to_hsla">to_hsla</a></p>
|
719
|
+
</div>
|
720
|
+
|
721
|
+
<div class="sig">
|
722
|
+
<h4 id="spaceship"><=></h4>
|
723
|
+
|
724
|
+
<p><span class="arg">pixel1</span> <=> <span class=
|
725
|
+
"arg">pixel2</span> -> -1, 0, <em>or</em> 1</p>
|
726
|
+
</div>
|
727
|
+
|
728
|
+
<div class="desc">
|
729
|
+
<h5>Description</h5>
|
730
|
+
|
731
|
+
<p>Returns -1, 0, or 1 depending on if <span class=
|
732
|
+
"arg">pixel1</span> is "less than," equal, or "greater than"
|
733
|
+
the <span class="arg">pixel2</span>.</p>
|
734
|
+
|
735
|
+
<p>Since there is no way to rank order pixels, and thus
|
736
|
+
determine if one pixel is "greater than" or "less than"
|
737
|
+
another, this method uses an arbitrary algorithm that ensures
|
738
|
+
these two conditions:</p>
|
739
|
+
|
740
|
+
<ol>
|
741
|
+
<li>pixels with equal RGBA (or CMYK) values compare equal,
|
742
|
+
and</li>
|
743
|
+
|
744
|
+
<li>comparing the same two unequal pixels always returns
|
745
|
+
the same result.</li>
|
746
|
+
</ol>
|
747
|
+
|
748
|
+
<h5>Returns</h5>
|
749
|
+
|
750
|
+
<p>-1, 0, or 1</p>
|
751
|
+
|
752
|
+
<h5>See also</h5>
|
753
|
+
|
754
|
+
<p><a href="#fcmp">fcmp</a></p>
|
755
|
+
</div>
|
756
|
+
|
757
|
+
<div class="sig">
|
758
|
+
<h4 id="fcmp">fcmp</h4>
|
759
|
+
|
760
|
+
<p><span class="arg">pixel</span>.fcmp(<span class=
|
761
|
+
"arg">pixel</span>, <span class="arg">fuzz</span>=0.0,
|
762
|
+
<span class="arg">colorspace</span>=RGBColorspace) ->
|
763
|
+
<code>true</code> <em>or</em> <code>false</code></p>
|
764
|
+
</div>
|
765
|
+
|
766
|
+
<div class="desc">
|
767
|
+
<h5>Description</h5>
|
768
|
+
|
769
|
+
<p>Returns true if the argument is the same color as
|
770
|
+
<span class="arg">pixel</span>.</p>
|
771
|
+
|
772
|
+
<h5>Arguments</h5>
|
773
|
+
|
774
|
+
<dl>
|
775
|
+
<dt>pixel</dt>
|
776
|
+
|
777
|
+
<dd>The pixel to which the receiver is compared.</dd>
|
778
|
+
|
779
|
+
<dt>fuzz</dt>
|
780
|
+
|
781
|
+
<dd>The amount of fuzz to allow before the colors are
|
782
|
+
considered to be different.</dd>
|
783
|
+
|
784
|
+
<dt>colorspace</dt>
|
785
|
+
|
786
|
+
<dd>If the pixels are in the CMYK colorspace, specify
|
787
|
+
<a href=
|
788
|
+
"constants.html#ColorspaceType">Magick::CMYKColorspace</a>.</dd>
|
789
|
+
</dl>
|
790
|
+
|
791
|
+
<h5>Returns</h5>
|
792
|
+
|
793
|
+
<p><code>true</code> or <code>false</code></p>
|
794
|
+
|
795
|
+
<h5>See also</h5>
|
796
|
+
|
797
|
+
<p><a href="#spaceship"><=></a></p>
|
798
|
+
</div>
|
799
|
+
|
800
|
+
<div class="sig">
|
801
|
+
<h4>intensity</h4>
|
802
|
+
|
803
|
+
<p><span class="arg">pixel</span>.intensity() ->
|
804
|
+
integer</p>
|
805
|
+
</div>
|
806
|
+
|
807
|
+
<div class="desc">
|
808
|
+
<h5>Description</h5>
|
809
|
+
|
810
|
+
<p>Returns the intensity of the pixel. The intensity is
|
811
|
+
computed as 0.299*R+0.587*G+0.114*B.</p>
|
812
|
+
</div>
|
813
|
+
|
814
|
+
<div class="sig">
|
815
|
+
<h4>to_color</h4>
|
816
|
+
|
817
|
+
<p><span class="arg">pixel</span>.to_color(<span class=
|
818
|
+
"arg">compliance</span>=AllCompliance, <span class=
|
819
|
+
"arg">matte</span>=<code>false</code>, <span class=
|
820
|
+
"arg">depth</span>=<code>QuantumDepth</code>, <span class=
|
821
|
+
"arg">hex</span>=<code>false</code>) ->
|
822
|
+
<em>string</em></p>
|
823
|
+
</div>
|
824
|
+
|
825
|
+
<div class="desc">
|
826
|
+
<h5>Description</h5>
|
827
|
+
|
828
|
+
<p>Returns the <a href="imusage.html#color_names">color
|
829
|
+
name</a> corresponding the the pixel values. If there is no
|
830
|
+
such named color in the specified color standard, returns a
|
831
|
+
string in the form "rgb(r,g,b,a)".</p>
|
832
|
+
|
833
|
+
<h5>Arguments</h5>
|
834
|
+
|
835
|
+
<dl>
|
836
|
+
<dt>compliance</dt>
|
837
|
+
|
838
|
+
<dd>A <a href=
|
839
|
+
"constants.html#ComplianceType">ComplianceType</a>
|
840
|
+
constant. The default value of AllCompliance causes
|
841
|
+
<code>to_color</code> to search for a color name in any of
|
842
|
+
the 3 defined color standards.</dd>
|
843
|
+
|
844
|
+
<dt>matte</dt>
|
845
|
+
|
846
|
+
<dd>If false, the pixel's opacity attribute is
|
847
|
+
ignored.</dd>
|
848
|
+
|
849
|
+
<dt>depth</dt>
|
850
|
+
|
851
|
+
<dd>An image depth. The default is the quantum depth used
|
852
|
+
when ImageMagick was compiled. The values 16 and 32 can be
|
853
|
+
used only when ImageMagick was compiled with the
|
854
|
+
appropriate QuantumDepth.</dd>
|
855
|
+
|
856
|
+
<dt>hex</dt>
|
857
|
+
|
858
|
+
<dd>If true, represent the color name in hex (#rrggbbaa or
|
859
|
+
#rrrrggggbbbbaaaa) format. In this case <span class=
|
860
|
+
"arg">compliance</span> is meaningless.</dd>
|
861
|
+
</dl>
|
862
|
+
|
863
|
+
<h5>See also</h5>
|
864
|
+
|
865
|
+
<p>Compare this method to <a href=
|
866
|
+
"image3.html#to_color">Image#to_color</a>, in which the
|
867
|
+
<span class="arg">matte</span> and <span class=
|
868
|
+
"arg">depth</span> values are taken from an image.</p>
|
869
|
+
</div>
|
870
|
+
|
871
|
+
<div class="sig">
|
872
|
+
<h4 id="to_hsla">to_hsla</h4>
|
873
|
+
|
874
|
+
<p><span class="arg">pixel</span>.to_HSL ->
|
875
|
+
<em>array</em></p>
|
876
|
+
</div>
|
877
|
+
|
878
|
+
<div class="desc">
|
879
|
+
<h5>Description</h5>
|
880
|
+
|
881
|
+
<p>Converts the RGB representation of the pixel to hue,
|
882
|
+
saturation, lightness, and alpha values.</p>
|
883
|
+
|
884
|
+
<h5>Returns</h5>
|
885
|
+
|
886
|
+
<p>An array of the form <code>[hue, saturation, lightness,
|
887
|
+
alpha]</code>. Each value is in the range specified for it,
|
888
|
+
as described in <a href="#from_hsla">from_hsla</a>,
|
889
|
+
above.</p>
|
890
|
+
</div>
|
891
|
+
</div>
|
892
|
+
|
893
|
+
<div class="subhd">
|
894
|
+
<h2 id="struct">Struct classes</h2>
|
895
|
+
|
896
|
+
<div class="intro">
|
897
|
+
<h3>Introduction</h3>
|
898
|
+
|
899
|
+
<p>These classes are created by the Struct class and are used
|
900
|
+
to create objects used as attribute and argument values in
|
901
|
+
other RMagick classes. Like all the classes created by
|
902
|
+
Struct, these classes define both getter and setter methods
|
903
|
+
for their attributes. That is, for an attribute <em>x</em>
|
904
|
+
both the <code>x</code> and <code>x=</code> methods are
|
905
|
+
defined.</p>
|
906
|
+
|
907
|
+
<p>The <code>Pixel</code> and <code>Geometry</code> classes
|
908
|
+
define additional constructors and conversion methods.</p>
|
909
|
+
</div>
|
910
|
+
|
911
|
+
<h3 id="AffineMatrix">class AffineMatrix <span class=
|
912
|
+
"superclass">< Struct</span></h3>
|
913
|
+
|
914
|
+
<div class="sig">
|
915
|
+
<h4>new</h4>
|
916
|
+
|
917
|
+
<p>AffineMatrix.new(<span class="arg">sx</span>, <span class=
|
918
|
+
"arg">rx</span>, <span class="arg">ry</span>, <span class=
|
919
|
+
"arg">sy</span>, <span class="arg">tx</span>, <span class=
|
920
|
+
"arg">ty</span>) -> <em>matrix</em></p>
|
921
|
+
</div>
|
922
|
+
|
923
|
+
<div class="desc">
|
924
|
+
<h5>Description</h5>
|
925
|
+
|
926
|
+
<p>An AffineMatrix object describes a coordinate
|
927
|
+
transformation. This object is used as an argument to the
|
928
|
+
<a href=
|
929
|
+
"image1.html#affine_transform">Image#affine_transform</a>,
|
930
|
+
<a href=
|
931
|
+
"image1.html#composite_affine">Image#composite_affine</a>,
|
932
|
+
and <a href="draw.html#affine_eq">Draw#affine</a>
|
933
|
+
methods.</p>
|
934
|
+
|
935
|
+
<h5>Attributes</h5>
|
936
|
+
|
937
|
+
<dl>
|
938
|
+
<dt>sx, sy</dt>
|
939
|
+
|
940
|
+
<dd>The amount of scaling on the x- and y- axes.</dd>
|
941
|
+
|
942
|
+
<dt>rx, ry</dt>
|
943
|
+
|
944
|
+
<dd>The amount of rotation on the x- and y-axes, in
|
945
|
+
radians.</dd>
|
946
|
+
|
947
|
+
<dt>tx, ty</dt>
|
948
|
+
|
949
|
+
<dd>The amount of translation on the x- and y-axes, in
|
950
|
+
pixels.</dd>
|
951
|
+
</dl>
|
952
|
+
</div>
|
953
|
+
|
954
|
+
<h3 id="Chromaticity">class Chromaticity <span class=
|
955
|
+
"superclass">< Struct</span></h3>
|
956
|
+
|
957
|
+
<div class="sig">
|
958
|
+
<h4>new</h4>
|
959
|
+
|
960
|
+
<p>Chromaticity.new(<span class="arg">red_primary</span>,
|
961
|
+
<span class="arg">green_primary</span>, <span class=
|
962
|
+
"arg">blue_primary</span>, <span class=
|
963
|
+
"arg">white_point</span>) -> <em>chromaticity</em></p>
|
964
|
+
</div>
|
965
|
+
|
966
|
+
<div class="desc">
|
967
|
+
<h5>Description</h5>
|
968
|
+
|
969
|
+
<p>A Chromaticity object represents chromaticity values for
|
970
|
+
the <a href=
|
971
|
+
"imageattrs.html#chromaticity">Image#chromaticity</a>
|
972
|
+
attribute.</p>
|
973
|
+
|
974
|
+
<h5>Attributes</h5>
|
975
|
+
|
976
|
+
<p>The attribute values are <a href="#Primary">Primary</a>
|
977
|
+
objects.</p>
|
978
|
+
|
979
|
+
<dl>
|
980
|
+
<dt>red_primary</dt>
|
981
|
+
|
982
|
+
<dd>Red primary point (e.g. red_primary.x=0.64,
|
983
|
+
red_primary.y=0.33)</dd>
|
984
|
+
|
985
|
+
<dt>green_primary</dt>
|
986
|
+
|
987
|
+
<dd>Green primary point (e.g. green_primary.x=0.3,
|
988
|
+
green_primary.y=0.6)</dd>
|
989
|
+
|
990
|
+
<dt>blue_primary</dt>
|
991
|
+
|
992
|
+
<dd>Blue primary point (e.g. blue_primary.x=0.15,
|
993
|
+
blue_primary.y=0.06)</dd>
|
994
|
+
|
995
|
+
<dt>white_point</dt>
|
996
|
+
|
997
|
+
<dd>White point (e.g. white_point.x=0.3127,
|
998
|
+
white_point.y=0.329)</dd>
|
999
|
+
</dl>
|
1000
|
+
</div>
|
1001
|
+
|
1002
|
+
<h3 id="Point">class Point <span class="superclass"><
|
1003
|
+
Struct</span></h3>
|
1004
|
+
|
1005
|
+
<div class="sig">
|
1006
|
+
<h4>new</h4>
|
1007
|
+
|
1008
|
+
<p>Point.new(<span class="arg">x</span>, <span class=
|
1009
|
+
"arg">y</span>) -> <em>point</em></p>
|
1010
|
+
</div>
|
1011
|
+
|
1012
|
+
<div class="desc">
|
1013
|
+
<h5>Description</h5>
|
1014
|
+
|
1015
|
+
<p>The value of the <code>pixels_per_em</code> attribute in
|
1016
|
+
the TypeMetric struct returned by <a href=
|
1017
|
+
"draw.html#get_type_metrics">Draw#get_type_metrics</a> is a
|
1018
|
+
<code>Point</code> object..</p>
|
1019
|
+
|
1020
|
+
<h5>Attributes</h5>
|
1021
|
+
|
1022
|
+
<dl>
|
1023
|
+
<dt>x</dt>
|
1024
|
+
|
1025
|
+
<dd>Character width</dd>
|
1026
|
+
|
1027
|
+
<dt>y</dt>
|
1028
|
+
|
1029
|
+
<dd>Character height</dd>
|
1030
|
+
</dl>
|
1031
|
+
</div>
|
1032
|
+
|
1033
|
+
<h3 id="Primary">class Primary <span class="superclass"><
|
1034
|
+
Struct</span></h3>
|
1035
|
+
|
1036
|
+
<div class="sig">
|
1037
|
+
<h4>new</h4>
|
1038
|
+
|
1039
|
+
<p>Primary.new(<span class="arg">x</span>, <span class=
|
1040
|
+
"arg">y</span>, <span class="arg">z</span>) ->
|
1041
|
+
<em>primary</em></p>
|
1042
|
+
</div>
|
1043
|
+
|
1044
|
+
<div class="desc">
|
1045
|
+
<h5>Description</h5>
|
1046
|
+
|
1047
|
+
<p>See <a href="#Chromaticity">class Chromaticity</a>.</p>
|
1048
|
+
|
1049
|
+
<h5>Attributes</h5>
|
1050
|
+
|
1051
|
+
<dl>
|
1052
|
+
<dt>x</dt>
|
1053
|
+
|
1054
|
+
<dd>X ordinate</dd>
|
1055
|
+
|
1056
|
+
<dt>y</dt>
|
1057
|
+
|
1058
|
+
<dd>Y ordinate</dd>
|
1059
|
+
|
1060
|
+
<dt>z</dt>
|
1061
|
+
|
1062
|
+
<dd>Z ordinate. This attribute is always ignored.</dd>
|
1063
|
+
</dl>
|
1064
|
+
</div>
|
1065
|
+
|
1066
|
+
<h3 id="Rectangle">class Rectangle <span class=
|
1067
|
+
"superclass">< Struct</span></h3>
|
1068
|
+
|
1069
|
+
<div class="sig">
|
1070
|
+
<h4>new</h4>
|
1071
|
+
|
1072
|
+
<p>Rectangle.new(<span class="arg">width</span>, <span class=
|
1073
|
+
"arg">height</span>, <span class="arg">x</span>, <span class=
|
1074
|
+
"arg">y</span>) -> <em>rectangle</em></p>
|
1075
|
+
</div>
|
1076
|
+
|
1077
|
+
<div class="desc">
|
1078
|
+
<h5>Description</h5>
|
1079
|
+
|
1080
|
+
<p>The value of the <a href=
|
1081
|
+
"imageattrs.html#tile_info">Image#tile_info</a> and <a href=
|
1082
|
+
"imageattrs.html#bounding_box">Image#bounding_box</a>
|
1083
|
+
attributes.</p>
|
1084
|
+
|
1085
|
+
<h5>Attributes</h5>
|
1086
|
+
|
1087
|
+
<dl>
|
1088
|
+
<dt>width</dt>
|
1089
|
+
|
1090
|
+
<dd>Rectangle width</dd>
|
1091
|
+
|
1092
|
+
<dt>height</dt>
|
1093
|
+
|
1094
|
+
<dd>Rectangle height</dd>
|
1095
|
+
|
1096
|
+
<dt>x</dt>
|
1097
|
+
|
1098
|
+
<dd>Offset from the left edge of the image</dd>
|
1099
|
+
|
1100
|
+
<dt>y</dt>
|
1101
|
+
|
1102
|
+
<dd>Offset from the top edge of the image</dd>
|
1103
|
+
</dl>
|
1104
|
+
</div>
|
1105
|
+
|
1106
|
+
<h3 id="Segment">class Segment <span class="superclass"><
|
1107
|
+
Struct</span></h3>
|
1108
|
+
|
1109
|
+
<div class="sig">
|
1110
|
+
<h4>new</h4>
|
1111
|
+
|
1112
|
+
<p>Segment.new(<span class="arg">x1</span>, <span class=
|
1113
|
+
"arg">y1</span>, <span class="arg">x2</span>, <span class=
|
1114
|
+
"arg">y2</span>) -> <em>segment</em></p>
|
1115
|
+
</div>
|
1116
|
+
|
1117
|
+
<div class="desc">
|
1118
|
+
<h5>Description</h5>
|
1119
|
+
|
1120
|
+
<p>The value of the <code>bounds</code> attribute in the
|
1121
|
+
<a href="draw.html#get_type_metrics">TypeMetric</a>
|
1122
|
+
class.</p>
|
1123
|
+
|
1124
|
+
<h5>Attributes</h5>
|
1125
|
+
|
1126
|
+
<p><em>x1</em>, <em>y1</em>, <em>x2</em>, <em>y2</em></p>
|
1127
|
+
</div>
|
1128
|
+
</div>
|
1129
|
+
|
1130
|
+
<div class="subhd">
|
1131
|
+
<h2 id="fill">Fill classes</h2>
|
1132
|
+
</div>
|
1133
|
+
|
1134
|
+
<div class="intro">
|
1135
|
+
<h3>Introduction</h3>
|
1136
|
+
|
1137
|
+
<p>The <a href="image1.html#new">Image#new</a> and <a href=
|
1138
|
+
"ilist.html#new_image">ImageList#new_image</a> methods accept a
|
1139
|
+
<code>Fill</code> object as an optional third argument. A
|
1140
|
+
<code>Fill</code> object is an instance of a <em>Fill
|
1141
|
+
class</em>. Fill classes are designed to support custom
|
1142
|
+
background fills. Each <code>Fill</code> class defines only two
|
1143
|
+
methods, <code>initialize</code> and <code>fill</code>. The
|
1144
|
+
<code>initialize</code> method is called from the application
|
1145
|
+
to create an instance of the fill class. It accepts any
|
1146
|
+
arguments and does whatever is necessary to create the fill.
|
1147
|
+
The <code>fill</code> method is called from the initialize
|
1148
|
+
method of the new image object, after the image is completely
|
1149
|
+
initialized. The <code>fill</code> method gets the image as its
|
1150
|
+
only argument and sends whatever methods are necessary to the
|
1151
|
+
image to fill the image's background.</p>
|
1152
|
+
|
1153
|
+
<p>RMagick supplies three Fill classes,
|
1154
|
+
<code><strong>HatchFill</strong></code>,
|
1155
|
+
<code><strong>GradientFill</strong></code>, and
|
1156
|
+
<code><strong>TextureFill</strong></code>. These classes are
|
1157
|
+
explained below. The <code>HatchFill</code> class is intended
|
1158
|
+
as an example of how to write a <code>Fill</code> class and is
|
1159
|
+
written in pure Ruby. You can read it in RMagick.rb.</p>
|
1160
|
+
</div>
|
1161
|
+
|
1162
|
+
<h3 id="GradientFill">class GradientFill <span class=
|
1163
|
+
"superclass">< Object</span></h3>
|
1164
|
+
|
1165
|
+
<div class="sig">
|
1166
|
+
<h4>new</h4>
|
1167
|
+
|
1168
|
+
<p>GradientFill.new(<span class="arg">x1</span>, <span class=
|
1169
|
+
"arg">y1</span>, <span class="arg">x2</span>, <span class=
|
1170
|
+
"arg">y2</span>, <span class="arg">start_color</span>,
|
1171
|
+
<span class="arg">end_color</span>) ->
|
1172
|
+
<em>gradient_fill</em></p>
|
1173
|
+
</div>
|
1174
|
+
|
1175
|
+
<div class="desc">
|
1176
|
+
<h5>Description</h5>
|
1177
|
+
|
1178
|
+
<p>Creates a gradient fill. The <span class="arg">x1</span>,
|
1179
|
+
<span class="arg">y1</span>, and <span class="arg">x2</span>,
|
1180
|
+
<span class="arg">y2</span> arguments describe either a line or
|
1181
|
+
a point. If <span class="arg">x1</span> != <span class=
|
1182
|
+
"arg">x2</span> or <span class="arg">y1</span> != <span class=
|
1183
|
+
"arg">y2</span>, then the arguments describe the starting line
|
1184
|
+
for the gradient. The gradient will start with <span class=
|
1185
|
+
"arg">start_color</span> at the starting line and gradually
|
1186
|
+
transform to <span class="arg">end_color</span> as the distance
|
1187
|
+
increases from the starting line.</p>
|
1188
|
+
|
1189
|
+
<p>If <span class="arg">x1</span> == <span class=
|
1190
|
+
"arg">x2</span> and <span class="arg">y1</span> == <span class=
|
1191
|
+
"arg">y2</span>, the gradient radiates from the specified
|
1192
|
+
point, gradually transforming from <span class=
|
1193
|
+
"arg">start_color</span> to <span class=
|
1194
|
+
"arg">end_color</span>.</p>
|
1195
|
+
|
1196
|
+
<p>The line or point does not have to lie within the image
|
1197
|
+
bounds.</p>
|
1198
|
+
|
1199
|
+
<h5>Arguments</h5>
|
1200
|
+
|
1201
|
+
<dl>
|
1202
|
+
<dt>x1, y1</dt>
|
1203
|
+
|
1204
|
+
<dd>One of the starting line end-points.</dd>
|
1205
|
+
|
1206
|
+
<dt>x2, y2</dt>
|
1207
|
+
|
1208
|
+
<dd>The other end-point on the starting line.</dd>
|
1209
|
+
|
1210
|
+
<dt>start_color</dt>
|
1211
|
+
|
1212
|
+
<dd>The color at the starting line.</dd>
|
1213
|
+
|
1214
|
+
<dt>end_color</dt>
|
1215
|
+
|
1216
|
+
<dd>The color to which the gradient transforms.</dd>
|
1217
|
+
</dl>
|
1218
|
+
|
1219
|
+
<h5>Example</h5>
|
1220
|
+
|
1221
|
+
<p><a href="javascript:popup('gradientfill.rb.html')"><img src=
|
1222
|
+
"ex/gradientfill.gif" alt="GradientFill example" title=
|
1223
|
+
"Click to see the example script" /></a></p>
|
1224
|
+
</div>
|
1225
|
+
|
1226
|
+
<h3 id="HatchFill">class HatchFill <span class="superclass"><
|
1227
|
+
Object</span></h3>
|
1228
|
+
|
1229
|
+
<div class="sig">
|
1230
|
+
<h4>new</h4>
|
1231
|
+
|
1232
|
+
<p>HatchFill.new(<span class="arg">background_color</span>,
|
1233
|
+
<span class="arg">hatch_color</span>='white', <span class=
|
1234
|
+
"arg">dist</span>=10) -> <em>hatch_fill</em></p>
|
1235
|
+
</div>
|
1236
|
+
|
1237
|
+
<div class="desc">
|
1238
|
+
<h4>Description</h4>
|
1239
|
+
|
1240
|
+
<p>Creates a cross-hatched fill.</p>
|
1241
|
+
|
1242
|
+
<h4>Arguments</h4>
|
1243
|
+
|
1244
|
+
<dl>
|
1245
|
+
<dt>background_color</dt>
|
1246
|
+
|
1247
|
+
<dd>The image background color.</dd>
|
1248
|
+
|
1249
|
+
<dt>hatch_color</dt>
|
1250
|
+
|
1251
|
+
<dd>The color of the cross-hatch lines.</dd>
|
1252
|
+
|
1253
|
+
<dt>dist</dt>
|
1254
|
+
|
1255
|
+
<dd>The distance between cross-hatch lines, in pixels.</dd>
|
1256
|
+
</dl>
|
1257
|
+
|
1258
|
+
<h4>Example</h4>
|
1259
|
+
|
1260
|
+
<p><a href="javascript:popup('hatchfill.rb.html')"><img src=
|
1261
|
+
"ex/hatchfill.gif" alt="HatchFill example" title=
|
1262
|
+
"Click to see the example script" /></a></p>
|
1263
|
+
</div>
|
1264
|
+
|
1265
|
+
<h3 id="TextureFill">class TextureFill <span class=
|
1266
|
+
"superclass">< Object</span></h3>
|
1267
|
+
|
1268
|
+
<div class="sig">
|
1269
|
+
<h4>new</h4>
|
1270
|
+
|
1271
|
+
<p>TextureFill.new(<span class="arg">texture_image</span>)
|
1272
|
+
-> <em>texture_fill</em></p>
|
1273
|
+
</div>
|
1274
|
+
|
1275
|
+
<div class="desc">
|
1276
|
+
<h5>Description</h5>
|
1277
|
+
|
1278
|
+
<p>Creates a texture fill by tiling the <span class=
|
1279
|
+
"arg">texture_image</span> to fill the image.</p>
|
1280
|
+
|
1281
|
+
<h5>Arguments</h5>
|
1282
|
+
|
1283
|
+
<p>The texture to be used as the background. May be an image or
|
1284
|
+
imagelist. If <span class="arg">texture_image</span> is an
|
1285
|
+
imagelist, uses the current image.</p>
|
1286
|
+
|
1287
|
+
<h5>Example</h5>
|
1288
|
+
|
1289
|
+
<p><a href="javascript:popup('texturefill.rb.html')"><img src=
|
1290
|
+
"ex/texturefill.gif" alt="TextureFill example" title=
|
1291
|
+
"Click to see the example script" /></a></p>
|
1292
|
+
</div>
|
1293
|
+
|
1294
|
+
<div class="subhd">
|
1295
|
+
<h2 id="exception">Exception classes</h2>
|
1296
|
+
|
1297
|
+
<h3 id="MagickError">class ImageMagickError <span class=
|
1298
|
+
"superclass">< StandardError</span></h3>
|
1299
|
+
|
1300
|
+
<div class="desc">
|
1301
|
+
<h4>Description</h4>
|
1302
|
+
|
1303
|
+
<p>RMagick raises this exception when an ImageMagick function
|
1304
|
+
returns an error condition.</p>
|
1305
|
+
</div>
|
1306
|
+
|
1307
|
+
<h3 id="FatalImageMagickError">class FatalImageMagickError
|
1308
|
+
<span class="superclass">< StandardError</span></h3>
|
1309
|
+
|
1310
|
+
<div class="desc">
|
1311
|
+
<h4>Description</h4>
|
1312
|
+
|
1313
|
+
<p>RMagick raises this exception when ImageMagick raises a
|
1314
|
+
fatal (unrecoverable) error condition.</p>
|
1315
|
+
</div>
|
1316
|
+
|
1317
|
+
<h3 id="DestroyedImageError">class DestroyedImageError
|
1318
|
+
<span class="superclass">< StandardError</span></h3>
|
1319
|
+
|
1320
|
+
<div class="desc">
|
1321
|
+
<h4>Description</h4>
|
1322
|
+
|
1323
|
+
<p>RMagick raises this exception when any Image method
|
1324
|
+
(except <a href="image1.html#destroyed_q">destroyed?</a> and
|
1325
|
+
<a href="image2.html#inspect">inspect</a>) is called after an
|
1326
|
+
image has been <a href=
|
1327
|
+
"image1.html#destroy_bang">destroyed</a>.</p>
|
1328
|
+
</div>
|
1329
|
+
</div>
|
1330
|
+
|
1331
|
+
<p class="spacer"> </p>
|
1332
|
+
|
1333
|
+
<div class="nav">
|
1334
|
+
« <a href="draw.html">Prev</a> | <a href=
|
1335
|
+
"index.html">Contents</a> | <a href=
|
1336
|
+
"info.html">Next</a> »
|
1337
|
+
</div>
|
1338
|
+
</body>
|
1339
|
+
</html>
|