1 <!-- Copyright 2008 Lubomir Bourdev and Hailin Jin
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)
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)
13 Some files are held under additional license.
14 Please see "http://stlab.adobe.com/licenses.html" for more information.
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">
22 <TITLE>Generic Image Library: kth_semantic_element_type, kth_semantic_element_reference_type, kth_semantic_element_const_reference_type, semantic_at_c
</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"/>
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>
37 <!-- Generated by Doxygen 1.5.6 -->
38 <div class=
"contents">
39 <h1>kth_semantic_element_type, kth_semantic_element_reference_type, kth_semantic_element_const_reference_type, semantic_at_c
<br>
41 [
<a class=
"el" href=
"g_i_l_0105.html">Algorithms and Utility Functions
</a>]
</small>
42 </h1><hr><a name=
"_details"></a><h2>Detailed Description
</h2>
43 Support for accessing the elements of a color base by semantic index.
45 semantic_at_c: Semantic channel accessors
<p>
46 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>
47 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>
48 <span class=
"keyword">typedef
</span> packed_pixel_type
<uint16_t, mpl::vector3_c
<unsigned,
4,
3,
2>, bgr_layout_t
>::type bgr432_pixel_t;
50 <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>
51 <span class=
"keyword">typedef
</span> kth_semantic_element_reference_type
<bgr432_pixel_t,
0>::type red_channel_reference_t;
53 <span class=
"comment">// Initialize the pixel to black
</span>
54 bgr432_pixel_t red_pixel(
0,
0,
0);
56 <span class=
"comment">// Set the red channel to
100%
</span>
57 red_channel_reference_t red_channel = semantic_at_c
<0>(red_pixel);
58 red_channel = channel_traits
<red_channel_reference_t
>::max_value();
61 <table border=
"0" cellpadding=
"0" cellspacing=
"0">
63 <tr><td colspan=
"2"><br><h2>Classes
</h2></td></tr>
64 <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>
66 <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>
67 <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>
69 <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>
70 <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>
72 <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>
73 <tr><td colspan=
"2"><br><h2>Functions
</h2></td></tr>
74 <tr><td class=
"memTemplParams" nowrap
colspan=
"2"><a class=
"anchor" name=
"g2cdd9bfd1b27576659b8c79a3a0233de"></a><!-- doxytag: member="ColorBaseAlgorithmSemanticAtC::semantic_at_c" ref="g2cdd9bfd1b27576659b8c79a3a0233de" args="(ColorBase &p)" -->
75 template
<int K, typename ColorBase
> </td></tr>
76 <tr><td class=
"memTemplItemLeft" nowrap
align=
"right" valign=
"top">disable_if
< is_const
<br>
77 < ColorBase
>, typename
<br>
78 kth_semantic_element_reference_type
<br>
79 < 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>
81 <tr><td class=
"mdescLeft"> </td><td class=
"mdescRight">A mutable accessor to the K-th semantic element of a color base.
<br></td></tr>
82 <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)" -->
83 template
<int K, typename ColorBase
> </td></tr>
84 <tr><td class=
"memTemplItemLeft" nowrap
align=
"right" valign=
"top">kth_semantic_element_const_reference_type
<br>
85 < 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>
87 <tr><td class=
"mdescLeft"> </td><td class=
"mdescRight">A constant accessor to the K-th semantic element of a color base.
<br></td></tr>
90 <hr size=
"1"><address style=
"text-align: right;"><small>Generated on Sat May
2 13:
50:
17 2009 for Generic Image Library by
91 <a href=
"http://www.doxygen.org/index.html">
92 <img src=
"doxygen.png" alt=
"doxygen" align=
"middle" border=
"0"></a> 1.5.6 </small></address>