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.
5 // Copyright (C) 2018-2019 Intel Corporation
10 #include "opencv2/gapi/imgproc.hpp"
11 #include "opencv2/gapi/core.hpp"
12 #include "opencv2/gapi/gscalar.hpp"
13 #include "opencv2/gapi/operators.hpp"
15 cv::GMat operator+(const cv::GMat& lhs, const cv::GMat& rhs)
17 return cv::gapi::add(lhs, rhs);
20 cv::GMat operator+(const cv::GMat& lhs, const cv::GScalar& rhs)
22 return cv::gapi::addC(lhs, rhs);
25 cv::GMat operator+(const cv::GScalar& lhs, const cv::GMat& rhs)
27 return cv::gapi::addC(rhs, lhs);
30 cv::GMat operator-(const cv::GMat& lhs, const cv::GMat& rhs)
32 return cv::gapi::sub(lhs, rhs);
35 cv::GMat operator-(const cv::GMat& lhs, const cv::GScalar& rhs)
37 return cv::gapi::subC(lhs, rhs);
40 cv::GMat operator-(const cv::GScalar& lhs, const cv::GMat& rhs)
42 return cv::gapi::subRC(lhs, rhs);
45 cv::GMat operator*(const cv::GMat& lhs, float rhs)
47 return cv::gapi::mulC(lhs, static_cast<double>(rhs));
50 cv::GMat operator*(float lhs, const cv::GMat& rhs)
52 return cv::gapi::mulC(rhs, static_cast<double>(lhs));
55 cv::GMat operator*(const cv::GMat& lhs, const cv::GScalar& rhs)
57 return cv::gapi::mulC(lhs, rhs);
60 cv::GMat operator*(const cv::GScalar& lhs, const cv::GMat& rhs)
62 return cv::gapi::mulC(rhs, lhs);
65 cv::GMat operator/(const cv::GMat& lhs, const cv::GScalar& rhs)
67 return cv::gapi::divC(lhs, rhs, 1.0);
70 cv::GMat operator/(const cv::GMat& lhs, const cv::GMat& rhs)
72 return cv::gapi::div(lhs, rhs, 1.0);
75 cv::GMat operator/(const cv::GScalar& lhs, const cv::GMat& rhs)
77 return cv::gapi::divRC(lhs, rhs, 1.0);
80 cv::GMat operator&(const cv::GMat& lhs, const cv::GMat& rhs)
82 return cv::gapi::bitwise_and(lhs, rhs);
85 cv::GMat operator&(const cv::GMat& lhs, const cv::GScalar& rhs)
87 return cv::gapi::bitwise_and(lhs, rhs);
90 cv::GMat operator&(const cv::GScalar& lhs, const cv::GMat& rhs)
92 return cv::gapi::bitwise_and(rhs, lhs);
95 cv::GMat operator|(const cv::GMat& lhs, const cv::GMat& rhs)
97 return cv::gapi::bitwise_or(lhs, rhs);
100 cv::GMat operator|(const cv::GMat& lhs, const cv::GScalar& rhs)
102 return cv::gapi::bitwise_or(lhs, rhs);
105 cv::GMat operator|(const cv::GScalar& lhs, const cv::GMat& rhs)
107 return cv::gapi::bitwise_or(rhs, lhs);
110 cv::GMat operator^(const cv::GMat& lhs, const cv::GMat& rhs)
112 return cv::gapi::bitwise_xor(lhs, rhs);
115 cv::GMat operator^(const cv::GMat& lhs, const cv::GScalar& rhs)
117 return cv::gapi::bitwise_xor(lhs, rhs);
120 cv::GMat operator^(const cv::GScalar& lhs, const cv::GMat& rhs)
122 return cv::gapi::bitwise_xor(rhs, lhs);
125 cv::GMat operator~(const cv::GMat& lhs)
127 return cv::gapi::bitwise_not(lhs);
130 cv::GMat operator>(const cv::GMat& lhs, const cv::GMat& rhs)
132 return cv::gapi::cmpGT(lhs, rhs);
135 cv::GMat operator>=(const cv::GMat& lhs, const cv::GMat& rhs)
137 return cv::gapi::cmpGE(lhs, rhs);
140 cv::GMat operator<(const cv::GMat& lhs, const cv::GMat& rhs)
142 return cv::gapi::cmpLT(lhs, rhs);
145 cv::GMat operator<=(const cv::GMat& lhs, const cv::GMat& rhs)
147 return cv::gapi::cmpLE(lhs, rhs);
150 cv::GMat operator==(const cv::GMat& lhs, const cv::GMat& rhs)
152 return cv::gapi::cmpEQ(lhs, rhs);
155 cv::GMat operator!=(const cv::GMat& lhs, const cv::GMat& rhs)
157 return cv::gapi::cmpNE(lhs, rhs);
160 cv::GMat operator>(const cv::GMat& lhs, const cv::GScalar& rhs)
162 return cv::gapi::cmpGT(lhs, rhs);
165 cv::GMat operator>=(const cv::GMat& lhs, const cv::GScalar& rhs)
167 return cv::gapi::cmpGE(lhs, rhs);
170 cv::GMat operator<(const cv::GMat& lhs, const cv::GScalar& rhs)
172 return cv::gapi::cmpLT(lhs, rhs);
175 cv::GMat operator<=(const cv::GMat& lhs, const cv::GScalar& rhs)
177 return cv::gapi::cmpLE(lhs, rhs);
180 cv::GMat operator==(const cv::GMat& lhs, const cv::GScalar& rhs)
182 return cv::gapi::cmpEQ(lhs, rhs);
185 cv::GMat operator!=(const cv::GMat& lhs, const cv::GScalar& rhs)
187 return cv::gapi::cmpNE(lhs, rhs);
190 cv::GMat operator>(const cv::GScalar& lhs, const cv::GMat& rhs)
192 return cv::gapi::cmpLT(rhs, lhs);
194 cv::GMat operator>=(const cv::GScalar& lhs, const cv::GMat& rhs)
196 return cv::gapi::cmpLE(rhs, lhs);
198 cv::GMat operator<(const cv::GScalar& lhs, const cv::GMat& rhs)
200 return cv::gapi::cmpGT(rhs, lhs);
202 cv::GMat operator<=(const cv::GScalar& lhs, const cv::GMat& rhs)
204 return cv::gapi::cmpGE(rhs, lhs);
206 cv::GMat operator==(const cv::GScalar& lhs, const cv::GMat& rhs)
208 return cv::gapi::cmpEQ(rhs, lhs);
210 cv::GMat operator!=(const cv::GScalar& lhs, const cv::GMat& rhs)
212 return cv::gapi::cmpNE(rhs, lhs);