]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | <!-- Copyright 2008 Lubomir Bourdev and Hailin Jin |
2 | ||
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) | |
6 | --> | |
7 | ||
8 | <!-- | |
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) | |
12 | ||
13 | Some files are held under additional license. | |
14 | Please see "http://stlab.adobe.com/licenses.html" for more information. | |
15 | --> | |
16 | ||
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"> | |
20 | ||
21 | <head> | |
22 | <TITLE>Generic Image Library: apply_operation_base.hpp File Reference</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"/> | |
25 | </head> | |
26 | <body> | |
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> | |
35 | </div> | |
36 | <!-- End Header --> | |
37 | <!-- Generated by Doxygen 1.5.6 --> | |
38 | <div class="navpath"><a class="el" href="g_i_l_0076.html">boost</a> » <a class="el" href="g_i_l_0079.html">gil</a> » <a class="el" href="g_i_l_0078.html">extension</a> » <a class="el" href="g_i_l_0075.html">dynamic_image</a> | |
39 | </div> | |
40 | <div class="contents"> | |
41 | <h1>apply_operation_base.hpp File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2> | |
42 | Given an object with run-time specified type (denoted as an array of Bits, dynamic index, and a static set of Types) and a generic operation, casts the object to its appropriate type and applies the operation. | |
43 | <p> | |
44 | <dl class="author" compact><dt><b>Author:</b></dt><dd>Lubomir Bourdev and Hailin Jin <br> | |
45 | Adobe Systems Incorporated </dd></dl> | |
46 | <dl class="date" compact><dt><b>Date:</b></dt><dd>2005-2007 <br> | |
47 | Last updated on November 6, 2007 </dd></dl> | |
48 | ||
49 | <p> | |
50 | <code>#include "<a class="el" href="g_i_l_0093.html">../../gil_config.hpp</a>"</code><br> | |
51 | <code>#include "<a class="el" href="g_i_l_0642.html">../../utilities.hpp</a>"</code><br> | |
52 | <code>#include <boost/mpl/begin.hpp></code><br> | |
53 | <code>#include <boost/mpl/next.hpp></code><br> | |
54 | <code>#include <boost/mpl/deref.hpp></code><br> | |
55 | <code>#include <boost/mpl/size.hpp></code><br> | |
56 | <code>#include <boost/preprocessor/repeat.hpp></code><br> | |
57 | ||
58 | <p> | |
59 | <a href="g_i_l_0007.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0"> | |
60 | <tr><td></td></tr> | |
61 | <tr><td colspan="2"><br><h2>Namespaces</h2></td></tr> | |
62 | <tr><td class="memItemLeft" nowrap align="right" valign="top">namespace </td><td class="memItemRight" valign="bottom"><a class="el" href="namespaceboost.html">boost</a></td></tr> | |
63 | ||
64 | <tr><td class="memItemLeft" nowrap align="right" valign="top">namespace </td><td class="memItemRight" valign="bottom"><b>boost::gil</b></td></tr> | |
65 | ||
66 | <tr><td class="memItemLeft" nowrap align="right" valign="top">namespace </td><td class="memItemRight" valign="bottom"><b>boost::gil::detail</b></td></tr> | |
67 | ||
68 | <tr><td colspan="2"><br><h2>Defines</h2></td></tr> | |
69 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="d79b83cac67b5b966b9d5b66aa122460"></a><!-- doxytag: member="apply_operation_base.hpp::GIL_FWD_TYPEDEFS" ref="d79b83cac67b5b966b9d5b66aa122460" args="(z, N, text)" --> | |
70 | #define </td><td class="memItemRight" valign="bottom"><b>GIL_FWD_TYPEDEFS</b>(z, N, text) T##N; typedef typename mpl::next<T##N>::type</td></tr> | |
71 | ||
72 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="2b5c77543f4d9130526fed67ac7464ee"></a><!-- doxytag: member="apply_operation_base.hpp::GIL_FWD_CASE" ref="2b5c77543f4d9130526fed67ac7464ee" args="(z, N, SUM)" --> | |
73 | #define </td><td class="memItemRight" valign="bottom"><b>GIL_FWD_CASE</b>(z, N, SUM) case N: return op(*gil_reinterpret_cast<typename mpl::deref<T##N>::type*>(&bits));</td></tr> | |
74 | ||
75 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="9aeac994894106449bcde0806b254df9"></a><!-- doxytag: member="apply_operation_base.hpp::GIL_FWD_CONST_CASE" ref="9aeac994894106449bcde0806b254df9" args="(z, N, SUM)" --> | |
76 | #define </td><td class="memItemRight" valign="bottom"><b>GIL_FWD_CONST_CASE</b>(z, N, SUM) case N: return op(*gil_reinterpret_cast_c<const typename mpl::deref<T##N>::type*>(&bits));</td></tr> | |
77 | ||
78 | <tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><b>GIL_APPLY_FWD_OP</b>(z, N, text)</td></tr> | |
79 | ||
80 | <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="8dee41b11d92b34295f54281a098ae90"></a><!-- doxytag: member="apply_operation_base.hpp::GIL_GENERATE_APPLY_FWD_OPS" ref="8dee41b11d92b34295f54281a098ae90" args="(N)" --> | |
81 | #define </td><td class="memItemRight" valign="bottom"><b>GIL_GENERATE_APPLY_FWD_OPS</b>(N) BOOST_PP_REPEAT(N, GIL_APPLY_FWD_OP, BOOST_PP_EMPTY)</td></tr> | |
82 | ||
83 | <tr><td colspan="2"><br><h2>Functions</h2></td></tr> | |
84 | <tr><td class="memTemplParams" nowrap colspan="2"><a class="anchor" name="e7eaa4c36cc9636e1b2f97184c35636a"></a><!-- doxytag: member="apply_operation_base.hpp::apply_operation_basec" ref="e7eaa4c36cc9636e1b2f97184c35636a" args="(const Bits &bits, std::size_t index, Op op)" --> | |
85 | template<typename Types, typename Bits, typename Op> </td></tr> | |
86 | <tr><td class="memTemplItemLeft" nowrap align="right" valign="top">Op::result_type GIL_FORCEINLINE </td><td class="memTemplItemRight" valign="bottom"><b>apply_operation_basec</b> (const Bits &bits, std::size_t index, Op op)</td></tr> | |
87 | ||
88 | <tr><td class="memTemplParams" nowrap colspan="2"><a class="anchor" name="d771ee58462b8590bccbd0950c9b58d4"></a><!-- doxytag: member="apply_operation_base.hpp::apply_operation_base" ref="d771ee58462b8590bccbd0950c9b58d4" args="(Bits &bits, std::size_t index, Op op)" --> | |
89 | template<typename Types, typename Bits, typename Op> </td></tr> | |
90 | <tr><td class="memTemplItemLeft" nowrap align="right" valign="top">Op::result_type GIL_FORCEINLINE </td><td class="memTemplItemRight" valign="bottom"><b>apply_operation_base</b> (Bits &bits, std::size_t index, Op op)</td></tr> | |
91 | ||
92 | <tr><td class="memTemplParams" nowrap colspan="2"><a class="anchor" name="40a9fc96031783e58fa0e39a08d2c5a4"></a><!-- doxytag: member="apply_operation_base.hpp::apply_operation_base" ref="40a9fc96031783e58fa0e39a08d2c5a4" args="(const Bits1 &bits1, std::size_t index1, const Bits2 &bits2, std::size_t index2, Op op)" --> | |
93 | template<typename Types1, typename Types2, typename Bits1, typename Bits2, typename Op> </td></tr> | |
94 | <tr><td class="memTemplItemLeft" nowrap align="right" valign="top">static Op::result_type <br> | |
95 | GIL_FORCEINLINE </td><td class="memTemplItemRight" valign="bottom"><b>apply_operation_base</b> (const Bits1 &bits1, std::size_t index1, const Bits2 &bits2, std::size_t index2, Op op)</td></tr> | |
96 | ||
97 | </table> | |
98 | <hr><h2>Define Documentation</h2> | |
99 | <a class="anchor" name="97e41768b29fa4d0c910608e9243ec8f"></a><!-- doxytag: member="apply_operation_base.hpp::GIL_APPLY_FWD_OP" ref="97e41768b29fa4d0c910608e9243ec8f" args="(z, N, text)" --> | |
100 | <div class="memitem"> | |
101 | <div class="memproto"> | |
102 | <table class="memname"> | |
103 | <tr> | |
104 | <td class="memname">#define GIL_APPLY_FWD_OP </td> | |
105 | <td>(</td> | |
106 | <td class="paramtype">z, <tr> | |
107 | <td class="paramkey"></td> | |
108 | <td></td> | |
109 | <td class="paramtype">N, <tr> | |
110 | <td class="paramkey"></td> | |
111 | <td></td> | |
112 | <td class="paramtype">text </td> | |
113 | <td class="paramname"> </td> | |
114 | <td> ) </td> | |
115 | <td></td> | |
116 | </tr> | |
117 | </table> | |
118 | </div> | |
119 | <div class="memdoc"> | |
120 | ||
121 | <p> | |
122 | <b>Value:</b><div class="fragment"><pre class="fragment"><span class="keyword">template</span> <> <span class="keyword">struct </span>apply_operation_fwd_fn<BOOST_PP_ADD(N,1)> { \ | |
123 | <span class="keyword">template</span> <<span class="keyword">typename</span> Types, <span class="keyword">typename</span> Bits, <span class="keyword">typename</span> UnaryOp> \ | |
124 | <span class="keyword">typename</span> UnaryOp::result_type apply(Bits& bits, std::size_t index, UnaryOp op)<span class="keyword"> const </span>{ \ | |
125 | <span class="keyword">typedef</span> <span class="keyword">typename</span> mpl::begin<Types>::type \ | |
126 | BOOST_PP_REPEAT(N, GIL_FWD_TYPEDEFS, BOOST_PP_EMPTY) \ | |
127 | T##N; \ | |
128 | <span class="keywordflow">switch</span> (index) { \ | |
129 | BOOST_PP_REPEAT(BOOST_PP_ADD(N,1), GIL_FWD_CASE, BOOST_PP_EMPTY) \ | |
130 | } \ | |
131 | <span class="keywordflow">throw</span>; \ | |
132 | } \ | |
133 | <span class="keyword">template</span> <<span class="keyword">typename</span> Types, <span class="keyword">typename</span> Bits, <span class="keyword">typename</span> UnaryOp> \ | |
134 | <span class="keyword">typename</span> UnaryOp::result_type applyc(<span class="keyword">const</span> Bits& bits, std::size_t index, UnaryOp op)<span class="keyword"> const </span>{ \ | |
135 | <span class="keyword">typedef</span> <span class="keyword">typename</span> mpl::begin<Types>::type \ | |
136 | BOOST_PP_REPEAT(N, GIL_FWD_TYPEDEFS, BOOST_PP_EMPTY) \ | |
137 | T##N; \ | |
138 | <span class="keywordflow">switch</span> (index) { \ | |
139 | BOOST_PP_REPEAT(BOOST_PP_ADD(N,1), GIL_FWD_CONST_CASE,BOOST_PP_EMPTY) \ | |
140 | } \ | |
141 | <span class="keywordflow">throw</span>; \ | |
142 | } \ | |
143 | }; | |
144 | </pre></div> | |
145 | </div> | |
146 | </div><p> | |
147 | </div> | |
148 | <hr size="1"><address style="text-align: right;"><small>Generated on Sat May 2 13:50:15 2009 for Generic Image Library by | |
149 | <a href="http://www.doxygen.org/index.html"> | |
150 | <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address> | |
151 | </body> | |
152 | </html> |