Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / thirdparty / fluid / modules / gapi / include / opencv2 / gapi / own / convert.hpp
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 #ifndef OPENCV_GAPI_OWN_CONVERT_HPP
9 #define OPENCV_GAPI_OWN_CONVERT_HPP
10
11 #if !defined(GAPI_STANDALONE)
12
13 #include <opencv2/gapi/opencv_includes.hpp>
14 #include <opencv2/gapi/own/types.hpp>
15 #include <opencv2/gapi/own/mat.hpp>
16 #include "opencv2/gapi/own/scalar.hpp"
17
18 namespace cv
19 {
20     inline cv::gapi::own::Mat to_own(Mat const& m) { return {m.rows, m.cols, m.type(), m.data, m.step};};
21            cv::gapi::own::Mat to_own(Mat&&) = delete;
22
23     inline cv::gapi::own::Scalar to_own(const cv::Scalar& s) { return {s[0], s[1], s[2], s[3]}; };
24
25     inline cv::gapi::own::Size to_own (const Size& s) { return {s.width, s.height}; };
26
27     inline cv::gapi::own::Rect to_own (const Rect& r) { return {r.x, r.y, r.width, r.height}; };
28
29
30
31 namespace gapi
32 {
33 namespace own
34 {
35     inline cv::Mat to_ocv(Mat const& m) { return {m.rows, m.cols, m.type(), m.data, m.step};};
36            cv::Mat to_ocv(Mat&&)    = delete;
37
38     inline cv::Scalar to_ocv(const Scalar& s) { return {s[0], s[1], s[2], s[3]}; };
39
40     inline cv::Size to_ocv (const Size& s) { return cv::Size(s.width, s.height); };
41
42     inline cv::Rect to_ocv (const Rect& r) { return cv::Rect(r.x, r.y, r.width, r.height); };
43
44 } // namespace own
45 } // namespace gapi
46 } // namespace cv
47
48 #endif // !defined(GAPI_STANDALONE)
49
50 #endif // OPENCV_GAPI_OWN_CONVERT_HPP