1
/* ============================================================
3
* This file is a part of digiKam project
4
* http://www.digikam.org
7
* Description : a plugin to enhance image with local contrasts (as human eye does).
9
* Copyright (C) 2009 by Julien Pontabry <julien dot pontabry at gmail dot com>
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)
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.
22
* ============================================================ */
24
#include "imageplugin_localcontrast.moc"
29
#include <kactioncollection.h>
30
#include <kapplication.h>
32
#include <kgenericfactory.h>
33
#include <klibloader.h>
39
#include "localcontrasttool.h"
41
using namespace DigikamLocalContrastImagesPlugin;
43
K_PLUGIN_FACTORY( LocalContrastFactory, registerPlugin<ImagePlugin_LocalContrast>(); )
44
K_EXPORT_PLUGIN ( LocalContrastFactory("digikamimageplugin_localcontrast") )
46
ImagePlugin_LocalContrast::ImagePlugin_LocalContrast(QObject *parent, const QVariantList&)
47
: Digikam::ImagePlugin(parent, "ImagePlugin_LocalContrast")
49
m_localContrastAction = new KAction(KIcon("contrast"), i18n("Local Contrast..."), this);
50
actionCollection()->addAction("imageplugin_localcontrast", m_localContrastAction );
52
connect(m_localContrastAction, SIGNAL(triggered(bool)),
53
this, SLOT(slotLocalContrast()));
55
setXMLFile("digikamimageplugin_localcontrast_ui.rc");
57
kDebug() << "ImagePlugin_LocalContrast plugin loaded";
60
ImagePlugin_LocalContrast::~ImagePlugin_LocalContrast()
64
void ImagePlugin_LocalContrast::setEnabledActions(bool enable)
66
m_localContrastAction->setEnabled(enable);
69
void ImagePlugin_LocalContrast::slotLocalContrast()
71
LocalContrastTool *tool = new LocalContrastTool(this);