Commit ac0a08d3c8733df2a4cbdafc169d306fea348149
1 parent
5e8dc852
Allow all the QRectF operations in File to also take cv::Rect
Showing
1 changed file
with
4 additions
and
0 deletions
openbr/openbr_plugin.h
| ... | ... | @@ -42,6 +42,7 @@ |
| 42 | 42 | #include <opencv2/core/core.hpp> |
| 43 | 43 | #include <openbr/openbr.h> |
| 44 | 44 | #include <openbr/core/qtutils.h> |
| 45 | +#include <openbr/core/opencvutils.h> | |
| 45 | 46 | |
| 46 | 47 | /*! |
| 47 | 48 | * \defgroup cpp_plugin_sdk C++ Plugin SDK |
| ... | ... | @@ -314,9 +315,12 @@ struct BR_EXPORT File |
| 314 | 315 | QList<QRectF> namedRects() const; /*!< \brief Returns rects convertible from metadata values. */ |
| 315 | 316 | QList<QRectF> rects() const; /*!< \brief Returns the file's rects list. */ |
| 316 | 317 | void appendRect(const QRectF &rect); /*!< \brief Adds a rect to the file's rect list. */ |
| 318 | + void appendRect(const cv::Rect &rect) { appendRect(OpenCVUtils::fromRect(rect)); } /*!< \brief Adds a rect to the file's rect list. */ | |
| 317 | 319 | void appendRects(const QList<QRectF> &rects); /*!< \brief Adds rects to the file's rect list. */ |
| 320 | + void appendRects(const QList<cv::Rect> &rects) { appendRects(OpenCVUtils::fromRects(rects)); } /*!< \brief Adds rects to the file's rect list. */ | |
| 318 | 321 | inline void clearRects() { m_metadata["Rects"] = QList<QVariant>(); } /*!< \brief Clears the file's rect list. */ |
| 319 | 322 | inline void setRects(const QList<QRectF> &rects) { clearRects(); appendRects(rects); } /*!< \brief Overwrites the file's rect list. */ |
| 323 | + inline void setRects(const QList<cv::Rect> &rects) { clearRects(); appendRects(rects); } /*!< \brief Overwrites the file's rect list. */ | |
| 320 | 324 | |
| 321 | 325 | private: |
| 322 | 326 | QMap<QString,QVariant> m_metadata; | ... | ... |