1 // This file is part of OpenCV project.
3 // It is subject to the license terms in the LICENSE file found in the top-level directory
4 // of this distribution and at http://opencv.org/license.html.
6 // Copyright (C) 2018-2019 Intel Corporation
9 #ifndef OPENCV_GAPI_GSCALAR_HPP
10 #define OPENCV_GAPI_GSCALAR_HPP
14 #include <opencv2/gapi/opencv_includes.hpp>
15 #include <opencv2/gapi/gcommon.hpp> // GShape
16 #include <opencv2/gapi/util/optional.hpp>
17 #include "opencv2/gapi/own/scalar.hpp"
21 // Forward declaration; GNode and GOrigin are an internal
22 // (user-inaccessible) classes.
26 /** \addtogroup gapi_data_objects
30 class GAPI_EXPORTS GScalar
33 GScalar(); // Empty constructor
34 explicit GScalar(const cv::gapi::own::Scalar& s); // Constant value constructor from cv::gapi::own::Scalar
35 explicit GScalar(cv::gapi::own::Scalar&& s); // Constant value move-constructor from cv::gapi::own::Scalar
36 #if !defined(GAPI_STANDALONE)
37 explicit GScalar(const cv::Scalar& s); // Constant value constructor from cv::Scalar
38 #endif // !defined(GAPI_STANDALONE)
39 GScalar(double v0); // Constant value constructor from double
40 GScalar(const GNode &n, std::size_t out); // Operation result constructor
42 GOrigin& priv(); // Internal use only
43 const GOrigin& priv() const; // Internal use only
46 std::shared_ptr<GOrigin> m_priv;
52 * \addtogroup gapi_meta_args
57 // NB.: right now it is empty
59 inline bool operator== (const GScalarDesc &) const
61 return true; // NB: implement this method if GScalar meta appears
64 inline bool operator!= (const GScalarDesc &rhs) const
66 return !(*this == rhs);
70 static inline GScalarDesc empty_scalar_desc() { return GScalarDesc(); }
72 #if !defined(GAPI_STANDALONE)
73 GAPI_EXPORTS GScalarDesc descr_of(const cv::Scalar &scalar);
74 #endif // !defined(GAPI_STANDALONE)
77 GAPI_EXPORTS GScalarDesc descr_of(const cv::gapi::own::Scalar &scalar);
79 std::ostream& operator<<(std::ostream& os, const cv::GScalarDesc &desc);
83 #endif // OPENCV_GAPI_GSCALAR_HPP