digiKam
Loading...
Searching...
No Matches
lensfuniface.h
Go to the documentation of this file.
1/* ============================================================
2 *
3 * Date : 2008-02-10
4 * Description : a tool to fix automatically camera lens aberrations
5 *
6 * SPDX-FileCopyrightText: 2008 by Adrian Schroeter <adrian at suse dot de>
7 * SPDX-FileCopyrightText: 2008-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
8 *
9 * SPDX-License-Identifier: GPL-2.0-or-later
10 *
11 * ============================================================ */
12
13#pragma once
14
15// LensFun includes
16
17/*
18 * Pragma directives to reduce warnings from Lensfun header files.
19 *
20 * TODO: lensfun version > 0.3.2 introduce deprecated methods for the future.
21 * digiKam Code need to be ported to new API when Lensfun 0.4.0 will be releaed.
22 *
23 */
24#if defined(Q_CC_GNU)
25# pragma GCC diagnostic push
26# pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
27# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
28#endif
29
30#if defined(Q_CC_CLANG)
31# pragma clang diagnostic push
32# pragma clang diagnostic ignored "-Wmismatched-tags"
33# pragma clang diagnostic ignored "-Wdeprecated-declarations"
34#endif
35
36#include <lensfun.h>
37
41#define LENSFUN_MAKE_VERSION(major, minor, patch) (((major) << 16) | ((minor) << 8) | (patch))
42
46#define LENSFUN_VERSION LENSFUN_MAKE_VERSION(LF_VERSION_MAJOR, LF_VERSION_MINOR, LF_VERSION_MICRO)
47
51#define LENSFUN_TEST_VERSION(major,minor,patch) ( LENSFUN_VERSION >= LENSFUN_MAKE_VERSION(major,minor,patch) )
52
53// Restore warnings
54#if defined(Q_CC_GNU)
55# pragma GCC diagnostic pop
56#endif
57
58#if defined(Q_CC_CLANG)
59# pragma clang diagnostic pop
60#endif
61
62// Local includes
63
64#include "dmetadata.h"
65#include "digikam_export.h"
66#include "lensfunfilter.h"
67
68namespace Digikam
69{
70
71class DIGIKAM_EXPORT LensFunIface
72{
73public:
74
75 typedef const lfCamera* DevicePtr;
76 typedef const lfLens* LensPtr;
77 typedef QList<LensPtr> LensList;
78
79public:
80
82 {
83 MetadataUnavailable = -2,
84 MetadataNoMatch = -1,
85 MetadataPartialMatch = 0,
86 MetadataExactMatch = 1
87 };
88
89public:
90
93
94 void setFilterSettings(const LensFunContainer& other);
95
96 void setSettings(const LensFunContainer& other);
97 LensFunContainer settings() const;
98
99 MetadataMatch findFromMetadata(const DMetadata* const meta);
100
101 bool supportsDistortion() const;
102 bool supportsCCA() const;
103 bool supportsVig() const;
104 bool supportsGeometry() const;
105
106
110 QString makeDescription() const;
111
115 QString modelDescription() const;
116
120 QString lensDescription() const;
121
122 static QString lensFunVersion();
123
124public:
125
126 // Lensfun API based methods
127
128 LensPtr usedLens() const;
129 void setUsedLens(LensPtr lens);
130
131 DevicePtr usedCamera() const;
132 void setUsedCamera(DevicePtr cam);
133
134 lfDatabase* lensFunDataBase() const;
135 const lfCamera* const* lensFunCameras() const;
136
137 DevicePtr findCamera(const QString& make, const QString& model) const;
138 LensPtr findLens(const QString& model) const;
139
140private:
141
142 // Disable
143 LensFunIface(const LensFunIface&) = delete;
144 LensFunIface& operator=(const LensFunIface&) = delete;
145
146private:
147
148 class Private;
149 Private* const d = nullptr;
150};
151
152} // namespace Digikam
153
154Q_DECLARE_METATYPE(Digikam::LensFunIface::DevicePtr)
155Q_DECLARE_METATYPE(Digikam::LensFunIface::LensPtr)
Definition dmetadata.h:46
Definition lensfunfilter.h:25
Definition lensfuniface.h:72
const lfCamera * DevicePtr
Definition lensfuniface.h:75
MetadataMatch
Definition lensfuniface.h:82
const lfLens * LensPtr
Definition lensfuniface.h:76
QList< LensPtr > LensList
Definition lensfuniface.h:77
Definition datefolderview.cpp:34