digiKam
thumbnailcreator_p.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 : 2007-07-20
7  * Description : Loader for thumbnails
8  *
9  * Copyright (C) 2003-2005 by Renchi Raju <renchi dot raju at gmail dot com>
10  * Copyright (C) 2003-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  * Copyright (C) 2006-2011 by Marcel Wiesweg <marcel dot wiesweg at gmx 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)
17  * any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * ============================================================ */
25 
26 #ifndef DIGIKAM_THUMB_NAIL_CREATOR_PRIVATE_H
27 #define DIGIKAM_THUMB_NAIL_CREATOR_PRIVATE_H
28 
29 #include "thumbnailcreator.h"
30 
31 // Qt includes
32 
33 #include <QUrl>
34 #include <QFile>
35 #include <QBuffer>
36 #include <QPainter>
37 #include <QIODevice>
38 #include <QFileInfo>
39 #include <QUrlQuery>
40 #include <QApplication>
41 #include <QMimeDatabase>
42 #include <QTemporaryFile>
43 #include <QScopedPointer>
44 #include <QStandardPaths>
45 
46 // KDE includes
47 
48 #include <klocalizedstring.h>
49 
50 // Local includes
51 
52 #include "digikam_config.h"
53 #include "metaengine_previews.h"
54 #include "metaengine_rotation.h"
55 #include "drawdecoder.h"
56 #include "drawfiles.h"
57 #include "digikam_debug.h"
58 #include "dimg.h"
59 #include "dimgloader.h"
60 #include "dimgloaderobserver.h"
61 #include "dmetadata.h"
62 #include "iccmanager.h"
63 #include "iccprofile.h"
64 #include "iccsettings.h"
65 #include "loadsavethread.h"
66 #include "jpegutils.h"
67 #include "pgfutils.h"
68 #include "tagregion.h"
69 #include "thumbsdbaccess.h"
70 #include "thumbsdb.h"
71 #include "thumbsdbbackend.h"
72 #include "thumbnailsize.h"
73 
74 #ifdef HAVE_MEDIAPLAYER
75 # include "videothumbnailer.h"
76 # include "videostripfilter.h"
77 #endif
78 
79 namespace Digikam
80 {
81 
83 {
84 public:
85 
86  explicit ThumbnailImage()
87  : exifOrientation(DMetadata::ORIENTATION_UNSPECIFIED)
88  {
89  }
90 
91  bool isNull() const
92  {
93  return qimage.isNull();
94  }
95 
96 public:
97 
98  QImage qimage;
100 };
101 
102 // -------------------------------------------------------------------
103 
104 class Q_DECL_HIDDEN ThumbnailCreator::Private
105 {
106 public:
107 
108  explicit Private()
109  : exifRotate (true),
110  removeAlphaChannel (true),
111  onlyLargeThumbnails (false),
112  thumbnailStorage (ThumbnailCreator::FreeDesktopStandard),
113  infoProvider (nullptr),
114  dbIdForReplacement (-1),
115  thumbnailSize (0),
116  digiKamFingerPrint (QLatin1String("Digikam Thumbnail Generator")), // Used internally as PNG metadata. Do not use i18n.
117  observer (nullptr)
118  {
119  fastRawSettings.optimizeTimeLoading();
120  fastRawSettings.rawPrm.halfSizeColorImage = true;
121  fastRawSettings.rawPrm.sixteenBitsImage = false;
122  }
123 
127 
131 
133 
134  QString error;
135  QString bigThumbPath;
136  QString smallThumbPath;
137 
139 
140  QImage alphaImage;
141 
145 
146 public:
147 
148  int storageSize() const;
149 };
150 
151 } // namespace Digikam
152 
153 #endif // DIGIKAM_THUMB_NAIL_CREATOR_PRIVATE_H
Definition: dimgloaderobserver.h:41
Definition: dmetadata.h:55
Definition: drawdecoding.h:48
Definition: thumbnailcreator_p.h:105
QString smallThumbPath
Definition: thumbnailcreator_p.h:136
DRawDecoding rawSettings
Definition: thumbnailcreator_p.h:143
QString error
Definition: thumbnailcreator_p.h:134
bool onlyLargeThumbnails
Definition: thumbnailcreator_p.h:126
DImgLoaderObserver * observer
Definition: thumbnailcreator_p.h:142
bool removeAlphaChannel
Definition: thumbnailcreator_p.h:125
Private()
Definition: thumbnailcreator_p.h:108
ThumbnailInfoProvider * infoProvider
Definition: thumbnailcreator_p.h:129
bool exifRotate
Definition: thumbnailcreator_p.h:124
int dbIdForReplacement
Definition: thumbnailcreator_p.h:130
QString bigThumbPath
Definition: thumbnailcreator_p.h:135
int thumbnailSize
Definition: thumbnailcreator_p.h:132
ThumbnailCreator::StorageMethod thumbnailStorage
Definition: thumbnailcreator_p.h:128
QString digiKamFingerPrint
Definition: thumbnailcreator_p.h:138
QImage alphaImage
Definition: thumbnailcreator_p.h:140
DRawDecoding fastRawSettings
Definition: thumbnailcreator_p.h:144
Definition: thumbnailcreator.h:51
StorageMethod
Definition: thumbnailcreator.h:55
Definition: thumbnailcreator_p.h:83
ThumbnailImage()
Definition: thumbnailcreator_p.h:86
int exifOrientation
Definition: thumbnailcreator_p.h:99
bool isNull() const
Definition: thumbnailcreator_p.h:91
QImage qimage
Definition: thumbnailcreator_p.h:98
Definition: thumbnailinfo.h:112
Definition: datefolderview.cpp:43