1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 00:03:03 +04:00

Merge pull request #16118 from smirnov-alexey:as/gopaque

G-API: GOpaque implementation

* Stub initial copypasted solution

* Fix mov test and add a couple of others

* Fix warnings

* More code coverage and tests

* fix macos warning

* address review comments

* Address review comments and fix indentation

* Fix build on armv7
This commit is contained in:
Alexey Smirnov
2020-01-30 21:08:11 +03:00
committed by GitHub
parent 2ced568d34
commit 0d456f9111
33 changed files with 850 additions and 23 deletions
@@ -37,6 +37,10 @@ using GArg_Test_Types = ::testing::Types
, Expected<cv::GArray<float>, cv::detail::ArgKind::GARRAY>
, Expected<cv::GArray<cv::Point>, cv::detail::ArgKind::GARRAY>
, Expected<cv::GArray<cv::Rect>, cv::detail::ArgKind::GARRAY>
, Expected<cv::GOpaque<int>, cv::detail::ArgKind::GOPAQUE>
, Expected<cv::GOpaque<float>, cv::detail::ArgKind::GOPAQUE>
, Expected<cv::GOpaque<cv::Point>, cv::detail::ArgKind::GOPAQUE>
, Expected<cv::GOpaque<cv::Rect>, cv::detail::ArgKind::GOPAQUE>
// Built-in types
, Expected<int, cv::detail::ArgKind::OPAQUE_VAL>
@@ -85,6 +89,11 @@ TEST(GArg, HasWrap)
"GArray<int> has custom marshalling logic");
static_assert(cv::detail::has_custom_wrap<cv::GArray<std::string> >::value,
"GArray<int> has custom marshalling logic");
static_assert(cv::detail::has_custom_wrap<cv::GOpaque<int> >::value,
"GOpaque<int> has custom marshalling logic");
static_assert(cv::detail::has_custom_wrap<cv::GOpaque<std::string> >::value,
"GOpaque<int> has custom marshalling logic");
}
TEST(GArg, GArrayU)
@@ -97,5 +106,15 @@ TEST(GArg, GArrayU)
EXPECT_NO_THROW(arg2.get<cv::detail::GArrayU>());
}
TEST(GArg, GOpaqueU)
{
// Placing a GOpaque<T> into GArg automatically strips it to GOpaqueU
cv::GArg arg1 = cv::GArg(cv::GOpaque<int>());
EXPECT_NO_THROW(arg1.get<cv::detail::GOpaqueU>());
cv::GArg arg2 = cv::GArg(cv::GOpaque<cv::Point>());
EXPECT_NO_THROW(arg2.get<cv::detail::GOpaqueU>());
}
} // namespace opencv_test