digiKam
freerotationtool.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2004-11-28
7  * Description : a digiKam image editor tool to process image
8  * free rotation.
9  *
10  * Copyright (C) 2004-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  * Copyright (C) 2009-2010 by Andi Clemens <andi dot clemens at gmail dot com>
12  *
13  * This program is free software; you can redistribute it
14  * and/or modify it under the terms of the GNU General
15  * Public License as published by the Free Software Foundation;
16  * either version 2, or (at your option)
17  * any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * ============================================================ */
25 
26 #ifndef DIGIKAM_EDITOR_FREE_ROTATION_TOOL_H
27 #define DIGIKAM_EDITOR_FREE_ROTATION_TOOL_H
28 
29 // Local includes
30 
31 #include "editortool.h"
32 
33 class QPixmap;
34 class QString;
35 
36 using namespace Digikam;
37 
39 {
40 
42 {
43  Q_OBJECT
44 
45 public:
46 
47  explicit FreeRotationTool(QObject* const parent);
48  ~FreeRotationTool() override;
49 
50 public Q_SLOTS:
51 
52  void slotAutoAdjustP1Clicked();
53  void slotAutoAdjustP2Clicked();
54  void slotAutoAdjustClicked();
55 
56 private Q_SLOTS:
57 
58  void slotResetSettings() override;
59  void slotColorGuideChanged();
60 
61 private:
62 
63  void readSettings() override;
64  void writeSettings() override;
65  void preparePreview() override;
66  void prepareFinal() override;
67  void setPreviewImage() override;
68  void setFinalImage() override;
69 
70  QString centerString(const QString& str, int maxLength = -1) const;
71  QString repeatString(const QString& str, int times) const;
72  QPixmap generateBtnPixmap(const QString& label, const QColor& color) const;
73  QString generateButtonLabel(const QPoint& p) const;
74  double calculateAutoAngle() const;
75  bool pointIsValid(const QPoint& p) const;
76  void setPointInvalid(QPoint& p);
77  void updatePoints();
78  void resetPoints();
79 
80 private:
81 
82  class Private;
83  Private* const d;
84 };
85 
86 } // namespace DigikamEditorFreeRotationToolPlugin
87 
88 #endif // DIGIKAM_EDITOR_FREE_ROTATION_TOOL_H
Definition: editortool.h:136
Definition: freerotationtool.cpp:60
Definition: datefolderview.cpp:43