digiKam
panoactionthread.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 : 2011-05-23
7  * Description : a tool to create panorama by fusion of several images.
8  *
9  * Copyright (C) 2011-2016 by Benjamin Girault <benjamin dot girault at gmail dot com>
10  * Copyright (C) 2009-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  * Copyright (C) 2009-2011 by Johannes Wienke <languitar at semipol dot de>
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_PANO_ACTION_THREAD_H
26 #define DIGIKAM_PANO_ACTION_THREAD_H
27 
28 // Qt includes
29 
30 #include <QThread>
31 #include <QUrl>
32 
33 // KDE includes
34 
35 #include <ThreadWeaver/Sequence>
36 
37 // Local includes
38 
39 #include "panoactions.h"
40 #include "ptotype.h"
41 
42 using namespace Digikam;
43 
45 {
46 
47 struct PanoActionData;
48 
49 class PanoActionThread : public QObject
50 {
51  Q_OBJECT
52 
53 public:
54 
55  explicit PanoActionThread(QObject* const parent);
56  ~PanoActionThread() override;
57 
58 public:
59 
60  void preProcessFiles(const QList<QUrl>& urlList,
61  PanoramaItemUrlsMap& preProcessedMap,
62  QUrl& baseUrl,
63  QUrl& cpFindPtoUrl,
64  QUrl& cpCleanPtoUrl,
65  bool celeste,
66  PanoramaFileType fileType,
67  bool gPano,
68  const QString& huginVersion,
69  const QString& cpCleanPath,
70  const QString& cpFindPath);
71 
72  void optimizeProject(QUrl& ptoUrl,
73  QUrl& optimizePtoUrl,
74  QUrl& viewCropPtoUrl,
75  bool levelHorizon,
76  bool buildGPano,
77  const QString& autooptimiserPath,
78  const QString& panoModifyPath);
79 
80  void generatePanoramaPreview(QSharedPointer<const PTOType> ptoData,
81  QUrl& previewPtoUrl,
82  QUrl& previewMkUrl,
83  QUrl& previewUrl,
84  const PanoramaItemUrlsMap& preProcessedUrlsMap,
85  const QString& makePath,
86  const QString& pto2mkPath,
87  const QString& huginExecutorPath,
88  bool hugin2015,
89  const QString& enblendPath,
90  const QString& nonaPath);
91 
92  void compileProject(QSharedPointer<const PTOType> basePtoData,
93  QUrl& panoPtoUrl,
94  QUrl& mkUrl,
95  QUrl& panoUrl,
96  const PanoramaItemUrlsMap& preProcessedUrlsMap,
97  PanoramaFileType fileType,
98  const QRect& crop,
99  const QString& makePath,
100  const QString& pto2mkPath,
101  const QString& huginExecutorPath,
102  bool hugin2015,
103  const QString& enblendPath,
104  const QString& nonaPath);
105 
106  void copyFiles(const QUrl& ptoUrl,
107  const QUrl& panoUrl,
108  const QUrl& finalPanoUrl,
109  const PanoramaItemUrlsMap& preProcessedUrlsMap,
110  bool savePTO,
111  bool addGPlusMetadata);
112 
113  void cancel();
114  void finish();
115 
116 Q_SIGNALS:
117 
121 
122  void cpFindPtoReady(const QUrl& cpFindPtoUrl);
123  void cpCleanPtoReady(const QUrl& cpCleanPtoUrl);
124  void optimizePtoReady(const QUrl& optimizePtoUrl);
125  void previewFileReady(const QUrl& previewFileUrl);
126  void panoFileReady(const QUrl& panoFileUrl);
127 
128 private Q_SLOTS:
129 
130  void slotDone(ThreadWeaver::JobPointer j);
131  void slotStepDone(ThreadWeaver::JobPointer j);
132  void slotStarting(ThreadWeaver::JobPointer j);
133 
134 private:
135 
136  void appendStitchingJobs(const QSharedPointer<ThreadWeaver::Sequence>& js,
137  const QUrl& ptoUrl,
138  QUrl& mkUrl,
139  QUrl& outputUrl,
140  const PanoramaItemUrlsMap& preProcessedUrlsMap,
141  PanoramaFileType fileType,
142  const QString& makePath,
143  const QString& pto2mkPath,
144  const QString& enblendPath,
145  const QString& nonaPath,
146  bool preview);
147 
148 private:
149 
150  class Private;
151  Private* const d;
152 };
153 
154 } // namespace DigikamGenericPanoramaPlugin
155 
156 #endif // DIGIKAM_PANO_ACTION_THREAD_H
Definition: panoactionthread.h:50
void starting(const DigikamGenericPanoramaPlugin::PanoActionData &ad)
void previewFileReady(const QUrl &previewFileUrl)
void cpFindPtoReady(const QUrl &cpFindPtoUrl)
void jobCollectionFinished(const DigikamGenericPanoramaPlugin::PanoActionData &ad)
void stepFinished(const DigikamGenericPanoramaPlugin::PanoActionData &ad)
void panoFileReady(const QUrl &panoFileUrl)
void cpCleanPtoReady(const QUrl &cpCleanPtoUrl)
void optimizePtoReady(const QUrl &optimizePtoUrl)
Definition: panoactions.h:36
PanoramaFileType
Definition: panoactions.h:61
QMap< QUrl, PanoramaPreprocessedUrls > PanoramaItemUrlsMap
Map between original Url and processed temp Urls.
Definition: panoactions.h:87
Definition: datefolderview.cpp:43