~ubuntu-branches/ubuntu/saucy/digikam/saucy

« back to all changes in this revision

Viewing changes to imageplugins/enhance/inpaintingtool.h

  • Committer: Bazaar Package Importer
  • Author(s): Christian Mangold
  • Date: 2010-04-09 21:30:01 UTC
  • mfrom: (1.2.28 upstream)
  • Revision ID: james.westby@ubuntu.com-20100409213001-4bfyibrd359rn7o3
Tags: 2:1.2.0-0ubuntu1
* New upstream release (LP: #560576)
* Remove all patches, fixed upstream
  - Remove quilt build-depend

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ============================================================
 
2
 *
 
3
 * This file is a part of digiKam project
 
4
 * http://www.digikam.org
 
5
 *
 
6
 * Date        : 2005-03-30
 
7
 * Description : a digiKam image editor plugin to inpaint
 
8
 *               a photograph
 
9
 *
 
10
 * Copyright (C) 2005-2010 by Gilles Caulier <caulier dot gilles at gmail dot com>
 
11
 *
 
12
 * This program is free software; you can redistribute it
 
13
 * and/or modify it under the terms of the GNU General
 
14
 * Public License as published by the Free Software Foundation;
 
15
 * either version 2, or (at your option)
 
16
 * any later version.
 
17
 *
 
18
 * This program is distributed in the hope that it will be useful,
 
19
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
20
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
21
 * GNU General Public License for more details.
 
22
 *
 
23
 * ============================================================ */
 
24
 
 
25
#ifndef INPAINTINGTOOL_H
 
26
#define INPAINTINGTOOL_H
 
27
 
 
28
// Qt includes
 
29
 
 
30
#include <QString>
 
31
 
 
32
// KDE includes
 
33
 
 
34
#include <kpassivepopup.h>
 
35
 
 
36
// Local includes
 
37
 
 
38
#include "editortool.h"
 
39
 
 
40
using namespace Digikam;
 
41
 
 
42
namespace DigikamEnhanceImagePlugin
 
43
{
 
44
 
 
45
class InPaintingPassivePopup : public KPassivePopup
 
46
{
 
47
public:
 
48
 
 
49
    InPaintingPassivePopup(QWidget* parent) : KPassivePopup(parent), m_parent(parent) {}
 
50
 
 
51
protected:
 
52
 
 
53
    virtual void positionSelf() { move(m_parent->x() + 30, m_parent->y() + 30); }
 
54
 
 
55
private:
 
56
 
 
57
    QWidget* m_parent;
 
58
};
 
59
 
 
60
//-----------------------------------------------------------
 
61
 
 
62
class InPaintingToolPriv;
 
63
 
 
64
class InPaintingTool : public EditorToolThreaded
 
65
{
 
66
    Q_OBJECT
 
67
 
 
68
public:
 
69
 
 
70
    InPaintingTool(QObject* parent);
 
71
    ~InPaintingTool();
 
72
 
 
73
private Q_SLOTS:
 
74
 
 
75
    void processCImgUrl(const QString&);
 
76
    void slotResetValues(int);
 
77
    void slotResetSettings();
 
78
    void slotSaveAsSettings();
 
79
    void slotLoadSettings();
 
80
 
 
81
private:
 
82
 
 
83
    void readSettings();
 
84
    void writeSettings();
 
85
    void prepareEffect();
 
86
    void prepareFinal();
 
87
    void putPreviewData();
 
88
    void putFinalData();
 
89
    void renderingFinished();
 
90
 
 
91
private:
 
92
 
 
93
    enum InPaintingFilteringPreset
 
94
    {
 
95
        NoPreset = 0,
 
96
        RemoveSmallArtefact,
 
97
        RemoveMediumArtefact,
 
98
        RemoveLargeArtefact
 
99
    };
 
100
 
 
101
private:
 
102
 
 
103
    InPaintingToolPriv* const d;
 
104
};
 
105
 
 
106
}  // namespace DigikamEnhanceImagePlugin
 
107
 
 
108
#endif /* INPAINTINGTOOL_H */