File indexing completed on 2025-03-09 03:50:51

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2009-11-13
0007  * Description : a tool to blend bracketed images.
0008  *
0009  * SPDX-FileCopyrightText: 2009-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0010  * SPDX-FileCopyrightText: 2012-2015 by Benjamin Girault <benjamin dot girault at gmail dot com>
0011  *
0012  * SPDX-License-Identifier: GPL-2.0-or-later
0013  *
0014  * ============================================================ */
0015 
0016 #ifndef DIGIKAM_EXPO_BLENDING_MANAGER_H
0017 #define DIGIKAM_EXPO_BLENDING_MANAGER_H
0018 
0019 // Qt includes
0020 
0021 #include <QObject>
0022 #include <QPointer>
0023 #include <QUrl>
0024 
0025 // Local includes
0026 
0027 #include "dplugingeneric.h"
0028 #include "expoblendingactions.h"
0029 
0030 using namespace Digikam;
0031 
0032 namespace DigikamGenericExpoBlendingPlugin
0033 {
0034 
0035 class ExpoBlendingThread;
0036 class AlignBinary;
0037 class EnfuseBinary;
0038 
0039 class ExpoBlendingManager : public QObject
0040 {
0041     Q_OBJECT
0042 
0043 public:
0044 
0045     explicit ExpoBlendingManager(QObject* const parent = nullptr);
0046     ~ExpoBlendingManager() override;
0047 
0048     static QPointer<ExpoBlendingManager> internalPtr;
0049     static ExpoBlendingManager*          instance();
0050     static bool                          isCreated();
0051 
0052     bool checkBinaries();
0053 
0054     void setItemsList(const QList<QUrl>& urls);
0055     QList<QUrl>& itemsList() const;
0056 
0057     void setPlugin(DPlugin* const plugin);
0058 
0059     void setPreProcessedMap(const ExpoBlendingItemUrlsMap& urls);
0060     ExpoBlendingItemUrlsMap& preProcessedMap() const;
0061 
0062     ExpoBlendingThread* thread() const;
0063     AlignBinary&  alignBinary()  const;
0064     EnfuseBinary& enfuseBinary() const;
0065 
0066     void run();
0067 
0068     /**
0069      * Clean up all temporary files produced so far.
0070      */
0071     void cleanUp();
0072 
0073 Q_SIGNALS:
0074 
0075     void updateHostApp(const QUrl& url);
0076 
0077 private Q_SLOTS:
0078 
0079     void slotStartDialog();
0080     void slotSetEnfuseVersion(double version);
0081 
0082 private:
0083 
0084     void startWizard();
0085 
0086 private:
0087 
0088     class Private;
0089     Private* const d;
0090 };
0091 
0092 } // namespace DigikamGenericExpoBlendingPlugin
0093 
0094 #endif // DIGIKAM_EXPO_BLENDING_MANAGER_H