digiKam
expoblendingthread.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 : 2009-11-13
7  * Description : a tool to blend bracketed images.
8  *
9  * Copyright (C) 2009-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  * Copyright (C) 2009-2011 by Johannes Wienke <languitar at semipol dot de>
11  * Copyright (C) 2012-2015 by Benjamin Girault <benjamin dot girault 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) 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_EXPO_BLENDING_THREAD_H
26 #define DIGIKAM_EXPO_BLENDING_THREAD_H
27 
28 // Qt includes
29 
30 #include <QThread>
31 
32 // Local includes
33 
34 #include "metaengine.h"
35 #include "enfusesettings.h"
36 #include "expoblendingactions.h"
37 
38 class QProcess;
39 
40 using namespace Digikam;
41 
43 {
44 
45 class ExpoBlendingActionData;
46 
47 class ExpoBlendingThread : public QThread
48 {
49  Q_OBJECT
50 
51 public:
52 
53  explicit ExpoBlendingThread(QObject* const parent);
54  ~ExpoBlendingThread() override;
55 
56  void setEnfuseVersion(const double version);
57  void setPreProcessingSettings(bool align);
58  void loadProcessed(const QUrl& url);
59  void identifyFiles(const QList<QUrl>& urlList);
60  void convertRawFiles(const QList<QUrl>& urlList);
61  void preProcessFiles(const QList<QUrl>& urlList, const QString& alignPath);
62  void enfusePreview(const QList<QUrl>& alignedUrls, const QUrl& outputUrl,
63  const EnfuseSettings& settings, const QString& enfusePath);
64  void enfuseFinal(const QList<QUrl>& alignedUrls, const QUrl& outputUrl,
65  const EnfuseSettings& settings, const QString& enfusePath);
66 
67  void cancel();
68 
72  void cleanUpResultFiles();
73 
74 Q_SIGNALS:
75 
78 
79 private:
80 
81  void run() override;
82 
83  bool preProcessingMultithreaded(const QUrl& url);
84  bool startPreProcessing(const QList<QUrl>& inUrls, bool align, const QString& alignPath, QString& errors);
85  bool computePreview(const QUrl& inUrl, QUrl& outUrl);
86  bool convertRaw(const QUrl& inUrl, QUrl& outUrl);
87 
88  bool startEnfuse(const QList<QUrl>& inUrls, QUrl& outUrl,
89  const EnfuseSettings& settings,
90  const QString& enfusePath, QString& errors);
91 
92  QString getProcessError(QProcess& proc) const;
93 
94  float getAverageSceneLuminance(const QUrl& url);
95  bool getXmpRational(const char* xmpTagName, long& num, long& den, MetaEngine* const meta);
96 
97 public:
98 
99  class Private;
100 
101 private:
102 
103  Private* const d;
104 };
105 
106 } // namespace DigikamGenericExpoBlendingPlugin
107 
108 #endif // DIGIKAM_EXPO_BLENDING_THREAD_H
Definition: expoblendingthread.h:48
void convertRawFiles(const QList< QUrl > &urlList)
void starting(const DigikamGenericExpoBlendingPlugin::ExpoBlendingActionData &ad)
void finished(const DigikamGenericExpoBlendingPlugin::ExpoBlendingActionData &ad)
Definition: metaengine.h:58
Definition: bracketstack.cpp:43
Definition: datefolderview.cpp:43