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_ACTIONS_H 0017 #define DIGIKAM_PANO_ACTIONS_H 0018 0019 // Qt includes 0020 0021 #include <QString> 0022 #include <QImage> 0023 #include <QMetaType> 0024 #include <QMap> 0025 #include <QUrl> 0026 0027 namespace DigikamGenericPanoramaPlugin 0028 { 0029 0030 enum PanoAction 0031 { 0032 PANO_NONE = 0, // 0 0033 PANO_PREPROCESS_INPUT, // 1 0034 PANO_CREATEPTO, // 2 0035 PANO_CPFIND, // 3 0036 PANO_CPCLEAN, // 4 0037 PANO_OPTIMIZE, // 5 0038 PANO_AUTOCROP, // 6 0039 PANO_CREATEPREVIEWPTO, // 7 0040 PANO_CREATEMK, // 8 0041 PANO_CREATEMKPREVIEW, // 9 0042 PANO_CREATEFINALPTO, // 10 0043 PANO_NONAFILE, // 11 0044 PANO_NONAFILEPREVIEW, // 12 0045 PANO_STITCH, // 13 0046 PANO_STITCHPREVIEW, // 14 0047 PANO_HUGINEXECUTOR, // 15 0048 PANO_HUGINEXECUTORPREVIEW, // 16 0049 PANO_COPY // 17 0050 }; 0051 0052 typedef enum 0053 { 0054 JPEG, 0055 TIFF, 0056 HDR 0057 } 0058 PanoramaFileType; 0059 0060 class PanoramaPreprocessedUrls 0061 { 0062 public: 0063 0064 PanoramaPreprocessedUrls() = default; 0065 explicit PanoramaPreprocessedUrls(const QUrl& preprocessed, const QUrl& preview) 0066 : preprocessedUrl(preprocessed), 0067 previewUrl (preview) 0068 { 0069 } 0070 0071 ~PanoramaPreprocessedUrls() = default; 0072 0073 public: 0074 0075 QUrl preprocessedUrl; ///< Can be an original file or a converted version, depending on the original file type 0076 QUrl previewUrl; ///< The JPEG preview version, accordingly of preprocessedUrl constant. 0077 }; 0078 0079 typedef QMap<QUrl, PanoramaPreprocessedUrls> PanoramaItemUrlsMap; ///< Map between original Url and processed temp Urls. 0080 0081 // ---------------------------------------------------------------------------------------------------------- 0082 0083 struct PanoActionData 0084 { 0085 PanoActionData() 0086 : starting(false), 0087 success (false), 0088 id (0), 0089 action (PANO_NONE) 0090 { 0091 } 0092 0093 bool starting; 0094 bool success; 0095 0096 QString message; ///< Usually, an error message 0097 0098 int id; 0099 0100 PanoAction action; 0101 }; 0102 0103 } // namespace DigikamGenericPanoramaPlugin 0104 0105 Q_DECLARE_METATYPE(DigikamGenericPanoramaPlugin::PanoActionData) 0106 Q_DECLARE_METATYPE(DigikamGenericPanoramaPlugin::PanoramaPreprocessedUrls) 0107 0108 #endif // DIGIKAM_PANO_ACTIONS_H