~ubuntu-branches/ubuntu/precise/koffice/precise

« back to all changes in this revision

Viewing changes to krita/plugins/filters/pixelizefilter/kis_pixelize_filter.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2006-04-20 21:38:53 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060420213853-j5lxluqvymxt2zny
Tags: 1:1.5.0-0ubuntu2
UbuntuĀ uploadĀ 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * This file is part of the KDE project
 
3
 *
 
4
 * Copyright (c) Michael Thaler <michael.thaler@physik.tu-muenchen.de>
 
5
 *
 
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.
 
10
 *
 
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.
 
15
 *
 
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.
 
19
 */
 
20
 
 
21
#ifndef _KIS_PIXELIZE_FILTER_H_
 
22
#define _KIS_PIXELIZE_FILTER_H_
 
23
 
 
24
#include "kis_filter.h"
 
25
#include "kis_filter_config_widget.h"
 
26
 
 
27
class KisPixelizeFilterConfiguration : public KisFilterConfiguration
 
28
{
 
29
public:
 
30
    KisPixelizeFilterConfiguration(Q_UINT32 pixelWidth, Q_UINT32 pixelHeight)
 
31
        : KisFilterConfiguration( "pixelize", 1 )
 
32
        {
 
33
            setProperty("pixelWidth", pixelWidth);
 
34
            setProperty("pixelHeight", pixelHeight);
 
35
        };
 
36
public:
 
37
    inline Q_UINT32 pixelWidth() { return getInt("pixelWidth"); };
 
38
    inline Q_UINT32 pixelHeight() {return getInt("pixelHeight"); };
 
39
};
 
40
 
 
41
class KisPixelizeFilter : public KisFilter
 
42
{
 
43
public:
 
44
    KisPixelizeFilter();
 
45
public:
 
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; }
 
52
public:
 
53
    virtual KisFilterConfigWidget * createConfigurationWidget(QWidget* parent, KisPaintDeviceSP dev);
 
54
    virtual KisFilterConfiguration* configuration(QWidget*);
 
55
    virtual KisFilterConfiguration * configuration();
 
56
private:
 
57
    void pixelize(KisPaintDeviceSP src, KisPaintDeviceSP dst, int x, int y, int w, int h, int pixelWidth, int pixelHeight);
 
58
};
 
59
 
 
60
#endif