forked from opencv/opencv
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request opencv#18391 from dmatveev:dm/gframe_00_new_type
* G-API: Make GFrame a new (distinct) G-type, not an alias to GMat - The underlying host type is still cv::Mat, a new cv::MediaFrame type is to be added as a separate PR * Fix warnings and review comments - Somewhow there was a switch() without a default: clause in Fluid
- Loading branch information
Showing
8 changed files
with
110 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,6 +84,7 @@ enum class GShape: int | |
GSCALAR, | ||
GARRAY, | ||
GOPAQUE, | ||
GFRAME, | ||
}; | ||
|
||
struct GCompileArg; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// This file is part of OpenCV project. | ||
// It is subject to the license terms in the LICENSE file found in the top-level directory | ||
// of this distribution and at http://opencv.org/license.html. | ||
// | ||
// Copyright (C) 2020 Intel Corporation | ||
|
||
|
||
#ifndef OPENCV_GAPI_GFRAME_HPP | ||
#define OPENCV_GAPI_GFRAME_HPP | ||
|
||
#include <ostream> | ||
#include <memory> // std::shared_ptr | ||
|
||
#include <opencv2/gapi/opencv_includes.hpp> | ||
#include <opencv2/gapi/gcommon.hpp> // GShape | ||
|
||
#include <opencv2/gapi/gmat.hpp> | ||
#include <opencv2/gapi/own/assert.hpp> | ||
|
||
// TODO GAPI_EXPORTS or so | ||
namespace cv | ||
{ | ||
// Forward declaration; GNode and GOrigin are an internal | ||
// (user-inaccessible) classes. | ||
class GNode; | ||
struct GOrigin; | ||
|
||
/** \addtogroup gapi_data_objects | ||
* @{ | ||
*/ | ||
class GAPI_EXPORTS_W_SIMPLE GFrame | ||
{ | ||
public: | ||
GAPI_WRAP GFrame(); // Empty constructor | ||
GFrame(const GNode &n, std::size_t out); // Operation result constructor | ||
|
||
GOrigin& priv(); // Internal use only | ||
const GOrigin& priv() const; // Internal use only | ||
|
||
private: | ||
std::shared_ptr<GOrigin> m_priv; | ||
}; | ||
/** @} */ | ||
|
||
/** | ||
* \addtogroup gapi_meta_args | ||
* @{ | ||
*/ | ||
struct GAPI_EXPORTS GFrameDesc | ||
{ | ||
}; | ||
static inline GFrameDesc empty_gframe_desc() { return GFrameDesc{}; } | ||
/** @} */ | ||
|
||
GAPI_EXPORTS std::ostream& operator<<(std::ostream& os, const cv::GFrameDesc &desc); | ||
|
||
} // namespace cv | ||
|
||
#endif // OPENCV_GAPI_GFRAME_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// This file is part of OpenCV project. | ||
// It is subject to the license terms in the LICENSE file found in the top-level directory | ||
// of this distribution and at http://opencv.org/license.html. | ||
// | ||
// Copyright (C) 2020 Intel Corporation | ||
|
||
|
||
#include "precomp.hpp" | ||
|
||
#include <opencv2/gapi/gframe.hpp> | ||
|
||
#include "api/gorigin.hpp" | ||
|
||
// cv::GFrame public implementation ////////////////////////////////////////////// | ||
cv::GFrame::GFrame() | ||
: m_priv(new GOrigin(GShape::GMAT, GNode::Param())) { | ||
// N.B.: The shape here is still GMAT as currently cv::Mat is used | ||
// as an underlying host type. Will be changed to GFRAME once | ||
// GExecutor & GStreamingExecutor & selected backends will be extended | ||
// to support cv::MediaFrame. | ||
} | ||
|
||
cv::GFrame::GFrame(const GNode &n, std::size_t out) | ||
: m_priv(new GOrigin(GShape::GMAT, n, out)) { | ||
// N.B.: GMAT is here for the same reason as above ^ | ||
} | ||
|
||
cv::GOrigin& cv::GFrame::priv() { | ||
return *m_priv; | ||
} | ||
|
||
const cv::GOrigin& cv::GFrame::priv() const { | ||
return *m_priv; | ||
} | ||
|
||
namespace cv { | ||
std::ostream& operator<<(std::ostream& os, const cv::GFrameDesc &) { | ||
return os; | ||
} | ||
|
||
} // namespace cv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters