Boost GIL


apply_operation.hpp
Go to the documentation of this file.
1 /*
2  Copyright 2005-2007 Adobe Systems Incorporated
3 
4  Use, modification and distribution are subject to the Boost Software License,
5  Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
6  http://www.boost.org/LICENSE_1_0.txt).
7 
8  See http://opensource.adobe.com/gil for most recent version including documentation.
9 */
10 
11 /*************************************************************************************************/
12 
13 #ifndef GIL_APPLY_OPERATION_HPP
14 #define GIL_APPLY_OPERATION_HPP
15 
24 
25 #include "apply_operation_base.hpp"
26 #include "variant.hpp"
27 
28 #ifndef GIL_REDUCE_CODE_BLOAT
29 
30 namespace boost { namespace gil {
31 
34 template <typename Types, typename UnaryOp> BOOST_FORCEINLINE
35 typename UnaryOp::result_type apply_operation(variant<Types>& arg, UnaryOp op) {
36  return apply_operation_base<Types>(arg._bits, arg._index ,op);
37 }
38 
41 template <typename Types, typename UnaryOp> BOOST_FORCEINLINE
42 typename UnaryOp::result_type apply_operation(const variant<Types>& arg, UnaryOp op) {
43  return apply_operation_basec<Types>(arg._bits, arg._index ,op);
44 }
45 
48 template <typename Types1, typename Types2, typename BinaryOp> BOOST_FORCEINLINE
49 typename BinaryOp::result_type apply_operation(const variant<Types1>& arg1, const variant<Types2>& arg2, BinaryOp op) {
50  return apply_operation_base<Types1,Types2>(arg1._bits, arg1._index, arg2._bits, arg2._index, op);
51 }
52 
53 } } // namespace boost::gil
54 
55 #else
56 
57 #include "reduce.hpp"
58 
59 #endif
60 
61 #endif
Constructs for static-to-dynamic integer convesion.
Support for run-time instantiated types.
BOOST_FORCEINLINE BinaryOp::result_type apply_operation(const variant< Types1 > &arg1, const variant< Types2 > &arg2, BinaryOp op)
Invokes a generic constant operation (represented as a binary function object) on two variants...
Definition: apply_operation.hpp:49
Represents a concrete instance of a run-time specified type from a set of typesA concept is typically...
Definition: variant.hpp:89
Given an object with run-time specified type (denoted as an array of Bits, dynamic index...