File indexing completed on 2025-01-05 03:53:08
0001 /* ============================================================ 0002 * 0003 * This file is a part of digiKam project 0004 * https://www.digikam.org 0005 * 0006 * Date : 2011-05-23 0007 * Description : a tool to create panorama by fusion of several images. 0008 * 0009 * SPDX-FileCopyrightText: 2011-2016 by Benjamin Girault <benjamin dot girault at gmail dot com> 0010 * SPDX-FileCopyrightText: 2009-2024 by Gilles Caulier <caulier dot gilles at gmail dot com> 0011 * 0012 * SPDX-License-Identifier: GPL-2.0-or-later 0013 * 0014 * ============================================================ */ 0015 0016 #ifndef DIGIKAM_PANO_MANAGER_H 0017 #define DIGIKAM_PANO_MANAGER_H 0018 0019 // Qt includes 0020 0021 #include <QObject> 0022 #include <QPointer> 0023 0024 // Local includes 0025 0026 #include "panoactions.h" 0027 #include "ptotype.h" 0028 #include "dplugingeneric.h" 0029 0030 using namespace Digikam; 0031 0032 namespace DigikamGenericPanoramaPlugin 0033 { 0034 0035 class PanoActionThread; 0036 class AutoOptimiserBinary; 0037 class CPCleanBinary; 0038 class CPFindBinary; 0039 class EnblendBinary; 0040 class MakeBinary; 0041 class NonaBinary; 0042 class PanoModifyBinary; 0043 class Pto2MkBinary; 0044 class HuginExecutorBinary; 0045 0046 class PanoManager : public QObject 0047 { 0048 Q_OBJECT 0049 0050 public: 0051 0052 explicit PanoManager(QObject* const parent = nullptr); 0053 ~PanoManager() override; 0054 0055 public: 0056 0057 static QPointer<PanoManager> internalPtr; 0058 static PanoManager* instance(); 0059 static bool isCreated(); 0060 0061 public: 0062 0063 bool checkBinaries(); 0064 0065 void checkForHugin2015(); 0066 bool hugin2015() const; 0067 0068 void setGPano(bool gPano); 0069 bool gPano() const; 0070 /* 0071 void setHDR(bool hdr); 0072 bool hdr() const; 0073 */ 0074 void setFileFormatJPEG(); 0075 void setFileFormatTIFF(); 0076 void setFileFormatHDR(); 0077 PanoramaFileType format() const; 0078 0079 void setItemsList(const QList<QUrl>& urls); 0080 QList<QUrl>& itemsList() const; 0081 0082 void setPlugin(DPlugin* const plugin); 0083 0084 QUrl& basePtoUrl() const; 0085 QSharedPointer<PTOType> basePtoData(); 0086 void resetBasePto(); 0087 QUrl& cpFindPtoUrl() const; 0088 QSharedPointer<PTOType> cpFindPtoData(); 0089 void resetCpFindPto(); 0090 QUrl& cpCleanPtoUrl() const; 0091 QSharedPointer<PTOType> cpCleanPtoData(); 0092 void resetCpCleanPto(); 0093 QUrl& autoOptimisePtoUrl() const; 0094 QSharedPointer<PTOType> autoOptimisePtoData(); 0095 void resetAutoOptimisePto(); 0096 QUrl& viewAndCropOptimisePtoUrl() const; 0097 QSharedPointer<PTOType> viewAndCropOptimisePtoData(); 0098 void resetViewAndCropOptimisePto(); 0099 QUrl& previewPtoUrl() const; 0100 QSharedPointer<PTOType> previewPtoData(); 0101 void resetPreviewPto(); 0102 QUrl& panoPtoUrl() const; 0103 QSharedPointer<PTOType> panoPtoData(); 0104 void resetPanoPto(); 0105 0106 QUrl& previewMkUrl() const; 0107 void resetPreviewMkUrl(); 0108 QUrl& previewUrl() const; 0109 void resetPreviewUrl(); 0110 QUrl& mkUrl() const; 0111 void resetMkUrl(); 0112 QUrl& panoUrl() const; 0113 void resetPanoUrl(); 0114 0115 PanoramaItemUrlsMap& preProcessedMap() const; 0116 PanoActionThread* thread() const; 0117 AutoOptimiserBinary& autoOptimiserBinary() const; 0118 CPCleanBinary& cpCleanBinary() const; 0119 CPFindBinary& cpFindBinary() const; 0120 EnblendBinary& enblendBinary() const; 0121 MakeBinary& makeBinary() const; 0122 NonaBinary& nonaBinary() const; 0123 PanoModifyBinary& panoModifyBinary() const; 0124 Pto2MkBinary& pto2MkBinary() const; 0125 HuginExecutorBinary& huginExecutorBinary() const; 0126 0127 void run(); 0128 0129 Q_SIGNALS: 0130 0131 void updateHostApp(const QUrl& url); 0132 0133 private Q_SLOTS: 0134 0135 void setPreProcessedMap(const PanoramaItemUrlsMap& urls); 0136 0137 private: 0138 0139 void startWizard(); 0140 0141 private: 0142 0143 class Private; 0144 Private* const d; 0145 }; 0146 0147 } // namespace DigikamGenericPanoramaPlugin 0148 0149 #endif // DIGIKAM_PANO_MANAGER_H