blob: 0b63b10822324b5cf454b61c25f0b9525cb8d47b [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: planar_pixel_reference.hpp Source File</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="g_i_l_0076.html">boost</a>&nbsp;&raquo&nbsp;<a class="el" href="g_i_l_0079.html">gil</a>
</div>
<div class="contents">
<h1>planar_pixel_reference.hpp</h1><a href="g_i_l_0249.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> Copyright 2005-2007 Adobe Systems Incorporated</span>
<a name="l00003"></a>00003 <span class="comment"> </span>
<a name="l00004"></a>00004 <span class="comment"> Use, modification and distribution are subject to the Boost Software License,</span>
<a name="l00005"></a>00005 <span class="comment"> Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at</span>
<a name="l00006"></a>00006 <span class="comment"> http://www.boost.org/LICENSE_1_0.txt).</span>
<a name="l00007"></a>00007 <span class="comment"></span>
<a name="l00008"></a>00008 <span class="comment"> See http://stlab.adobe.com/gil for most recent version including documentation.</span>
<a name="l00009"></a>00009 <span class="comment">*/</span>
<a name="l00010"></a>00010
<a name="l00011"></a>00011 <span class="comment">/*************************************************************************************************/</span>
<a name="l00012"></a>00012
<a name="l00013"></a>00013 <span class="preprocessor">#ifndef GIL_PLANAR_REF_H</span>
<a name="l00014"></a>00014 <span class="preprocessor"></span><span class="preprocessor">#define GIL_PLANAR_REF_H</span>
<a name="l00015"></a>00015 <span class="preprocessor"></span>
<a name="l00024"></a>00024
<a name="l00025"></a>00025 <span class="preprocessor">#include &lt;boost/mpl/range_c.hpp&gt;</span>
<a name="l00026"></a>00026 <span class="preprocessor">#include "<a class="code" href="g_i_l_0094.html" title="GIL configuration file.">gil_config.hpp</a>"</span>
<a name="l00027"></a>00027 <span class="preprocessor">#include "<a class="code" href="g_i_l_0092.html" title="Concept check classes for GIL concepts.">gil_concept.hpp</a>"</span>
<a name="l00028"></a>00028 <span class="preprocessor">#include "<a class="code" href="g_i_l_0067.html" title="pixel class and related utilities">color_base.hpp</a>"</span>
<a name="l00029"></a>00029 <span class="preprocessor">#include "<a class="code" href="channel_8hpp.html" title="Channel utilities.">channel.hpp</a>"</span>
<a name="l00030"></a>00030 <span class="preprocessor">#include "<a class="code" href="pixel_8hpp.html" title="pixel class and related utilities">pixel.hpp</a>"</span>
<a name="l00031"></a>00031 <span class="preprocessor">#include "<a class="code" href="g_i_l_0247.html" title="planar pixel pointer class">planar_pixel_iterator.hpp</a>"</span>
<a name="l00032"></a>00032
<a name="l00033"></a>00033 <span class="keyword">namespace </span>boost { <span class="keyword">namespace </span>gil {
<a name="l00034"></a>00034
<a name="l00039"></a>00039
<a name="l00043"></a>00043
<a name="l00044"></a>00044
<a name="l00050"></a>00050 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ChannelReference, <span class="keyword">typename</span> ColorSpace&gt; <span class="comment">// ChannelReference is a channel reference (const or mutable)</span>
<a name="l00051"></a><a class="code" href="g_i_l_0611.html">00051</a> <span class="keyword">struct </span><a class="code" href="g_i_l_0611.html" title="A reference proxy to a planar pixel. Models: HomogeneousColorBaseConcept, HomogeneousPixelConcept...">planar_pixel_reference</a>
<a name="l00052"></a>00052 : <span class="keyword">public</span> detail::homogeneous_color_base&lt;ChannelReference,layout&lt;ColorSpace&gt;,mpl::size&lt;ColorSpace&gt;::value&gt; {
<a name="l00053"></a>00053 <span class="keyword">typedef</span> detail::homogeneous_color_base&lt;ChannelReference,layout&lt;ColorSpace&gt;,mpl::size&lt;ColorSpace&gt;::value&gt; parent_t;
<a name="l00054"></a>00054 <span class="keyword">private</span>:
<a name="l00055"></a>00055 <span class="comment">// These three are only defined for homogeneous pixels</span>
<a name="l00056"></a>00056 <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="g_i_l_0429.html" title="Traits for channels. Contains the following members:.">channel_traits&lt;ChannelReference&gt;::value_type</a> channel_t;
<a name="l00057"></a>00057 <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="g_i_l_0429.html" title="Traits for channels. Contains the following members:.">channel_traits&lt;ChannelReference&gt;::const_reference</a> channel_const_reference;
<a name="l00058"></a>00058 <span class="keyword">public</span>:
<a name="l00059"></a>00059 BOOST_STATIC_CONSTANT(<span class="keywordtype">bool</span>, is_mutable = <a class="code" href="g_i_l_0429.html" title="Traits for channels. Contains the following members:.">channel_traits&lt;ChannelReference&gt;::is_mutable</a>);
<a name="l00060"></a>00060 <span class="keyword">typedef</span> <a class="code" href="g_i_l_0599.html" title="Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept...">pixel&lt;channel_t,layout&lt;ColorSpace&gt;</a> &gt; <a class="code" href="g_i_l_0599.html" title="Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept...">value_type</a>;
<a name="l00061"></a>00061 <span class="keyword">typedef</span> <a class="code" href="g_i_l_0611.html" title="A reference proxy to a planar pixel. Models: HomogeneousColorBaseConcept, HomogeneousPixelConcept...">planar_pixel_reference</a> <a class="code" href="g_i_l_0611.html" title="A reference proxy to a planar pixel. Models: HomogeneousColorBaseConcept, HomogeneousPixelConcept...">reference</a>;
<a name="l00062"></a>00062 <span class="keyword">typedef</span> <a class="code" href="g_i_l_0611.html" title="A reference proxy to a planar pixel. Models: HomogeneousColorBaseConcept, HomogeneousPixelConcept...">planar_pixel_reference&lt;channel_const_reference,ColorSpace&gt;</a> <a class="code" href="g_i_l_0611.html" title="A reference proxy to a planar pixel. Models: HomogeneousColorBaseConcept, HomogeneousPixelConcept...">const_reference</a>;
<a name="l00063"></a>00063
<a name="l00064"></a>00064 <a class="code" href="g_i_l_0611.html" title="A reference proxy to a planar pixel. Models: HomogeneousColorBaseConcept, HomogeneousPixelConcept...">planar_pixel_reference</a>(ChannelReference v0, ChannelReference v1) : parent_t(v0,v1) {}
<a name="l00065"></a>00065 <a class="code" href="g_i_l_0611.html" title="A reference proxy to a planar pixel. Models: HomogeneousColorBaseConcept, HomogeneousPixelConcept...">planar_pixel_reference</a>(ChannelReference v0, ChannelReference v1, ChannelReference v2) : parent_t(v0,v1,v2) {}
<a name="l00066"></a>00066 <a class="code" href="g_i_l_0611.html" title="A reference proxy to a planar pixel. Models: HomogeneousColorBaseConcept, HomogeneousPixelConcept...">planar_pixel_reference</a>(ChannelReference v0, ChannelReference v1, ChannelReference v2, ChannelReference v3) : parent_t(v0,v1,v2,v3) {}
<a name="l00067"></a>00067 <a class="code" href="g_i_l_0611.html" title="A reference proxy to a planar pixel. Models: HomogeneousColorBaseConcept, HomogeneousPixelConcept...">planar_pixel_reference</a>(ChannelReference v0, ChannelReference v1, ChannelReference v2, ChannelReference v3, ChannelReference v4) : parent_t(v0,v1,v2,v3,v4) {}
<a name="l00068"></a>00068 <a class="code" href="g_i_l_0611.html" title="A reference proxy to a planar pixel. Models: HomogeneousColorBaseConcept, HomogeneousPixelConcept...">planar_pixel_reference</a>(ChannelReference v0, ChannelReference v1, ChannelReference v2, ChannelReference v3, ChannelReference v4, ChannelReference v5) : parent_t(v0,v1,v2,v3,v4,v5) {}
<a name="l00069"></a>00069
<a name="l00070"></a>00070 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> P&gt; <a class="code" href="g_i_l_0611.html" title="A reference proxy to a planar pixel. Models: HomogeneousColorBaseConcept, HomogeneousPixelConcept...">planar_pixel_reference</a>(<span class="keyword">const</span> P&amp; p) : parent_t(p) { check_compatible&lt;P&gt;();}
<a name="l00071"></a>00071
<a name="l00072"></a>00072 <span class="comment">// PERFORMANCE_CHECK: Is this constructor necessary?</span>
<a name="l00073"></a>00073 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ChannelV, <span class="keyword">typename</span> Mapping&gt;
<a name="l00074"></a>00074 <a class="code" href="g_i_l_0611.html" title="A reference proxy to a planar pixel. Models: HomogeneousColorBaseConcept, HomogeneousPixelConcept...">planar_pixel_reference</a>(<a class="code" href="g_i_l_0599.html" title="Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept...">pixel</a>&lt;ChannelV,<a class="code" href="g_i_l_0567.html" title="Represents a color space and ordering of channels in memory.">layout&lt;ColorSpace,Mapping&gt;</a> &gt;&amp; p) : parent_t(p) { check_compatible&lt;pixel&lt;ChannelV,layout&lt;ColorSpace,Mapping&gt; &gt; &gt;();}
<a name="l00075"></a>00075
<a name="l00076"></a>00076 <span class="comment">// Construct at offset from a given location</span>
<a name="l00077"></a>00077 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ChannelPtr&gt; <a class="code" href="g_i_l_0611.html" title="A reference proxy to a planar pixel. Models: HomogeneousColorBaseConcept, HomogeneousPixelConcept...">planar_pixel_reference</a>(<span class="keyword">const</span> <a class="code" href="g_i_l_0609.html" title="An iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept...">planar_pixel_iterator&lt;ChannelPtr,ColorSpace&gt;</a>&amp; p, std::ptrdiff_t diff) : parent_t(p,diff) {}
<a name="l00078"></a>00078
<a name="l00079"></a>00079 <span class="keyword">const</span> <a class="code" href="g_i_l_0611.html" title="A reference proxy to a planar pixel. Models: HomogeneousColorBaseConcept, HomogeneousPixelConcept...">planar_pixel_reference</a>&amp; operator=(<span class="keyword">const</span> <a class="code" href="g_i_l_0611.html" title="A reference proxy to a planar pixel. Models: HomogeneousColorBaseConcept, HomogeneousPixelConcept...">planar_pixel_reference</a>&amp; p)<span class="keyword"> const </span>{ static_copy(p,*<span class="keyword">this</span>); <span class="keywordflow">return</span> *<span class="keyword">this</span>; }
<a name="l00080"></a>00080 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> P&gt; <span class="keyword">const</span> <a class="code" href="g_i_l_0611.html" title="A reference proxy to a planar pixel. Models: HomogeneousColorBaseConcept, HomogeneousPixelConcept...">planar_pixel_reference</a>&amp; operator=(<span class="keyword">const</span> P&amp; p)<span class="keyword"> const </span>{ check_compatible&lt;P&gt;(); static_copy(p,*<span class="keyword">this</span>); <span class="keywordflow">return</span> *<span class="keyword">this</span>; }
<a name="l00081"></a>00081
<a name="l00082"></a>00082 <span class="comment">// This overload is necessary for a compiler implementing Core Issue 574</span>
<a name="l00083"></a>00083 <span class="comment">// to prevent generation of an implicit copy assignment operator (the reason</span>
<a name="l00084"></a>00084 <span class="comment">// for generating implicit copy assignment operator is that according to</span>
<a name="l00085"></a>00085 <span class="comment">// Core Issue 574, a cv-qualified assignment operator is not considered</span>
<a name="l00086"></a>00086 <span class="comment">// "copy assignment operator").</span>
<a name="l00087"></a>00087 <span class="comment">// EDG implemented Core Issue 574 starting with EDG Version 3.8. I'm not</span>
<a name="l00088"></a>00088 <span class="comment">// sure why they did it for a template member function as well.</span>
<a name="l00089"></a>00089 <span class="preprocessor">#if BOOST_WORKAROUND(__HP_aCC, &gt;= 61700) || BOOST_WORKAROUND(__INTEL_COMPILER, &gt;= 1000)</span>
<a name="l00090"></a>00090 <span class="preprocessor"></span> <span class="keyword">const</span> <a class="code" href="g_i_l_0611.html" title="A reference proxy to a planar pixel. Models: HomogeneousColorBaseConcept, HomogeneousPixelConcept...">planar_pixel_reference</a>&amp; operator=(<span class="keyword">const</span> <a class="code" href="g_i_l_0611.html" title="A reference proxy to a planar pixel. Models: HomogeneousColorBaseConcept, HomogeneousPixelConcept...">planar_pixel_reference</a>&amp; p) { static_copy(p,*<span class="keyword">this</span>); <span class="keywordflow">return</span> *<span class="keyword">this</span>; }
<a name="l00091"></a>00091 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> P&gt; <span class="keyword">const</span> <a class="code" href="g_i_l_0611.html" title="A reference proxy to a planar pixel. Models: HomogeneousColorBaseConcept, HomogeneousPixelConcept...">planar_pixel_reference</a>&amp; operator=(<span class="keyword">const</span> P&amp; p) { check_compatible&lt;P&gt;(); static_copy(p,*<span class="keyword">this</span>); <span class="keywordflow">return</span> *<span class="keyword">this</span>; }
<a name="l00092"></a>00092 <span class="preprocessor">#endif</span>
<a name="l00093"></a>00093 <span class="preprocessor"></span>
<a name="l00094"></a>00094 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> P&gt; <span class="keywordtype">bool</span> operator==(<span class="keyword">const</span> P&amp; p)<span class="keyword"> const </span>{ check_compatible&lt;P&gt;(); <span class="keywordflow">return</span> static_equal(*<span class="keyword">this</span>,p); }
<a name="l00095"></a>00095 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> P&gt; <span class="keywordtype">bool</span> operator!=(<span class="keyword">const</span> P&amp; p)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> !(*<span class="keyword">this</span>==p); }
<a name="l00096"></a>00096
<a name="l00097"></a>00097 ChannelReference operator[](std::size_t i)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> this-&gt;at_c_dynamic(i); }
<a name="l00098"></a>00098
<a name="l00099"></a>00099 <span class="keyword">const</span> <a class="code" href="g_i_l_0611.html" title="A reference proxy to a planar pixel. Models: HomogeneousColorBaseConcept, HomogeneousPixelConcept...">planar_pixel_reference</a>* operator-&gt;()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="keyword">this</span>; }
<a name="l00100"></a>00100 <span class="keyword">private</span>:
<a name="l00101"></a>00101 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> Pixel&gt; <span class="keyword">static</span> <span class="keywordtype">void</span> check_compatible() { gil_function_requires&lt;PixelsCompatibleConcept&lt;Pixel,planar_pixel_reference&gt; &gt;(); }
<a name="l00102"></a>00102 };
<a name="l00103"></a>00103
<a name="l00105"></a>00105 <span class="comment">// ColorBasedConcept</span>
<a name="l00107"></a>00107 <span class="comment"></span>
<a name="l00108"></a>00108 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ChannelReference, <span class="keyword">typename</span> ColorSpace, <span class="keywordtype">int</span> K&gt;
<a name="l00109"></a>00109 <span class="keyword">struct </span>kth_element_type&lt;<a class="code" href="g_i_l_0611.html" title="A reference proxy to a planar pixel. Models: HomogeneousColorBaseConcept, HomogeneousPixelConcept...">planar_pixel_reference</a>&lt;ChannelReference,ColorSpace&gt;, K&gt; {
<a name="l00110"></a>00110 <span class="keyword">typedef</span> ChannelReference type;
<a name="l00111"></a>00111 };
<a name="l00112"></a>00112
<a name="l00113"></a>00113 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ChannelReference, <span class="keyword">typename</span> ColorSpace, <span class="keywordtype">int</span> K&gt;
<a name="l00114"></a>00114 <span class="keyword">struct </span>kth_element_reference_type&lt;planar_pixel_reference&lt;ChannelReference,ColorSpace&gt;, K&gt; {
<a name="l00115"></a>00115 <span class="keyword">typedef</span> ChannelReference type;
<a name="l00116"></a>00116 };
<a name="l00117"></a>00117
<a name="l00118"></a>00118 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ChannelReference, <span class="keyword">typename</span> ColorSpace, <span class="keywordtype">int</span> K&gt;
<a name="l00119"></a>00119 <span class="keyword">struct </span>kth_element_const_reference_type&lt;planar_pixel_reference&lt;ChannelReference,ColorSpace&gt;, K&gt;
<a name="l00120"></a>00120 : <span class="keyword">public</span> add_reference&lt;typename add_const&lt;ChannelReference&gt;::type&gt;
<a name="l00121"></a>00121 {
<a name="l00122"></a>00122 <span class="comment">// typedef typename channel_traits&lt;ChannelReference&gt;::const_reference type;</span>
<a name="l00123"></a>00123 };
<a name="l00124"></a>00124
<a name="l00126"></a>00126 <span class="comment">// PixelConcept</span>
<a name="l00128"></a>00128 <span class="comment"></span>
<a name="l00131"></a>00131 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ChannelReference, <span class="keyword">typename</span> ColorSpace&gt;
<a name="l00132"></a><a class="code" href="g_i_l_0543.html">00132</a> <span class="keyword">struct </span>is_pixel&lt; <a class="code" href="g_i_l_0611.html" title="A reference proxy to a planar pixel. Models: HomogeneousColorBaseConcept, HomogeneousPixelConcept...">planar_pixel_reference</a>&lt;ChannelReference,ColorSpace&gt; &gt; : <span class="keyword">public</span> mpl::true_{};
<a name="l00133"></a>00133
<a name="l00135"></a>00135 <span class="comment">// HomogeneousPixelBasedConcept</span>
<a name="l00137"></a>00137 <span class="comment"></span>
<a name="l00140"></a>00140 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ChannelReference, <span class="keyword">typename</span> ColorSpace&gt;
<a name="l00141"></a><a class="code" href="g_i_l_0445.html">00141</a> <span class="keyword">struct </span>color_space_type&lt;<a class="code" href="g_i_l_0611.html" title="A reference proxy to a planar pixel. Models: HomogeneousColorBaseConcept, HomogeneousPixelConcept...">planar_pixel_reference</a>&lt;ChannelReference,ColorSpace&gt; &gt; {
<a name="l00142"></a>00142 <span class="keyword">typedef</span> ColorSpace type;
<a name="l00143"></a>00143 };
<a name="l00144"></a>00144
<a name="l00147"></a>00147 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ChannelReference, <span class="keyword">typename</span> ColorSpace&gt;
<a name="l00148"></a><a class="code" href="g_i_l_0418.html">00148</a> <span class="keyword">struct </span>channel_mapping_type&lt;<a class="code" href="g_i_l_0611.html" title="A reference proxy to a planar pixel. Models: HomogeneousColorBaseConcept, HomogeneousPixelConcept...">planar_pixel_reference</a>&lt;ChannelReference,ColorSpace&gt; &gt; {
<a name="l00149"></a>00149 <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="g_i_l_0567.html" title="Represents a color space and ordering of channels in memory.">layout&lt;ColorSpace&gt;::channel_mapping_t</a> type;
<a name="l00150"></a>00150 };
<a name="l00151"></a>00151
<a name="l00154"></a>00154 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ChannelReference, <span class="keyword">typename</span> ColorSpace&gt;
<a name="l00155"></a><a class="code" href="g_i_l_0544.html">00155</a> <span class="keyword">struct </span>is_planar&lt;<a class="code" href="g_i_l_0611.html" title="A reference proxy to a planar pixel. Models: HomogeneousColorBaseConcept, HomogeneousPixelConcept...">planar_pixel_reference</a>&lt;ChannelReference,ColorSpace&gt; &gt; : mpl::true_ {};
<a name="l00156"></a>00156
<a name="l00159"></a>00159 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ChannelReference, <span class="keyword">typename</span> ColorSpace&gt;
<a name="l00160"></a><a class="code" href="g_i_l_0431.html">00160</a> <span class="keyword">struct </span>channel_type&lt;<a class="code" href="g_i_l_0611.html" title="A reference proxy to a planar pixel. Models: HomogeneousColorBaseConcept, HomogeneousPixelConcept...">planar_pixel_reference</a>&lt;ChannelReference,ColorSpace&gt; &gt; {
<a name="l00161"></a>00161 <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="g_i_l_0429.html" title="Traits for channels. Contains the following members:.">channel_traits&lt;ChannelReference&gt;::value_type</a> type;
<a name="l00162"></a>00162 };
<a name="l00163"></a>00163
<a name="l00164"></a>00164 } } <span class="comment">// namespace boost::gil</span>
<a name="l00165"></a>00165
<a name="l00166"></a>00166 <span class="keyword">namespace </span>std {
<a name="l00167"></a>00167 <span class="comment">// We are forced to define swap inside std namespace because on some platforms (Visual Studio 8) STL calls swap qualified.</span>
<a name="l00168"></a>00168 <span class="comment">// swap with 'left bias': </span>
<a name="l00169"></a>00169 <span class="comment">// - swap between proxy and anything</span>
<a name="l00170"></a>00170 <span class="comment">// - swap between value type and proxy</span>
<a name="l00171"></a>00171 <span class="comment">// - swap between proxy and proxy</span>
<a name="l00172"></a>00172 <span class="comment">// Having three overloads allows us to swap between different (but compatible) models of PixelConcept</span>
<a name="l00173"></a>00173
<a name="l00176"></a>00176 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> CR, <span class="keyword">typename</span> CS, <span class="keyword">typename</span> R&gt; <span class="keyword">inline</span>
<a name="l00177"></a><a class="code" href="g_i_l_0210.html#g6d999f5f7438cb34d08e8dc5f772534b">00177</a> <span class="keywordtype">void</span> swap(<span class="keyword">const</span> <a class="code" href="g_i_l_0611.html" title="A reference proxy to a planar pixel. Models: HomogeneousColorBaseConcept, HomogeneousPixelConcept...">boost::gil::planar_pixel_reference&lt;CR,CS&gt;</a> x, R&amp; y) {
<a name="l00178"></a>00178 boost::gil::swap_proxy&lt;typename boost::gil::planar_pixel_reference&lt;CR,CS&gt;::value_type&gt;(x,y);
<a name="l00179"></a>00179 }
<a name="l00180"></a>00180
<a name="l00181"></a>00181
<a name="l00184"></a>00184 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> CR, <span class="keyword">typename</span> CS&gt; <span class="keyword">inline</span>
<a name="l00185"></a><a class="code" href="g_i_l_0210.html#gd9a1b6749646bc4cf0032b8a977f7cf1">00185</a> <span class="keywordtype">void</span> swap(<span class="keyword">typename</span> <a class="code" href="g_i_l_0611.html" title="A reference proxy to a planar pixel. Models: HomogeneousColorBaseConcept, HomogeneousPixelConcept...">boost::gil::planar_pixel_reference&lt;CR,CS&gt;::value_type</a>&amp; x, <span class="keyword">const</span> <a class="code" href="g_i_l_0611.html" title="A reference proxy to a planar pixel. Models: HomogeneousColorBaseConcept, HomogeneousPixelConcept...">boost::gil::planar_pixel_reference&lt;CR,CS&gt;</a> y) {
<a name="l00186"></a>00186 boost::gil::swap_proxy&lt;typename boost::gil::planar_pixel_reference&lt;CR,CS&gt;::value_type&gt;(x,y);
<a name="l00187"></a>00187 }
<a name="l00188"></a>00188
<a name="l00189"></a>00189
<a name="l00192"></a>00192 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> CR, <span class="keyword">typename</span> CS&gt; <span class="keyword">inline</span>
<a name="l00193"></a><a class="code" href="g_i_l_0210.html#ge6300a98647b6138a58bd00507f22c87">00193</a> <span class="keywordtype">void</span> swap(<span class="keyword">const</span> <a class="code" href="g_i_l_0611.html" title="A reference proxy to a planar pixel. Models: HomogeneousColorBaseConcept, HomogeneousPixelConcept...">boost::gil::planar_pixel_reference&lt;CR,CS&gt;</a> x, <span class="keyword">const</span> <a class="code" href="g_i_l_0611.html" title="A reference proxy to a planar pixel. Models: HomogeneousColorBaseConcept, HomogeneousPixelConcept...">boost::gil::planar_pixel_reference&lt;CR,CS&gt;</a> y) {
<a name="l00194"></a>00194 boost::gil::swap_proxy&lt;typename boost::gil::planar_pixel_reference&lt;CR,CS&gt;::value_type&gt;(x,y);
<a name="l00195"></a>00195 }
<a name="l00196"></a>00196 } <span class="comment">// namespace std</span>
<a name="l00197"></a>00197
<a name="l00198"></a>00198 <span class="preprocessor">#endif</span>
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>Generated on Sat May 2 13:50:14 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>