-
Notifications
You must be signed in to change notification settings - Fork 0
/
featureitem.h
49 lines (38 loc) · 1.18 KB
/
featureitem.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef FEATUREITEM_H
#define FEATUREITEM_H
#include <QtQuick/QQuickPaintedItem>
#include <QPainter>
class FeatureItem : public QQuickPaintedItem
{
Q_OBJECT
Q_PROPERTY(QString imagePath READ imagePath WRITE setImagePath NOTIFY imagePathChanged)
Q_ENUMS(FeatureExtractorType)
Q_PROPERTY(FeatureExtractorType featureExtractorType READ featureExtractorType WRITE setFeatureExtractorType NOTIFY featureExtractorTypeChanged)
public:
FeatureItem(QQuickItem *parent = 0);
FeatureItem(const FeatureItem &other);
FeatureItem& operator =(const FeatureItem &other);
enum FeatureExtractorType {
HaarLike,
LBP,
CensusFeature,
ColorBins,
Laplacian
};
void paint(QPainter *painter);
public slots:
QString imagePath() const;
void setImagePath(QString &imgPath);
FeatureItem::FeatureExtractorType featureExtractorType() const;
void setFeatureExtractorType(FeatureExtractorType type);
signals:
void imagePathChanged();
void featureExtractorTypeChanged();
private:
void compute();
private:
FeatureExtractorType m_extractorType;
QImage m_image;
QString m_imagePath;
};
#endif // FEATUREITEM_H