blob: 6bd7a595dc7c187d9b5d8aa60166beab84ed2cf2 [file] [log] [blame]
<!-- Copyright 2008 Lubomir Bourdev and Hailin Jin
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
-->
<!--
Copyright 2005-2007 Adobe Systems Incorporated
Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
or a copy at http://stlab.adobe.com/licenses.html)
Some files are held under additional license.
Please see "http://stlab.adobe.com/licenses.html" for more information.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<TITLE>Generic Image Library: pixel_2d_locator_base Class Template Reference</TITLE>
<META HTTP-EQUIV="content-type" CONTENT="text/html;charset=ISO-8859-1"/>
<LINK TYPE="text/css" REL="stylesheet" HREF="adobe_source.css"/>
</head>
<body>
<table border="0" cellspacing="0" cellpadding="0" style='width: 100%; margin: 0; padding: 0'><tr>
<td width="100%" valign="top" style='padding-left: 10px; padding-right: 10px; padding-bottom: 10px'>
<div class="qindex"><a class="qindex" href="index.html">Modules</a>
| <a class="qindex" href="classes.html">Alphabetical List</a>
| <a class="qindex" href="annotated.html">Class List</a>
| <a class="qindex" href="dirs.html">Directories</a>
| <a class="qindex" href="files.html">File List</a>
| <a class="qindex" href="../index.html">GIL Home Page</a>
</div>
<!-- End Header -->
<!-- Generated by Doxygen 1.5.6 -->
<div class="navpath"><a class="el" href="namespaceboost.html">boost</a>::<b>gil</b>::<a class="el" href="g_i_l_0058.html">pixel_2d_locator_base</a>
</div>
<div class="contents">
<h1>pixel_2d_locator_base Class Template Reference<br>
<small>
[<a class="el" href="g_i_l_0205.html">Models</a>,&nbsp;<a class="el" href="g_i_l_0182.html">Models</a>]</small>
</h1><!-- doxytag: class="boost::gil::pixel_2d_locator_base" --><code>#include &lt;<a class="el" href="g_i_l_0236.html">locator.hpp</a>&gt;</code>
<p>
<div class="dynheader">
Inheritance diagram for pixel_2d_locator_base:</div>
<div class="dynsection">
<p><center><img src="g_i_l_0008.png" usemap="#pixel_2d_locator_base_map" border="0" alt=""></center>
<map name="pixel_2d_locator_base_map">
<area href="g_i_l_0044.html" alt="memory_based_2d_locator" shape="rect" coords="0,56,164,80">
<area href="g_i_l_0064.html" alt="virtual_2d_locator" shape="rect" coords="174,56,338,80">
</map>
</div>
<p>
<a href="g_i_l_0057.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>
<h3>template&lt;typename Loc, typename XIterator, typename YIterator&gt;<br>
class boost::gil::pixel_2d_locator_base&lt; Loc, XIterator, YIterator &gt;</h3>
base class for models of <a class="el" href="g_i_l_0354.html" title="GIL&#39;s 2-dimensional locator over immutable GIL pixels.">PixelLocatorConcept</a><p>
Pixel locator is similar to a <a class="el" href="g_i_l_0599.html" title="Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept...">pixel</a> iterator, but allows for 2D navigation of pixels within an <a class="el" href="g_i_l_0038.html" title="container interface over image view. Models ImageConcept, PixelBasedConcept">image</a> view. It has a 2D difference_type and supports random access operations like:
<p>
<div class="fragment"><pre class="fragment"> difference_type offset2(2,3);
locator+=offset2;
locator[offset2]=my_pixel;
</pre></div><p>
In addition, each coordinate acts as a random-access iterator that can be modified separately: "++locator.x()" or "locator.y()+=10" thereby moving the locator horizontally or vertically.<p>
It is called a locator because it doesn't implement the complete interface of a random access iterator. For example, increment and decrement operations don't make sense (no way to specify dimension). Also 2D difference between two locators cannot be computed without knowledge of the X position within the <a class="el" href="g_i_l_0038.html" title="container interface over image view. Models ImageConcept, PixelBasedConcept">image</a>.<p>
This base class provides most of the methods and typedefs needed to create a model of a locator. GIL provides two locator models as subclasses of <code><a class="el" href="g_i_l_0058.html" title="base class for models of PixelLocatorConceptPixel locator is similar to a pixel iterator...">pixel_2d_locator_base</a></code>. A memory-based locator, <code><a class="el" href="g_i_l_0044.html" title="Memory-based pixel locator. Models: PixelLocatorConcept,HasDynamicXStepTypeConcept...">memory_based_2d_locator</a></code> and a virtual locator, <code><a class="el" href="g_i_l_0064.html" title="A 2D locator over a virtual image. Upon dereferencing, invokes a given function object...">virtual_2d_locator</a></code>. The minimum functionality a subclass must provide is this: <div class="fragment"><pre class="fragment"> <span class="keyword">class </span>my_locator : <span class="keyword">public</span> pixel_2d_locator_base&lt;my_locator, ..., ...&gt; { <span class="comment">// supply the types for x-iterator and y-iterator</span>
<span class="keyword">typedef</span> ... const_t; <span class="comment">// read-only locator</span>
<span class="keyword">template</span> &lt;<span class="keyword">typename</span> Deref&gt; <span class="keyword">struct </span>add_deref {
<span class="keyword">typedef</span> ... type; <span class="comment">// locator that invokes the Deref dereference object upon pixel access</span>
<span class="keyword">static</span> type make(<span class="keyword">const</span> my_locator&amp; loc, <span class="keyword">const</span> Deref&amp; d);
};
my_locator();
my_locator(<span class="keyword">const</span> my_locator&amp; pl);
<span class="comment">// constructors with dynamic step in y (and x). Only valid for locators with dynamic steps</span>
my_locator(<span class="keyword">const</span> my_locator&amp; loc, coord_t y_step);
my_locator(<span class="keyword">const</span> my_locator&amp; loc, coord_t x_step, coord_t y_step, <span class="keywordtype">bool</span> transpose);
<span class="keywordtype">bool</span> operator==(<span class="keyword">const</span> my_locator&amp; p) <span class="keyword">const</span>;
<span class="comment">// return _references_ to horizontal/vertical iterators. Advancing them moves this locator</span>
x_iterator&amp; x();
y_iterator&amp; y();
x_iterator <span class="keyword">const</span>&amp; x() <span class="keyword">const</span>;
y_iterator <span class="keyword">const</span>&amp; y() <span class="keyword">const</span>;
<span class="comment">// return the vertical distance to another locator. Some models need the horizontal distance to compute it</span>
y_coord_t y_distance_to(<span class="keyword">const</span> my_locator&amp; loc2, x_coord_t xDiff) <span class="keyword">const</span>;
<span class="comment">// return true iff incrementing an x-iterator located at the last column will position it at the first </span>
<span class="comment">// column of the next row. Some models need the image width to determine that.</span>
<span class="keywordtype">bool</span> is_1d_traversable(x_coord_t width) <span class="keyword">const</span>;
};
</pre></div><p>
Models may choose to override some of the functions in the base class with more efficient versions. <table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Types</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e3d00803fa442dc8138e53c6fd6ff551"></a><!-- doxytag: member="boost::gil::pixel_2d_locator_base::x_iterator" ref="e3d00803fa442dc8138e53c6fd6ff551" args="" -->
typedef XIterator&nbsp;</td><td class="memItemRight" valign="bottom"><b>x_iterator</b></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="1c26f78fc975b07e562860c6035b5c77"></a><!-- doxytag: member="boost::gil::pixel_2d_locator_base::y_iterator" ref="1c26f78fc975b07e562860c6035b5c77" args="" -->
typedef YIterator&nbsp;</td><td class="memItemRight" valign="bottom"><b>y_iterator</b></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="8948d7b39ef0dc53a64eeadd1f120236"></a><!-- doxytag: member="boost::gil::pixel_2d_locator_base::value_type" ref="8948d7b39ef0dc53a64eeadd1f120236" args="" -->
typedef std::iterator_traits<br>
&lt; x_iterator &gt;::value_type&nbsp;</td><td class="memItemRight" valign="bottom"><b>value_type</b></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="4c771c6b67581e966f3101a1b89b1984"></a><!-- doxytag: member="boost::gil::pixel_2d_locator_base::reference" ref="4c771c6b67581e966f3101a1b89b1984" args="" -->
typedef std::iterator_traits<br>
&lt; x_iterator &gt;::reference&nbsp;</td><td class="memItemRight" valign="bottom"><b>reference</b></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a5844f24fb8f1a0086e9682b95250cab"></a><!-- doxytag: member="boost::gil::pixel_2d_locator_base::coord_t" ref="a5844f24fb8f1a0086e9682b95250cab" args="" -->
typedef std::iterator_traits<br>
&lt; x_iterator &gt;<br>
::<a class="el" href="g_i_l_0060.html">difference_type</a>&nbsp;</td><td class="memItemRight" valign="bottom"><b>coord_t</b></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="d9fb8862d623c886c8c2afbe30fe386e"></a><!-- doxytag: member="boost::gil::pixel_2d_locator_base::difference_type" ref="d9fb8862d623c886c8c2afbe30fe386e" args="" -->
typedef <a class="el" href="g_i_l_0060.html">point2</a>&lt; coord_t &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><b>difference_type</b></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="da4e134f4052097a3359396e730be85f"></a><!-- doxytag: member="boost::gil::pixel_2d_locator_base::point_t" ref="da4e134f4052097a3359396e730be85f" args="" -->
typedef <a class="el" href="g_i_l_0060.html">difference_type</a>&nbsp;</td><td class="memItemRight" valign="bottom"><b>point_t</b></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="2f949a5fca986fca0058a1d0f288d9cf"></a><!-- doxytag: member="boost::gil::pixel_2d_locator_base::x_coord_t" ref="2f949a5fca986fca0058a1d0f288d9cf" args="" -->
typedef point_t::template axis<br>
&lt; 0 &gt;::coord_t&nbsp;</td><td class="memItemRight" valign="bottom"><b>x_coord_t</b></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="55d7968c5aa5022ee076def9ae3e4c97"></a><!-- doxytag: member="boost::gil::pixel_2d_locator_base::y_coord_t" ref="55d7968c5aa5022ee076def9ae3e4c97" args="" -->
typedef point_t::template axis<br>
&lt; 1 &gt;::coord_t&nbsp;</td><td class="memItemRight" valign="bottom"><b>y_coord_t</b></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="923cc58ccc57319b3b438070df9dbedd"></a><!-- doxytag: member="boost::gil::pixel_2d_locator_base::cached_location_t" ref="923cc58ccc57319b3b438070df9dbedd" args="" -->
typedef <a class="el" href="g_i_l_0060.html">difference_type</a>&nbsp;</td><td class="memItemRight" valign="bottom"><b>cached_location_t</b></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5c6c2fc2ab0d5c3e10c8d78c1d83a5ae"></a><!-- doxytag: member="boost::gil::pixel_2d_locator_base::operator!=" ref="5c6c2fc2ab0d5c3e10c8d78c1d83a5ae" args="(const Loc &amp;p) const " -->
bool&nbsp;</td><td class="memItemRight" valign="bottom"><b>operator!=</b> (const Loc &amp;p) const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a9c85632f9e9074e06d3e5f4e0c46f82"></a><!-- doxytag: member="boost::gil::pixel_2d_locator_base::x_at" ref="a9c85632f9e9074e06d3e5f4e0c46f82" args="(x_coord_t dx, y_coord_t dy) const " -->
x_iterator&nbsp;</td><td class="memItemRight" valign="bottom"><b>x_at</b> (x_coord_t dx, y_coord_t dy) const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e38d5bc61a3101e3bb7bd6ab0ff86e0d"></a><!-- doxytag: member="boost::gil::pixel_2d_locator_base::x_at" ref="e38d5bc61a3101e3bb7bd6ab0ff86e0d" args="(const difference_type &amp;d) const " -->
x_iterator&nbsp;</td><td class="memItemRight" valign="bottom"><b>x_at</b> (const <a class="el" href="g_i_l_0060.html">difference_type</a> &amp;d) const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="10a35d80a9ff2c5888f68527f332add2"></a><!-- doxytag: member="boost::gil::pixel_2d_locator_base::y_at" ref="10a35d80a9ff2c5888f68527f332add2" args="(x_coord_t dx, y_coord_t dy) const " -->
y_iterator&nbsp;</td><td class="memItemRight" valign="bottom"><b>y_at</b> (x_coord_t dx, y_coord_t dy) const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="948188df93afb3e9076013cfb3334618"></a><!-- doxytag: member="boost::gil::pixel_2d_locator_base::y_at" ref="948188df93afb3e9076013cfb3334618" args="(const difference_type &amp;d) const " -->
y_iterator&nbsp;</td><td class="memItemRight" valign="bottom"><b>y_at</b> (const <a class="el" href="g_i_l_0060.html">difference_type</a> &amp;d) const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="54d7a594e81421cf0b5fbd0f0e83bdc8"></a><!-- doxytag: member="boost::gil::pixel_2d_locator_base::xy_at" ref="54d7a594e81421cf0b5fbd0f0e83bdc8" args="(x_coord_t dx, y_coord_t dy) const " -->
Loc&nbsp;</td><td class="memItemRight" valign="bottom"><b>xy_at</b> (x_coord_t dx, y_coord_t dy) const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="8d5c54b73f9efe922043baac745e3676"></a><!-- doxytag: member="boost::gil::pixel_2d_locator_base::xy_at" ref="8d5c54b73f9efe922043baac745e3676" args="(const difference_type &amp;d) const " -->
Loc&nbsp;</td><td class="memItemRight" valign="bottom"><b>xy_at</b> (const <a class="el" href="g_i_l_0060.html">difference_type</a> &amp;d) const </td></tr>
<tr><td class="memTemplParams" nowrap colspan="2"><a class="anchor" name="1c63dd714aee21b469663d1178c954c8"></a><!-- doxytag: member="boost::gil::pixel_2d_locator_base::axis_iterator" ref="1c63dd714aee21b469663d1178c954c8" args="()" -->
template&lt;std::size_t D&gt; </td></tr>
<tr><td class="memTemplItemLeft" nowrap align="right" valign="top">axis&lt; D &gt;::iterator &amp;&nbsp;</td><td class="memTemplItemRight" valign="bottom"><b>axis_iterator</b> ()</td></tr>
<tr><td class="memTemplParams" nowrap colspan="2"><a class="anchor" name="9225fcf12833f4fd4d61b86912cc2967"></a><!-- doxytag: member="boost::gil::pixel_2d_locator_base::axis_iterator" ref="9225fcf12833f4fd4d61b86912cc2967" args="() const " -->
template&lt;std::size_t D&gt; </td></tr>
<tr><td class="memTemplItemLeft" nowrap align="right" valign="top">axis&lt; D &gt;::iterator const &amp;&nbsp;</td><td class="memTemplItemRight" valign="bottom"><b>axis_iterator</b> () const </td></tr>
<tr><td class="memTemplParams" nowrap colspan="2"><a class="anchor" name="ac46b196dfd20e7f9fc71a978b0034d6"></a><!-- doxytag: member="boost::gil::pixel_2d_locator_base::axis_iterator" ref="ac46b196dfd20e7f9fc71a978b0034d6" args="(const point_t &amp;p) const " -->
template&lt;std::size_t D&gt; </td></tr>
<tr><td class="memTemplItemLeft" nowrap align="right" valign="top">axis&lt; D &gt;::iterator&nbsp;</td><td class="memTemplItemRight" valign="bottom"><b>axis_iterator</b> (const <a class="el" href="g_i_l_0060.html">point_t</a> &amp;p) const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="c2e37864c7119a0bfbf5343c4b91db73"></a><!-- doxytag: member="boost::gil::pixel_2d_locator_base::operator()" ref="c2e37864c7119a0bfbf5343c4b91db73" args="(x_coord_t dx, y_coord_t dy) const " -->
reference&nbsp;</td><td class="memItemRight" valign="bottom"><b>operator()</b> (x_coord_t dx, y_coord_t dy) const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="4353d357fd57b04981e3a631b0b79a84"></a><!-- doxytag: member="boost::gil::pixel_2d_locator_base::operator[]" ref="4353d357fd57b04981e3a631b0b79a84" args="(const difference_type &amp;d) const " -->
reference&nbsp;</td><td class="memItemRight" valign="bottom"><b>operator[]</b> (const <a class="el" href="g_i_l_0060.html">difference_type</a> &amp;d) const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a149c2249879e7727f33688b76bf2c99"></a><!-- doxytag: member="boost::gil::pixel_2d_locator_base::operator*" ref="a149c2249879e7727f33688b76bf2c99" args="() const " -->
reference&nbsp;</td><td class="memItemRight" valign="bottom"><b>operator*</b> () const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5183ba70dbe786e8dd0cb258b73ed2d2"></a><!-- doxytag: member="boost::gil::pixel_2d_locator_base::operator+=" ref="5183ba70dbe786e8dd0cb258b73ed2d2" args="(const difference_type &amp;d)" -->
Loc &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><b>operator+=</b> (const <a class="el" href="g_i_l_0060.html">difference_type</a> &amp;d)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e4adb8167f7979861b075323379317de"></a><!-- doxytag: member="boost::gil::pixel_2d_locator_base::operator-=" ref="e4adb8167f7979861b075323379317de" args="(const difference_type &amp;d)" -->
Loc &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><b>operator-=</b> (const <a class="el" href="g_i_l_0060.html">difference_type</a> &amp;d)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="dff47b8c0f4c756c9b4a45888f9a81ce"></a><!-- doxytag: member="boost::gil::pixel_2d_locator_base::operator+" ref="dff47b8c0f4c756c9b4a45888f9a81ce" args="(const difference_type &amp;d) const " -->
Loc&nbsp;</td><td class="memItemRight" valign="bottom"><b>operator+</b> (const <a class="el" href="g_i_l_0060.html">difference_type</a> &amp;d) const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="4e0438f79c980e5eb7bed95560ef516b"></a><!-- doxytag: member="boost::gil::pixel_2d_locator_base::operator-" ref="4e0438f79c980e5eb7bed95560ef516b" args="(const difference_type &amp;d) const " -->
Loc&nbsp;</td><td class="memItemRight" valign="bottom"><b>operator-</b> (const <a class="el" href="g_i_l_0060.html">difference_type</a> &amp;d) const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e448a693f3baaa731f1d70bb48609611"></a><!-- doxytag: member="boost::gil::pixel_2d_locator_base::cache_location" ref="e448a693f3baaa731f1d70bb48609611" args="(const difference_type &amp;d) const " -->
<a class="el" href="g_i_l_0060.html">cached_location_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><b>cache_location</b> (const <a class="el" href="g_i_l_0060.html">difference_type</a> &amp;d) const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="2dafb8db61c81881f0d2d0e264ac8ed6"></a><!-- doxytag: member="boost::gil::pixel_2d_locator_base::cache_location" ref="2dafb8db61c81881f0d2d0e264ac8ed6" args="(x_coord_t dx, y_coord_t dy) const " -->
<a class="el" href="g_i_l_0060.html">cached_location_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><b>cache_location</b> (x_coord_t dx, y_coord_t dy) const </td></tr>
<tr><td colspan="2"><br><h2>Static Public Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="cf81c27b3fffa67d66b47f46979b607e"></a><!-- doxytag: member="boost::gil::pixel_2d_locator_base::num_dimensions" ref="cf81c27b3fffa67d66b47f46979b607e" args="" -->
static const std::size_t&nbsp;</td><td class="memItemRight" valign="bottom"><b>num_dimensions</b> = 2</td></tr>
<tr><td colspan="2"><br><h2>Friends</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="9ba84c0f7be73a7130508a02eefbdad6"></a><!-- doxytag: member="boost::gil::pixel_2d_locator_base::pixel_2d_locator" ref="9ba84c0f7be73a7130508a02eefbdad6" args="" -->
class&nbsp;</td><td class="memItemRight" valign="bottom"><b>pixel_2d_locator</b></td></tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="g_i_l_0236.html">locator.hpp</a></ul>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Sat May 2 13:50:18 2009 for Generic Image Library by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
</body>
</html>