blob: 5e0a64e02776c9d56337cd59eee920bf185393d0 [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: 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 &lt;<a class="el" href="g_i_l_0091.html">gil_concept.hpp</a>&gt;</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&lt;typename ColorBase&gt;<br>
struct boost::gil::ColorBaseConcept&lt; ColorBase &gt;</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&lt;K&gt;(ColorBase)</code> function, which allows for accessing the elements based on their physical order. GIL provides a <code>semantic_at_c&lt;K&gt;(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&lt;typename T&gt; : CopyConstructible&lt;T&gt;, EqualityComparable&lt;T&gt; {
<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> &lt;<span class="keywordtype">int</span> K&gt; <span class="keyword">struct </span>kth_element_type; where Metafunction&lt;kth_element_type&gt;;
<span class="comment">// The result of at_c</span>
<span class="keyword">template</span> &lt;<span class="keywordtype">int</span> K&gt; <span class="keyword">struct </span>kth_element_const_reference_type; where Metafunction&lt;kth_element_const_reference_type&gt;;
<span class="keyword">template</span> &lt;<span class="keywordtype">int</span> K&gt; kth_element_const_reference_type&lt;T,K&gt;::type at_c(T);
<span class="comment">// Copy-constructible and equality comparable with other compatible color bases</span>
<span class="keyword">template</span> &lt;ColorBaseConcept T2&gt; where { ColorBasesCompatibleConcept&lt;T,T2&gt; }
T::T(T2);
<span class="keyword">template</span> &lt;ColorBaseConcept T2&gt; where { ColorBasesCompatibleConcept&lt;T,T2&gt; }
<span class="keywordtype">bool</span> operator==(<span class="keyword">const</span> T&amp;, <span class="keyword">const</span> T2&amp;);
<span class="keyword">template</span> &lt;ColorBaseConcept T2&gt; where { ColorBasesCompatibleConcept&lt;T,T2&gt; }
<span class="keywordtype">bool</span> operator!=(<span class="keyword">const</span> T&amp;, <span class="keyword">const</span> T2&amp;);
};
</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&nbsp;</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&nbsp;</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&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>