chalk

kis_previewwidget.h
1/*
2 * kis_previewwidget.h - part of Chalk
3 *
4 * Copyright (c) 2001 John Califf <jcaliff@compuzone.net>
5 * Copyright (c) 2004 Bart Coppens <kde@bartcoppens.be>
6 * Copyright (c) 2005 Cyrille Berger <cberger@cberger.net>
7 * Copyright (c) 2007 Benjamin Schleimer <bensch128@yahoo.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 */
23#ifndef __kis_previewwidget_h__
24#define __kis_previewwidget_h__
25
26#include <tqimage.h>
27#include <tqevent.h>
28
29#include "kis_types.h"
30
31#include "kis_previewwidgetbase.h"
32
33class TQWidget;
34class KisProfile;
35class KisFilter;
37class TQTimer;
38class KisLabelProgress;
39
48class KisPreviewWidget : public PreviewWidgetBase
49{
50 TQ_OBJECT
51
52
53public:
55 KisPreviewWidget( TQWidget* parent = 0, const char* name = 0 );
56 virtual ~KisPreviewWidget();
57
59 bool getAutoUpdate() const;
60
61 void wheelEvent(TQWheelEvent * e);
62
69 void runFilter(KisFilter * filter, KisFilterConfiguration * config);
70
71public slots:
72
74 void slotSetDevice(KisPaintDeviceSP dev);
75
77 void slotSetAutoUpdate(bool set);
78
80 void setPreviewDisplayed(bool v);
81
83 void needUpdate();
84
85signals:
87 void updated();
88
89private slots:
90
91 void zoomIn();
92 void zoomOut();
93 void zoomOneToOne();
94
98 void forceUpdate();
99
103 void updateZoom();
104
107 void runFilterHelper();
108
109private:
113 void zoomChanged(const double zoom);
114
115 bool m_autoupdate;
116 bool m_previewIsDisplayed;
117
118 TQImage m_scaledOriginal;
119 bool m_dirtyOriginal;
120 KisPaintDeviceSP m_origDevice;
121
122 TQImage m_scaledPreview;
123 bool m_dirtyPreview;
124 KisPaintDeviceSP m_previewDevice;
125 KisImageSP m_scaledImage;
126
127 double m_filterZoom;
128 double m_zoom;
129 KisProfile * m_profile;
130
131 KisLabelProgress *m_progress;
132
133 TQTimer * m_zoomTimer;
134 TQTimer * m_filterTimer;
135 KisFilter * m_filter;
136 KisFilterConfiguration * m_config;
137 bool m_firstFilter;
138 bool m_firstZoom;
139};
140
141#endif
A KisFilterConfiguration is the serializable representation of the filter parameters.
Basic interface of a Chalk filter.
Definition kis_filter.h:46
A widget that can be used by plugins to show a preview of the effect of the plugin to the user.
void updated()
This is emitted when the position or zoom factor of the widget has changed.
void slotSetDevice(KisPaintDeviceSP dev)
Sets the preview to use the layer specified as argument.
void runFilter(KisFilter *filter, KisFilterConfiguration *config)
Instructs the KisPreviewWidget to eventually update the preview.
bool getAutoUpdate() const
returns if the preview is automatically updated
void setPreviewDisplayed(bool v)
Toggle between display preview and display original.
void needUpdate()
use to indicate that the preview need to be updated.
void slotSetAutoUpdate(bool set)
Enables or disables the automatically updating of the preview.