Plasma
renderthread.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef RENDERTHREAD_H
00011 #define RENDERTHREAD_H
00012
00013 #include "backgroundpackage.h"
00014 #include <QColor>
00015 #include <QImage>
00016 #include <QMutex>
00017 #include <QThread>
00018 #include <QWaitCondition>
00019
00020 class RenderThread : public QThread
00021 {
00022 Q_OBJECT
00023 public:
00024 RenderThread(const QSize &size, float ratio);
00025 virtual ~RenderThread();
00026
00027 int render(const QString &file,
00028 const QColor &color,
00029 Background::ResizeMethod method,
00030 Qt::TransformationMode mode);
00031
00032 void setSize(const QSize &size);
00033 protected:
00034 virtual void run();
00035 private:
00036 QMutex m_mutex;
00037 QWaitCondition m_condition;
00038
00039
00040 int m_current_token;
00041 QString m_file;
00042 QColor m_color;
00043 QSize m_size;
00044 float m_ratio;
00045 Background::ResizeMethod m_method;
00046 Qt::TransformationMode m_mode;
00047
00048 bool m_abort;
00049 bool m_restart;
00050 signals:
00051 void done(int token, const QImage &pixmap);
00052 };
00053
00054 #endif // RENDERTHREAD_H