| <!-- 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: kth_semantic_element_type, kth_semantic_element_reference_type, kth_semantic_element_const_reference_type, semantic_at_c</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="contents"> |
| <h1>kth_semantic_element_type, kth_semantic_element_reference_type, kth_semantic_element_const_reference_type, semantic_at_c<br> |
| <small> |
| [<a class="el" href="g_i_l_0105.html">Algorithms and Utility Functions</a>]</small> |
| </h1><hr><a name="_details"></a><h2>Detailed Description</h2> |
| Support for accessing the elements of a color base by semantic index. |
| <p> |
| semantic_at_c: Semantic channel accessors<p> |
| The semantic index of an element is the index of its color in the color space. Semantic indexing allows for proper pairing of elements of color bases independent on their <a class="el" href="g_i_l_0567.html" title="Represents a color space and ordering of channels in memory.">layout</a>. For example, red is the first semantic element of a color base regardless of whether it has an RGB <a class="el" href="g_i_l_0567.html" title="Represents a color space and ordering of channels in memory.">layout</a> or a BGR <a class="el" href="g_i_l_0567.html" title="Represents a color space and ordering of channels in memory.">layout</a>. All GIL color base algorithms taking multiple color bases use semantic indexing to access their elements.<p> |
| Example: <div class="fragment"><pre class="fragment"><span class="comment">// 16-bit BGR pixel, 4 bits for the blue, 3 bits for the green, 2 bits for the red channel and 7 unused bits</span> |
| <span class="keyword">typedef</span> packed_pixel_type<uint16_t, mpl::vector3_c<unsigned,4,3,2>, bgr_layout_t>::type bgr432_pixel_t; |
| |
| <span class="comment">// A reference to its red channel. Although the red channel is the third, its semantic index is 0 in the RGB color space</span> |
| <span class="keyword">typedef</span> kth_semantic_element_reference_type<bgr432_pixel_t, 0>::type red_channel_reference_t; |
| |
| <span class="comment">// Initialize the pixel to black</span> |
| bgr432_pixel_t red_pixel(0,0,0); |
| |
| <span class="comment">// Set the red channel to 100%</span> |
| red_channel_reference_t red_channel = semantic_at_c<0>(red_pixel); |
| red_channel = channel_traits<red_channel_reference_t>::max_value(); |
| </pre></div> |
| <p> |
| <table border="0" cellpadding="0" cellspacing="0"> |
| <tr><td></td></tr> |
| <tr><td colspan="2"><br><h2>Classes</h2></td></tr> |
| <tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="g_i_l_0565.html">kth_semantic_element_type</a></td></tr> |
| |
| <tr><td class="mdescLeft"> </td><td class="mdescRight">Specifies the type of the K-th semantic element of a color base. <a href="g_i_l_0565.html#_details">More...</a><br></td></tr> |
| <tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="g_i_l_0563.html">kth_semantic_element_reference_type</a></td></tr> |
| |
| <tr><td class="mdescLeft"> </td><td class="mdescRight">Specifies the return type of the mutable semantic_at_c<K>(color_base);. <a href="g_i_l_0563.html#_details">More...</a><br></td></tr> |
| <tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="g_i_l_0561.html">kth_semantic_element_const_reference_type</a></td></tr> |
| |
| <tr><td class="mdescLeft"> </td><td class="mdescRight">Specifies the return type of the constant semantic_at_c<K>(color_base);. <a href="g_i_l_0561.html#_details">More...</a><br></td></tr> |
| <tr><td colspan="2"><br><h2>Functions</h2></td></tr> |
| <tr><td class="memTemplParams" nowrap colspan="2"><a class="anchor" name="g2cdd9bfd1b27576659b8c79a3a0233de"></a><!-- doxytag: member="ColorBaseAlgorithmSemanticAtC::semantic_at_c" ref="g2cdd9bfd1b27576659b8c79a3a0233de" args="(ColorBase &p)" --> |
| template<int K, typename ColorBase> </td></tr> |
| <tr><td class="memTemplItemLeft" nowrap align="right" valign="top">disable_if< is_const<br> |
| < ColorBase >, typename <br> |
| kth_semantic_element_reference_type<br> |
| < ColorBase, K >::type >::type </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="g_i_l_0114.html#g2cdd9bfd1b27576659b8c79a3a0233de">semantic_at_c</a> (ColorBase &p)</td></tr> |
| |
| <tr><td class="mdescLeft"> </td><td class="mdescRight">A mutable accessor to the K-th semantic element of a color base. <br></td></tr> |
| <tr><td class="memTemplParams" nowrap colspan="2"><a class="anchor" name="gba9e03ce04fda71e2e840c10325b8b11"></a><!-- doxytag: member="ColorBaseAlgorithmSemanticAtC::semantic_at_c" ref="gba9e03ce04fda71e2e840c10325b8b11" args="(const ColorBase &p)" --> |
| template<int K, typename ColorBase> </td></tr> |
| <tr><td class="memTemplItemLeft" nowrap align="right" valign="top">kth_semantic_element_const_reference_type<br> |
| < ColorBase, K >::type </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="g_i_l_0114.html#gba9e03ce04fda71e2e840c10325b8b11">semantic_at_c</a> (const ColorBase &p)</td></tr> |
| |
| <tr><td class="mdescLeft"> </td><td class="mdescRight">A constant accessor to the K-th semantic element of a color base. <br></td></tr> |
| </table> |
| </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> |