Commit 46de61d3509e4e44140ad96f79f30e85f646df6a
1 parent
3473eeed
fixed issue with including private headers
Showing
2 changed files
with
17 additions
and
5 deletions
openbr/openbr_plugin.cpp
| ... | ... | @@ -234,6 +234,11 @@ void File::appendRect(const QRectF &rect) |
| 234 | 234 | m_metadata["Rects"] = newRects; |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | +void File::appendRect(const Rect &rect) | |
| 238 | +{ | |
| 239 | + appendRect(OpenCVUtils::fromRect(rect)); | |
| 240 | +} | |
| 241 | + | |
| 237 | 242 | void File::appendRects(const QList<QRectF> &rects) |
| 238 | 243 | { |
| 239 | 244 | QList<QVariant> newRects = m_metadata["Rects"].toList(); |
| ... | ... | @@ -242,6 +247,11 @@ void File::appendRects(const QList<QRectF> &rects) |
| 242 | 247 | m_metadata["Rects"] = newRects; |
| 243 | 248 | } |
| 244 | 249 | |
| 250 | +void File::appendRects(const QList<Rect> &rects) | |
| 251 | +{ | |
| 252 | + appendRects(OpenCVUtils::fromRects(rects)); | |
| 253 | +} | |
| 254 | + | |
| 245 | 255 | /* File - private methods */ |
| 246 | 256 | void File::init(const QString &file) |
| 247 | 257 | { | ... | ... |
openbr/openbr_plugin.h
| ... | ... | @@ -41,8 +41,6 @@ |
| 41 | 41 | #include <QVector> |
| 42 | 42 | #include <opencv2/core/core.hpp> |
| 43 | 43 | #include <openbr/openbr.h> |
| 44 | -#include <openbr/core/qtutils.h> | |
| 45 | -#include <openbr/core/opencvutils.h> | |
| 46 | 44 | |
| 47 | 45 | /*! |
| 48 | 46 | * \defgroup cpp_plugin_sdk C++ Plugin SDK |
| ... | ... | @@ -222,7 +220,11 @@ struct BR_EXPORT File |
| 222 | 220 | template <typename T> |
| 223 | 221 | void setList(const QString &key, const QList<T> &value) |
| 224 | 222 | { |
| 225 | - set(key, QtUtils::toVariantList(value)); | |
| 223 | + QVariantList variantList; | |
| 224 | + variantList.reserve(value.size()); | |
| 225 | + foreach (const T &item, value) | |
| 226 | + variantList << item; | |
| 227 | + set(key, variantList); | |
| 226 | 228 | } |
| 227 | 229 | |
| 228 | 230 | inline void remove(const QString &key) { m_metadata.remove(key); } /*!< \brief Remove the metadata key. */ |
| ... | ... | @@ -315,9 +317,9 @@ struct BR_EXPORT File |
| 315 | 317 | QList<QRectF> namedRects() const; /*!< \brief Returns rects convertible from metadata values. */ |
| 316 | 318 | QList<QRectF> rects() const; /*!< \brief Returns the file's rects list. */ |
| 317 | 319 | 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. */ | |
| 320 | + void appendRect(const cv::Rect &rect); /*!< \brief Adds a rect to the file's rect list. */ | |
| 319 | 321 | 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. */ | |
| 322 | + void appendRects(const QList<cv::Rect> &rects); /*!< \brief Adds rects to the file's rect list. */ | |
| 321 | 323 | inline void clearRects() { m_metadata["Rects"] = QList<QVariant>(); } /*!< \brief Clears the file's rect list. */ |
| 322 | 324 | inline void setRects(const QList<QRectF> &rects) { clearRects(); appendRects(rects); } /*!< \brief Overwrites the file's rect list. */ |
| 323 | 325 | inline void setRects(const QList<cv::Rect> &rects) { clearRects(); appendRects(rects); } /*!< \brief Overwrites the file's rect list. */ | ... | ... |