2012-01-06 16:09:03 +00:00
|
|
|
#ifndef _PAYSAGES_QT_PREVIEW_H_
|
|
|
|
#define _PAYSAGES_QT_PREVIEW_H_
|
2011-12-26 21:53:29 +00:00
|
|
|
|
|
|
|
#include <QMutex>
|
|
|
|
#include <QImage>
|
|
|
|
#include <QWidget>
|
|
|
|
|
|
|
|
class Preview:public QWidget
|
|
|
|
{
|
2012-01-05 18:39:17 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
2011-12-26 21:53:29 +00:00
|
|
|
public:
|
|
|
|
Preview(QWidget* parent);
|
|
|
|
static void startUpdater();
|
|
|
|
void doRender();
|
2011-12-27 19:03:46 +00:00
|
|
|
void redraw();
|
2011-12-26 21:53:29 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void resizeEvent(QResizeEvent* event);
|
|
|
|
void paintEvent(QPaintEvent* event);
|
|
|
|
virtual QColor getColor(double x, double y) = 0;
|
|
|
|
|
|
|
|
void renderPixbuf();
|
|
|
|
void forceRender();
|
|
|
|
|
|
|
|
double conf_scroll_xmin;
|
|
|
|
double conf_scroll_xmax;
|
|
|
|
double conf_scroll_ymin;
|
|
|
|
double conf_scroll_ymax;
|
|
|
|
|
|
|
|
double conf_scale_min;
|
|
|
|
double conf_scale_max;
|
|
|
|
double conf_scale_step;
|
|
|
|
|
|
|
|
double xoffset;
|
|
|
|
double yoffset;
|
|
|
|
double scaling;
|
|
|
|
|
|
|
|
QMutex* lock;
|
|
|
|
QImage* pixbuf;
|
|
|
|
|
|
|
|
int mousex;
|
|
|
|
int mousey;
|
|
|
|
|
|
|
|
int need_rerender;
|
|
|
|
int need_render;
|
|
|
|
//SmallPreviewCallback renderer;
|
|
|
|
};
|
|
|
|
|
2012-01-06 16:09:03 +00:00
|
|
|
#endif // _PAYSAGES_QT_PREVIEW_H_
|