From ac0a08d3c8733df2a4cbdafc169d306fea348149 Mon Sep 17 00:00:00 2001 From: Austin Blanton Date: Tue, 15 Oct 2013 17:11:34 -0400 Subject: [PATCH] Allow all the QRectF operations in File to also take cv::Rect --- openbr/openbr_plugin.h | 4 ++++ 1 file changed, 4 insertions(+), 0 deletions(-) diff --git a/openbr/openbr_plugin.h b/openbr/openbr_plugin.h index 9919054..d551bb0 100644 --- a/openbr/openbr_plugin.h +++ b/openbr/openbr_plugin.h @@ -42,6 +42,7 @@ #include #include #include +#include /*! * \defgroup cpp_plugin_sdk C++ Plugin SDK @@ -314,9 +315,12 @@ struct BR_EXPORT File QList namedRects() const; /*!< \brief Returns rects convertible from metadata values. */ QList rects() const; /*!< \brief Returns the file's rects list. */ void appendRect(const QRectF &rect); /*!< \brief Adds a rect to the file's rect list. */ + void appendRect(const cv::Rect &rect) { appendRect(OpenCVUtils::fromRect(rect)); } /*!< \brief Adds a rect to the file's rect list. */ void appendRects(const QList &rects); /*!< \brief Adds rects to the file's rect list. */ + void appendRects(const QList &rects) { appendRects(OpenCVUtils::fromRects(rects)); } /*!< \brief Adds rects to the file's rect list. */ inline void clearRects() { m_metadata["Rects"] = QList(); } /*!< \brief Clears the file's rect list. */ inline void setRects(const QList &rects) { clearRects(); appendRects(rects); } /*!< \brief Overwrites the file's rect list. */ + inline void setRects(const QList &rects) { clearRects(); appendRects(rects); } /*!< \brief Overwrites the file's rect list. */ private: QMap m_metadata; -- libgit2 0.21.4