-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgigrenderthread.h
More file actions
50 lines (45 loc) · 1.27 KB
/
Copy pathgigrenderthread.h
File metadata and controls
50 lines (45 loc) · 1.27 KB
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
#pragma once
#include "renderqueue.h"
#include <QThread>
#include <QHash>
#include <QImage>
#include <QMutex>
#include <QList>
class GigBmpImage;
class GigRenderThread : public QThread
{
Q_OBJECT
struct CacheData
{
TiledImageGraphicsItem* item;
QImage image;
};
typedef QList<CacheData> CacheDataList;
public:
GigRenderThread(QObject *parent);
~GigRenderThread();
void render(TiledImageGraphicsItem* item, int priority=0);
QImage cachedRawImageOf(TiledImageGraphicsItem* item);
void cacheRawImage(TiledImageGraphicsItem* item);
bool startService(const QString& filePath);
void stopService(unsigned long waitTime=ULONG_MAX);
void reset(void);
void resetItemCount(int count);
GigBmpImage* image(void);
signals:
void renderStatusChanged(const QString& status);
void renderProgress(int doneCount, int requestCount);
void renderedImage(TiledImageGraphicsItem* item, QImage scaleDown);
void cachedImage(TiledImageGraphicsItem* item);
protected:
virtual void run(void);
void addCache(TiledImageGraphicsItem* item, QImage image);
bool m_stopped;
GigBmpImage* m_image;
QWaitCondition m_queueNotEmpty;
RenderQueue m_eventQueue;
mutable QMutex m_cacheLock;
CacheDataList m_cache;
int m_itemCount;
int m_renderedItemCount;
};