digiKam
previewtask.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-12-26
7  * Description : Multithreaded loader for previews
8  *
9  * Copyright (C) 2006-2011 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
10  * Copyright (C) 2006-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_PREVIEW_TASK_H
26 #define DIGIKAM_PREVIEW_TASK_H
27 
28 // Qt includes
29 
30 #include <QImage>
31 
32 // Local includes
33 
34 #include "loadsavetask.h"
35 #include "metaengine_previews.h"
36 
37 namespace Digikam
38 {
39 
41 {
42 public:
43 
44  explicit PreviewLoadingTask(LoadSaveThread* const thread,
45  const LoadingDescription& description);
46  ~PreviewLoadingTask() override;
47 
48  void execute() override;
49 
50 private:
51 
52  bool loadExiv2Preview(MetaEnginePreviews& previews, int sizeLimit = -1);
53  bool loadLibRawPreview(int sizeLimit = -1);
54  bool loadHalfSizeRaw();
55  bool needToScale();
56  bool loadImagePreview(int sizeLimit = -1);
57  void convertQImageToDImg();
58 
59 private:
60 
61  QImage m_qimage;
62  bool m_fromRawEmbeddedPreview;
63 
64 private:
65 
66  // Disable
67  PreviewLoadingTask(const PreviewLoadingTask&) = delete;
68  PreviewLoadingTask& operator=(const PreviewLoadingTask&) = delete;
69 };
70 
71 } // namespace Digikam
72 
73 #endif // DIGIKAM_PREVIEW_TASK_H
Definition: loadsavethread.h:103
Definition: loadingdescription.h:45
Definition: metaengine_previews.h:44
Definition: previewtask.h:41
~PreviewLoadingTask() override
Definition: previewtask.cpp:52
PreviewLoadingTask(LoadSaveThread *const thread, const LoadingDescription &description)
Definition: previewtask.cpp:46
void execute() override
Definition: previewtask.cpp:56
Definition: loadsavetask.h:134
Definition: datefolderview.cpp:43