digiKam
Loading...
Searching...
No Matches
icctransform.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 : 2005-11-18
7 * Description : a class to apply ICC color correction to image.
8 *
9 * SPDX-FileCopyrightText: 2005-2006 by F.J. Cruz <fj dot cruz at supercable dot es>
10 * SPDX-FileCopyrightText: 2009 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
11 * SPDX-FileCopyrightText: 2005-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
12 *
13 * SPDX-License-Identifier: GPL-2.0-or-later
14 *
15 * ============================================================ */
16
17#pragma once
18
19// Qt includes
20
21#include <QByteArray>
22#include <QMetaType>
23#include <QString>
24
25// Local includes
26
27#include "dimg.h"
28#include "digikam_export.h"
29
30class QImage;
31
32namespace Digikam
33{
34
35class DImgLoaderObserver;
36class TransformDescription;
37
38class DIGIKAM_EXPORT IccTransform
39{
40public:
41
43 {
44 Perceptual = 0,
45 RelativeColorimetric = 1,
46 Saturation = 2,
47 AbsoluteColorimetric = 3
48 };
49
50public:
51
52 explicit IccTransform();
54
55 IccTransform(const IccTransform& other);
56 IccTransform& operator=(const IccTransform& other);
57
62 bool apply(DImg& image, DImgLoaderObserver* const observer = nullptr);
63
67 bool apply(QImage& qimage);
68
72 void close();
73
81 void setEmbeddedProfile(const DImg& image);
82 void setInputProfile(const IccProfile& profile);
83
87 void setOutputProfile(const IccProfile& profile);
88
92 void setProofProfile(const IccProfile& profile);
93
99 void setDoNotEmbedOutputProfile(bool doNotEmbed);
100
104 void setIntent(RenderingIntent intent);
105 void setIntent(int intent)
106 {
107 setIntent((RenderingIntent)intent);
108 }
109
110 void setProofIntent(RenderingIntent intent);
111 void setProofIntent(int intent)
112 {
113 setProofIntent((RenderingIntent)intent);
114 }
115
116 void setUseBlackPointCompensation(bool useBPC);
117 void setCheckGamut(bool checkGamut);
118 void setCheckGamutMaskColor(const QColor& color);
119
123 IccProfile embeddedProfile() const;
124 IccProfile inputProfile() const;
125 IccProfile outputProfile() const;
126 IccProfile proofProfile() const;
127
128 RenderingIntent intent() const;
129 RenderingIntent proofIntent() const;
130 bool isUsingBlackPointCompensation() const;
131 bool isCheckingGamut() const;
132 QColor checkGamutMaskColor() const;
133
138 bool willHaveEffect();
139
144 IccProfile effectiveInputProfile() const;
145
149 static void init();
150
151private:
152
153 bool checkProfiles();
154 TransformDescription getDescription(const DImg& image);
155 TransformDescription getProofingDescription(const DImg& image);
156 TransformDescription getDescription(const QImage& image);
157 bool open(TransformDescription& description);
158 bool openProofing(TransformDescription& description);
159 void transform(const DImg& img, const TransformDescription&,
160 DImgLoaderObserver* const observer = nullptr);
161 void transform(QImage& img, const TransformDescription&);
162
163public:
164
165 class Private;
166
167private:
168
169 QSharedDataPointer<Private> d;
170};
171
172} // namespace Digikam
173
174Q_DECLARE_METATYPE(Digikam::IccTransform)
Definition dimgloaderobserver.h:31
Definition dimg.h:52
Definition iccprofile.h:33
Definition icctransform.h:39
void setIntent(int intent)
Definition icctransform.h:105
void setProofIntent(int intent)
Definition icctransform.h:111
RenderingIntent
Definition icctransform.h:43
Definition datefolderview.cpp:34