digiKam
Loading...
Searching...
No Matches
drawdecoder_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 : 2008-10-09
7 * Description : internal private container for DRawDecoder
8 *
9 * SPDX-FileCopyrightText: 2008-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
10 *
11 * SPDX-License-Identifier: GPL-2.0-or-later
12 *
13 * ============================================================ */
14
15#pragma once
16
17#include "digikam_config.h"
18
19// Qt includes
20
21#include <QByteArray>
22#include <QFile>
23#include <QFileInfo>
24#include <QStringList>
25#include <QUrl>
26#include <QPointer>
27
28// Local includes
29
30#include "digikam_debug.h"
31#include "drawinfo.h"
32#include "drawdecoder.h"
33#include "drawfiles.h"
34
35// LibRaw includes
36
37#include "libraw_version.h"
38#include "libraw_config.h"
39
40// Pragma directives to reduce warnings from LibRaw and LCMS2 headers
41
42#if !defined(Q_OS_DARWIN) && defined(Q_CC_GNU)
43# pragma GCC diagnostic push
44# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
45#endif
46
47#if defined(Q_CC_CLANG)
48# pragma clang diagnostic push
49# pragma clang diagnostic ignored "-Wdeprecated-declarations"
50# pragma clang diagnostic ignored "-Wundef"
51# pragma clang diagnostic ignored "-Wdeprecated-register"
52# pragma clang diagnostic ignored "-Wmacro-redefined"
53#endif
54
55// LibRaw includes
56
57#include "libraw.h"
58
59// Restore warnings
60#if !defined(Q_OS_DARWIN) && defined(Q_CC_GNU)
61# pragma GCC diagnostic pop
62#endif
63
64#if defined(Q_CC_CLANG)
65# pragma clang diagnostic pop
66#endif
67
68namespace Digikam
69{
70
71extern "C"
72{
73 int s_progressCallbackForLibRaw(void* context, enum LibRaw_progress p, int iteration, int expected);
74 void s_exifParserCallbackForLibRaw(void* context, int tag, int type, int len, unsigned int ord, void* ifp, INT64 base);
75}
76
77class Q_DECL_HIDDEN DRawDecoder::Private
78{
79
80public:
81
82 explicit Private(DRawDecoder* const p);
83 ~Private() = default;
84
85public:
86
87 int progressCallback(enum LibRaw_progress p, int iteration, int expected);
88 void exifParserCallback(int tag, int type, int len, unsigned int ord, void* ifp, INT64 base);
89
90 void setProgress(double value);
91 double progressValue() const;
92
93 bool loadFromLibraw(const QString& filePath, QByteArray& imageData,
94 int& width, int& height, int& rgbmax);
95
96public:
97
98 static void createPPMHeader(QByteArray& imgData, libraw_processed_image_t* const img);
99
100 static void fillIndentifyInfo(LibRaw* const raw, DRawInfo& identify);
101
102 static bool loadEmbeddedPreview(QByteArray&, LibRaw* const raw);
103
104 static bool loadHalfPreview(QImage&, LibRaw* const raw, bool rotate = true);
105
106private:
107
108 double m_progress = 0.0;
109
110 DRawDecoder* m_parent = nullptr;
111
112 friend class DRawDecoder;
113};
114
115} // namespace Digikam
Definition drawdecoder_p.h:78
Definition drawdecoder.h:40
Definition drawinfo.h:37
qulonglong value
Definition itemviewutilities.cpp:585
Definition datefolderview.cpp:34
int s_progressCallbackForLibRaw(void *context, enum LibRaw_progress p, int iteration, int expected)
Definition drawdecoder_p.cpp:35
void s_exifParserCallbackForLibRaw(void *context, int tag, int type, int len, unsigned int ord, void *ifp, INT64 base)
Definition drawdecoder_p.cpp:47