<!-- 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: ColorBaseConcept Struct 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_0274.html">ColorBaseConcept</a> </div> <div class="contents"> <h1>ColorBaseConcept Struct Template Reference<br> <small> [<a class="el" href="g_i_l_0117.html">Concepts</a>]</small> </h1><!-- doxytag: class="boost::gil::ColorBaseConcept" --><code>#include <<a class="el" href="g_i_l_0091.html">gil_concept.hpp</a>></code> <p> <p> <a href="g_i_l_0273.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2> <h3>template<typename ColorBase><br> struct boost::gil::ColorBaseConcept< ColorBase ></h3> A color base is a container of color elements (such as channels, channel references or channel pointers). <p> COLOR BASE CONCEPTS The most common use of color base is in the implementation of a <a class="el" href="g_i_l_0599.html" title="Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept...">pixel</a>, in which case the color elements are channel values. The color base concept, however, can be used in other scenarios. For example, a planar <a class="el" href="g_i_l_0599.html" title="Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept...">pixel</a> has channels that are not contiguous in memory. Its reference is a proxy class that uses a color base whose elements are channel references. Its iterator uses a color base whose elements are channel iterators.<p> A color base must have an associated <a class="el" href="g_i_l_0567.html" title="Represents a color space and ordering of channels in memory.">layout</a> (which consists of a color space, as well as an ordering of the channels). There are two ways to index the elements of a color base: A physical index corresponds to the way they are ordered in memory, and a semantic index corresponds to the way the elements are ordered in their color space. For example, in the RGB color space the elements are ordered as {<a class="el" href="g_i_l_0618.html" title="Red.">red_t</a>, <a class="el" href="g_i_l_0537.html" title="Green.">green_t</a>, <a class="el" href="g_i_l_0405.html" title="Blue.">blue_t</a>}. For a color base with a BGR <a class="el" href="g_i_l_0567.html" title="Represents a color space and ordering of channels in memory.">layout</a>, the first element in physical ordering is the blue element, whereas the first semantic element is the red one. Models of <code><a class="el" href="g_i_l_0274.html" title="A color base is a container of color elements (such as channels, channel references...">ColorBaseConcept</a></code> are required to provide the <code>at_c<K>(ColorBase)</code> function, which allows for accessing the elements based on their physical order. GIL provides a <code>semantic_at_c<K>(ColorBase)</code> function (described later) which can operate on any model of <a class="el" href="g_i_l_0274.html" title="A color base is a container of color elements (such as channels, channel references...">ColorBaseConcept</a> and returns the corresponding semantic element.<p> <div class="fragment"><pre class="fragment">concept ColorBaseConcept<typename T> : CopyConstructible<T>, EqualityComparable<T> { <span class="comment">// a GIL layout (the color space and element permutation)</span> <span class="keyword">typename</span> layout_t; <span class="comment">// The type of K-th element</span> <span class="keyword">template</span> <<span class="keywordtype">int</span> K> <span class="keyword">struct </span>kth_element_type; where Metafunction<kth_element_type>; <span class="comment">// The result of at_c</span> <span class="keyword">template</span> <<span class="keywordtype">int</span> K> <span class="keyword">struct </span>kth_element_const_reference_type; where Metafunction<kth_element_const_reference_type>; <span class="keyword">template</span> <<span class="keywordtype">int</span> K> kth_element_const_reference_type<T,K>::type at_c(T); <span class="comment">// Copy-constructible and equality comparable with other compatible color bases</span> <span class="keyword">template</span> <ColorBaseConcept T2> where { ColorBasesCompatibleConcept<T,T2> } T::T(T2); <span class="keyword">template</span> <ColorBaseConcept T2> where { ColorBasesCompatibleConcept<T,T2> } <span class="keywordtype">bool</span> operator==(<span class="keyword">const</span> T&, <span class="keyword">const</span> T2&); <span class="keyword">template</span> <ColorBaseConcept T2> where { ColorBasesCompatibleConcept<T,T2> } <span class="keywordtype">bool</span> operator!=(<span class="keyword">const</span> T&, <span class="keyword">const</span> T2&); }; </pre></div> <table border="0" cellpadding="0" cellspacing="0"> <tr><td></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="b0a0dbf6ca9028bbbb2240cad5882537"></a><!-- doxytag: member="boost::gil::ColorBaseConcept::constraints" ref="b0a0dbf6ca9028bbbb2240cad5882537" args="()" --> void </td><td class="memItemRight" valign="bottom"><b>constraints</b> ()</td></tr> <tr><td colspan="2"><br><h2>Public Attributes</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="36965b52a82be93752886f21e7efcf94"></a><!-- doxytag: member="boost::gil::ColorBaseConcept::cb" ref="36965b52a82be93752886f21e7efcf94" args="" --> ColorBase </td><td class="memItemRight" valign="bottom"><b>cb</b></td></tr> </table> <hr>The documentation for this struct was generated from the following file:<ul> <li><a class="el" href="g_i_l_0091.html">gil_concept.hpp</a></ul> </div> <hr size="1"><address style="text-align: right;"><small>Generated on Sat May 2 13:50:17 2009 for Generic Image Library by <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>