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: 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"/>
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=
"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>
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.
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>
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>
59 <a href=
"g_i_l_0007.html">Go to the source code of this file.
</a><table border=
"0" cellpadding=
"0" cellspacing=
"0">
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>
64 <tr><td class=
"memItemLeft" nowrap
align=
"right" valign=
"top">namespace
</td><td class=
"memItemRight" valign=
"bottom"><b>boost::gil
</b></td></tr>
66 <tr><td class=
"memItemLeft" nowrap
align=
"right" valign=
"top">namespace
</td><td class=
"memItemRight" valign=
"bottom"><b>boost::gil::detail
</b></td></tr>
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>
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>
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>
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>
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>
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>
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>
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>
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">
104 <td class=
"memname">#define GIL_APPLY_FWD_OP
</td>
106 <td class=
"paramtype">z,
<tr>
107 <td class=
"paramkey"></td>
109 <td class=
"paramtype">N,
<tr>
110 <td class=
"paramkey"></td>
112 <td class=
"paramtype">text
</td>
113 <td class=
"paramname"> </td>
114 <td> )
</td>
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) \
128 <span class=
"keywordflow">switch
</span> (index) { \
129 BOOST_PP_REPEAT(BOOST_PP_ADD(N,
1), GIL_FWD_CASE, BOOST_PP_EMPTY) \
131 <span class=
"keywordflow">throw
</span>; \
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) \
138 <span class=
"keywordflow">switch
</span> (index) { \
139 BOOST_PP_REPEAT(BOOST_PP_ADD(N,
1), GIL_FWD_CONST_CASE,BOOST_PP_EMPTY) \
141 <span class=
"keywordflow">throw
</span>; \
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>