Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / thirdparty / fluid / modules / gapi / include / opencv2 / gapi / gscalar.hpp
1 // This file is part of OpenCV project.
2
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.
5 //
6 // Copyright (C) 2018-2019 Intel Corporation
7
8
9 #ifndef OPENCV_GAPI_GSCALAR_HPP
10 #define OPENCV_GAPI_GSCALAR_HPP
11
12 #include <ostream>
13
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"
18
19 namespace cv
20 {
21 // Forward declaration; GNode and GOrigin are an internal
22 // (user-inaccessible) classes.
23 class GNode;
24 struct GOrigin;
25
26 /** \addtogroup gapi_data_objects
27  * @{
28  */
29
30 class GAPI_EXPORTS GScalar
31 {
32 public:
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
41
42     GOrigin& priv();                                   // Internal use only
43     const GOrigin& priv()  const;                      // Internal use only
44
45 private:
46     std::shared_ptr<GOrigin> m_priv;
47 };
48
49 /** @} */
50
51 /**
52  * \addtogroup gapi_meta_args
53  * @{
54  */
55 struct GScalarDesc
56 {
57     // NB.: right now it is empty
58
59     inline bool operator== (const GScalarDesc &) const
60     {
61         return true; // NB: implement this method if GScalar meta appears
62     }
63
64     inline bool operator!= (const GScalarDesc &rhs) const
65     {
66         return !(*this == rhs);
67     }
68 };
69
70 static inline GScalarDesc empty_scalar_desc() { return GScalarDesc(); }
71
72 #if !defined(GAPI_STANDALONE)
73 GAPI_EXPORTS GScalarDesc descr_of(const cv::Scalar            &scalar);
74 #endif // !defined(GAPI_STANDALONE)
75 /** @} */
76
77 GAPI_EXPORTS GScalarDesc descr_of(const cv::gapi::own::Scalar &scalar);
78
79 std::ostream& operator<<(std::ostream& os, const cv::GScalarDesc &desc);
80
81 } // namespace cv
82
83 #endif // OPENCV_GAPI_GSCALAR_HPP