[Digikam-devel] extragear/graphics/digikam/imageplugins
Andi Clemens
andi.clemens at gmx.net
Sun Aug 31 22:27:21 BST 2008
SVN commit 855475 by aclemens:
digiKam from trunk: Shear plugin is now ported to Editor Tool API.
CCMAIL: digikam-devel at kde.org
M +1 -1 EDITORTOOLPORT
M +1 -1 sheartool/CMakeLists.txt
D sheartool/imageeffect_sheartool.cpp
D sheartool/imageeffect_sheartool.h
M +6 -4 sheartool/imageplugin_sheartool.cpp
M +4 -4 sheartool/shear.cpp
M +23 -23 sheartool/shear.h
A sheartool/sheartool.cpp sheartool/imageeffect_sheartool.cpp#855466 [License: GPL (v2+)]
A sheartool/sheartool.h sheartool/imageeffect_sheartool.h#855420 [License: GPL (v2+)]
--- trunk/extragear/graphics/digikam/imageplugins/EDITORTOOLPORT #855474:855475
@@ -31,7 +31,7 @@
freerotation ImageGuideDlg A DONE
inpainting ImageGuideDlg DONE DONE
raindrop ImageGuideDlg DONE DONE
-sheartool ImageGuideDlg A DONE
+sheartool ImageGuideDlg DONE DONE
coreplugin
\---blur CtrlPanelDlg DONE
--- trunk/extragear/graphics/digikam/imageplugins/sheartool/CMakeLists.txt #855474:855475
@@ -1,6 +1,6 @@
SET(digikamimageplugin_sheartool_PART_SRCS imageplugin_sheartool.cpp
- imageeffect_sheartool.cpp
+ sheartool.cpp
shear.cpp
)
--- trunk/extragear/graphics/digikam/imageplugins/sheartool/imageplugin_sheartool.cpp #855474:855475
@@ -34,10 +34,12 @@
// Local includes.
#include "ddebug.h"
-#include "imageeffect_sheartool.h"
+#include "sheartool.h"
#include "imageplugin_sheartool.h"
#include "imageplugin_sheartool.moc"
+using namespace DigikamShearToolImagesPlugin;
+
K_PLUGIN_FACTORY( ShearToolFactory, registerPlugin<ImagePlugin_ShearTool>(); )
K_EXPORT_PLUGIN ( ShearToolFactory("digikamimageplugin_sheartool") )
@@ -47,7 +49,7 @@
m_sheartoolAction = new KAction(KIcon("shear"), i18n("Shear..."), this);
actionCollection()->addAction("imageplugin_sheartool", m_sheartoolAction );
- connect(m_sheartoolAction, SIGNAL(triggered(bool)),
+ connect(m_sheartoolAction, SIGNAL(triggered(bool)),
this, SLOT(slotShearTool()));
setXMLFile("digikamimageplugin_sheartool_ui.rc");
@@ -66,6 +68,6 @@
void ImagePlugin_ShearTool::slotShearTool()
{
- DigikamShearToolImagesPlugin::ImageEffect_ShearTool dlg(kapp->activeWindow());
- dlg.exec();
+ ShearTool *tool = new ShearTool(kapp->activeWindow());
+ loadTool(tool);
}
--- trunk/extragear/graphics/digikam/imageplugins/sheartool/shear.cpp #855474:855475
@@ -41,9 +41,9 @@
namespace DigikamShearToolImagesPlugin
{
-ShearTool::ShearTool(Digikam::DImg *orgImage, QObject *parent, float hAngle, float vAngle,
- bool antialiasing, QColor backgroundColor, int orgW, int orgH)
- : Digikam::DImgThreadedFilter(orgImage, parent, "sheartool")
+Shear::Shear(Digikam::DImg *orgImage, QObject *parent, float hAngle, float vAngle,
+ bool antialiasing, QColor backgroundColor, int orgW, int orgH)
+ : Digikam::DImgThreadedFilter(orgImage, parent, "sheartool")
{
m_hAngle = hAngle;
m_vAngle = vAngle;
@@ -55,7 +55,7 @@
initFilter();
}
-void ShearTool::filterImage(void)
+void Shear::filterImage(void)
{
int progress;
register int x, y, p = 0, pt;
--- trunk/extragear/graphics/digikam/imageplugins/sheartool/shear.h #855474:855475
@@ -5,25 +5,25 @@
*
* Date : 2005-07-18
* Description : Shear tool threaded image filter.
- *
+ *
* Copyright (C) 2005-2007 by Gilles Caulier <caulier dot gilles at gmail dot com>
- *
+ *
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General
* Public License as published by the Free Software Foundation;
* either version 2, or (at your option)
* any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* ============================================================ */
-
-#ifndef SHEAR_TOOL_H
-#define SHEAR_TOOL_H
+#ifndef SHEAR_H
+#define SHEAR_H
+
// Qt includes.
#include <QSize>
@@ -36,26 +36,26 @@
namespace DigikamShearToolImagesPlugin
{
-class ShearTool : public Digikam::DImgThreadedFilter
+class Shear : public Digikam::DImgThreadedFilter
{
public:
-
- ShearTool(Digikam::DImg *orgImage, QObject *parent=0, float hAngle=0.0, float vAngle=0.0,
+
+ Shear(Digikam::DImg *orgImage, QObject *parent=0, float hAngle=0.0, float vAngle=0.0,
bool antialiasing=true, QColor backgroundColor=Qt::black, int orgW=0, int orgH=0);
- ~ShearTool(){};
-
+ ~Shear(){};
+
QSize getNewSize(void){ return m_newSize; };
-
-private:
+private:
+
virtual void filterImage(void);
-
+
inline int setPosition (int Width, int X, int Y)
{
- return (Y *Width*4 + 4*X);
+ return (Y *Width*4 + 4*X);
};
-
+
inline bool isInside (int Width, int Height, int X, int Y)
{
bool bIsWOk = ((X < 0) ? false : (X >= Width ) ? false : true);
@@ -63,21 +63,21 @@
return (bIsWOk && bIsHOk);
};
-private:
+private:
bool m_antiAlias;
int m_orgW;
int m_orgH;
-
+
float m_hAngle;
float m_vAngle;
-
+
QColor m_backgroundColor;
-
+
QSize m_newSize;
-};
+};
} // NameSpace DigikamShearToolImagesPlugin
-#endif /* SHEAR_TOOL_H */
+#endif /* SHEAR_H */
More information about the Digikam-devel
mailing list