Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / thirdparty / fluid / modules / gapi / src / api / operators.cpp
1 // This file is part of OpenCV project.
2 // It is subject to the license terms in the LICENSE file found in the top-level directory
3 // of this distribution and at http://opencv.org/license.html.
4 //
5 // Copyright (C) 2018-2019 Intel Corporation
6
7
8 #include "precomp.hpp"
9
10 #include "opencv2/gapi/imgproc.hpp"
11 #include "opencv2/gapi/core.hpp"
12 #include "opencv2/gapi/gscalar.hpp"
13 #include "opencv2/gapi/operators.hpp"
14
15 cv::GMat operator+(const cv::GMat& lhs, const cv::GMat& rhs)
16 {
17     return cv::gapi::add(lhs, rhs);
18 }
19
20 cv::GMat operator+(const cv::GMat& lhs, const cv::GScalar& rhs)
21 {
22     return cv::gapi::addC(lhs, rhs);
23 }
24
25 cv::GMat operator+(const cv::GScalar& lhs, const cv::GMat& rhs)
26 {
27     return cv::gapi::addC(rhs, lhs);
28 }
29
30 cv::GMat operator-(const cv::GMat& lhs, const cv::GMat& rhs)
31 {
32     return cv::gapi::sub(lhs, rhs);
33 }
34
35 cv::GMat operator-(const cv::GMat& lhs, const cv::GScalar& rhs)
36 {
37     return cv::gapi::subC(lhs, rhs);
38 }
39
40 cv::GMat operator-(const cv::GScalar& lhs, const cv::GMat& rhs)
41 {
42     return cv::gapi::subRC(lhs, rhs);
43 }
44
45 cv::GMat operator*(const cv::GMat& lhs, float rhs)
46 {
47     return cv::gapi::mulC(lhs, static_cast<double>(rhs));
48 }
49
50 cv::GMat operator*(float lhs, const cv::GMat& rhs)
51 {
52     return cv::gapi::mulC(rhs, static_cast<double>(lhs));
53 }
54
55 cv::GMat operator*(const cv::GMat& lhs, const cv::GScalar& rhs)
56 {
57     return cv::gapi::mulC(lhs, rhs);
58 }
59
60 cv::GMat operator*(const cv::GScalar& lhs, const cv::GMat& rhs)
61 {
62     return cv::gapi::mulC(rhs, lhs);
63 }
64
65 cv::GMat operator/(const cv::GMat& lhs, const cv::GScalar& rhs)
66 {
67     return cv::gapi::divC(lhs, rhs, 1.0);
68 }
69
70 cv::GMat operator/(const cv::GMat& lhs, const cv::GMat& rhs)
71 {
72     return cv::gapi::div(lhs, rhs, 1.0);
73 }
74
75 cv::GMat operator/(const cv::GScalar& lhs, const cv::GMat& rhs)
76 {
77     return cv::gapi::divRC(lhs, rhs, 1.0);
78 }
79
80 cv::GMat operator&(const cv::GMat& lhs, const cv::GMat& rhs)
81 {
82     return cv::gapi::bitwise_and(lhs, rhs);
83 }
84
85 cv::GMat operator&(const cv::GMat& lhs, const cv::GScalar& rhs)
86 {
87     return cv::gapi::bitwise_and(lhs, rhs);
88 }
89
90 cv::GMat operator&(const cv::GScalar& lhs, const cv::GMat& rhs)
91 {
92     return cv::gapi::bitwise_and(rhs, lhs);
93 }
94
95 cv::GMat operator|(const cv::GMat& lhs, const cv::GMat& rhs)
96 {
97     return cv::gapi::bitwise_or(lhs, rhs);
98 }
99
100 cv::GMat operator|(const cv::GMat& lhs, const cv::GScalar& rhs)
101 {
102     return cv::gapi::bitwise_or(lhs, rhs);
103 }
104
105 cv::GMat operator|(const cv::GScalar& lhs, const cv::GMat& rhs)
106 {
107     return cv::gapi::bitwise_or(rhs, lhs);
108 }
109
110 cv::GMat operator^(const cv::GMat& lhs, const cv::GMat& rhs)
111 {
112     return cv::gapi::bitwise_xor(lhs, rhs);
113 }
114
115 cv::GMat operator^(const cv::GMat& lhs, const cv::GScalar& rhs)
116 {
117     return cv::gapi::bitwise_xor(lhs, rhs);
118 }
119
120 cv::GMat operator^(const cv::GScalar& lhs, const cv::GMat& rhs)
121 {
122     return cv::gapi::bitwise_xor(rhs, lhs);
123 }
124
125 cv::GMat operator~(const cv::GMat& lhs)
126 {
127     return cv::gapi::bitwise_not(lhs);
128 }
129
130 cv::GMat operator>(const cv::GMat& lhs, const cv::GMat& rhs)
131 {
132     return cv::gapi::cmpGT(lhs, rhs);
133 }
134
135 cv::GMat operator>=(const cv::GMat& lhs, const cv::GMat& rhs)
136 {
137     return cv::gapi::cmpGE(lhs, rhs);
138 }
139
140 cv::GMat operator<(const cv::GMat& lhs, const cv::GMat& rhs)
141 {
142     return cv::gapi::cmpLT(lhs, rhs);
143 }
144
145 cv::GMat operator<=(const cv::GMat& lhs, const cv::GMat& rhs)
146 {
147     return cv::gapi::cmpLE(lhs, rhs);
148 }
149
150 cv::GMat operator==(const cv::GMat& lhs, const cv::GMat& rhs)
151 {
152     return cv::gapi::cmpEQ(lhs, rhs);
153 }
154
155 cv::GMat operator!=(const cv::GMat& lhs, const cv::GMat& rhs)
156 {
157     return cv::gapi::cmpNE(lhs, rhs);
158 }
159
160 cv::GMat operator>(const cv::GMat& lhs, const cv::GScalar& rhs)
161 {
162     return cv::gapi::cmpGT(lhs, rhs);
163 }
164
165 cv::GMat operator>=(const cv::GMat& lhs, const cv::GScalar& rhs)
166 {
167     return cv::gapi::cmpGE(lhs, rhs);
168 }
169
170 cv::GMat operator<(const cv::GMat& lhs, const cv::GScalar& rhs)
171 {
172     return cv::gapi::cmpLT(lhs, rhs);
173 }
174
175 cv::GMat operator<=(const cv::GMat& lhs, const cv::GScalar& rhs)
176 {
177     return cv::gapi::cmpLE(lhs, rhs);
178 }
179
180 cv::GMat operator==(const cv::GMat& lhs, const cv::GScalar& rhs)
181 {
182     return cv::gapi::cmpEQ(lhs, rhs);
183 }
184
185 cv::GMat operator!=(const cv::GMat& lhs, const cv::GScalar& rhs)
186 {
187     return cv::gapi::cmpNE(lhs, rhs);
188 }
189
190 cv::GMat operator>(const cv::GScalar& lhs, const cv::GMat& rhs)
191 {
192     return cv::gapi::cmpLT(rhs, lhs);
193 }
194 cv::GMat operator>=(const cv::GScalar& lhs, const cv::GMat& rhs)
195 {
196     return cv::gapi::cmpLE(rhs, lhs);
197 }
198 cv::GMat operator<(const cv::GScalar& lhs, const cv::GMat& rhs)
199 {
200     return cv::gapi::cmpGT(rhs, lhs);
201 }
202 cv::GMat operator<=(const cv::GScalar& lhs, const cv::GMat& rhs)
203 {
204     return cv::gapi::cmpGE(rhs, lhs);
205 }
206 cv::GMat operator==(const cv::GScalar& lhs, const cv::GMat& rhs)
207 {
208     return cv::gapi::cmpEQ(rhs, lhs);
209 }
210 cv::GMat operator!=(const cv::GScalar& lhs, const cv::GMat& rhs)
211 {
212     return cv::gapi::cmpNE(rhs, lhs);
213 }