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();
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 void setRatio(float ratio);
00034
00035 protected:
00036 virtual void run();
00037
00038 private:
00039 QMutex m_mutex;
00040 QWaitCondition m_condition;
00041
00042
00043 int m_current_token;
00044 QString m_file;
00045 QColor m_color;
00046 QSize m_size;
00047 float m_ratio;
00048 Background::ResizeMethod m_method;
00049 Qt::TransformationMode m_mode;
00050
00051 bool m_abort;
00052 bool m_restart;
00053
00054 signals:
00055 void done(int token, const QImage &pixmap);
00056 };
00057
00058 #endif // RENDERTHREAD_H