Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/gapi/include/opencv2/gapi/gmat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ static inline GMatDesc empty_gmat_desc() { return GMatDesc{-1,-1,{-1,-1}}; }
GAPI_EXPORTS GMatDesc descr_of(const cv::UMat &mat);
#endif // !defined(GAPI_STANDALONE)

GAPI_EXPORTS GMatDesc descr_of(const cv::Mat &mat);
GAPI_EXPORTS GMatDesc descr_of(const cv::Mat &mat); //another way: previous declaration

@mpashchenkov mpashchenkov May 6, 2020

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And we get error: conflicts with a previous declaration (212 str.).

We include opencv_includes.hpp (cvdefs.hpp in STANDALONE) in gmat.hpp.

cvdefs.hpp: cv::gapi::own::descr_of(const gapi::own::Mat &)

gmat.hpp: cv::descr_of(const gapi::own::Mat &)

It is logical, but i can't put declaration of function under STANDALONE flag in cvdefs.

/** @} */

// FIXME: WHY??? WHY it is under different namespace?
Expand Down
2 changes: 1 addition & 1 deletion modules/gapi/include/opencv2/gapi/opencv_includes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#ifndef OPENCV_GAPI_OPENCV_INCLUDES_HPP
#define OPENCV_GAPI_OPENCV_INCLUDES_HPP

#if !defined(GAPI_STANDALONE)
#if !defined(GAPI_STANDALONE) //

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

opencv_includes.hpp - fork for include files.

# include <opencv2/core/mat.hpp>
# include <opencv2/core/cvdef.h>
# include <opencv2/core/types.hpp>
Expand Down
11 changes: 9 additions & 2 deletions modules/gapi/include/opencv2/gapi/own/cvdefs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
#if defined(GAPI_STANDALONE)
#include <opencv2/gapi/own/types.hpp> // cv::gapi::own::Rect/Size/Point
#include <opencv2/gapi/own/scalar.hpp> // cv::gapi::own::Scalar

#include <opencv2/gapi/gmat.hpp> // call opencv_includes.hpp, that call cvdefs.hpp, that call gmat.hpp, ...

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is first way with include<gmat.hpp> for descr_of function.

// Simulate OpenCV definitions taken from various
// OpenCV interface headers if G-API is built in a
// standalone mode.

// interface.h:

typedef unsigned char uchar;
typedef char schar;

Expand Down Expand Up @@ -139,15 +138,23 @@ enum InterpolationFlags{
INTER_LINEAR_EXACT = 5,
INTER_MAX = 7,
};

// struct GMatDesc; // another way - without include gmat.hpp

// replacement of cv's structures:
namespace gapi { namespace own {
class Mat;
// GMatDesc descr_of(const Mat &mat); // another way: error-> conflicts with a previous declaration in gmat.hpp

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another way - we don't include gmat.hpp. We put a function prototype.

cv::gapi::own::descr_of(const gapi::own::Mat &)

}} // namespace gapi::own

using gapi::own::descr_of; // with include gmat.hpp it has not been declared

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We get error ‘fluidcv::gapi::own::descr_of’ has not been declared


using Rect = gapi::own::Rect;
using Size = gapi::own::Size;
using Point = gapi::own::Point;
using Scalar = gapi::own::Scalar;
using Mat = gapi::own::Mat;

} // namespace cv

static inline int cvFloor( double value )
Expand Down