2
* This file is part of the KDE project
4
* Copyright (c) Michael Thaler <michael.thaler@physik.tu-muenchen.de>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21
#ifndef _KIS_PIXELIZE_FILTER_H_
22
#define _KIS_PIXELIZE_FILTER_H_
24
#include "kis_filter.h"
25
#include "kis_filter_config_widget.h"
27
class KisPixelizeFilterConfiguration : public KisFilterConfiguration
30
KisPixelizeFilterConfiguration(Q_UINT32 pixelWidth, Q_UINT32 pixelHeight)
31
: KisFilterConfiguration( "pixelize", 1 )
33
setProperty("pixelWidth", pixelWidth);
34
setProperty("pixelHeight", pixelHeight);
37
inline Q_UINT32 pixelWidth() { return getInt("pixelWidth"); };
38
inline Q_UINT32 pixelHeight() {return getInt("pixelHeight"); };
41
class KisPixelizeFilter : public KisFilter
46
virtual void process(KisPaintDeviceSP,KisPaintDeviceSP, KisFilterConfiguration* , const QRect&);
47
static inline KisID id() { return KisID("pixelize", i18n("Pixelize")); };
48
virtual bool supportsPainting() { return true; }
49
virtual bool supportsPreview() { return true; }
50
virtual std::list<KisFilterConfiguration*> listOfExamplesConfiguration(KisPaintDeviceSP )
51
{ std::list<KisFilterConfiguration*> list; list.insert(list.begin(), new KisPixelizeFilterConfiguration(10,10)); return list; }
53
virtual KisFilterConfigWidget * createConfigurationWidget(QWidget* parent, KisPaintDeviceSP dev);
54
virtual KisFilterConfiguration* configuration(QWidget*);
55
virtual KisFilterConfiguration * configuration();
57
void pixelize(KisPaintDeviceSP src, KisPaintDeviceSP dst, int x, int y, int w, int h, int pixelWidth, int pixelHeight);