Imported Upstream version 1.72.0
[platform/upstream/boost.git] / libs / gil / doc / html / reference / group___color_base_algorithm_semantic_at_c.html
1 <!-- HTML header for doxygen 1.8.13-->
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4   <head>
5     <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
6     <meta http-equiv="X-UA-Compatible" content="IE=9"/>
7     <meta name="generator" content="Doxygen 1.8.15"/>
8     <meta name="viewport" content="width=device-width, initial-scale=1"/>
9     <title>Generic Image Library: kth_semantic_element_type, kth_semantic_element_reference_type, kth_semantic_element_const_reference_type, semantic_at_c</title>
10     <link href="tabs.css" rel="stylesheet" type="text/css"/>
11     <script type="text/javascript" src="jquery.js"></script>
12     <script type="text/javascript" src="dynsections.js"></script>
13     <link href="doxygen.css" rel="stylesheet" type="text/css" />
14     <link href="doxygen-boost.css" rel="stylesheet" type="text/css"/>
15   </head>
16   <body>
17     <div class="boost-header">
18       <table border="0" cellpadding="7" cellspacing="0" width="100%" summary="header">
19         <tr>
20           <td valign="top" width="300">
21             <h3><a href="../index.html"><img alt="Boost GIL" src="../_static/gil.png" border="0"></a></h3>
22           </td>
23           <td ><h1 align="center"><a href="../index.html"></a></h1></td>
24           <td></td>
25         </tr>
26       </table>
27     </div>
28     <hr/>
29     <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
30 <!-- Generated by Doxygen 1.8.15 -->
31 <script type="text/javascript" src="menudata.js"></script>
32 <script type="text/javascript" src="menu.js"></script>
33 <script type="text/javascript">
34 /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
35 $(function() {
36   initMenu('',false,false,'search.php','Search');
37 });
38 /* @license-end */</script>
39 <div id="main-nav"></div>
40 </div><!-- top -->
41 <div class="header">
42   <div class="summary">
43 <a href="#nested-classes">Classes</a> &#124;
44 <a href="#func-members">Functions</a>  </div>
45   <div class="headertitle">
46 <div class="title">kth_semantic_element_type, kth_semantic_element_reference_type, kth_semantic_element_const_reference_type, semantic_at_c<div class="ingroups"><a class="el" href="group___color_base.html">ColorBase</a> &raquo; <a class="el" href="group___color_base_algorithm.html">Algorithms and Utility Functions</a></div></div>  </div>
47 </div><!--header-->
48 <div class="contents">
49
50 <p>semantic_at_c: Semantic channel accessors  
51 <a href="#details">More...</a></p>
52 <table class="memberdecls">
53 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
54 Classes</h2></td></tr>
55 <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structboost_1_1gil_1_1kth__semantic__element__type.html">kth_semantic_element_type&lt; ColorBase, K &gt;</a></td></tr>
56 <tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Specifies the type of the K-th semantic element of a color base.  <a href="structboost_1_1gil_1_1kth__semantic__element__type.html#details">More...</a><br /></td></tr>
57 <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
58 <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structboost_1_1gil_1_1kth__semantic__element__reference__type.html">kth_semantic_element_reference_type&lt; ColorBase, K &gt;</a></td></tr>
59 <tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Specifies the return type of the mutable semantic_at_c&lt;K&gt;(color_base);.  <a href="structboost_1_1gil_1_1kth__semantic__element__reference__type.html#details">More...</a><br /></td></tr>
60 <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
61 <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structboost_1_1gil_1_1kth__semantic__element__const__reference__type.html">kth_semantic_element_const_reference_type&lt; ColorBase, K &gt;</a></td></tr>
62 <tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Specifies the return type of the constant semantic_at_c&lt;K&gt;(color_base);.  <a href="structboost_1_1gil_1_1kth__semantic__element__const__reference__type.html#details">More...</a><br /></td></tr>
63 <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
64 </table><table class="memberdecls">
65 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
66 Functions</h2></td></tr>
67 <tr class="memitem:ga573a620f96007b12bfe165db664f511a"><td class="memTemplParams" colspan="2"><a id="ga573a620f96007b12bfe165db664f511a"></a>
68 template&lt;int K, typename ColorBase &gt; </td></tr>
69 <tr class="memitem:ga573a620f96007b12bfe165db664f511a"><td class="memTemplItemLeft" align="right" valign="top">auto&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group___color_base_algorithm_semantic_at_c.html#ga573a620f96007b12bfe165db664f511a">semantic_at_c</a> (ColorBase &amp;p) -&gt; typename std::enable_if&lt; !std::is_const&lt; ColorBase &gt;::value, typename <a class="el" href="structboost_1_1gil_1_1kth__semantic__element__reference__type.html">kth_semantic_element_reference_type</a>&lt; ColorBase, K &gt;::type &gt;::type</td></tr>
70 <tr class="memdesc:ga573a620f96007b12bfe165db664f511a"><td class="mdescLeft">&#160;</td><td class="mdescRight">A mutable accessor to the K-th semantic element of a color base. <br /></td></tr>
71 <tr class="separator:ga573a620f96007b12bfe165db664f511a"><td class="memSeparator" colspan="2">&#160;</td></tr>
72 <tr class="memitem:ga5aa277c761861eb6c540da0ba2e22d4e"><td class="memTemplParams" colspan="2"><a id="ga5aa277c761861eb6c540da0ba2e22d4e"></a>
73 template&lt;int K, typename ColorBase &gt; </td></tr>
74 <tr class="memitem:ga5aa277c761861eb6c540da0ba2e22d4e"><td class="memTemplItemLeft" align="right" valign="top">auto&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group___color_base_algorithm_semantic_at_c.html#ga5aa277c761861eb6c540da0ba2e22d4e">semantic_at_c</a> (ColorBase const &amp;p) -&gt; typename <a class="el" href="structboost_1_1gil_1_1kth__semantic__element__const__reference__type.html">kth_semantic_element_const_reference_type</a>&lt; ColorBase, K &gt;::type</td></tr>
75 <tr class="memdesc:ga5aa277c761861eb6c540da0ba2e22d4e"><td class="mdescLeft">&#160;</td><td class="mdescRight">A constant accessor to the K-th semantic element of a color base. <br /></td></tr>
76 <tr class="separator:ga5aa277c761861eb6c540da0ba2e22d4e"><td class="memSeparator" colspan="2">&#160;</td></tr>
77 </table>
78 <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
79 <p>semantic_at_c: Semantic channel accessors </p>
80 <p>Support for accessing the elements of a color base by semantic index</p>
81 <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 layout. For example, red is the first semantic element of a color base regardless of whether it has an RGB layout or a BGR layout. All GIL color base algorithms taking multiple color bases use semantic indexing to access their elements.</p>
82 <p>Example: </p><div class="fragment"><div class="line"><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></div><div class="line"><span class="keyword">using</span> bgr432_pixel_t = packed_pixel_type&lt;uint16_t, mp11::mp_list_c&lt;unsigned,4,3,2&gt;, bgr_layout_t&gt;::type;</div><div class="line"></div><div class="line"><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></div><div class="line"><span class="keyword">using</span> red_channel_reference_t = kth_semantic_element_reference_type&lt;bgr432_pixel_t, 0&gt;::type;</div><div class="line"></div><div class="line"><span class="comment">// Initialize the pixel to black</span></div><div class="line">bgr432_pixel_t red_pixel(0,0,0);</div><div class="line"></div><div class="line"><span class="comment">// Set the red channel to 100%</span></div><div class="line">red_channel_reference_t red_channel = semantic_at_c&lt;0&gt;(red_pixel);</div><div class="line">red_channel = channel_traits&lt;red_channel_reference_t&gt;::max_value();</div></div><!-- fragment --> </div><!-- contents -->
83      <!-- HTML footer for doxygen 1.8.13-->
84      <!-- start footer part -->
85      <hr class="footer"/>
86      <address class="footer">
87       <small>
88         Generated by &#160;<a href="http://www.doxygen.org/index.html">doxygen</a> 1.8.15
89       </small>
90     </address>
91   </body>
92 </html>