digiKam
loadingdescription.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 : 2006-01-16
7  * Description : image file IO threaded interface.
8  *
9  * Copyright (C) 2006-2011 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
10  * Copyright (C) 2012-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option)
16  * 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_LOADING_DESCRIPTION_H
26 #define DIGIKAM_LOADING_DESCRIPTION_H
27 
28 // Qt includes
29 
30 #include <QFlags>
31 
32 // Local includes
33 
34 #include "dimg.h"
35 #include "digikam_export.h"
36 #include "previewsettings.h"
37 
38 namespace Digikam
39 {
40 
41 class IccTransform;
42 class ThumbnailIdentifier;
43 
44 class DIGIKAM_EXPORT LoadingDescription
45 {
46 public:
47 
49  {
55  ConvertForOutput
56  };
57 
59  {
76  RawDecodingTimeOptimized
77  };
78 
79 public:
80 
82  {
83  public:
84 
86  {
90  DetailThumbnail
91  };
92 
94  {
95  NoFlags = 0,
96  OnlyPregenerate = 1 << 0
97  };
98  Q_DECLARE_FLAGS(PreviewFlags, PreviewFlag)
99 
100  public:
101 
102  explicit PreviewParameters();
103 
104  bool onlyPregenerate() const;
105 
106  bool operator==(const PreviewParameters& other) const;
107 
108  public:
109 
111  int size;
112  PreviewFlags flags;
114  QVariant extraParameter;
116  };
117 
118  // ---------------------------------------------------------------------
119 
121  {
122  public:
123 
125  {
126  colorManagement = NoColorConversion;
127  }
128 
129  public:
130 
131  bool needsProcessing() const;
132 
133  void setTransform(const IccTransform& transform);
134  bool hasTransform() const;
135  IccTransform transform() const;
136 
137  void setProfile(const IccProfile& profile);
138  bool hasProfile() const;
139  IccProfile profile() const;
140 
141  bool operator==(const PostProcessingParameters& other) const;
142 
143  public:
144 
146  QVariant iccData;
147  };
148 
149 public:
150 
155 
159  explicit LoadingDescription(const QString& filePath,
160  ColorManagementSettings = NoColorConversion);
161 
165  LoadingDescription(const QString& filePath,
166  const DRawDecoding& settings,
167  RawDecodingHint rawDecodingHint = RawDecodingCustomSettings,
168  ColorManagementSettings = NoColorConversion);
169 
178  LoadingDescription(const QString& filePath,
179  const PreviewSettings& settings,
180  int size,
181  ColorManagementSettings = NoColorConversion,
182  PreviewParameters::PreviewType = PreviewParameters::PreviewImage);
183 
187  QString cacheKey() const;
188 
193  bool needCheckRawDecoding() const;
194 
200  QStringList lookupCacheKeys() const;
201 
206  bool isReducedVersion() const;
207 
211  bool isThumbnail() const;
212 
216  bool isPreviewImage() const;
217 
221  ThumbnailIdentifier thumbnailIdentifier() const;
222 
226  bool operator==(const LoadingDescription& other) const;
227  bool operator!=(const LoadingDescription& other) const;
228 
233  bool equalsIgnoreReducedVersion(const LoadingDescription& other) const;
234 
239  bool equalsOrBetterThan(const LoadingDescription& other) const;
240 
241 public:
242 
247  static QStringList possibleCacheKeys(const QString& filePath);
248  static QStringList possibleThumbnailCacheKeys(const QString& filePath);
249 
250 public:
251 
252  QString filePath;
257 };
258 
259 } // namespace Digikam
260 
261 Q_DECLARE_OPERATORS_FOR_FLAGS(Digikam::LoadingDescription::PreviewParameters::PreviewFlags)
262 
263 #endif // DIGIKAM_LOADING_DESCRIPTION_H
Definition: drawdecoding.h:48
Definition: iccprofile.h:43
Definition: icctransform.h:49
Definition: loadingdescription.h:121
ColorManagementSettings colorManagement
Definition: loadingdescription.h:145
QVariant iccData
Definition: loadingdescription.h:146
PostProcessingParameters()
Definition: loadingdescription.h:124
Definition: loadingdescription.h:82
PreviewSettings previewSettings
Definition: loadingdescription.h:113
PreviewFlag
Definition: loadingdescription.h:94
QVariant extraParameter
Definition: loadingdescription.h:114
int size
Definition: loadingdescription.h:111
QVariant storageReference
Definition: loadingdescription.h:115
PreviewFlags flags
Definition: loadingdescription.h:112
PreviewType
Definition: loadingdescription.h:86
@ PreviewImage
Definition: loadingdescription.h:88
@ NoPreview
Definition: loadingdescription.h:87
@ Thumbnail
Definition: loadingdescription.h:89
PreviewType type
Definition: loadingdescription.h:110
Definition: loadingdescription.h:45
QString filePath
Definition: loadingdescription.h:252
RawDecodingHint
Definition: loadingdescription.h:59
@ RawDecodingDefaultSettings
Definition: loadingdescription.h:63
@ RawDecodingCustomSettings
Definition: loadingdescription.h:71
@ RawDecodingGlobalSettings
Definition: loadingdescription.h:67
PostProcessingParameters postProcessingParameters
Definition: loadingdescription.h:256
ColorManagementSettings
Definition: loadingdescription.h:49
@ ConvertForEditor
Definition: loadingdescription.h:52
@ ConvertForDisplay
IccData can be the output profile.
Definition: loadingdescription.h:54
@ ApplyTransform
IccData is an IccTransform.
Definition: loadingdescription.h:51
@ NoColorConversion
Definition: loadingdescription.h:50
@ ConvertToSRGB
Definition: loadingdescription.h:53
RawDecodingHint rawDecodingHint
Definition: loadingdescription.h:254
PreviewParameters previewParameters
Definition: loadingdescription.h:255
DRawDecoding rawDecodingSettings
Definition: loadingdescription.h:253
Definition: previewsettings.h:35
Definition: thumbnailinfo.h:40
Definition: datefolderview.cpp:43
bool operator==(const SearchTextSettings &a, const SearchTextSettings &b)
Definition: searchtextbar.cpp:49