File indexing completed on 2025-04-27 03:58:08

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2006-12-26
0007  * Description : Multithreaded loader for previews
0008  *
0009  * SPDX-FileCopyrightText: 2006-2011 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
0010  * SPDX-FileCopyrightText: 2006-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_PREVIEW_TASK_H
0017 #define DIGIKAM_PREVIEW_TASK_H
0018 
0019 // Qt includes
0020 
0021 #include <QImage>
0022 
0023 // Local includes
0024 
0025 #include "loadsavetask.h"
0026 #include "metaengine_previews.h"
0027 
0028 namespace Digikam
0029 {
0030 
0031 class PreviewLoadingTask : public SharedLoadingTask
0032 {
0033 public:
0034 
0035     explicit PreviewLoadingTask(LoadSaveThread* const thread,
0036                                 const LoadingDescription& description);
0037     ~PreviewLoadingTask() override;
0038 
0039     void execute()        override;
0040 
0041 private:
0042 
0043     bool loadExiv2Preview(MetaEnginePreviews& previews, int sizeLimit = -1);
0044     bool loadLibRawPreview(int sizeLimit = -1);
0045     bool loadHalfSizeRaw();
0046     bool loadFullSizeRaw();
0047     bool needToScale();
0048     bool loadImagePreview(int sizeLimit = -1);
0049     void convertQImageToDImg();
0050 
0051 private:
0052 
0053     QImage m_qimage;
0054     bool   m_fromRawEmbeddedPreview;
0055 
0056 private:
0057 
0058     // Disable
0059     PreviewLoadingTask(const PreviewLoadingTask&)            = delete;
0060     PreviewLoadingTask& operator=(const PreviewLoadingTask&) = delete;
0061 };
0062 
0063 } // namespace Digikam
0064 
0065 #endif // DIGIKAM_PREVIEW_TASK_H