File indexing completed on 2025-01-05 03:51:42
0001 /* ============================================================ 0002 * 0003 * This file is a part of digiKam project 0004 * https://www.digikam.org 0005 * 0006 * Date : 2018-07-30 0007 * Description : image editor plugin to reduce noise 0008 * 0009 * SPDX-FileCopyrightText: 2018-2024 by Gilles Caulier <caulier dot gilles at gmail dot com> 0010 * 0011 * SPDX-License-Identifier: GPL-2.0-or-later 0012 * 0013 * ============================================================ */ 0014 0015 #include "noisereductiontoolplugin.h" 0016 0017 // Qt includes 0018 0019 #include <QPointer> 0020 0021 // KDE includes 0022 0023 #include <klocalizedstring.h> 0024 0025 // Local includes 0026 0027 #include "editorwindow.h" 0028 #include "noisereductiontool.h" 0029 0030 namespace DigikamEditorNoiseReductionToolPlugin 0031 { 0032 0033 NoiseReductionToolPlugin::NoiseReductionToolPlugin(QObject* const parent) 0034 : DPluginEditor(parent) 0035 { 0036 } 0037 0038 NoiseReductionToolPlugin::~NoiseReductionToolPlugin() 0039 { 0040 } 0041 0042 QString NoiseReductionToolPlugin::name() const 0043 { 0044 return i18nc("@title", "Noise Reduction"); 0045 } 0046 0047 QString NoiseReductionToolPlugin::iid() const 0048 { 0049 return QLatin1String(DPLUGIN_IID); 0050 } 0051 0052 QIcon NoiseReductionToolPlugin::icon() const 0053 { 0054 return QIcon::fromTheme(QLatin1String("noisereduction")); 0055 } 0056 0057 QString NoiseReductionToolPlugin::description() const 0058 { 0059 return i18nc("@info", "A tool to remove photograph noise using wavelets"); 0060 } 0061 0062 QString NoiseReductionToolPlugin::details() const 0063 { 0064 return i18nc("@info", "This Image Editor tool can reduce noise in image."); 0065 } 0066 0067 QString NoiseReductionToolPlugin::handbookSection() const 0068 { 0069 return QLatin1String("image_editor"); 0070 } 0071 0072 QString NoiseReductionToolPlugin::handbookChapter() const 0073 { 0074 return QLatin1String("enhancement_tools"); 0075 } 0076 0077 QString NoiseReductionToolPlugin::handbookReference() const 0078 { 0079 return QLatin1String("enhance-nr"); 0080 } 0081 0082 QList<DPluginAuthor> NoiseReductionToolPlugin::authors() const 0083 { 0084 return QList<DPluginAuthor>() 0085 << DPluginAuthor(QString::fromUtf8("Gilles Caulier"), 0086 QString::fromUtf8("caulier dot gilles at gmail dot com"), 0087 QString::fromUtf8("(C) 2004-2021")) 0088 ; 0089 } 0090 0091 void NoiseReductionToolPlugin::setup(QObject* const parent) 0092 { 0093 DPluginAction* const ac = new DPluginAction(parent); 0094 ac->setIcon(icon()); 0095 ac->setText(i18nc("@action", "Noise Reduction...")); 0096 ac->setObjectName(QLatin1String("editorwindow_enhance_noisereduction")); 0097 ac->setActionCategory(DPluginAction::EditorEnhance); 0098 0099 connect(ac, SIGNAL(triggered(bool)), 0100 this, SLOT(slotNoiseReduction())); 0101 0102 addAction(ac); 0103 } 0104 0105 void NoiseReductionToolPlugin::slotNoiseReduction() 0106 { 0107 EditorWindow* const editor = dynamic_cast<EditorWindow*>(sender()->parent()); 0108 0109 if (editor) 0110 { 0111 NoiseReductionTool* const tool = new NoiseReductionTool(editor); 0112 tool->setPlugin(this); 0113 editor->loadTool(tool); 0114 } 0115 } 0116 0117 } // namespace DigikamEditorNoiseReductionToolPlugin 0118 0119 #include "moc_noisereductiontoolplugin.cpp"