gframe.hpp 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. // This file is part of OpenCV project.
  2. // It is subject to the license terms in the LICENSE file found in the top-level directory
  3. // of this distribution and at http://opencv.org/license.html.
  4. //
  5. // Copyright (C) 2020 Intel Corporation
  6. #ifndef OPENCV_GAPI_GFRAME_HPP
  7. #define OPENCV_GAPI_GFRAME_HPP
  8. #include <ostream>
  9. #include <memory> // std::shared_ptr
  10. #include <opencv2/gapi/opencv_includes.hpp>
  11. #include <opencv2/gapi/gcommon.hpp> // GShape
  12. #include <opencv2/gapi/gmat.hpp>
  13. #include <opencv2/gapi/own/assert.hpp>
  14. // TODO GAPI_EXPORTS or so
  15. namespace cv
  16. {
  17. // Forward declaration; GNode and GOrigin are an internal
  18. // (user-inaccessible) classes.
  19. class GNode;
  20. struct GOrigin;
  21. /** \addtogroup gapi_data_objects
  22. * @{
  23. */
  24. class GAPI_EXPORTS_W_SIMPLE GFrame
  25. {
  26. public:
  27. GAPI_WRAP GFrame(); // Empty constructor
  28. GFrame(const GNode &n, std::size_t out); // Operation result constructor
  29. GOrigin& priv(); // Internal use only
  30. const GOrigin& priv() const; // Internal use only
  31. private:
  32. std::shared_ptr<GOrigin> m_priv;
  33. };
  34. /** @} */
  35. enum class MediaFormat: int
  36. {
  37. BGR = 0,
  38. NV12,
  39. };
  40. /**
  41. * \addtogroup gapi_meta_args
  42. * @{
  43. */
  44. struct GAPI_EXPORTS GFrameDesc
  45. {
  46. MediaFormat fmt;
  47. cv::Size size;
  48. bool operator== (const GFrameDesc &) const;
  49. };
  50. static inline GFrameDesc empty_gframe_desc() { return GFrameDesc{}; }
  51. /** @} */
  52. class MediaFrame;
  53. GAPI_EXPORTS GFrameDesc descr_of(const MediaFrame &frame);
  54. GAPI_EXPORTS std::ostream& operator<<(std::ostream& os, const cv::GFrameDesc &desc);
  55. } // namespace cv
  56. #endif // OPENCV_GAPI_GFRAME_HPP