File: pdfrenderengine.h

package info (click to toggle)
texstudio 2.3%2Bdebian-3
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 20,992 kB
  • sloc: cpp: 61,734; ansic: 4,300; xml: 726; sh: 125; makefile: 25
file content (57 lines) | stat: -rw-r--r-- 914 bytes parent folder | download
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
53
54
55
56
57
#ifndef PDFRENDERENGINE_H
#define PDFRENDERENGINE_H

#ifndef NO_POPPLER_PREVIEW

#include "poppler-qt4.h"

#include <QThread>
#include <QSemaphore>
#include <QMutex>
#include <QQueue>
#include <QImage>

class PDFQueue;

class RenderCommand {
public:
	explicit RenderCommand(int p,double xr=72.0,double yr=72.0,int x=-1,int y=-1,int w=-1,int h=-1);
	int pageNr;
	double xres;
	double yres;
	int x;
	int y;
	int w;
	int h;
	Poppler::Page::Rotation rotate;
	int ticket;
	bool priority;
};

class PDFRenderEngine : public QThread
{
	Q_OBJECT
public:
	explicit PDFRenderEngine(QObject *parent,PDFQueue *mQueue);
	~PDFRenderEngine();

	QByteArray tempData;
	void setDocument(Poppler::Document *doc);
signals:
	void sendImage(QImage image,int page,int ticket);

public slots:

protected:
	void run();

private:
	Poppler::Document	*document;
	int cachedNumPages;
	PDFQueue *queue;

};

#endif // PDFRENDERENGINE_H

#endif