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
8 #ifndef OPENCV_GAPI_OWN_CONVERT_HPP
9 #define OPENCV_GAPI_OWN_CONVERT_HPP
11 #if !defined(GAPI_STANDALONE)
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"
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;
23 inline cv::gapi::own::Scalar to_own(const cv::Scalar& s) { return {s[0], s[1], s[2], s[3]}; };
25 inline cv::gapi::own::Size to_own (const Size& s) { return {s.width, s.height}; };
27 inline cv::gapi::own::Rect to_own (const Rect& r) { return {r.x, r.y, r.width, r.height}; };
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;
38 inline cv::Scalar to_ocv(const Scalar& s) { return {s[0], s[1], s[2], s[3]}; };
40 inline cv::Size to_ocv (const Size& s) { return cv::Size(s.width, s.height); };
42 inline cv::Rect to_ocv (const Rect& r) { return cv::Rect(r.x, r.y, r.width, r.height); };
48 #endif // !defined(GAPI_STANDALONE)
50 #endif // OPENCV_GAPI_OWN_CONVERT_HPP