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

« back to all changes in this revision

Viewing changes to imageplugins/localcontrast/imageplugin_localcontrast.cpp

  • 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        : 2009-08-09
7
 
 * Description : a plugin to enhance image with local contrasts (as human eye does).
8
 
 *
9
 
 * Copyright (C) 2009 by Julien Pontabry <julien dot pontabry at gmail dot com>
10
 
 *
11
 
 * This program is free software; you can redistribute it
12
 
 * and/or modify it under the terms of the GNU General
13
 
 * Public License as published by the Free Software Foundation;
14
 
 * either version 2, or (at your option)
15
 
 * any later version.
16
 
 *
17
 
 * This program is distributed in the hope that it will be useful,
18
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
 
 * GNU General Public License for more details.
21
 
 *
22
 
 * ============================================================ */
23
 
 
24
 
#include "imageplugin_localcontrast.moc"
25
 
 
26
 
// KDE includes
27
 
 
28
 
#include <kaction.h>
29
 
#include <kactioncollection.h>
30
 
#include <kapplication.h>
31
 
#include <kcursor.h>
32
 
#include <kgenericfactory.h>
33
 
#include <klibloader.h>
34
 
#include <klocale.h>
35
 
#include <kdebug.h>
36
 
 
37
 
// Local includes
38
 
 
39
 
#include "localcontrasttool.h"
40
 
 
41
 
using namespace DigikamLocalContrastImagesPlugin;
42
 
 
43
 
K_PLUGIN_FACTORY( LocalContrastFactory, registerPlugin<ImagePlugin_LocalContrast>(); )
44
 
K_EXPORT_PLUGIN ( LocalContrastFactory("digikamimageplugin_localcontrast") )
45
 
 
46
 
ImagePlugin_LocalContrast::ImagePlugin_LocalContrast(QObject *parent, const QVariantList&)
47
 
                         : Digikam::ImagePlugin(parent, "ImagePlugin_LocalContrast")
48
 
{
49
 
    m_localContrastAction  = new KAction(KIcon("contrast"), i18n("Local Contrast..."), this);
50
 
    actionCollection()->addAction("imageplugin_localcontrast", m_localContrastAction );
51
 
 
52
 
    connect(m_localContrastAction, SIGNAL(triggered(bool)),
53
 
            this, SLOT(slotLocalContrast()));
54
 
 
55
 
    setXMLFile("digikamimageplugin_localcontrast_ui.rc");
56
 
 
57
 
    kDebug() << "ImagePlugin_LocalContrast plugin loaded";
58
 
}
59
 
 
60
 
ImagePlugin_LocalContrast::~ImagePlugin_LocalContrast()
61
 
{
62
 
}
63
 
 
64
 
void ImagePlugin_LocalContrast::setEnabledActions(bool enable)
65
 
{
66
 
    m_localContrastAction->setEnabled(enable);
67
 
}
68
 
 
69
 
void ImagePlugin_LocalContrast::slotLocalContrast()
70
 
{
71
 
    LocalContrastTool *tool = new LocalContrastTool(this);
72
 
    loadTool(tool);
73
 
}