1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130 | /* ============================================================
*
* This file is a part of digiKam project
* https://www.digikam.org
*
* Date : 2010-12-14
* Description : Filter to manage and help with raw loading
*
* SPDX-FileCopyrightText: 2010-2011 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*
* ============================================================ */
#pragma once
// Local includes
#include "digikam_export.h"
#include "dimgthreadedfilter.h"
#include "drawdecoding.h"
#include "iccprofile.h"
namespace Digikam
{
class DImgLoaderObserver;
class FilterAction;
/**
* This is a special filter.
* It implements RAW post processing.
* Additionally, it provides some facilities for use from the DImg Raw loader.
*
* The original image shall come from RawEngine without further modification.
*/
class DIGIKAM_EXPORT RawProcessingFilter : public DImgThreadedFilter
{
Q_OBJECT
public:
/**
* Default constructor. You need to call setSettings() and setOriginalImage()
* before starting the filter.
*/
explicit RawProcessingFilter(QObject* const parent = nullptr);
/**
* Traditional constructor
*/
RawProcessingFilter(DImg* const orgImage,
QObject* const parent,
const DRawDecoding& settings,
const QString& name = QString());
/**
* For use with a master filter. Computation is started immediately.
*/
RawProcessingFilter(const DRawDecoding& settings,
DImgThreadedFilter* const master,
const DImg& orgImage,
const DImg& destImage,
int progressBegin = 0,
int progressEnd = 100,
const QString& name = QString());
~RawProcessingFilter() override;
/**
* Set the raw decoding settings. The post processing is carried out here,
* the libraw settings are needed to construct the FilterAction.
*/
void setSettings(const DRawDecoding& settings);
DRawDecoding settings() const;
/**
* As additional and first post-processing step, convert the image's
* color space to the specified profile.
*/
void setOutputProfile(const IccProfile& profile);
/**
* Normally, filters post progress and are cancelled by DynamicThread facilities.
* Here, as an alternative, a DImgLoaderObserver is set. It's continueQuery is called
* and progress is posted in the given interval.
*/
void setObserver(DImgLoaderObserver* const observer, int progressBegin, int progressEnd);
static QString FilterIdentifier()
{
return QLatin1String("digikam:RawConverter");
}
static QString DisplayableName();
static QList<int> SupportedVersions()
{
return QList<int>() << 1;
}
static int CurrentVersion()
{
return 1;
}
void readParameters(const FilterAction& action) override;
QString filterIdentifier() const override
{
return FilterIdentifier();
}
FilterAction filterAction() override;
protected:
void postProgress(int); // not virtual<--- Derived function 'RawProcessingFilter::postProgress'
bool continueQuery() const; // not virtual
void filterImage() override;
protected:
DRawDecoding m_settings;
IccProfile m_customOutputProfile;
DImgLoaderObserver* m_observer = nullptr;
};
} // namespace Digikam
|