-
Notifications
You must be signed in to change notification settings - Fork 0
/
qflipthread.h
52 lines (43 loc) · 1.07 KB
/
qflipthread.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
50
51
52
#ifndef QFLIPTHREAD_H
#define QFLIPTHREAD_H
#include <QObject>
#include <QThread>
#include <QImage>
enum type_thread{
FLIP = 0,
SHUFFLE,
ROTATE,
RESIZE,
NULL_TYPE
};
class QFlipThread : public QThread
{
Q_OBJECT
public:
explicit QFlipThread(QObject *parent = 0);
explicit QFlipThread(type_thread type);
void setFunc(QString* pImgDir, QStringList* pImgList);
protected:
virtual void run();
private:
void shuffleImages(const QStringList& list);
void rotateSets(const QStringList& list);
void resizeSets(const QStringList& list, int w, int h);
private:
QImage flipImage(const QImage& img_src, bool horizon = true);
QImage rotateImage(const QImage& img_src, qreal angle);
QImage resizeImage(const QImage& img_src, int w, int h);
private:
QString* m_pImgDir;
QStringList* m_pImgList;
type_thread m_type;
public:
int m_rsWidth;
int m_rsHeight;
signals:
void nextImage(int idx);
void rotateSingle(const QImage& img);
public slots:
void getResizePara(int w, int h);
};
#endif // QFLIPTHREAD_H