VisionCpp  0.0.1
expr_tree.hpp
Go to the documentation of this file.
1 // This file is part of VisionCpp, a lightweight C++ template library
2 // for computer vision and image processing.
3 //
4 // Copyright (C) 2016 Codeplay Software Limited. All Rights Reserved.
5 //
6 // Contact: visioncpp@codeplay.com
7 //
8 // Licensed under the Apache License, Version 2.0 (the "License");
9 // you may not use this file except in compliance with the License.
10 // You may obtain a copy of the License at
11 //
12 // http://www.apache.org/licenses/LICENSE-2.0
13 //
14 // Unless required by applicable law or agreed to in writing, software
15 // distributed under the License is distributed on an "AS IS" BASIS,
16 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 // See the License for the specific language governing permissions and
18 // limitations under the License.
19 
20 /// \file expr_tree.hpp
21 /// \brief This file contains the forward declarations and all the necessary
22 /// include headers for the construction of static expression trees.
23 
24 #ifndef VISIONCPP_INCLUDE_FRAMEWORK_EXPR_TREE_EXPR_TREE_HPP_
25 #define VISIONCPP_INCLUDE_FRAMEWORK_EXPR_TREE_EXPR_TREE_HPP_
26 
27 namespace visioncpp {
28 namespace internal {
29 /// \struct GlobalUnaryOp
30 /// \brief This class is used to encapsulate the global unary functor and the
31 /// types of each operand in this functor. The functor passed to this struct
32 /// applies global neighbour. This struct is used for global neighbour operation
33 /// template parameters:
34 /// \tparam USROP : the user/built-in functor
35 /// \tparam InTp the input type for that unary functor
36 template <typename USROP, typename InTp>
37 struct GlobalUnaryOp {
38  using OP = USROP;
39  using InType = InTp;
41  using OutType = decltype(OP()(x));
42  static constexpr size_t Operation_type =
44 };
45 /// \struct LocalUnaryOp
46 /// \brief This class is used to encapsulate the local unary functor and the
47 /// types of each operand in this functor. The functor passed to this struct
48 /// applies local neighbour. This struct is used for local neighbour operation
49 /// template parameters:
50 /// \tparam USROP : the user/built-in functor
51 /// \tparam InTp the input type for that unary functor
52 template <typename USROP, typename InTp>
53 struct LocalUnaryOp {
54  using OP = USROP;
55  using InType = InTp;
57  using OutType = decltype(OP()(x));
59 };
60 /// \struct LocalBinaryOp
61 /// \brief This class is used to encapsulate the local binary functor and the
62 /// types of each operand in this functor. The functor passed to this struct
63 /// applies local neighbour. This struct is used for local neighbour operation.
64 /// template parameters:
65 /// \tparam USROP : the user/built-in functor
66 /// \tparam InTp1 the left hand side input type for the binary functor
67 /// \tparam InTp2 the right hand side input type for the binary functor
68 template <typename USROP, typename InTp1, typename InTp2>
69 struct LocalBinaryOp {
70  using OP = USROP;
71  using InType1 = InTp1;
72  using InType2 = InTp2;
75  using OutType = decltype(OP()(x, y));
77 };
78 /// \struct PixelUnaryOp
79 /// \brief This class is used to encapsulate the unary point operation functor
80 /// and the types of each operand in this functor. The functor passed to this
81 /// struct applies point operation. This struct is used for point operation.
82 /// template parameters:
83 /// \tparam USROP : the user/built-in functor
84 /// \tparam InTp the right-hand side input type for the unary functor
85 template <typename USROP, typename InTp>
86 struct PixelUnaryOp {
87  using OP = USROP;
88  using InType = InTp;
90  using OutType = decltype(OP()(x));
91 };
92 /// \struct PixelBinaryOp
93 /// \brief This class is used to encapsulate the binary point operation functor
94 /// and the types of each operand in this functor. The functor passed to this
95 /// struct applies point operation. This struct is used for point operation.
96 /// template parameters:
97 /// \tparam USROP : the user/built-in functor
98 /// \tparam InTp1 the left-hand side input type for the binary functor
99 /// \tparam InTp2 the right-hand side input type for the binary functor
100 template <typename USROP, typename InTp1, typename InTp2>
102  using OP = USROP;
103  using InType1 = InTp1;
104  using InType2 = InTp2;
107  using OutType = decltype(OP()(x, y));
108 };
109 
110 } // internal
111 } // visioncpp
112 // Expression Tree headers
114 #include "point_ops/point_ops.hpp"
115 // here it should be
117 #endif // VISIONCPP_INCLUDE_FRAMEWORK_EXPR_TREE_EXPR_TREE_HPP_
This file contains a set of includes and forward declaration required to build complex operations lik...
VisionCpp namespace.
Definition: sycl/device.hpp:24
This file contains a set of includes used to construct neighbour nodes in expression tree.
This files contains a set of include headers for point operation node in the expression tree.
This class is used to encapsulate the global unary functor and the types of each operand in this func...
Definition: expr_tree.hpp:37
static constexpr size_t Operation_type
Definition: expr_tree.hpp:42
visioncpp::internal::GlobalNeighbour< InTp > x
Definition: expr_tree.hpp:40
This class is used to encapsulate the local binary functor and the types of each operand in this func...
Definition: expr_tree.hpp:69
static constexpr size_t Operation_type
Definition: expr_tree.hpp:76
visioncpp::internal::ConstNeighbour< InTp2 > y
Definition: expr_tree.hpp:74
decltype(OP()(x, y)) OutType
Definition: expr_tree.hpp:75
visioncpp::internal::LocalNeighbour< InTp1 > x
Definition: expr_tree.hpp:73
This class is used to encapsulate the local unary functor and the types of each operand in this funct...
Definition: expr_tree.hpp:53
visioncpp::internal::LocalNeighbour< InTp > x
Definition: expr_tree.hpp:56
static constexpr size_t Operation_type
Definition: expr_tree.hpp:58
This class is used to encapsulate the binary point operation functor and the types of each operand in...
Definition: expr_tree.hpp:101
decltype(OP()(x, y)) OutType
Definition: expr_tree.hpp:107
This class is used to encapsulate the unary point operation functor and the types of each operand in ...
Definition: expr_tree.hpp:86