]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | <!-- Copyright 2008 Lubomir Bourdev and Hailin Jin |
2 | ||
3 | Distributed under the Boost Software License, Version 1.0. | |
4 | (See accompanying file LICENSE_1_0.txt or copy at | |
5 | http://www.boost.org/LICENSE_1_0.txt) | |
6 | --> | |
7 | ||
8 | <!-- | |
9 | Copyright 2005-2007 Adobe Systems Incorporated | |
10 | Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt | |
11 | or a copy at http://stlab.adobe.com/licenses.html) | |
12 | ||
13 | Some files are held under additional license. | |
14 | Please see "http://stlab.adobe.com/licenses.html" for more information. | |
15 | --> | |
16 | ||
17 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
18 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
19 | <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> | |
20 | ||
21 | <head> | |
22 | <TITLE>Generic Image Library: planar_pixel_reference.hpp Source File</TITLE> | |
23 | <META HTTP-EQUIV="content-type" CONTENT="text/html;charset=ISO-8859-1"/> | |
24 | <LINK TYPE="text/css" REL="stylesheet" HREF="adobe_source.css"/> | |
25 | </head> | |
26 | <body> | |
27 | <table border="0" cellspacing="0" cellpadding="0" style='width: 100%; margin: 0; padding: 0'><tr> | |
28 | <td width="100%" valign="top" style='padding-left: 10px; padding-right: 10px; padding-bottom: 10px'> | |
29 | <div class="qindex"><a class="qindex" href="index.html">Modules</a> | |
30 | | <a class="qindex" href="classes.html">Alphabetical List</a> | |
31 | | <a class="qindex" href="annotated.html">Class List</a> | |
32 | | <a class="qindex" href="dirs.html">Directories</a> | |
33 | | <a class="qindex" href="files.html">File List</a> | |
34 | | <a class="qindex" href="../index.html">GIL Home Page</a> | |
35 | </div> | |
36 | <!-- End Header --> | |
37 | <!-- Generated by Doxygen 1.5.6 --> | |
38 | <div class="navpath"><a class="el" href="g_i_l_0076.html">boost</a> » <a class="el" href="g_i_l_0079.html">gil</a> | |
39 | </div> | |
40 | <div class="contents"> | |
41 | <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> | |
42 | <a name="l00002"></a>00002 <span class="comment"> Copyright 2005-2007 Adobe Systems Incorporated</span> | |
43 | <a name="l00003"></a>00003 <span class="comment"> </span> | |
44 | <a name="l00004"></a>00004 <span class="comment"> Use, modification and distribution are subject to the Boost Software License,</span> | |
45 | <a name="l00005"></a>00005 <span class="comment"> Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at</span> | |
46 | <a name="l00006"></a>00006 <span class="comment"> http://www.boost.org/LICENSE_1_0.txt).</span> | |
47 | <a name="l00007"></a>00007 <span class="comment"></span> | |
48 | <a name="l00008"></a>00008 <span class="comment"> See http://stlab.adobe.com/gil for most recent version including documentation.</span> | |
49 | <a name="l00009"></a>00009 <span class="comment">*/</span> | |
50 | <a name="l00010"></a>00010 | |
51 | <a name="l00011"></a>00011 <span class="comment">/*************************************************************************************************/</span> | |
52 | <a name="l00012"></a>00012 | |
53 | <a name="l00013"></a>00013 <span class="preprocessor">#ifndef GIL_PLANAR_REF_H</span> | |
54 | <a name="l00014"></a>00014 <span class="preprocessor"></span><span class="preprocessor">#define GIL_PLANAR_REF_H</span> | |
55 | <a name="l00015"></a>00015 <span class="preprocessor"></span> | |
56 | <a name="l00024"></a>00024 | |
57 | <a name="l00025"></a>00025 <span class="preprocessor">#include <boost/mpl/range_c.hpp></span> | |
58 | <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> | |
59 | <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> | |
60 | <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> | |
61 | <a name="l00029"></a>00029 <span class="preprocessor">#include "<a class="code" href="channel_8hpp.html" title="Channel utilities.">channel.hpp</a>"</span> | |
62 | <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> | |
63 | <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> | |
64 | <a name="l00032"></a>00032 | |
65 | <a name="l00033"></a>00033 <span class="keyword">namespace </span>boost { <span class="keyword">namespace </span>gil { | |
66 | <a name="l00034"></a>00034 | |
67 | <a name="l00039"></a>00039 | |
68 | <a name="l00043"></a>00043 | |
69 | <a name="l00044"></a>00044 | |
70 | <a name="l00050"></a>00050 <span class="keyword">template</span> <<span class="keyword">typename</span> ChannelReference, <span class="keyword">typename</span> ColorSpace> <span class="comment">// ChannelReference is a channel reference (const or mutable)</span> | |
71 | <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> | |
72 | <a name="l00052"></a>00052 : <span class="keyword">public</span> detail::homogeneous_color_base<ChannelReference,layout<ColorSpace>,mpl::size<ColorSpace>::value> { | |
73 | <a name="l00053"></a>00053 <span class="keyword">typedef</span> detail::homogeneous_color_base<ChannelReference,layout<ColorSpace>,mpl::size<ColorSpace>::value> parent_t; | |
74 | <a name="l00054"></a>00054 <span class="keyword">private</span>: | |
75 | <a name="l00055"></a>00055 <span class="comment">// These three are only defined for homogeneous pixels</span> | |
76 | <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<ChannelReference>::value_type</a> channel_t; | |
77 | <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<ChannelReference>::const_reference</a> channel_const_reference; | |
78 | <a name="l00058"></a>00058 <span class="keyword">public</span>: | |
79 | <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<ChannelReference>::is_mutable</a>); | |
80 | <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<channel_t,layout<ColorSpace></a> > <a class="code" href="g_i_l_0599.html" title="Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept...">value_type</a>; | |
81 | <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>; | |
82 | <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<channel_const_reference,ColorSpace></a> <a class="code" href="g_i_l_0611.html" title="A reference proxy to a planar pixel. Models: HomogeneousColorBaseConcept, HomogeneousPixelConcept...">const_reference</a>; | |
83 | <a name="l00063"></a>00063 | |
84 | <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) {} | |
85 | <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) {} | |
86 | <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) {} | |
87 | <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) {} | |
88 | <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) {} | |
89 | <a name="l00069"></a>00069 | |
90 | <a name="l00070"></a>00070 <span class="keyword">template</span> <<span class="keyword">typename</span> P> <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& p) : parent_t(p) { check_compatible<P>();} | |
91 | <a name="l00071"></a>00071 | |
92 | <a name="l00072"></a>00072 <span class="comment">// PERFORMANCE_CHECK: Is this constructor necessary?</span> | |
93 | <a name="l00073"></a>00073 <span class="keyword">template</span> <<span class="keyword">typename</span> ChannelV, <span class="keyword">typename</span> Mapping> | |
94 | <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><ChannelV,<a class="code" href="g_i_l_0567.html" title="Represents a color space and ordering of channels in memory.">layout<ColorSpace,Mapping></a> >& p) : parent_t(p) { check_compatible<pixel<ChannelV,layout<ColorSpace,Mapping> > >();} | |
95 | <a name="l00075"></a>00075 | |
96 | <a name="l00076"></a>00076 <span class="comment">// Construct at offset from a given location</span> | |
97 | <a name="l00077"></a>00077 <span class="keyword">template</span> <<span class="keyword">typename</span> ChannelPtr> <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<ChannelPtr,ColorSpace></a>& p, std::ptrdiff_t diff) : parent_t(p,diff) {} | |
98 | <a name="l00078"></a>00078 | |
99 | <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>& 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>& p)<span class="keyword"> const </span>{ static_copy(p,*<span class="keyword">this</span>); <span class="keywordflow">return</span> *<span class="keyword">this</span>; } | |
100 | <a name="l00080"></a>00080 <span class="keyword">template</span> <<span class="keyword">typename</span> P> <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=(<span class="keyword">const</span> P& p)<span class="keyword"> const </span>{ check_compatible<P>(); static_copy(p,*<span class="keyword">this</span>); <span class="keywordflow">return</span> *<span class="keyword">this</span>; } | |
101 | <a name="l00081"></a>00081 | |
102 | <a name="l00082"></a>00082 <span class="comment">// This overload is necessary for a compiler implementing Core Issue 574</span> | |
103 | <a name="l00083"></a>00083 <span class="comment">// to prevent generation of an implicit copy assignment operator (the reason</span> | |
104 | <a name="l00084"></a>00084 <span class="comment">// for generating implicit copy assignment operator is that according to</span> | |
105 | <a name="l00085"></a>00085 <span class="comment">// Core Issue 574, a cv-qualified assignment operator is not considered</span> | |
106 | <a name="l00086"></a>00086 <span class="comment">// "copy assignment operator").</span> | |
107 | <a name="l00087"></a>00087 <span class="comment">// EDG implemented Core Issue 574 starting with EDG Version 3.8. I'm not</span> | |
108 | <a name="l00088"></a>00088 <span class="comment">// sure why they did it for a template member function as well.</span> | |
109 | <a name="l00089"></a>00089 <span class="preprocessor">#if BOOST_WORKAROUND(__HP_aCC, >= 61700) || BOOST_WORKAROUND(__INTEL_COMPILER, >= 1000)</span> | |
110 | <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>& 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>& p) { static_copy(p,*<span class="keyword">this</span>); <span class="keywordflow">return</span> *<span class="keyword">this</span>; } | |
111 | <a name="l00091"></a>00091 <span class="keyword">template</span> <<span class="keyword">typename</span> P> <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=(<span class="keyword">const</span> P& p) { check_compatible<P>(); static_copy(p,*<span class="keyword">this</span>); <span class="keywordflow">return</span> *<span class="keyword">this</span>; } | |
112 | <a name="l00092"></a>00092 <span class="preprocessor">#endif</span> | |
113 | <a name="l00093"></a>00093 <span class="preprocessor"></span> | |
114 | <a name="l00094"></a>00094 <span class="keyword">template</span> <<span class="keyword">typename</span> P> <span class="keywordtype">bool</span> operator==(<span class="keyword">const</span> P& p)<span class="keyword"> const </span>{ check_compatible<P>(); <span class="keywordflow">return</span> static_equal(*<span class="keyword">this</span>,p); } | |
115 | <a name="l00095"></a>00095 <span class="keyword">template</span> <<span class="keyword">typename</span> P> <span class="keywordtype">bool</span> operator!=(<span class="keyword">const</span> P& p)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> !(*<span class="keyword">this</span>==p); } | |
116 | <a name="l00096"></a>00096 | |
117 | <a name="l00097"></a>00097 ChannelReference operator[](std::size_t i)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> this->at_c_dynamic(i); } | |
118 | <a name="l00098"></a>00098 | |
119 | <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->()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="keyword">this</span>; } | |
120 | <a name="l00100"></a>00100 <span class="keyword">private</span>: | |
121 | <a name="l00101"></a>00101 <span class="keyword">template</span> <<span class="keyword">typename</span> Pixel> <span class="keyword">static</span> <span class="keywordtype">void</span> check_compatible() { gil_function_requires<PixelsCompatibleConcept<Pixel,planar_pixel_reference> >(); } | |
122 | <a name="l00102"></a>00102 }; | |
123 | <a name="l00103"></a>00103 | |
124 | <a name="l00105"></a>00105 <span class="comment">// ColorBasedConcept</span> | |
125 | <a name="l00107"></a>00107 <span class="comment"></span> | |
126 | <a name="l00108"></a>00108 <span class="keyword">template</span> <<span class="keyword">typename</span> ChannelReference, <span class="keyword">typename</span> ColorSpace, <span class="keywordtype">int</span> K> | |
127 | <a name="l00109"></a>00109 <span class="keyword">struct </span>kth_element_type<<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,ColorSpace>, K> { | |
128 | <a name="l00110"></a>00110 <span class="keyword">typedef</span> ChannelReference type; | |
129 | <a name="l00111"></a>00111 }; | |
130 | <a name="l00112"></a>00112 | |
131 | <a name="l00113"></a>00113 <span class="keyword">template</span> <<span class="keyword">typename</span> ChannelReference, <span class="keyword">typename</span> ColorSpace, <span class="keywordtype">int</span> K> | |
132 | <a name="l00114"></a>00114 <span class="keyword">struct </span>kth_element_reference_type<planar_pixel_reference<ChannelReference,ColorSpace>, K> { | |
133 | <a name="l00115"></a>00115 <span class="keyword">typedef</span> ChannelReference type; | |
134 | <a name="l00116"></a>00116 }; | |
135 | <a name="l00117"></a>00117 | |
136 | <a name="l00118"></a>00118 <span class="keyword">template</span> <<span class="keyword">typename</span> ChannelReference, <span class="keyword">typename</span> ColorSpace, <span class="keywordtype">int</span> K> | |
137 | <a name="l00119"></a>00119 <span class="keyword">struct </span>kth_element_const_reference_type<planar_pixel_reference<ChannelReference,ColorSpace>, K> | |
138 | <a name="l00120"></a>00120 : <span class="keyword">public</span> add_reference<typename add_const<ChannelReference>::type> | |
139 | <a name="l00121"></a>00121 { | |
140 | <a name="l00122"></a>00122 <span class="comment">// typedef typename channel_traits<ChannelReference>::const_reference type;</span> | |
141 | <a name="l00123"></a>00123 }; | |
142 | <a name="l00124"></a>00124 | |
143 | <a name="l00126"></a>00126 <span class="comment">// PixelConcept</span> | |
144 | <a name="l00128"></a>00128 <span class="comment"></span> | |
145 | <a name="l00131"></a>00131 <span class="keyword">template</span> <<span class="keyword">typename</span> ChannelReference, <span class="keyword">typename</span> ColorSpace> | |
146 | <a name="l00132"></a><a class="code" href="g_i_l_0543.html">00132</a> <span class="keyword">struct </span>is_pixel< <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,ColorSpace> > : <span class="keyword">public</span> mpl::true_{}; | |
147 | <a name="l00133"></a>00133 | |
148 | <a name="l00135"></a>00135 <span class="comment">// HomogeneousPixelBasedConcept</span> | |
149 | <a name="l00137"></a>00137 <span class="comment"></span> | |
150 | <a name="l00140"></a>00140 <span class="keyword">template</span> <<span class="keyword">typename</span> ChannelReference, <span class="keyword">typename</span> ColorSpace> | |
151 | <a name="l00141"></a><a class="code" href="g_i_l_0445.html">00141</a> <span class="keyword">struct </span>color_space_type<<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,ColorSpace> > { | |
152 | <a name="l00142"></a>00142 <span class="keyword">typedef</span> ColorSpace type; | |
153 | <a name="l00143"></a>00143 }; | |
154 | <a name="l00144"></a>00144 | |
155 | <a name="l00147"></a>00147 <span class="keyword">template</span> <<span class="keyword">typename</span> ChannelReference, <span class="keyword">typename</span> ColorSpace> | |
156 | <a name="l00148"></a><a class="code" href="g_i_l_0418.html">00148</a> <span class="keyword">struct </span>channel_mapping_type<<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,ColorSpace> > { | |
157 | <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<ColorSpace>::channel_mapping_t</a> type; | |
158 | <a name="l00150"></a>00150 }; | |
159 | <a name="l00151"></a>00151 | |
160 | <a name="l00154"></a>00154 <span class="keyword">template</span> <<span class="keyword">typename</span> ChannelReference, <span class="keyword">typename</span> ColorSpace> | |
161 | <a name="l00155"></a><a class="code" href="g_i_l_0544.html">00155</a> <span class="keyword">struct </span>is_planar<<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,ColorSpace> > : mpl::true_ {}; | |
162 | <a name="l00156"></a>00156 | |
163 | <a name="l00159"></a>00159 <span class="keyword">template</span> <<span class="keyword">typename</span> ChannelReference, <span class="keyword">typename</span> ColorSpace> | |
164 | <a name="l00160"></a><a class="code" href="g_i_l_0431.html">00160</a> <span class="keyword">struct </span>channel_type<<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,ColorSpace> > { | |
165 | <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<ChannelReference>::value_type</a> type; | |
166 | <a name="l00162"></a>00162 }; | |
167 | <a name="l00163"></a>00163 | |
168 | <a name="l00164"></a>00164 } } <span class="comment">// namespace boost::gil</span> | |
169 | <a name="l00165"></a>00165 | |
170 | <a name="l00166"></a>00166 <span class="keyword">namespace </span>std { | |
171 | <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> | |
172 | <a name="l00168"></a>00168 <span class="comment">// swap with 'left bias': </span> | |
173 | <a name="l00169"></a>00169 <span class="comment">// - swap between proxy and anything</span> | |
174 | <a name="l00170"></a>00170 <span class="comment">// - swap between value type and proxy</span> | |
175 | <a name="l00171"></a>00171 <span class="comment">// - swap between proxy and proxy</span> | |
176 | <a name="l00172"></a>00172 <span class="comment">// Having three overloads allows us to swap between different (but compatible) models of PixelConcept</span> | |
177 | <a name="l00173"></a>00173 | |
178 | <a name="l00176"></a>00176 <span class="keyword">template</span> <<span class="keyword">typename</span> CR, <span class="keyword">typename</span> CS, <span class="keyword">typename</span> R> <span class="keyword">inline</span> | |
179 | <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<CR,CS></a> x, R& y) { | |
180 | <a name="l00178"></a>00178 boost::gil::swap_proxy<typename boost::gil::planar_pixel_reference<CR,CS>::value_type>(x,y); | |
181 | <a name="l00179"></a>00179 } | |
182 | <a name="l00180"></a>00180 | |
183 | <a name="l00181"></a>00181 | |
184 | <a name="l00184"></a>00184 <span class="keyword">template</span> <<span class="keyword">typename</span> CR, <span class="keyword">typename</span> CS> <span class="keyword">inline</span> | |
185 | <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<CR,CS>::value_type</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<CR,CS></a> y) { | |
186 | <a name="l00186"></a>00186 boost::gil::swap_proxy<typename boost::gil::planar_pixel_reference<CR,CS>::value_type>(x,y); | |
187 | <a name="l00187"></a>00187 } | |
188 | <a name="l00188"></a>00188 | |
189 | <a name="l00189"></a>00189 | |
190 | <a name="l00192"></a>00192 <span class="keyword">template</span> <<span class="keyword">typename</span> CR, <span class="keyword">typename</span> CS> <span class="keyword">inline</span> | |
191 | <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<CR,CS></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<CR,CS></a> y) { | |
192 | <a name="l00194"></a>00194 boost::gil::swap_proxy<typename boost::gil::planar_pixel_reference<CR,CS>::value_type>(x,y); | |
193 | <a name="l00195"></a>00195 } | |
194 | <a name="l00196"></a>00196 } <span class="comment">// namespace std</span> | |
195 | <a name="l00197"></a>00197 | |
196 | <a name="l00198"></a>00198 <span class="preprocessor">#endif</span> | |
197 | </pre></div></div> | |
198 | <hr size="1"><address style="text-align: right;"><small>Generated on Sat May 2 13:50:14 2009 for Generic Image Library by | |
199 | <a href="http://www.doxygen.org/index.html"> | |
200 | <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address> | |
201 | </body> | |
202 | </html> |