krita
kis_previewwidget.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __kis_previewwidget_h__
00024 #define __kis_previewwidget_h__
00025
00026 #include <qimage.h>
00027 #include <qevent.h>
00028
00029 #include "kis_types.h"
00030
00031 #include "kis_previewwidgetbase.h"
00032
00033 class QWidget;
00034 class KisProfile;
00035 class KisFilter;
00036 class KisFilterConfiguration;
00037 class QTimer;
00038 class KisLabelProgress;
00039
00048 class KisPreviewWidget : public PreviewWidgetBase
00049 {
00050 Q_OBJECT
00051
00052 public:
00054 KisPreviewWidget( QWidget* parent = 0, const char* name = 0 );
00055 virtual ~KisPreviewWidget();
00056
00058 bool getAutoUpdate() const;
00059
00060 void wheelEvent(QWheelEvent * e);
00061
00068 void runFilter(KisFilter * filter, KisFilterConfiguration * config);
00069
00070 public slots:
00071
00073 void slotSetDevice(KisPaintDeviceSP dev);
00074
00076 void slotSetAutoUpdate(bool set);
00077
00079 void setPreviewDisplayed(bool v);
00080
00082 void needUpdate();
00083
00084 signals:
00086 void updated();
00087
00088 private slots:
00089
00090 void zoomIn();
00091 void zoomOut();
00092 void zoomOneToOne();
00093
00097 void forceUpdate();
00098
00102 void updateZoom();
00103
00106 void runFilterHelper();
00107
00108 private:
00112 void zoomChanged(const double zoom);
00113
00114 bool m_autoupdate;
00115 bool m_previewIsDisplayed;
00116
00117 QImage m_scaledOriginal;
00118 bool m_dirtyOriginal;
00119 KisPaintDeviceSP m_origDevice;
00120
00121 QImage m_scaledPreview;
00122 bool m_dirtyPreview;
00123 KisPaintDeviceSP m_previewDevice;
00124 KisImageSP m_scaledImage;
00125
00126 double m_filterZoom;
00127 double m_zoom;
00128 KisProfile * m_profile;
00129
00130 KisLabelProgress *m_progress;
00131
00132 QTimer * m_zoomTimer;
00133 QTimer * m_filterTimer;
00134 KisFilter * m_filter;
00135 KisFilterConfiguration * m_config;
00136 bool m_firstFilter;
00137 bool m_firstZoom;
00138 };
00139
00140 #endif
|