Merge pull request #19828 from OrestChura:oc/fix_garray_garray_input
[G-API] Fix bug of GArray<GArray> passing through a graph * Add test to check GArray<GArray> passing through a graph (assertion failed) * G-API: Flatten GArray<T> to std::vector<T> when capturing VCtr - Also: Fix formatting in garray.hpp * Refactored test, added valuable check * Initialize size_t Co-authored-by: Dmitry Matveev <dmitry.matveev@intel.com>
This commit is contained in:
@@ -246,12 +246,18 @@ namespace detail
|
||||
|
||||
public:
|
||||
VectorRef() = default;
|
||||
template<typename T> explicit VectorRef(const std::vector<T>& vec) :
|
||||
m_ref(new VectorRefT<T>(vec)), m_kind(GOpaqueTraits<T>::kind) {}
|
||||
template<typename T> explicit VectorRef(std::vector<T>& vec) :
|
||||
m_ref(new VectorRefT<T>(vec)), m_kind(GOpaqueTraits<T>::kind) {}
|
||||
template<typename T> explicit VectorRef(std::vector<T>&& vec) :
|
||||
m_ref(new VectorRefT<T>(std::move(vec))), m_kind(GOpaqueTraits<T>::kind) {}
|
||||
template<typename T> explicit VectorRef(const std::vector<T>& vec)
|
||||
: m_ref(new VectorRefT<T>(vec))
|
||||
, m_kind(GOpaqueTraits<T>::kind)
|
||||
{}
|
||||
template<typename T> explicit VectorRef(std::vector<T>& vec)
|
||||
: m_ref(new VectorRefT<T>(vec))
|
||||
, m_kind(GOpaqueTraits<T>::kind)
|
||||
{}
|
||||
template<typename T> explicit VectorRef(std::vector<T>&& vec)
|
||||
: m_ref(new VectorRefT<T>(std::move(vec)))
|
||||
, m_kind(GOpaqueTraits<T>::kind)
|
||||
{}
|
||||
|
||||
cv::detail::OpaqueKind getKind() const
|
||||
{
|
||||
@@ -321,9 +327,10 @@ namespace detail
|
||||
# define FLATTEN_NS cv
|
||||
#endif
|
||||
template<class T> struct flatten_g;
|
||||
template<> struct flatten_g<cv::GMat> { using type = FLATTEN_NS::Mat; };
|
||||
template<> struct flatten_g<cv::GScalar> { using type = FLATTEN_NS::Scalar; };
|
||||
template<class T> struct flatten_g { using type = T; };
|
||||
template<> struct flatten_g<cv::GMat> { using type = FLATTEN_NS::Mat; };
|
||||
template<> struct flatten_g<cv::GScalar> { using type = FLATTEN_NS::Scalar; };
|
||||
template<class T> struct flatten_g<GArray<T>> { using type = std::vector<T>; };
|
||||
template<class T> struct flatten_g { using type = T; };
|
||||
#undef FLATTEN_NS
|
||||
// FIXME: the above mainly duplicates "ProtoToParam" thing from gtyped.hpp
|
||||
// but I decided not to include gtyped here - probably worth moving that stuff
|
||||
|
||||
Reference in New Issue
Block a user