digiKam
metaengine_rotation.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 : 2006-09-15
7  * Description : Exiv2 library interface.
8  * Tools for combining rotation operations.
9  *
10  * Copyright (C) 2006-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  * Copyright (C) 2006-2013 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
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 META_ENGINE_ROTATION_H
27 #define META_ENGINE_ROTATION_H
28 
29 // Qt includes
30 
31 #include <QTransform>
32 
33 // Local includes
34 
35 #include "digikam_export.h"
36 #include "metaengine.h"
37 
38 namespace Digikam
39 {
40 
41 class DIGIKAM_EXPORT MetaEngineRotation
42 {
43 
44 public:
45 
54  {
55  NoTransformation = 0,
56  FlipHorizontal = 1,
57  FlipVertical = 2,
58  Rotate90 = 5,
59  Rotate180 = 6,
60  Rotate270 = 7
61  };
62 
63 public:
64 
69 
73  explicit MetaEngineRotation(TransformationAction action);
74 
78  explicit MetaEngineRotation(MetaEngine::ImageOrientation exifOrientation);
79 
80  bool operator==(const MetaEngineRotation& ma) const;
81  bool operator!=(const MetaEngineRotation& ma) const;
82 
86  bool isNoTransform() const;
87 
88  MetaEngineRotation& operator*=(const MetaEngineRotation& ma);
89 
93  MetaEngineRotation& operator*=(TransformationAction action);
94 
99 
103  MetaEngineRotation& operator*=(MetaEngine::ImageOrientation exifOrientation);
104 
105  MetaEngineRotation(int m11, int m12, int m21, int m22);
106 
113  QList<TransformationAction> transformations() const;
114 
119  MetaEngine::ImageOrientation exifOrientation() const;
120 
124  QTransform toTransform() const;
125 
129  static QTransform toTransform(MetaEngine::ImageOrientation orientation);
130 
131 protected:
132 
133  void set(int m11, int m12, int m21, int m22);
134 
135 protected:
136 
137  int m[2][2];
138 };
139 
140 } // namespace Digikam
141 
142 #endif // META_ENGINE_ROTATION_H
Definition: metaengine_rotation.h:42
TransformationAction
Definition: metaengine_rotation.h:54
ImageOrientation
Definition: metaengine.h:96
Definition: piwigotalker.h:48
Definition: datefolderview.cpp:43
bool operator==(const SearchTextSettings &a, const SearchTextSettings &b)
Definition: searchtextbar.cpp:49