digiKam
focuspoints_extractor.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 : Extraction of focus points by exiftool data
8  *
9  * Copyright (C) 2021-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  * Copyright (C) 2021 by Phuoc Khanh Le <phuockhanhnk94 at gmail dot com>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option)
16  * any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * ============================================================ */
24 
25 #ifndef DIGIKAM_FOCUSPOINTS_EXTRACTOR_H
26 #define DIGIKAM_FOCUSPOINTS_EXTRACTOR_H
27 
28 // Qt includes
29 
30 #include <QObject>
31 #include <QVariant>
32 #include <QStringList>
33 
34 // Local includes
35 
36 #include "digikam_export.h"
37 #include "focuspoint.h"
38 #include "metaengine.h"
39 
40 namespace Digikam
41 {
42 
43 class DIGIKAM_EXPORT FocusPointsExtractor : public QObject
44 {
45  Q_OBJECT
46 
47 public:
48 
58 
59 public:
60 
61  explicit FocusPointsExtractor(QObject* const parent, const QString& path);
63 
64 public:
65 
66  ListAFPoints get_af_points();
67  ListAFPoints get_af_points(FocusPoint::TypePoint type);
68 
69  bool isAFPointsReadOnly() const;
70  QString make() const;
71  QString model() const;
72  QSize originalSize() const;
73  MetaEngine::ImageOrientation orientation() const;
74 
75 private:
76 
77  QVariant findValue(const QString& tagName, bool isList = false) const;
78  QVariant findValue(const QString& tagNameRoot, const QString& key, bool isList = false) const;
79  QVariant findValueFirstMatch(const QStringList& listTagNames, bool isList = false) const;
80  QVariant findValueFirstMatch(const QString& tagNameRoot, const QStringList& keys, bool isList = false) const;
81  QVariant findNumValue(const QString& tagName) const;
82 
83  void setAFPointsReadOnly(bool readOnly) const;
84  void setOriginalSize(const QSize& size) const;
85 
86  ListAFPoints findAFPoints() const;
87 
88  ListAFPoints getAFPoints_canon() const;
89  ListAFPoints getAFPoints_exif() const;
90  ListAFPoints getAFPoints_nikon() const;
91  ListAFPoints getAFPoints_panasonic() const;
92  ListAFPoints getAFPoints_sony() const;
93  ListAFPoints getAFPoints_xmp() const;
94 
95 private:
96 
97  class Private;
98  Private* const d;
99 };
100 
101 } // namespace Digikam
102 
103 #endif // DIGIKAM_FOCUSPOINTS_EXTRACTOR_H
TypePoint
Definition: focuspoint.h:49
Definition: focuspoints_extractor.h:44
ImageOrientation
Definition: metaengine.h:96
Definition: datefolderview.cpp:43