doc/imageattrs.html in rmagick-1.8.3 vs doc/imageattrs.html in rmagick-1.9.0
- old
+ new
@@ -2,11 +2,11 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content=
- "HTML Tidy for Linux/x86 (vers 1st December 2004), see www.w3.org" />
+ "HTML Tidy for Linux/x86 (vers 1st March 2005), see www.w3.org" />
<title>RMagick: class Image (attribute methods)</title>
<meta http-equiv="Content-Type" content=
"text/html; charset=us-ascii" />
<meta name="GENERATOR" content="Quanta Plus" />
@@ -119,10 +119,12 @@
<li><a href=
"#mean_error_per_pixel">mean_error_per_pixel</a></li>
<li><a href="#mime_type">mime_type</a></li>
+
+ <li><a href="#monitor">monitor</a></li>
</ul>
</div>
<div class="toccol">
<ul>
@@ -979,9 +981,98 @@
<h4>Description</h4>
<p><span class="imquote">Returns the officially registered (or
de facto) MIME media-type.</span> If there is no registered
media-type, returns "image/x-magick". Get-only.</p>
+ </div>
+
+ <div class="sig">
+ <h3 id="monitor">monitor</h3>
+
+ <p><span class="arg">image.</span>monitor = <em>aProc</em></p>
+ </div>
+
+ <div class="desc">
+ <h4>Description</h4>
+
+ <p>Establish a progress monitor. Most <code>Image</code> and
+ <code>ImageList</code> methods will periodically call the
+ monitor with arguments indicating the progress of the method.
+ The argument is a Proc object that accepts the three arguments
+ listed here:</p>
+
+ <dl>
+ <dt>method_name</dt>
+
+ <dd>The name of the monitored method.</dd>
+
+ <dt>quantum</dt>
+
+ <dd>A number between 0 and <span class="arg">span</span> that
+ identifies how much of the operation has been completed (or,
+ in some cases, remains to be completed).</dd>
+
+ <dt>span</dt>
+
+ <dd>The number of quanta needed to complete the
+ operation.</dd>
+ </dl>
+
+ <p>If the monitor proc returns <code>nil</code> or
+ <code>false</code> the operation will be immediately
+ terminated. To stop monitoring, set <code>monitor</code> to
+ <code>nil</code>. Available in ImageMagick 6.1.0 and later,
+ this attribute supercedes <a href=
+ "magick.html#set_monitor">Magick.set_monitor</a>. Set-only.</p>
+
+ <h4>Argument</h4>
+
+ <p>Any object that can respond to</p>
+ <pre>
+ obj.call(method_name, quantum, span)
+</pre>
+
+ <p>With very large images it is possible, though not very
+ likely, for the <span class="arg">quantum</span> and
+ <span class="arg">span</span> arguments to be
+ <code>Bignum</code> objects.</p>
+
+ <h4>Example</h4>
+ <pre>
+img.monitor = Proc.new do |method, offset, span|
+ printf("%s is %3.0f%% complete.\n", method, (offset.to_f/span)*100)
+ true
+ end
+
+img.blur_image(0,20)
+</pre>
+
+ <p><em>produces:</em></p>
+ <pre>
+blur_image is 0% complete.
+blur_image is 0% complete.
+blur_image is 0% complete.
+blur_image is 1% complete.
+blur_image is 2% complete.
+blur_image is 4% complete.
+blur_image is 7% complete.
+blur_image is 14% complete.
+blur_image is 28% complete.
+blur_image is 56% complete.
+blur_image is 56% complete.
+blur_image is 56% complete.
+blur_image is 56% complete.
+blur_image is 57% complete.
+blur_image is 59% complete.
+blur_image is 63% complete.
+blur_image is 70% complete.
+blur_image is 84% complete.
+blur_image is 100% complete.
+</pre>
+
+ <h4>See also</h4>
+
+ <p><a href="info.html#monitor">Image::Info#monitor=</a></p>
</div>
<div class="sig">
<h3 id="montage">montage</h3>