@@ -410,9 +410,13 @@ namespace std
410410 };
411411} // namespace std
412412
413-
414413namespace cv {
414+ class GAPI_EXPORTS_W_SIMPLE GKernelPackage;
415+
415416namespace gapi {
417+ GAPI_EXPORTS cv::GKernelPackage combine (const cv::GKernelPackage &lhs,
418+ const cv::GKernelPackage &rhs);
419+
416420 // / @private
417421 class GFunctor
418422 {
@@ -427,6 +431,7 @@ namespace gapi {
427431 private:
428432 const char * m_id;
429433 };
434+ } // namespace gapi
430435
431436 /* * \addtogroup gapi_compile_args
432437 * @{
@@ -463,7 +468,7 @@ namespace gapi {
463468 {
464469
465470 // / @private
466- using M = std::unordered_map<std::string, std::pair<GBackend, GKernelImpl>>;
471+ using M = std::unordered_map<std::string, std::pair<cv::gapi:: GBackend, cv:: GKernelImpl>>;
467472
468473 // / @private
469474 M m_id_kernels;
@@ -500,10 +505,8 @@ namespace gapi {
500505 }
501506
502507 public:
503- void include (const GFunctor& functor)
504- {
505- m_id_kernels[functor.id ()] = std::make_pair (functor.backend (), functor.impl ());
506- }
508+ void include (const cv::gapi::GFunctor& functor);
509+
507510 /* *
508511 * @brief Returns total number of kernels
509512 * in the package (across all backends included)
@@ -555,7 +558,7 @@ namespace gapi {
555558 *
556559 * @param backend backend which kernels to remove
557560 */
558- void remove (const GBackend& backend);
561+ void remove (const cv::gapi:: GBackend& backend);
559562
560563 /* *
561564 * @brief Remove all kernels implementing the given API from
@@ -595,7 +598,7 @@ namespace gapi {
595598 *
596599 */
597600 template <typename KAPI>
598- GBackend lookup () const
601+ cv::gapi:: GBackend lookup () const
599602 {
600603 return lookup (KAPI::id ()).first ;
601604 }
@@ -621,18 +624,14 @@ namespace gapi {
621624 * @param backend backend associated with the kernel
622625 * @param kernel_id a name/id of the kernel
623626 */
624- void include (const cv::gapi::GBackend& backend, const std::string& kernel_id)
625- {
626- removeAPI (kernel_id);
627- m_id_kernels[kernel_id] = std::make_pair (backend, GKernelImpl{{}, {}});
628- }
627+ void include (const cv::gapi::GBackend& backend, const std::string& kernel_id);
629628
630629 /* *
631630 * @brief Lists all backends which are included into package
632631 *
633632 * @return vector of backends
634633 */
635- std::vector<GBackend> backends () const ;
634+ std::vector<cv::gapi:: GBackend> backends () const ;
636635
637636 // TODO: Doxygen bug -- it wants me to place this comment
638637 // here, not below.
@@ -643,9 +642,17 @@ namespace gapi {
643642 * @param rhs "Right-hand-side" package in the process
644643 * @return a new kernel package.
645644 */
646- friend GAPI_EXPORTS GKernelPackage combine (const GKernelPackage &lhs,
647- const GKernelPackage &rhs);
645+ friend GAPI_EXPORTS GKernelPackage cv::gapi:: combine (const GKernelPackage &lhs,
646+ const GKernelPackage &rhs);
648647 };
648+ /* * @} */
649+
650+ namespace gapi {
651+ using GKernelPackage = cv::GKernelPackage; // Keep backward compatibility
652+
653+ /* * \addtogroup gapi_compile_args
654+ * @{
655+ */
649656
650657 /* *
651658 * @brief Create a kernel package object containing kernels
@@ -695,10 +702,6 @@ namespace gapi {
695702
696703 /* * @} */
697704
698- // FYI - this function is already commented above
699- GAPI_EXPORTS GKernelPackage combine (const GKernelPackage &lhs,
700- const GKernelPackage &rhs);
701-
702705 /* *
703706 * @brief Combines multiple G-API kernel packages into one
704707 *
@@ -710,7 +713,7 @@ namespace gapi {
710713 * @return The resulting kernel package
711714 */
712715 template <typename ... Ps>
713- GKernelPackage combine (const GKernelPackage &a, const GKernelPackage &b, Ps&&... rest)
716+ cv:: GKernelPackage combine (const cv:: GKernelPackage &a, const cv:: GKernelPackage &b, Ps&&... rest)
714717 {
715718 return combine (a, combine (b, rest...));
716719 }
@@ -733,7 +736,7 @@ namespace gapi {
733736
734737namespace detail
735738{
736- template <> struct CompileArgTag <cv::gapi:: GKernelPackage>
739+ template <> struct CompileArgTag <cv::GKernelPackage>
737740 {
738741 static const char * tag () { return " gapi.kernel_package" ; }
739742 };
0 commit comments