File indexing completed on 2025-01-05 03:53:10

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2012-03-15
0007  * Description : a tool to create panorama by fusion of several images.
0008  *
0009  * SPDX-FileCopyrightText: 2012-2016 by Benjamin Girault <benjamin dot girault at gmail dot com>
0010  *
0011  * SPDX-License-Identifier: GPL-2.0-or-later
0012  *
0013  * ============================================================ */
0014 
0015 #include "compilemktask.h"
0016 
0017 // Local includes
0018 
0019 #include "digikam_debug.h"
0020 #include "digikam_globals.h"
0021 
0022 namespace DigikamGenericPanoramaPlugin
0023 {
0024 
0025 CompileMKTask::CompileMKTask(const QString& workDirPath,
0026                              const QUrl& mkUrl,
0027                              const QUrl& /*panoUrl*/,
0028                              const QString& nonaPath,
0029                              const QString& enblendPath,
0030                              const QString& makePath,
0031                              bool preview)
0032     : CommandTask(preview ? PANO_STITCHPREVIEW : PANO_STITCH, workDirPath, makePath),
0033 /*
0034       panoUrl(&panoUrl),
0035 */
0036       mkUrl(mkUrl),
0037       nonaPath(nonaPath),
0038       enblendPath(enblendPath)
0039 {
0040 }
0041 
0042 void CompileMKTask::run(ThreadWeaver::JobPointer, ThreadWeaver::Thread*)
0043 {
0044     QStringList args;
0045     args << QLatin1String("-f");
0046     args << mkUrl.toLocalFile();
0047     args << QString::fromLatin1("ENBLEND='%1'").arg(enblendPath);
0048     args << QString::fromLatin1("NONA='%1'").arg(nonaPath);
0049 
0050     runProcess(args);
0051 
0052     qCDebug(DIGIKAM_DPLUGIN_GENERIC_LOG) << "make command line: " << getCommandLine();
0053 
0054     qCDebug(DIGIKAM_DPLUGIN_GENERIC_LOG) << "make output:" << QT_ENDL << output;
0055 }
0056 
0057 } // namespace DigikamGenericPanoramaPlugin