digiKam
Loading...
Searching...
No Matches
focuspoint.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 : 28/08/2021
7 * Description : Focus point properties container (relative to original image size)
8 *
9 * SPDX-FileCopyrightText: 2021-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
10 * SPDX-FileCopyrightText: 2021 by Phuoc Khanh Le <phuockhanhnk94 at gmail dot com>
11 *
12 * SPDX-License-Identifier: GPL-2.0-or-later
13 *
14 * ============================================================ */
15
16#pragma once
17
18// Qt includes
19
20#include <QVariant>
21#include <QStringList>
22#include <QRectF>
23#include <QDebug>
24#include <QExplicitlySharedDataPointer>
25
26// Local includes
27
28#include "digikam_export.h"
29#include "metaengine.h"
30
31namespace Digikam
32{
33
34class DIGIKAM_EXPORT FocusPoint
35{
36public:
37
39 {
40 Inactive = 0,
41 InFocus = 1,
42 Selected = 2,
43 SelectedInFocus = 3
44 };
45
46public:
47
53 FocusPoint(float x_position, float y_position, float width, float height, TypePoint type);
54 FocusPoint(float x_position, float y_position, float width, float height);
55 explicit FocusPoint(const QRectF& rectF);
56 FocusPoint(const FocusPoint& other);
57 FocusPoint();
59
63 FocusPoint& operator=(const FocusPoint& other);
64
68 void setType(TypePoint type);
69 TypePoint getType() const;
70 QString getTypeDescription() const;
71
75 void setCenterPosition(float x_position, float y_position);
76 void setSize(float width, float height);
77 void setRect(const QRectF& rectF);
78 QPointF getCenterPosition() const;
79 QSizeF getSize() const;
80 QRectF getRect() const;
81
85 QRect getRectBySize(const QSize& size) const;
86
87private:
88
89 class Private;
90 QExplicitlySharedDataPointer<Private> d;
91};
92
97{
98 return (static_cast<FocusPoint::TypePoint>(static_cast<int>(type1) | static_cast<int>(type2)));
99}
100
102{
103 return (static_cast<FocusPoint::TypePoint>(static_cast<int>(type1) & static_cast<int>(type2)));
104}
105
107{
108 return (type1 = type1 | type2);
109}
110
112{
113 return (type1 = type1 & type2);
114}
115
117DIGIKAM_EXPORT QDebug operator<<(QDebug dbg, const FocusPoint& fp);
118
119} // namespace Digikam
Definition focuspoint.h:35
TypePoint
Definition focuspoint.h:39
Definition datefolderview.cpp:34
QDebug operator<<(QDebug dbg, const DbEngineParameters &p)
Definition dbengineparameters.cpp:930
FocusPoint::TypePoint operator&(FocusPoint::TypePoint type1, FocusPoint::TypePoint type2)
Definition focuspoint.h:101
FocusPoint::TypePoint & operator&=(FocusPoint::TypePoint &type1, FocusPoint::TypePoint type2)
Definition focuspoint.h:111
FocusPoint::TypePoint operator|(FocusPoint::TypePoint type1, FocusPoint::TypePoint type2)
Definition focuspoint.h:96
FocusPoint::TypePoint & operator|=(FocusPoint::TypePoint &type1, FocusPoint::TypePoint type2)
Definition focuspoint.h:106